From 2d1d5a7d336ca43d0421b1d01892396161f46545 Mon Sep 17 00:00:00 2001 From: Elchin Gasimov Date: Wed, 11 Sep 2024 10:55:35 +0400 Subject: [PATCH] Add context.Context support for operations --- client_test.go | 259 +- connection.go | 121 +- connection_pool.go | 71 +- .../graph_client_basic_example.go | 13 +- .../contex_request_cancellation_example.go | 61 + .../graph_client_goroutines_example.go | 19 +- examples/json_example/parse_json_example.go | 37 +- .../parameter_example/parameter_example.go | 11 +- .../session_pool_example.go | 27 +- .../ssl_example/graph_client_ssl_example.go | 14 +- go.mod | 13 +- go.sum | 41 +- nebula/GoUnusedProtection__.go | 6 + nebula/common-consts.go | 31 + nebula/common.go | 6547 ++ nebula/constants.go | 26 - nebula/graph/GoUnusedProtection__.go | 6 + nebula/graph/constants.go | 28 - nebula/graph/graph-consts.go | 33 + nebula/graph/graph.go | 4667 ++ .../graph_service-remote.go | 313 + nebula/graph/graphservice.go | 3730 - nebula/graph/ttypes.go | 2570 - nebula/meta/GoUnusedProtection__.go | 6 + nebula/meta/constants.go | 29 - nebula/meta/meta-consts.go | 33 + nebula/meta/meta.go | 59771 ++++++++++++++++ .../meta_service-remote.go | 2365 + nebula/meta/metaservice.go | 31607 -------- nebula/meta/ttypes.go | 35297 --------- nebula/storage/GoUnusedProtection__.go | 6 + nebula/storage/constants.go | 30 - .../graph_storage_service-remote.go | 703 + nebula/storage/graphstorageservice.go | 7929 -- .../internal_storage_service-remote.go | 235 + nebula/storage/storage-consts.go | 35 + nebula/storage/storage.go | 29818 ++++++++ .../storage_admin_service-remote.go | 521 + nebula/storage/storageadminservice.go | 5339 -- nebula/storage/ttypes.go | 18938 ----- nebula/ttypes.go | 7243 -- result_set.go | 16 +- result_set_test.go | 4 +- schema_manager.go | 29 +- schema_manager_test.go | 125 +- session.go | 77 +- session_pool.go | 156 +- session_pool_test.go | 236 +- session_test.go | 34 +- ssl_connection_test.go | 29 +- ssl_sessionpool_test.go | 13 +- thriftfiles/common.thrift | 547 + thriftfiles/graph.thrift | 119 + thriftfiles/meta.thrift | 1310 + thriftfiles/raftex.thrift | 146 + thriftfiles/storage.thrift | 933 + 56 files changed, 108940 insertions(+), 113383 deletions(-) create mode 100644 examples/contex_request_cancellation_example/contex_request_cancellation_example.go create mode 100644 nebula/GoUnusedProtection__.go create mode 100644 nebula/common-consts.go create mode 100644 nebula/common.go delete mode 100644 nebula/constants.go create mode 100644 nebula/graph/GoUnusedProtection__.go delete mode 100644 nebula/graph/constants.go create mode 100644 nebula/graph/graph-consts.go create mode 100644 nebula/graph/graph.go create mode 100755 nebula/graph/graph_service-remote/graph_service-remote.go delete mode 100644 nebula/graph/graphservice.go delete mode 100644 nebula/graph/ttypes.go create mode 100644 nebula/meta/GoUnusedProtection__.go delete mode 100644 nebula/meta/constants.go create mode 100644 nebula/meta/meta-consts.go create mode 100644 nebula/meta/meta.go create mode 100755 nebula/meta/meta_service-remote/meta_service-remote.go delete mode 100644 nebula/meta/metaservice.go delete mode 100644 nebula/meta/ttypes.go create mode 100644 nebula/storage/GoUnusedProtection__.go delete mode 100644 nebula/storage/constants.go create mode 100755 nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go delete mode 100644 nebula/storage/graphstorageservice.go create mode 100755 nebula/storage/internal_storage_service-remote/internal_storage_service-remote.go create mode 100644 nebula/storage/storage-consts.go create mode 100644 nebula/storage/storage.go create mode 100755 nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go delete mode 100644 nebula/storage/storageadminservice.go delete mode 100644 nebula/storage/ttypes.go delete mode 100644 nebula/ttypes.go create mode 100644 thriftfiles/common.thrift create mode 100644 thriftfiles/graph.thrift create mode 100644 thriftfiles/meta.thrift create mode 100644 thriftfiles/raftex.thrift create mode 100644 thriftfiles/storage.thrift diff --git a/client_test.go b/client_test.go index 72de1cac..12f29bbc 100644 --- a/client_test.go +++ b/client_test.go @@ -11,6 +11,7 @@ package nebula_go import ( + "context" "encoding/json" "fmt" "log" @@ -57,20 +58,21 @@ var testPoolConfig = GetDefaultConf() // Using docker-compose is the easiest way and you can reference this file: // https://github.com/vesoft-inc/nebula/blob/master/docker/docker-compose.yaml -func logoutAndClose(conn *connection, sessionID int64) { - conn.signOut(sessionID) +func logoutAndClose(ctx context.Context, conn *connection, sessionID int64) { + conn.signOut(ctx, sessionID) conn.close() } func TestConnection(t *testing.T) { + ctx := context.Background() hostAddress := HostAddress{Host: address, Port: port} conn := newConnection(hostAddress) - err := conn.open(hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") + err := conn.open(ctx, hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") if err != nil { t.Fatalf("fail to open connection, address: %s, port: %d, %s", address, port, err.Error()) } - authResp, authErr := conn.authenticate(username, password) + authResp, authErr := conn.authenticate(ctx, username, password) if authErr != nil { t.Fatalf("fail to authenticate, username: %s, password: %s, %s", username, password, authErr.Error()) } @@ -82,37 +84,37 @@ func TestConnection(t *testing.T) { sessionID := authResp.GetSessionID() - defer logoutAndClose(conn, sessionID) + defer logoutAndClose(ctx, conn, sessionID) - resp, err := conn.execute(sessionID, "SHOW HOSTS;") + resp, err := conn.execute(ctx, sessionID, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return } checkConResp("show hosts", resp) - resp, err = conn.execute(sessionID, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") + resp, err = conn.execute(ctx, sessionID, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") if err != nil { t.Error(err.Error()) return } checkConResp("create space", resp) - resp, err = conn.execute(sessionID, "return 1") + resp, err = conn.execute(ctx, sessionID, "return 1") if err != nil { t.Error(err.Error()) return } checkConResp("return 1", resp) - resp, err = conn.execute(sessionID, "DROP SPACE client_test;") + resp, err = conn.execute(ctx, sessionID, "DROP SPACE client_test;") if err != nil { t.Error(err.Error()) return } checkConResp("drop space", resp) - res := conn.ping() + res := conn.ping(ctx) if res != true { t.Error("Connection ping failed") return @@ -120,14 +122,15 @@ func TestConnection(t *testing.T) { } func TestConnectionIPv6(t *testing.T) { + ctx := context.Background() hostAddress := HostAddress{Host: addressIPv6, Port: port} conn := newConnection(hostAddress) - err := conn.open(hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") + err := conn.open(ctx, hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") if err != nil { t.Fatalf("fail to open connection, address: %s, port: %d, %s", address, port, err.Error()) } - authResp, authErr := conn.authenticate(username, password) + authResp, authErr := conn.authenticate(ctx, username, password) if authErr != nil { t.Fatalf("fail to authenticate, username: %s, password: %s, %s", username, password, authErr.Error()) } @@ -139,29 +142,29 @@ func TestConnectionIPv6(t *testing.T) { sessionID := authResp.GetSessionID() - defer logoutAndClose(conn, sessionID) + defer logoutAndClose(ctx, conn, sessionID) - resp, err := conn.execute(sessionID, "SHOW HOSTS;") + resp, err := conn.execute(ctx, sessionID, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return } checkConResp("show hosts", resp) - resp, err = conn.execute(sessionID, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") + resp, err = conn.execute(ctx, sessionID, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") if err != nil { t.Error(err.Error()) return } checkConResp("create space", resp) - resp, err = conn.execute(sessionID, "DROP SPACE client_test;") + resp, err = conn.execute(ctx, sessionID, "DROP SPACE client_test;") if err != nil { t.Error(err.Error()) return } checkConResp("drop space", resp) - res := conn.ping() + res := conn.ping(ctx) if res != true { t.Error("Connection ping failed") return @@ -169,6 +172,8 @@ func TestConnectionIPv6(t *testing.T) { } func TestConfigs(t *testing.T) { + ctx := context.Background() + hostAddress := HostAddress{Host: address, Port: port} hostList := []HostAddress{} hostList = append(hostList, hostAddress) @@ -206,7 +211,7 @@ func TestConfigs(t *testing.T) { for _, testPoolConfig := range configList { // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -214,14 +219,14 @@ func TestConfigs(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) } - defer session.Release() + defer session.Release(ctx) // Execute a query - resp, err := tryToExecute(session, "SHOW HOSTS;") + resp, err := tryToExecute(ctx, session, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return @@ -229,6 +234,7 @@ func TestConfigs(t *testing.T) { checkResultSet(t, "show hosts", resp) // Create a new space resp, err = tryToExecute( + ctx, session, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") if err != nil { @@ -237,7 +243,7 @@ func TestConfigs(t *testing.T) { } checkResultSet(t, "create space", resp) - err = dropSpace("client_test") + err = dropSpace(ctx, "client_test") if err != nil { t.Fatalf(err.Error()) return @@ -246,6 +252,7 @@ func TestConfigs(t *testing.T) { } func TestVersionVerify(t *testing.T) { + ctx := context.Background() const ( username = "root" password = "nebula" @@ -254,7 +261,7 @@ func TestVersionVerify(t *testing.T) { hostAddress := HostAddress{Host: address, Port: port} conn := newConnection(hostAddress) - err := conn.open(hostAddress, testPoolConfig.TimeOut, nil, false, nil, "INVALID_VERSION") + err := conn.open(ctx, hostAddress, testPoolConfig.TimeOut, nil, false, nil, "INVALID_VERSION") if err != nil { assert.Contains(t, err.Error(), "incompatible handshakeKey between client and server") } @@ -262,6 +269,8 @@ func TestVersionVerify(t *testing.T) { } func TestAuthentication(t *testing.T) { + ctx := context.Background() + const ( username = "dummy" password = "nebula" @@ -270,13 +279,13 @@ func TestAuthentication(t *testing.T) { hostAddress := HostAddress{Host: address, Port: port} conn := newConnection(hostAddress) - err := conn.open(hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") + err := conn.open(ctx, hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") if err != nil { t.Fatalf("fail to open connection, address: %s, port: %d, %s", address, port, err.Error()) } defer conn.close() - resp, authErr := conn.authenticate(username, password) + resp, authErr := conn.authenticate(ctx, username, password) if authErr != nil { t.Fatalf("fail to authenticate, username: %s, password: %s, %s", username, password, authErr.Error()) } @@ -285,6 +294,8 @@ func TestAuthentication(t *testing.T) { } func TestInvalidHostTimeout(t *testing.T) { + ctx := context.Background() + hostAddress := HostAddress{Host: address, Port: port} // invalid host invalidHostAddress := HostAddress{Host: "192.168.100.125", Port: 3699} @@ -296,21 +307,22 @@ func TestInvalidHostTimeout(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } // close all connections in the pool defer pool.Close() - err = pool.Ping(invalidHostList[0], 1000*time.Millisecond) + err = pool.Ping(ctx, invalidHostList[0], 1000*time.Millisecond) assert.EqualError(t, err, "failed to open transport, error: dial tcp 192.168.100.125:3699: i/o timeout") - err = pool.Ping(invalidHostList[1], 1000*time.Millisecond) + err = pool.Ping(ctx, invalidHostList[1], 1000*time.Millisecond) if err != nil { t.Error("failed to ping 127.0.0.1") } } func TestServiceDataIO(t *testing.T) { + ctx := context.Background() hostAddress := HostAddress{Host: address, Port: port} hostList := []HostAddress{} hostList = append(hostList, hostAddress) @@ -323,7 +335,7 @@ func TestServiceDataIO(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -331,7 +343,7 @@ func TestServiceDataIO(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) @@ -339,12 +351,12 @@ func TestServiceDataIO(t *testing.T) { // Save session create time loc, _ := time.LoadLocation("Asia/Shanghai") sessionCreatedTime := time.Now().In(loc) - defer session.Release() + defer session.Release(ctx) // Create schemas - createTestDataSchema(t, session) + createTestDataSchema(ctx, t, session) // Load data - loadTestData(t, session) + loadTestData(ctx, t, session) // test base type { @@ -355,7 +367,7 @@ func TestServiceDataIO(t *testing.T) { "person.start_school, person.morning, " + "person.property, person.is_girl, person.child_name, " + "person.expend, person.first_out_city, person.hobby" - resp, err := tryToExecute(session, query) + resp, err := tryToExecute(ctx, session, query) if err != nil { t.Fatalf(err.Error()) return @@ -437,7 +449,7 @@ func TestServiceDataIO(t *testing.T) { // test node { - resp, err := tryToExecute(session, "MATCH (v:person {name: \"Bob\"}) RETURN v") + resp, err := tryToExecute(ctx, session, "MATCH (v:person {name: \"Bob\"}) RETURN v") if err != nil { t.Fatalf(err.Error()) return @@ -485,7 +497,7 @@ func TestServiceDataIO(t *testing.T) { // test edge { - resp, err := tryToExecute(session, "MATCH (:person{name: \"Bob\"}) -[e:friend]-> (:person{name: \"Lily\"}) RETURN e") + resp, err := tryToExecute(ctx, session, "MATCH (:person{name: \"Bob\"}) -[e:friend]-> (:person{name: \"Lily\"}) RETURN e") if err != nil { t.Fatalf(err.Error()) return @@ -527,7 +539,7 @@ func TestServiceDataIO(t *testing.T) { // Test path { - resp, err := tryToExecute(session, "MATCH p = (:person{name: \"Bob\"}) -[e:friend]-> (:person{name: \"Lily\"}) RETURN p") + resp, err := tryToExecute(ctx, session, "MATCH p = (:person{name: \"Bob\"}) -[e:friend]-> (:person{name: \"Lily\"}) RETURN p") if err != nil { t.Fatalf(err.Error()) return @@ -556,7 +568,7 @@ func TestServiceDataIO(t *testing.T) { // Check timestamp { // test show jobs - _, err := tryToExecute(session, "SUBMIT JOB STATS") + _, err := tryToExecute(ctx, session, "SUBMIT JOB STATS") if err != nil { t.Fatalf(err.Error()) return @@ -564,7 +576,7 @@ func TestServiceDataIO(t *testing.T) { expected := int8(time.Now().In(loc).Hour()) time.Sleep(5 * time.Second) - resp, err := tryToExecute(session, "SHOW JOBS") + resp, err := tryToExecute(ctx, session, "SHOW JOBS") if err != nil { t.Fatalf(err.Error()) return @@ -595,7 +607,7 @@ func TestServiceDataIO(t *testing.T) { assert.Equal(t, expected, localTime.GetHour()) // test show sessions - resp, err = tryToExecute(session, "SHOW SESSIONS") + resp, err = tryToExecute(ctx, session, "SHOW SESSIONS") if err != nil { t.Fatalf(err.Error()) return @@ -624,7 +636,7 @@ func TestServiceDataIO(t *testing.T) { } assert.Equal(t, int8(sessionCreatedTime.Hour()), localTime.GetHour()) } - err = dropSpace("client_test") + err = dropSpace(ctx, "client_test") if err != nil { t.Fatalf(err.Error()) } @@ -632,6 +644,7 @@ func TestServiceDataIO(t *testing.T) { } func TestPool_SingleHost(t *testing.T) { + ctx := context.Background() hostAddress := HostAddress{Host: address, Port: port} hostList := []HostAddress{} hostList = append(hostList, hostAddress) @@ -644,7 +657,7 @@ func TestPool_SingleHost(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -652,34 +665,36 @@ func TestPool_SingleHost(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) } - defer session.Release() + defer session.Release(ctx) // Execute a query - resp, err := tryToExecute(session, "SHOW HOSTS;") + resp, err := tryToExecute(ctx, session, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "show hosts", resp) // Create a new space - resp, err = tryToExecute(session, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") + resp, err = tryToExecute(ctx, session, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "create space", resp) - err = dropSpace("client_test") + err = dropSpace(ctx, "client_test") if err != nil { t.Fatalf(err.Error()) } } func TestPool_MultiHosts(t *testing.T) { + ctx := context.Background() + hostList := poolAddress // Minimum pool size < hosts number multiHostsConfig := PoolConfig{ @@ -690,7 +705,7 @@ func TestPool_MultiHosts(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, multiHostsConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, multiHostsConfig, nebulaLog) if err != nil { log.Fatal(fmt.Sprintf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) } @@ -699,7 +714,7 @@ func TestPool_MultiHosts(t *testing.T) { // Take all idle connection and try to create a new session for i := 0; i < multiHostsConfig.MaxConnPoolSize; i++ { - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Errorf("fail to create a new session from connection pool, %s", err.Error()) } @@ -709,24 +724,24 @@ func TestPool_MultiHosts(t *testing.T) { assert.Equal(t, 0, pool.idleConnectionQueue.Len()) assert.Equal(t, 3, pool.activeConnectionQueue.Len()) - _, err = pool.GetSession(username, password) + _, err = pool.GetSession(ctx, username, password) assert.EqualError(t, err, "failed to get connection: No valid connection in the idle queue and connection number has reached the pool capacity") // Release 1 connection back to pool sessionToRelease := sessionList[0] - sessionToRelease.Release() + sessionToRelease.Release(ctx) sessionList = sessionList[1:] assert.Equal(t, 1, pool.idleConnectionQueue.Len()) assert.Equal(t, 2, pool.activeConnectionQueue.Len()) // Try again to get connection - newSession, err := pool.GetSession(username, password) + newSession, err := pool.GetSession(ctx, username, password) if err != nil { t.Errorf("fail to create a new session, %s", err.Error()) } assert.Equal(t, 0, pool.idleConnectionQueue.Len()) assert.Equal(t, 3, pool.activeConnectionQueue.Len()) - resp, err := tryToExecute(newSession, "SHOW HOSTS;") + resp, err := tryToExecute(ctx, newSession, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return @@ -734,15 +749,17 @@ func TestPool_MultiHosts(t *testing.T) { checkResultSet(t, "show hosts", resp) // Try to get more session when the pool is full - _, err = pool.GetSession(username, password) + _, err = pool.GetSession(ctx, username, password) assert.EqualError(t, err, "failed to get connection: No valid connection in the idle queue and connection number has reached the pool capacity") for i := 0; i < len(sessionList); i++ { - sessionList[i].Release() + sessionList[i].Release(ctx) } } func TestMultiThreads(t *testing.T) { + ctx := context.Background() + hostList := poolAddress testPoolConfig := PoolConfig{ @@ -753,7 +770,7 @@ func TestMultiThreads(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { log.Fatal(fmt.Sprintf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) @@ -770,7 +787,7 @@ func TestMultiThreads(t *testing.T) { for i := 0; i < testPoolConfig.MaxConnPoolSize; i++ { go func(sessCh chan<- *Session, wg *sync.WaitGroup) { defer wg.Done() - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Errorf("fail to create a new session from connection pool, %s", err.Error()) } @@ -792,12 +809,14 @@ func TestMultiThreads(t *testing.T) { assert.Equal(t, 666, len(sessionList), "Total number of sessions should be 666") for i := 0; i < testPoolConfig.MaxConnPoolSize; i++ { - sessionList[i].Release() + sessionList[i].Release(ctx) } assert.Equal(t, 666, pool.getIdleConnCount(), "Total number of idle connections should be 666") } func TestLoadBalancer(t *testing.T) { + ctx := context.Background() + hostList := poolAddress var loadPerHost = make(map[HostAddress]int) testPoolConfig := PoolConfig{ @@ -808,7 +827,7 @@ func TestLoadBalancer(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -818,7 +837,7 @@ func TestLoadBalancer(t *testing.T) { // Create multiple sessions for i := 0; i < 999; i++ { - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Errorf("fail to create a new session from connection pool, %s", err.Error()) } @@ -831,11 +850,13 @@ func TestLoadBalancer(t *testing.T) { assert.Equal(t, 333, v, "Total number of sessions should be 333") } for i := 0; i < len(sessionList); i++ { - sessionList[i].Release() + sessionList[i].Release(ctx) } } func TestIdleTimeoutCleaner(t *testing.T) { + ctx := context.Background() + hostList := poolAddress idleTimeoutConfig := PoolConfig{ @@ -846,7 +867,7 @@ func TestIdleTimeoutCleaner(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, idleTimeoutConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, idleTimeoutConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -856,7 +877,7 @@ func TestIdleTimeoutCleaner(t *testing.T) { // Create session for i := 0; i < idleTimeoutConfig.MaxConnPoolSize; i++ { - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Errorf("fail to create a new session from connection pool, %s", err.Error()) } @@ -864,12 +885,12 @@ func TestIdleTimeoutCleaner(t *testing.T) { } for i := range sessionList { - _, err := sessionList[i].Execute("SHOW HOSTS;") + _, err := sessionList[i].Execute(ctx, "SHOW HOSTS;") if err != nil { t.Errorf("Error info: %s", err.Error()) return } - sessionList[i].Release() + sessionList[i].Release(ctx) } time.Sleep(idleTimeoutConfig.IdleTime) @@ -883,6 +904,8 @@ func TestIdleTimeoutCleaner(t *testing.T) { } func TestTimeout(t *testing.T) { + ctx := context.Background() + hostAddress := HostAddress{Host: address, Port: port} hostList := []HostAddress{} hostList = append(hostList, hostAddress) @@ -895,7 +918,7 @@ func TestTimeout(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -903,7 +926,7 @@ func TestTimeout(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) @@ -917,7 +940,7 @@ func TestTimeout(t *testing.T) { "USE test_timeout;" + "CREATE TAG IF NOT EXISTS person (name string, age int);" + "CREATE EDGE IF NOT EXISTS like(likeness int);" - resultSet, err := tryToExecute(session, createSchema) + resultSet, err := tryToExecute(ctx, session, createSchema) if err != nil { t.Fatalf(err.Error()) return @@ -933,7 +956,7 @@ func TestTimeout(t *testing.T) { "'B':('B', 10), " + "'C':('C', 10), " + "'D':('D', 10)" - resultSet, err := tryToExecute(session, query) + resultSet, err := tryToExecute(ctx, session, query) if err != nil { t.Fatalf(err.Error()) return @@ -945,7 +968,7 @@ func TestTimeout(t *testing.T) { "'B'->'C':(70), " + "'C'->'D':(84), " + "'D'->'A':(68)" - resultSet, err = tryToExecute(session, query) + resultSet, err = tryToExecute(ctx, session, query) if err != nil { t.Fatalf(err.Error()) return @@ -954,22 +977,24 @@ func TestTimeout(t *testing.T) { } // trigger timeout - _, err = session.Execute("GO 10000 STEPS FROM 'A' OVER * YIELD like.likeness") + _, err = session.Execute(ctx, "GO 10000 STEPS FROM 'A' OVER * YIELD like.likeness") assert.Contains(t, err.Error(), "timeout") - resultSet, err := tryToExecute(session, "YIELD 999") + resultSet, err := tryToExecute(ctx, session, "YIELD 999") assert.Empty(t, err) assert.True(t, resultSet.IsSucceed()) assert.Contains(t, resultSet.AsStringTable(), []string{"999"}) // Drop space - err = dropSpace("client_test") + err = dropSpace(ctx, "client_test") if err != nil { t.Fatalf(err.Error()) } } func TestExecuteJson(t *testing.T) { + ctx := context.Background() + hostList := []HostAddress{{Host: address, Port: port}} testPoolConfig = PoolConfig{ @@ -980,7 +1005,7 @@ func TestExecuteJson(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -988,21 +1013,21 @@ func TestExecuteJson(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) } - defer session.Release() + defer session.Release(ctx) // Create schemas - createTestDataSchema(t, session) + createTestDataSchema(ctx, t, session) // Load data - loadTestData(t, session) + loadTestData(ctx, t, session) // Simple query { - jsonStrResult, err := session.ExecuteJson(`YIELD 1, 2.2, "hello", [1,2,"abc"], {key: "value"}, "汉字"`) + jsonStrResult, err := session.ExecuteJson(ctx, `YIELD 1, 2.2, "hello", [1,2,"abc"], {key: "value"}, "汉字"`) if err != nil { t.Fatalf("fail to get the result in json format, %s", err.Error()) } @@ -1033,7 +1058,7 @@ func TestExecuteJson(t *testing.T) { // Complex result { - jsonStrResult, err := session.ExecuteJson("MATCH (v:person {name: \"Bob\"}) RETURN v") + jsonStrResult, err := session.ExecuteJson(ctx, "MATCH (v:person {name: \"Bob\"}) RETURN v") if err != nil { t.Fatalf("fail to get the result in json format, %s", err.Error()) } @@ -1067,7 +1092,7 @@ func TestExecuteJson(t *testing.T) { // Error test { - jsonStrResult, err := session.ExecuteJson("MATCH (v:invalidTag {name: \"Bob\"}) RETURN v") + jsonStrResult, err := session.ExecuteJson(ctx, "MATCH (v:invalidTag {name: \"Bob\"}) RETURN v") if err != nil { t.Fatalf("fail to get the result in json format, %s", err.Error()) } @@ -1087,6 +1112,8 @@ func TestExecuteJson(t *testing.T) { } func TestExecuteWithParameter(t *testing.T) { + ctx := context.Background() + hostList := []HostAddress{{Host: address, Port: port}} testPoolConfig = PoolConfig{ @@ -1097,7 +1124,7 @@ func TestExecuteWithParameter(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, testPoolConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, testPoolConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -1105,17 +1132,17 @@ func TestExecuteWithParameter(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) } - defer session.Release() + defer session.Release(ctx) // Create schemas - createTestDataSchema(t, session) + createTestDataSchema(ctx, t, session) // Load data - loadTestData(t, session) + loadTestData(ctx, t, session) // p1:true p2:3 p3:[true,3] p4:{"a":true,"b":"Bob"} params := make(map[string]interface{}) @@ -1126,7 +1153,7 @@ func TestExecuteWithParameter(t *testing.T) { // Simple result { - resp, err := tryToExecuteWithParameter(session, "RETURN toBoolean($p1) and false, $p2+3, $p3[1]>3", params) + resp, err := tryToExecuteWithParameter(ctx, session, "RETURN toBoolean($p1) and false, $p2+3, $p3[1]>3", params) if err != nil { t.Fatalf(err.Error()) return @@ -1193,7 +1220,7 @@ func TestExecuteWithParameter(t *testing.T) { // Complex result { query := "MATCH (v:person {name: $p4.b}) WHERE v.person.age>$p2-3 and $p1==true RETURN v ORDER BY $p3[0] LIMIT $p2" - resp, err := tryToExecuteWithParameter(session, query, params) + resp, err := tryToExecuteWithParameter(ctx, session, query, params) if err != nil { t.Fatalf(err.Error()) return @@ -1229,6 +1256,8 @@ func TestExecuteWithParameter(t *testing.T) { } func TestReconnect(t *testing.T) { + ctx := context.Background() + hostList := poolAddress timeoutConfig := PoolConfig{ @@ -1239,18 +1268,18 @@ func TestReconnect(t *testing.T) { } // Initialize connection pool - pool, err := NewConnectionPool(hostList, timeoutConfig, nebulaLog) + pool, err := NewConnectionPool(ctx, hostList, timeoutConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Errorf("fail to create a new session from connection pool, %s", err.Error()) } - defer session.Release() + defer session.Release(ctx) // Send query to server periodically for i := 0; i < timeoutConfig.MaxConnPoolSize; i++ { @@ -1261,7 +1290,7 @@ func TestReconnect(t *testing.T) { if i == 7 { stopContainer(t, "nebula-docker-compose_graphd1_1") } - _, err := session.Execute("SHOW HOSTS;") + _, err := session.Execute(ctx, "SHOW HOSTS;") fmt.Println("Sending query...") if err != nil { @@ -1270,7 +1299,7 @@ func TestReconnect(t *testing.T) { } } - resp, err := session.Execute("SHOW HOSTS;") + resp, err := session.Execute(ctx, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return @@ -1315,12 +1344,12 @@ func startContainer(t *testing.T, containerName string) { } type executer interface { - Execute(query string) (*ResultSet, error) + Execute(ctx context.Context, query string) (*ResultSet, error) } -func tryToExecute(e executer, query string) (resp *ResultSet, err error) { +func tryToExecute(ctx context.Context, e executer, query string) (resp *ResultSet, err error) { for i := 3; i > 0; i-- { - resp, err = e.Execute(query) + resp, err = e.Execute(ctx, query) if err == nil && resp.IsSucceed() { return } @@ -1329,9 +1358,9 @@ func tryToExecute(e executer, query string) (resp *ResultSet, err error) { return } -func tryToExecuteWithParameter(session *Session, query string, params map[string]interface{}) (resp *ResultSet, err error) { +func tryToExecuteWithParameter(ctx context.Context, session *Session, query string, params map[string]interface{}) (resp *ResultSet, err error) { for i := 3; i > 0; i-- { - resp, err = session.ExecuteWithParameter(query, params) + resp, err = session.ExecuteWithParameter(ctx, query, params) if err == nil && resp.IsSucceed() { return } @@ -1341,7 +1370,7 @@ func tryToExecuteWithParameter(session *Session, query string, params map[string } // creates schema -func createTestDataSchema(t *testing.T, executor executer) { +func createTestDataSchema(ctx context.Context, t *testing.T, executor executer) { createSchema := "CREATE SPACE IF NOT EXISTS test_data(vid_type = FIXED_STRING(30));" + "USE test_data; " + "CREATE TAG IF NOT EXISTS person(name string, age int8, grade int16, " + @@ -1353,7 +1382,7 @@ func createTestDataSchema(t *testing.T, executor executer) { "CREATE EDGE IF NOT EXISTS like(likeness double); " + "CREATE EDGE IF NOT EXISTS friend(start_Datetime datetime, end_Datetime datetime); " + "CREATE TAG INDEX IF NOT EXISTS person_name_index ON person(name(8));" - resultSet, err := tryToExecute(executor, createSchema) + resultSet, err := tryToExecute(ctx, executor, createSchema) if err != nil { t.Fatalf(err.Error()) return @@ -1364,7 +1393,7 @@ func createTestDataSchema(t *testing.T, executor executer) { } // inserts data that used in tests -func loadTestData(t *testing.T, e executer) { +func loadTestData(ctx context.Context, t *testing.T, e executer) { query := "INSERT VERTEX person(name, age, grade, friends, book_num," + "birthday, start_school, morning, property," + "is_girl, child_name, expend, first_out_city) VALUES" + @@ -1383,7 +1412,7 @@ func loadTestData(t *testing.T, e executer) { "'John':('John', 10, 3, 10, 100, datetime('2010-09-10T10:08:02'), " + "date('2017-09-10'), time('07:10:00'), " + "1000.0, false, \"Hello World!\", 100.0, 1111)" - resultSet, err := tryToExecute(e, query) + resultSet, err := tryToExecute(ctx, e, query) if err != nil { t.Fatalf(err.Error()) return @@ -1394,7 +1423,7 @@ func loadTestData(t *testing.T, e executer) { "INSERT VERTEX student(name, interval) VALUES " + "'Bob':('Bob', duration({months:1, seconds:100, microseconds:20})), 'Lily':('Lily', duration({years: 1, seconds: 0})), " + "'Tom':('Tom', duration({years: 1, seconds: 0})), 'Jerry':('Jerry', duration({years: 1, seconds: 0})), 'John':('John', duration({years: 1, seconds: 0}))" - resultSet, err = tryToExecute(e, query) + resultSet, err = tryToExecute(ctx, e, query) if err != nil { t.Fatalf(err.Error()) return @@ -1409,7 +1438,7 @@ func loadTestData(t *testing.T, e executer) { "'Tom'->'Jerry':(68.3), " + "'Bob'->'John':(97.2), " + "'Lily'->'Tom':(80.0)" - resultSet, err = tryToExecute(e, query) + resultSet, err = tryToExecute(ctx, e, query) if err != nil { t.Fatalf(err.Error()) return @@ -1423,7 +1452,7 @@ func loadTestData(t *testing.T, e executer) { "'Jerry'->'Lily':(datetime('2008-09-10T10:08:02'), datetime('2010-09-10T10:08:02')), " + "'Tom'->'Jerry':(datetime('2008-09-10T10:08:02'), datetime('2010-09-10T10:08:02')), " + "'Bob'->'John':(datetime('2008-09-10T10:08:02'), datetime('2010-09-10T10:08:02'))" - resultSet, err = tryToExecute(e, query) + resultSet, err = tryToExecute(ctx, e, query) if err != nil { t.Fatalf(err.Error()) return @@ -1432,17 +1461,17 @@ func loadTestData(t *testing.T, e executer) { } // prepareSpace creates a space for test -func prepareSpace(spaceName string) error { +func prepareSpace(ctx context.Context, spaceName string) error { hostAddress := HostAddress{Host: address, Port: port} conn := newConnection(hostAddress) testPoolConfig := GetDefaultConf() - err := conn.open(hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") + err := conn.open(ctx, hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") if err != nil { return fmt.Errorf("fail to open connection, address: %s, port: %d, %s", address, port, err.Error()) } - authResp, authErr := conn.authenticate(username, password) + authResp, authErr := conn.authenticate(ctx, username, password) if authErr != nil { return fmt.Errorf("fail to authenticate, username: %s, password: %s, %s", username, password, authErr.Error()) } @@ -1454,11 +1483,11 @@ func prepareSpace(spaceName string) error { sessionID := authResp.GetSessionID() - defer logoutAndClose(conn, sessionID) + defer logoutAndClose(ctx, conn, sessionID) query := fmt.Sprintf("CREATE SPACE IF NOT EXISTS"+ " %s(partition_num=32, replica_factor=1, vid_type = FIXED_STRING(30));", spaceName) - resp, err := conn.execute(sessionID, query) + resp, err := conn.execute(ctx, sessionID, query) if err != nil { log.Fatalf(err.Error()) } @@ -1469,17 +1498,17 @@ func prepareSpace(spaceName string) error { } // dropSpace drops a space. The space name should be the same as the one created in prepareSpace -func dropSpace(spaceName string) error { +func dropSpace(ctx context.Context, spaceName string) error { hostAddress := HostAddress{Host: address, Port: port} conn := newConnection(hostAddress) testPoolConfig := GetDefaultConf() - err := conn.open(hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") + err := conn.open(ctx, hostAddress, testPoolConfig.TimeOut, nil, false, nil, "") if err != nil { return fmt.Errorf("fail to open connection, address: %s, port: %d, %s", address, port, err.Error()) } - authResp, authErr := conn.authenticate(username, password) + authResp, authErr := conn.authenticate(ctx, username, password) if authErr != nil { return fmt.Errorf("fail to authenticate, username: %s, password: %s, %s", username, password, authErr.Error()) } @@ -1491,10 +1520,10 @@ func dropSpace(spaceName string) error { sessionID := authResp.GetSessionID() - defer logoutAndClose(conn, sessionID) + defer logoutAndClose(ctx, conn, sessionID) query := fmt.Sprintf("DROP SPACE IF EXISTS %s;", spaceName) - resp, err := conn.execute(sessionID, query) + resp, err := conn.execute(ctx, sessionID, query) if err != nil { return err } diff --git a/connection.go b/connection.go index 5f4e108e..cf359dc8 100644 --- a/connection.go +++ b/connection.go @@ -17,7 +17,7 @@ import ( "strconv" "time" - "github.com/vesoft-inc/fbthrift/thrift/lib/go/thrift" + "github.com/apache/thrift/lib/go/thrift" "github.com/vesoft-inc/nebula-go/v3/nebula" "github.com/vesoft-inc/nebula-go/v3/nebula/graph" "golang.org/x/net/http2" @@ -32,6 +32,7 @@ type connection struct { httpHeader http.Header handshakeKey string graph *graph.GraphServiceClient + transport thrift.TTransport } func newConnection(severAddress HostAddress) *connection { @@ -42,12 +43,13 @@ func newConnection(severAddress HostAddress) *connection { sslConfig: nil, handshakeKey: "", graph: nil, + transport: nil, } } -// open opens a transport for the connection +// open opens transport for the connection // if sslConfig is not nil, an SSL transport will be created -func (cn *connection) open(hostAddress HostAddress, timeout time.Duration, sslConfig *tls.Config, +func (cn *connection) open(ctx context.Context, hostAddress HostAddress, timeout time.Duration, sslConfig *tls.Config, useHTTP2 bool, httpHeader http.Header, handshakeKey string) error { ip := hostAddress.Host port := hostAddress.Port @@ -58,20 +60,21 @@ func (cn *connection) open(hostAddress HostAddress, timeout time.Duration, sslCo var ( err error - transport thrift.Transport - pf thrift.ProtocolFactory + transport thrift.TTransport + pf thrift.TProtocolFactory ) if useHTTP2 { if sslConfig != nil { - transport, err = thrift.NewHTTPPostClientWithOptions("https://"+newAdd, thrift.HTTPClientOptions{ - Client: &http.Client{ - Transport: &http2.Transport{ - TLSClientConfig: sslConfig, + transport, err = thrift.NewTHttpClientWithOptions("https://"+newAdd, + thrift.THttpClientOptions{ + Client: &http.Client{ + Transport: &http2.Transport{ + TLSClientConfig: sslConfig, + }, }, - }, - }) + }) } else { - transport, err = thrift.NewHTTPPostClientWithOptions("http://"+newAdd, thrift.HTTPClientOptions{ + transport, err = thrift.NewTHttpClientWithOptions("https://"+newAdd, thrift.THttpClientOptions{ Client: &http.Client{ Transport: &http2.Transport{ // So http2.Transport doesn't complain the URL scheme isn't 'https' @@ -85,13 +88,15 @@ func (cn *connection) open(hostAddress HostAddress, timeout time.Duration, sslCo }, }, }) + } if err != nil { return fmt.Errorf("failed to create a net.Conn-backed Transport,: %s", err.Error()) } - pf = thrift.NewBinaryProtocolFactoryDefault() + + pf = thrift.NewTBinaryProtocolFactoryDefault() if httpHeader != nil { - client, ok := transport.(*thrift.HTTPClient) + client, ok := transport.(*thrift.THttpClient) if !ok { return fmt.Errorf("failed to get thrift http client") } @@ -109,37 +114,43 @@ func (cn *connection) open(hostAddress HostAddress, timeout time.Duration, sslCo } else { bufferSize := 128 << 10 - var sock thrift.Transport + var sock thrift.TTransport if sslConfig != nil { - sock, err = thrift.NewSSLSocketTimeout(newAdd, sslConfig, timeout) + //TODO replace the deprecated thrift structures later + sock, err = thrift.NewTSSLSocketTimeout(newAdd, sslConfig, timeout, timeout) } else { - sock, err = thrift.NewSocket(thrift.SocketAddr(newAdd), thrift.SocketTimeout(timeout)) + sock, err = thrift.NewTSocketTimeout(newAdd, timeout, timeout) } if err != nil { return fmt.Errorf("failed to create a net.Conn-backed Transport,: %s", err.Error()) } // Set transport - bufferedTranFactory := thrift.NewBufferedTransportFactory(bufferSize) - transport = thrift.NewHeaderTransport(bufferedTranFactory.GetTransport(sock)) - pf = thrift.NewHeaderProtocolFactory() + bufferedTransFactory := thrift.NewTBufferedTransportFactory(bufferSize) + buffTransport, _ := bufferedTransFactory.GetTransport(sock) + transport = thrift.NewTHeaderTransport(buffTransport) + pf = thrift.NewTHeaderProtocolFactory() } + cn.transport = transport cn.graph = graph.NewGraphServiceClientFactory(transport, pf) - if err = cn.graph.Open(); err != nil { + + if err = cn.transport.Open(); err != nil { return fmt.Errorf("failed to open transport, error: %s", err.Error()) } - if !cn.graph.IsOpen() { + + if !cn.transport.IsOpen() { return fmt.Errorf("transport is off") } - return cn.verifyClientVersion() + + return cn.verifyClientVersion(ctx) } -func (cn *connection) verifyClientVersion() error { +func (cn *connection) verifyClientVersion(ctx context.Context) error { req := graph.NewVerifyClientVersionReq() if cn.handshakeKey != "" { - req.SetVersion([]byte(cn.handshakeKey)) + req.Version = []byte(cn.handshakeKey) } - resp, err := cn.graph.VerifyClientVersion(req) + resp, err := cn.graph.VerifyClientVersion(ctx, req) if err != nil { cn.close() return fmt.Errorf("failed to verify client handshakeKey: %s", err.Error()) @@ -154,17 +165,18 @@ func (cn *connection) verifyClientVersion() error { // Because the code generated by Fbthrift does not handle the seqID, // the message will be dislocated when the timeout occurs, resulting in unexpected response. // When the timeout occurs, the connection will be reopened to avoid the impact of the message. -func (cn *connection) reopen() error { +func (cn *connection) reopen(ctx context.Context) error { cn.close() - return cn.open(cn.severAddress, cn.timeout, cn.sslConfig, cn.useHTTP2, cn.httpHeader, cn.handshakeKey) + return cn.open(ctx, cn.severAddress, cn.timeout, cn.sslConfig, cn.useHTTP2, cn.httpHeader, cn.handshakeKey) } // Authenticate -func (cn *connection) authenticate(username, password string) (*graph.AuthResponse, error) { - resp, err := cn.graph.Authenticate([]byte(username), []byte(password)) +func (cn *connection) authenticate(ctx context.Context, username, password string) (*graph.AuthResponse, error) { + resp, err := cn.graph.Authenticate(ctx, []byte(username), []byte(password)) if err != nil { err = fmt.Errorf("authentication fails, %s", err.Error()) - if e := cn.graph.Close(); e != nil { + + if e := cn.transport.Close(); e != nil { err = fmt.Errorf("fail to close transport, error: %s", e.Error()) } return nil, err @@ -173,13 +185,13 @@ func (cn *connection) authenticate(username, password string) (*graph.AuthRespon return resp, nil } -func (cn *connection) execute(sessionID int64, stmt string) (*graph.ExecutionResponse, error) { - return cn.executeWithParameter(sessionID, stmt, map[string]*nebula.Value{}) +func (cn *connection) execute(ctx context.Context, sessionID int64, stmt string) (*graph.ExecutionResponse, error) { + return cn.executeWithParameter(ctx, sessionID, stmt, map[string]*nebula.Value{}) } -func (cn *connection) executeWithParameter(sessionID int64, stmt string, +func (cn *connection) executeWithParameter(ctx context.Context, sessionID int64, stmt string, params map[string]*nebula.Value) (*graph.ExecutionResponse, error) { - resp, err := cn.graph.ExecuteWithParameter(sessionID, []byte(stmt), params) + resp, err := cn.graph.ExecuteWithParameter(ctx, sessionID, []byte(stmt), params) if err != nil { return nil, err } @@ -187,25 +199,27 @@ func (cn *connection) executeWithParameter(sessionID int64, stmt string, return resp, nil } -func (cn *connection) executeWithParameterTimeout(sessionID int64, stmt string, params map[string]*nebula.Value, timeoutMs int64) (*graph.ExecutionResponse, error) { - return cn.graph.ExecuteWithTimeout(sessionID, []byte(stmt), params, timeoutMs) +func (cn *connection) executeWithParameterTimeout(ctx context.Context, sessionID int64, stmt string, params map[string]*nebula.Value, timeoutMs int64) (*graph.ExecutionResponse, error) { + //TODO handle timeout value later + return cn.graph.ExecuteWithParameter(ctx, sessionID, []byte(stmt), params) + //return cn.graph.ExecuteWithTimeout(ctx, sessionID, []byte(stmt), params, timeoutMs) } -func (cn *connection) executeJson(sessionID int64, stmt string) ([]byte, error) { - return cn.ExecuteJsonWithParameter(sessionID, stmt, map[string]*nebula.Value{}) +func (cn *connection) executeJson(ctx context.Context, sessionID int64, stmt string) ([]byte, error) { + return cn.ExecuteJsonWithParameter(ctx, sessionID, stmt, map[string]*nebula.Value{}) } -func (cn *connection) ExecuteJsonWithParameter(sessionID int64, stmt string, params map[string]*nebula.Value) ([]byte, error) { - jsonResp, err := cn.graph.ExecuteJsonWithParameter(sessionID, []byte(stmt), params) +func (cn *connection) ExecuteJsonWithParameter(ctx context.Context, sessionID int64, stmt string, params map[string]*nebula.Value) ([]byte, error) { + jsonResp, err := cn.graph.ExecuteJsonWithParameter(ctx, sessionID, []byte(stmt), params) if err != nil { // reopen the connection if timeout - if _, ok := err.(thrift.TransportException); ok { - if err.(thrift.TransportException).TypeID() == thrift.TIMED_OUT { - reopenErr := cn.reopen() + if _, ok := err.(thrift.TTransportException); ok { + if err.(thrift.TTransportException).TypeId() == thrift.TIMED_OUT { + reopenErr := cn.reopen(ctx) if reopenErr != nil { return nil, reopenErr } - return cn.graph.ExecuteJsonWithParameter(sessionID, []byte(stmt), params) + return cn.graph.ExecuteJsonWithParameter(ctx, sessionID, []byte(stmt), params) } } } @@ -214,15 +228,15 @@ func (cn *connection) ExecuteJsonWithParameter(sessionID int64, stmt string, par } // Check connection to host address -func (cn *connection) ping() bool { - _, err := cn.execute(0, "YIELD 1") +func (cn *connection) ping(ctx context.Context) bool { + _, err := cn.execute(ctx, 0, "YIELD 1") return err == nil } // Sign out and release session ID -func (cn *connection) signOut(sessionID int64) error { +func (cn *connection) signOut(ctx context.Context, sessionID int64) error { // Release session ID to graphd - return cn.graph.Signout(sessionID) + return cn.graph.Signout(ctx, sessionID) } // Update returnedAt for cleaner @@ -231,6 +245,11 @@ func (cn *connection) release() { } // Close transport -func (cn *connection) close() { - cn.graph.Close() +func (cn *connection) close() error { + if e := cn.transport.Close(); e != nil { + err := fmt.Errorf("fail to close transport, error: %s", e.Error()) + + return err + } + return nil } diff --git a/connection_pool.go b/connection_pool.go index 5e82305a..63a2d736 100644 --- a/connection_pool.go +++ b/connection_pool.go @@ -10,6 +10,7 @@ package nebula_go import ( "container/list" + "context" "crypto/tls" "fmt" "net/http" @@ -33,12 +34,13 @@ type ConnectionPool struct { } // NewConnectionPool constructs a new connection pool using the given addresses and configs -func NewConnectionPool(addresses []HostAddress, conf PoolConfig, log Logger) (*ConnectionPool, error) { - return NewSslConnectionPool(addresses, conf, nil, log) +func NewConnectionPool(ctx context.Context, addresses []HostAddress, conf PoolConfig, log Logger) (*ConnectionPool, error) { + return NewSslConnectionPool(ctx, addresses, conf, nil, log) } -// NewConnectionPool constructs a new SSL connection pool using the given addresses and configs -func NewSslConnectionPool(addresses []HostAddress, conf PoolConfig, sslConfig *tls.Config, log Logger) (*ConnectionPool, error) { +// NewSslConnectionPool constructs a new SSL connection pool using the given addresses and configs +func NewSslConnectionPool( + ctx context.Context, addresses []HostAddress, conf PoolConfig, sslConfig *tls.Config, log Logger) (*ConnectionPool, error) { // Check input if len(addresses) == 0 { return nil, fmt.Errorf("failed to initialize connection pool: illegal address input") @@ -56,7 +58,7 @@ func NewSslConnectionPool(addresses []HostAddress, conf PoolConfig, sslConfig *t } // Init pool with SSL socket - if err := newPool.initPool(); err != nil { + if err := newPool.initPool(ctx); err != nil { return nil, err } newPool.startCleaner() @@ -64,8 +66,8 @@ func NewSslConnectionPool(addresses []HostAddress, conf PoolConfig, sslConfig *t } // initPool initializes the connection pool -func (pool *ConnectionPool) initPool() error { - if err := checkAddresses(pool.conf.TimeOut, pool.addresses, pool.sslConfig, +func (pool *ConnectionPool) initPool(ctx context.Context) error { + if err := checkAddresses(ctx, pool.conf.TimeOut, pool.addresses, pool.sslConfig, pool.conf.UseHTTP2, pool.conf.HttpHeader, pool.conf.HandshakeKey); err != nil { return fmt.Errorf("failed to open connection, error: %s ", err.Error()) } @@ -75,12 +77,14 @@ func (pool *ConnectionPool) initPool() error { newConn := newConnection(pool.addresses[i%len(pool.addresses)]) // Open connection to host - if err := newConn.open(newConn.severAddress, pool.conf.TimeOut, pool.sslConfig, + if err := newConn.open(ctx, newConn.severAddress, pool.conf.TimeOut, pool.sslConfig, pool.conf.UseHTTP2, pool.conf.HttpHeader, pool.conf.HandshakeKey); err != nil { // If initialization failed, clean idle queue idleLen := pool.idleConnectionQueue.Len() for i := 0; i < idleLen; i++ { - pool.idleConnectionQueue.Front().Value.(*connection).close() + if err := pool.idleConnectionQueue.Front().Value.(*connection).close(); err != nil { + pool.log.Error(fmt.Sprintf("failed to close connection, error: %s", err.Error())) + } pool.idleConnectionQueue.Remove(pool.idleConnectionQueue.Front()) } return fmt.Errorf("failed to open connection, error: %s ", err.Error()) @@ -93,13 +97,13 @@ func (pool *ConnectionPool) initPool() error { // GetSession authenticates the username and password. // It returns a session if the authentication succeed. -func (pool *ConnectionPool) GetSession(username, password string) (*Session, error) { +func (pool *ConnectionPool) GetSession(ctx context.Context, username, password string) (*Session, error) { // Get valid and usable connection var conn *connection = nil var err error = nil const retryTimes = 3 for i := 0; i < retryTimes; i++ { - conn, err = pool.getIdleConn() + conn, err = pool.getIdleConn(ctx) if err == nil { break } @@ -108,7 +112,7 @@ func (pool *ConnectionPool) GetSession(username, password string) (*Session, err return nil, err } // Authenticate - resp, err := conn.authenticate(username, password) + resp, err := conn.authenticate(ctx, username, password) if err != nil { // if authentication failed, put connection back pool.pushBack(conn) @@ -138,7 +142,7 @@ func (pool *ConnectionPool) GetSession(username, password string) (*Session, err return &newSession, nil } -func (pool *ConnectionPool) getIdleConn() (*connection, error) { +func (pool *ConnectionPool) getIdleConn(ctx context.Context) (*connection, error) { pool.rwLock.Lock() defer pool.rwLock.Unlock() @@ -149,18 +153,20 @@ func (pool *ConnectionPool) getIdleConn() (*connection, error) { var tmpNextEle *list.Element for ele := pool.idleConnectionQueue.Front(); ele != nil; ele = tmpNextEle { // Check if connection is valid - if res := ele.Value.(*connection).ping(); res { + if res := ele.Value.(*connection).ping(ctx); res { newConn = ele.Value.(*connection) newEle = ele break } else { tmpNextEle = ele.Next() pool.idleConnectionQueue.Remove(ele) - ele.Value.(*connection).close() + if err := ele.Value.(*connection).close(); err != nil { + pool.log.Error(fmt.Sprintf("failed to close connection, error: %s", err.Error())) + } } } if newConn == nil { - return pool.createConnection() + return pool.createConnection(ctx) } // Remove new connection from idle and add to active if found pool.idleConnectionQueue.Remove(newEle) @@ -169,7 +175,7 @@ func (pool *ConnectionPool) getIdleConn() (*connection, error) { } // Create a new connection if there is no idle connection and total connection < pool max size - newConn, err := pool.createConnection() + newConn, err := pool.createConnection(ctx) // TODO: If no idle available, wait for timeout and reconnect return newConn, err } @@ -199,8 +205,8 @@ func (pool *ConnectionPool) deactivate(conn *connection, pushBack, release bool) } // Ping checks availability of host -func (pool *ConnectionPool) Ping(host HostAddress, timeout time.Duration) error { - return pingAddress(host, timeout, pool.sslConfig, pool.conf.UseHTTP2, pool.conf.HttpHeader, pool.conf.HandshakeKey) +func (pool *ConnectionPool) Ping(ctx context.Context, host HostAddress, timeout time.Duration) error { + return pingAddress(ctx, host, timeout, pool.sslConfig, pool.conf.UseHTTP2, pool.conf.HttpHeader, pool.conf.HandshakeKey) } // Close closes all connection @@ -213,11 +219,16 @@ func (pool *ConnectionPool) Close() { activeLen := pool.activeConnectionQueue.Len() for i := 0; i < idleLen; i++ { - pool.idleConnectionQueue.Front().Value.(*connection).close() + if err := pool.idleConnectionQueue.Front().Value.(*connection).close(); err != nil { + pool.log.Error(fmt.Sprintf("failed to close connection, error: %s", err.Error())) + } pool.idleConnectionQueue.Remove(pool.idleConnectionQueue.Front()) } for i := 0; i < activeLen; i++ { - pool.activeConnectionQueue.Front().Value.(*connection).close() + if err := pool.activeConnectionQueue.Front().Value.(*connection).close(); err != nil { + pool.log.Error(fmt.Sprintf("failed to close connection, error: %s", err.Error())) + } + pool.activeConnectionQueue.Remove(pool.activeConnectionQueue.Front()) } @@ -246,12 +257,12 @@ func (pool *ConnectionPool) getHost() HostAddress { } // Select a new host to create a new connection -func (pool *ConnectionPool) newConnToHost() (*connection, error) { +func (pool *ConnectionPool) newConnToHost(ctx context.Context) (*connection, error) { // Get a valid host (round robin) host := pool.getHost() newConn := newConnection(host) // Open connection to host - if err := newConn.open(newConn.severAddress, pool.conf.TimeOut, pool.sslConfig, + if err := newConn.open(ctx, newConn.severAddress, pool.conf.TimeOut, pool.sslConfig, pool.conf.UseHTTP2, pool.conf.HttpHeader, pool.conf.HandshakeKey); err != nil { return nil, err } @@ -271,7 +282,7 @@ func removeFromList(l *list.List, conn *connection) { } // Compare total connection number with pool max size and return a connection if capable -func (pool *ConnectionPool) createConnection() (*connection, error) { +func (pool *ConnectionPool) createConnection(ctx context.Context) (*connection, error) { totalConn := pool.idleConnectionQueue.Len() + pool.activeConnectionQueue.Len() // If no idle available and the number of total connection reaches the max pool size, return error/wait for timeout if totalConn >= pool.conf.MaxConnPoolSize { @@ -279,7 +290,7 @@ func (pool *ConnectionPool) createConnection() (*connection, error) { " in the idle queue and connection number has reached the pool capacity") } - newConn, err := pool.newConnToHost() + newConn, err := pool.newConnToHost(ctx) if err != nil { return nil, err } @@ -322,7 +333,9 @@ func (pool *ConnectionPool) connectionCleaner() { closing := pool.timeoutConnectionList() pool.rwLock.Unlock() for _, c := range closing { - c.close() + if err := c.close(); err != nil { + pool.log.Error(fmt.Sprintf("failed to close connection, error: %s", err.Error())) + } } t.Reset(d) @@ -359,6 +372,7 @@ func (pool *ConnectionPool) timeoutConnectionList() (closing []*connection) { // It opens a temporary connection to each address and closes it immediately. // If no error is returned, the addresses are available. func checkAddresses( + ctx context.Context, confTimeout time.Duration, addresses []HostAddress, sslConfig *tls.Config, useHTTP2 bool, httpHeader http.Header, handshakeKey string, ) error { @@ -367,7 +381,7 @@ func checkAddresses( timeout = confTimeout } for _, address := range addresses { - if err := pingAddress(address, timeout, sslConfig, useHTTP2, httpHeader, handshakeKey); err != nil { + if err := pingAddress(ctx, address, timeout, sslConfig, useHTTP2, httpHeader, handshakeKey); err != nil { return err } } @@ -375,12 +389,13 @@ func checkAddresses( } func pingAddress( + ctx context.Context, address HostAddress, timeout time.Duration, sslConfig *tls.Config, useHTTP2 bool, httpHeader http.Header, handshakeKey string, ) error { newConn := newConnection(address) // Open connection to host - if err := newConn.open(newConn.severAddress, timeout, sslConfig, useHTTP2, httpHeader, handshakeKey); err != nil { + if err := newConn.open(ctx, newConn.severAddress, timeout, sslConfig, useHTTP2, httpHeader, handshakeKey); err != nil { return err } defer newConn.close() diff --git a/examples/basic_example/graph_client_basic_example.go b/examples/basic_example/graph_client_basic_example.go index 5835028b..df223595 100644 --- a/examples/basic_example/graph_client_basic_example.go +++ b/examples/basic_example/graph_client_basic_example.go @@ -9,6 +9,7 @@ package main import ( + "context" "fmt" nebula "github.com/vesoft-inc/nebula-go/v3" @@ -28,6 +29,8 @@ const ( var log = nebula.DefaultLogger{} func main() { + ctx := context.Background() + hostAddress := nebula.HostAddress{Host: address, Port: port} hostList := []nebula.HostAddress{hostAddress} // Create configs for connection pool using default values @@ -36,7 +39,7 @@ func main() { testPoolConfig.HandshakeKey = "3.0.0" // Initialize connection pool - pool, err := nebula.NewConnectionPool(hostList, testPoolConfig, log) + pool, err := nebula.NewConnectionPool(ctx, hostList, testPoolConfig, log) if err != nil { log.Fatal(fmt.Sprintf("Fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) } @@ -44,13 +47,13 @@ func main() { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { log.Fatal(fmt.Sprintf("Fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error())) } // Release session and return connection back to connection pool - defer session.Release() + defer session.Release(ctx) checkResultSet := func(prefix string, res *nebula.ResultSet) { if !res.IsSucceed() { @@ -66,7 +69,7 @@ func main() { "CREATE EDGE IF NOT EXISTS like(likeness double)" // Execute a query - resultSet, err := session.Execute(createSchema) + resultSet, err := session.Execute(ctx, createSchema) if err != nil { fmt.Print(err.Error()) return @@ -77,7 +80,7 @@ func main() { { query := "DROP SPACE IF EXISTS basic_example_space" // Send query - resultSet, err := session.Execute(query) + resultSet, err := session.Execute(ctx, query) if err != nil { fmt.Print(err.Error()) return diff --git a/examples/contex_request_cancellation_example/contex_request_cancellation_example.go b/examples/contex_request_cancellation_example/contex_request_cancellation_example.go new file mode 100644 index 00000000..76a662b0 --- /dev/null +++ b/examples/contex_request_cancellation_example/contex_request_cancellation_example.go @@ -0,0 +1,61 @@ +package main + +import ( + "context" + "fmt" + nebula "github.com/vesoft-inc/nebula-go/v3" + "strings" +) + +const ( + address = "127.0.0.1" + // The default port of NebulaGraph 2.x is 9669. + // 3699 is only for testing. + port = 3699 + username = "root" + password = "nebula" + useHTTP2 = false +) + +// Initialize logger +var log = nebula.DefaultLogger{} + +func main() { + ctx := context.Background() + ctx, cancel := context.WithCancel(ctx) + + hostAddress := nebula.HostAddress{Host: address, Port: port} + hostList := []nebula.HostAddress{hostAddress} + // Create configs for connection pool using default values + testPoolConfig := nebula.GetDefaultConf() + testPoolConfig.UseHTTP2 = useHTTP2 + + // Initialize connection pool + pool, err := nebula.NewConnectionPool(ctx, hostList, testPoolConfig, log) + if err != nil { + log.Fatal(fmt.Sprintf("Fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) + } + // Close all connections in the pool + defer pool.Close() + + // Create session + session, _ := pool.GetSession(ctx, username, password) + + // Release session and return connection back to connection pool + defer session.Release(ctx) + + // Intentionally call cancel() + cancel() + + yieldQuery := "YIELD 5;" + + // Execute a query + _, err = session.Execute(ctx, yieldQuery) + if err != nil && strings.Contains(err.Error(), context.Canceled.Error()) { + fmt.Println(err.Error()) + return + } + + fmt.Print("\n") + log.Info("Nebula Go Client Goroutines Example Finished") +} diff --git a/examples/goroutines_example/graph_client_goroutines_example.go b/examples/goroutines_example/graph_client_goroutines_example.go index 0a919db9..d25e255f 100644 --- a/examples/goroutines_example/graph_client_goroutines_example.go +++ b/examples/goroutines_example/graph_client_goroutines_example.go @@ -9,6 +9,7 @@ package main import ( + "context" "fmt" "strings" "sync" @@ -31,6 +32,8 @@ const ( var log = nebula.DefaultLogger{} func main() { + ctx := context.Background() + hostAddress := nebula.HostAddress{Host: address, Port: port} hostList := []nebula.HostAddress{hostAddress} // Create configs for connection pool using default values @@ -38,7 +41,7 @@ func main() { testPoolConfig.UseHTTP2 = useHTTP2 // Initialize connection pool - pool, err := nebula.NewConnectionPool(hostList, testPoolConfig, log) + pool, err := nebula.NewConnectionPool(ctx, hostList, testPoolConfig, log) if err != nil { log.Fatal(fmt.Sprintf("Fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) } @@ -50,13 +53,13 @@ func main() { go func(wg *sync.WaitGroup) { defer wg.Done() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { log.Fatal(fmt.Sprintf("Fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error())) } // Release session and return connection back to connection pool - defer session.Release() + defer session.Release(ctx) // Method used to check execution response checkResultSet := func(prefix string, res *nebula.ResultSet) { if !res.IsSucceed() { @@ -70,7 +73,7 @@ func main() { "CREATE EDGE IF NOT EXISTS like(likeness double)" // Execute a query - resultSet, err := session.Execute(createSchema) + resultSet, err := session.Execute(ctx, createSchema) if err != nil { fmt.Print(err.Error()) return @@ -87,7 +90,7 @@ func main() { "'John':('John', 11);" // Insert multiple vertexes - resultSet, err := session.Execute(insertVertexes) + resultSet, err := session.Execute(ctx, insertVertexes) if err != nil { fmt.Print(err.Error()) return @@ -103,7 +106,7 @@ func main() { "'Tom'->'Jerry':(68.3), " + "'Bob'->'John':(97.2);" - resultSet, err := session.Execute(insertEdges) + resultSet, err := session.Execute(ctx, insertEdges) if err != nil { fmt.Print(err.Error()) return @@ -114,7 +117,7 @@ func main() { { query := "GO FROM 'Bob' OVER like YIELD $^.person.name, $^.person.age, like.likeness" // Send query - resultSet, err := session.Execute(query) + resultSet, err := session.Execute(ctx, query) if err != nil { fmt.Print(err.Error()) return @@ -155,7 +158,7 @@ func main() { { query := "DROP SPACE IF EXISTS example_space" // Send query - resultSet, err := session.Execute(query) + resultSet, err := session.Execute(ctx, query) if err != nil { fmt.Print(err.Error()) return diff --git a/examples/json_example/parse_json_example.go b/examples/json_example/parse_json_example.go index 54bf7cff..6104beff 100644 --- a/examples/json_example/parse_json_example.go +++ b/examples/json_example/parse_json_example.go @@ -9,6 +9,7 @@ package main import ( + "context" "encoding/json" "fmt" "time" @@ -74,6 +75,8 @@ type JsonObj struct { } func main() { + ctx := context.Background() + hostAddress := nebula.HostAddress{Host: address, Port: port} hostList := []nebula.HostAddress{hostAddress} // Create configs for connection pool using default values @@ -81,7 +84,7 @@ func main() { testPoolConfig.UseHTTP2 = useHTTP2 // Initialize connection pool - pool, err := nebula.NewConnectionPool(hostList, testPoolConfig, log) + pool, err := nebula.NewConnectionPool(ctx, hostList, testPoolConfig, log) if err != nil { log.Fatal(fmt.Sprintf("Fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) } @@ -89,22 +92,22 @@ func main() { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { log.Fatal(fmt.Sprintf("Fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error())) } // Release session and return connection back to connection pool - defer session.Release() + defer session.Release(ctx) // Create schemas - createTestDataSchema(session) + createTestDataSchema(ctx, session) // Load data - loadTestData(session) + loadTestData(ctx, session) // Complex result { - jsonStrResult, err := session.ExecuteJson("MATCH (v:person {name: \"Bob\"}) RETURN v") + jsonStrResult, err := session.ExecuteJson(ctx, "MATCH (v:person {name: \"Bob\"}) RETURN v") if err != nil { log.Fatal(fmt.Sprintf("fail to get the result in json format, %s", err.Error())) } @@ -126,7 +129,7 @@ func main() { } // With error { - jsonStrResult, err := session.ExecuteJson("MATCH (v:person {name: \"Bob\"}) RETURN v") + jsonStrResult, err := session.ExecuteJson(ctx, "MATCH (v:person {name: \"Bob\"}) RETURN v") if err != nil { log.Fatal(fmt.Sprintf("fail to get the result in json format, %s", err.Error())) } @@ -142,14 +145,14 @@ func main() { } fmt.Println("Error message: ", string(msg)) } - dropSpace(session, "client_test") + dropSpace(ctx, session, "client_test") fmt.Print("\n") log.Info("Nebula Go JSON parsing Example Finished") } // creates schema -func createTestDataSchema(session *nebula.Session) { +func createTestDataSchema(ctx context.Context, session *nebula.Session) { createSchema := "CREATE SPACE IF NOT EXISTS test_data(vid_type = FIXED_STRING(30));" + "USE test_data; " + "CREATE TAG IF NOT EXISTS person(name string, age int8, grade int16, " + @@ -161,7 +164,7 @@ func createTestDataSchema(session *nebula.Session) { "CREATE EDGE IF NOT EXISTS like(likeness double); " + "CREATE EDGE IF NOT EXISTS friend(start_Datetime datetime, end_Datetime datetime); " + "CREATE TAG INDEX IF NOT EXISTS person_name_index ON person(name(8));" - resultSet, err := session.Execute(createSchema) + resultSet, err := session.Execute(ctx, createSchema) if err != nil { log.Fatal(err.Error()) return @@ -172,7 +175,7 @@ func createTestDataSchema(session *nebula.Session) { } // inserts data that used in tests -func loadTestData(session *nebula.Session) { +func loadTestData(ctx context.Context, session *nebula.Session) { query := "INSERT VERTEX person(name, age, grade, friends, book_num," + "birthday, start_school, morning, property," + "is_girl, child_name, expend, first_out_city) VALUES" + @@ -191,7 +194,7 @@ func loadTestData(session *nebula.Session) { "'John':('John', 10, 3, 10, 100, datetime('2010-09-10T10:08:02'), " + "date('2017-09-10'), time('07:10:00'), " + "1000.0, false, \"Hello World!\", 100.0, 1111)" - resultSet, err := session.Execute(query) + resultSet, err := session.Execute(ctx, query) if err != nil { log.Fatal(err.Error()) return @@ -202,7 +205,7 @@ func loadTestData(session *nebula.Session) { "INSERT VERTEX student(name) VALUES " + "'Bob':('Bob'), 'Lily':('Lily'), " + "'Tom':('Tom'), 'Jerry':('Jerry'), 'John':('John')" - resultSet, err = session.Execute(query) + resultSet, err = session.Execute(ctx, query) if err != nil { log.Fatal(err.Error()) return @@ -216,7 +219,7 @@ func loadTestData(session *nebula.Session) { "'Jerry'->'Lily':(84.0)," + "'Tom'->'Jerry':(68.3), " + "'Bob'->'John':(97.2)" - resultSet, err = session.Execute(query) + resultSet, err = session.Execute(ctx, query) if err != nil { log.Fatal(err.Error()) return @@ -230,7 +233,7 @@ func loadTestData(session *nebula.Session) { "'Jerry'->'Lily':(datetime('2008-09-10T10:08:02'), datetime('2010-09-10T10:08:02')), " + "'Tom'->'Jerry':(datetime('2008-09-10T10:08:02'), datetime('2010-09-10T10:08:02')), " + "'Bob'->'John':(datetime('2008-09-10T10:08:02'), datetime('2010-09-10T10:08:02'))" - resultSet, err = session.Execute(query) + resultSet, err = session.Execute(ctx, query) if err != nil { log.Fatal(err.Error()) return @@ -238,9 +241,9 @@ func loadTestData(session *nebula.Session) { checkResultSet(query, resultSet) } -func dropSpace(session *nebula.Session, spaceName string) { +func dropSpace(ctx context.Context, session *nebula.Session, spaceName string) { query := fmt.Sprintf("DROP SPACE IF EXISTS %s;", spaceName) - resultSet, err := session.Execute(query) + resultSet, err := session.Execute(ctx, query) if err != nil { log.Fatal(err.Error()) return diff --git a/examples/parameter_example/parameter_example.go b/examples/parameter_example/parameter_example.go index 028648db..ca81f0d4 100644 --- a/examples/parameter_example/parameter_example.go +++ b/examples/parameter_example/parameter_example.go @@ -7,6 +7,7 @@ package main import ( + "context" "fmt" "strings" "sync" @@ -28,6 +29,8 @@ const ( var log = nebulago.DefaultLogger{} func main() { + ctx := context.Background() + hostAddress := nebulago.HostAddress{Host: address, Port: port} hostList := []nebulago.HostAddress{hostAddress} // Create configs for connection pool using default values @@ -35,7 +38,7 @@ func main() { testPoolConfig.UseHTTP2 = useHTTP2 // Initialize connection pool - pool, err := nebulago.NewConnectionPool(hostList, testPoolConfig, log) + pool, err := nebulago.NewConnectionPool(ctx, hostList, testPoolConfig, log) if err != nil { log.Fatal(fmt.Sprintf("Fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) } @@ -47,13 +50,13 @@ func main() { go func(wg *sync.WaitGroup) { defer wg.Done() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { log.Fatal(fmt.Sprintf("Fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error())) } // Release session and return connection back to connection pool - defer session.Release() + defer session.Release(ctx) checkResultSet := func(prefix string, res *nebulago.ResultSet) { if !res.IsSucceed() { @@ -72,7 +75,7 @@ func main() { query := "RETURN abs($p2)+1 AS col1, toBoolean($p1) and false AS col2, $p3, $p4.a" // Send query // resultSet, err := session.ExecuteWithParameter(query, params) - resultSet, err := session.ExecuteWithParameter(query, params) + resultSet, err := session.ExecuteWithParameter(ctx, query, params) if err != nil { fmt.Print(err.Error()) return diff --git a/examples/session_pool_example/session_pool_example.go b/examples/session_pool_example/session_pool_example.go index 6a8f6497..f0d3e60a 100644 --- a/examples/session_pool_example/session_pool_example.go +++ b/examples/session_pool_example/session_pool_example.go @@ -9,6 +9,7 @@ package main import ( + "context" "fmt" "strings" "sync" @@ -37,7 +38,9 @@ type Person struct { } func main() { - prepareSpace() + ctx := context.Background() + + prepareSpace(ctx) hostAddress := nebula.HostAddress{Host: address, Port: port} // Create configs for session pool @@ -53,11 +56,11 @@ func main() { } // create session pool - sessionPool, err := nebula.NewSessionPool(*config, nebula.DefaultLogger{}) + sessionPool, err := nebula.NewSessionPool(ctx, *config, nebula.DefaultLogger{}) if err != nil { log.Fatal(fmt.Sprintf("failed to initialize session pool, %s", err.Error())) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) checkResultSet := func(prefix string, res *nebula.ResultSet) { if !res.IsSucceed() { @@ -75,7 +78,7 @@ func main() { "'John':('John', 11);" // Insert multiple vertexes - resultSet, err := sessionPool.Execute(insertVertexes) + resultSet, err := sessionPool.Execute(ctx, insertVertexes) if err != nil { fmt.Print(err.Error()) return @@ -91,7 +94,7 @@ func main() { "'Tom'->'Jerry':(68.3), " + "'Bob'->'John':(97.2);" - resultSet, err := sessionPool.Execute(insertEdges) + resultSet, err := sessionPool.Execute(ctx, insertEdges) if err != nil { fmt.Print(err.Error()) return @@ -108,7 +111,7 @@ func main() { go func(wg *sync.WaitGroup) { defer wg.Done() - resultSet, err = sessionPool.Execute(query) + resultSet, err = sessionPool.Execute(ctx, query) if err != nil { fmt.Print(err.Error()) return @@ -155,7 +158,7 @@ func main() { { query := "DROP SPACE IF EXISTS example_space" // Send query - resultSet, err := sessionPool.Execute(query) + resultSet, err := sessionPool.Execute(ctx, query) if err != nil { fmt.Print(err.Error()) return @@ -167,7 +170,7 @@ func main() { } // Just a helper function to create a space for this example to run. -func prepareSpace() { +func prepareSpace(ctx context.Context) { hostAddress := nebula.HostAddress{Host: address, Port: port} hostList := []nebula.HostAddress{hostAddress} // Create configs for connection pool using default values @@ -175,7 +178,7 @@ func prepareSpace() { testPoolConfig.UseHTTP2 = useHTTP2 // Initialize connection pool - pool, err := nebula.NewConnectionPool(hostList, testPoolConfig, log) + pool, err := nebula.NewConnectionPool(ctx, hostList, testPoolConfig, log) if err != nil { log.Fatal(fmt.Sprintf("Fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) } @@ -183,13 +186,13 @@ func prepareSpace() { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { log.Fatal(fmt.Sprintf("Fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error())) } // Release session and return connection back to connection pool - defer session.Release() + defer session.Release(ctx) checkResultSet := func(prefix string, res *nebula.ResultSet) { if !res.IsSucceed() { @@ -205,7 +208,7 @@ func prepareSpace() { "CREATE EDGE IF NOT EXISTS like(likeness double)" // Execute a query - resultSet, err := session.Execute(createSchema) + resultSet, err := session.Execute(ctx, createSchema) if err != nil { fmt.Print(err.Error()) return diff --git a/examples/ssl_example/graph_client_ssl_example.go b/examples/ssl_example/graph_client_ssl_example.go index 318e4e83..96783b66 100644 --- a/examples/ssl_example/graph_client_ssl_example.go +++ b/examples/ssl_example/graph_client_ssl_example.go @@ -9,6 +9,7 @@ package main import ( + "context" "fmt" nebula "github.com/vesoft-inc/nebula-go/v3" @@ -27,6 +28,9 @@ const ( var log = nebula.DefaultLogger{} func main() { + + ctx := context.Background() + hostAddress := nebula.HostAddress{Host: address, Port: port} hostList := []nebula.HostAddress{hostAddress} // Create configs for connection pool using default values @@ -45,7 +49,7 @@ func main() { sslConfig.InsecureSkipVerify = false // Initialize connection pool - pool, err := nebula.NewSslConnectionPool(hostList, testPoolConfig, sslConfig, log) + pool, err := nebula.NewSslConnectionPool(ctx, hostList, testPoolConfig, sslConfig, log) if err != nil { log.Fatal(fmt.Sprintf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error())) } @@ -53,13 +57,13 @@ func main() { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { log.Fatal(fmt.Sprintf("Fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error())) } // Release session and return connection back to connection pool - defer session.Release() + defer session.Release(ctx) checkResultSet := func(prefix string, res *nebula.ResultSet) { if !res.IsSucceed() { @@ -75,7 +79,7 @@ func main() { "CREATE EDGE IF NOT EXISTS like(likeness double)" // Execute a query - resultSet, err := session.Execute(createSchema) + resultSet, err := session.Execute(ctx, createSchema) if err != nil { fmt.Print(err.Error()) return @@ -86,7 +90,7 @@ func main() { { query := "DROP SPACE IF EXISTS basic_example_space" // Send query - resultSet, err := session.Execute(query) + resultSet, err := session.Execute(ctx, query) if err != nil { fmt.Print(err.Error()) return diff --git a/go.mod b/go.mod index 7057c16a..b117275d 100644 --- a/go.mod +++ b/go.mod @@ -1,9 +1,18 @@ module github.com/vesoft-inc/nebula-go/v3 -go 1.16 +go 1.21 + +toolchain go1.23.0 require ( + github.com/apache/thrift v0.20.0 github.com/stretchr/testify v1.7.0 - github.com/vesoft-inc/fbthrift v0.0.0-20230214024353-fa2f34755b28 golang.org/x/net v0.17.0 ) + +require ( + github.com/davecgh/go-spew v1.1.0 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + golang.org/x/text v0.13.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect +) diff --git a/go.sum b/go.sum index d1c95190..cda81135 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/apache/thrift v0.20.0 h1:631+KvYbsBZxmuJjYwhezVsrfc/TbqtZV4QcxOX1fOI= +github.com/apache/thrift v0.20.0/go.mod h1:hOk1BQqcp2OLzGsyVXdfMk7YFlMxK3aoEVhjD06QhB8= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -5,49 +7,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/vesoft-inc/fbthrift v0.0.0-20230214024353-fa2f34755b28 h1:gpoPCGeOEuk/TnoY9nLVK1FoBM5ie7zY3BPVG8q43ME= -github.com/vesoft-inc/fbthrift v0.0.0-20230214024353-fa2f34755b28/go.mod h1:xu7e9za8StcJhBZmCDwK1Hyv4/Y0xFsjS+uqp10ECJg= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/nebula/GoUnusedProtection__.go b/nebula/GoUnusedProtection__.go new file mode 100644 index 00000000..08bbdad4 --- /dev/null +++ b/nebula/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package nebula + +var GoUnusedProtection__ int; + diff --git a/nebula/common-consts.go b/nebula/common-consts.go new file mode 100644 index 00000000..ede28589 --- /dev/null +++ b/nebula/common-consts.go @@ -0,0 +1,31 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package nebula + +import ( + "bytes" + "context" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +const Version = "3.0.0" + +func init() { +} + diff --git a/nebula/common.go b/nebula/common.go new file mode 100644 index 00000000..82c87ff8 --- /dev/null +++ b/nebula/common.go @@ -0,0 +1,6547 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package nebula + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +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 +) + +func (p NullType) String() string { + switch p { + case NullType___NULL__: return "__NULL__" + case NullType_NaN: return "NaN" + case NullType_BAD_DATA: return "BAD_DATA" + case NullType_BAD_TYPE: return "BAD_TYPE" + case NullType_ERR_OVERFLOW: return "ERR_OVERFLOW" + case NullType_UNKNOWN_PROP: return "UNKNOWN_PROP" + case NullType_DIV_BY_ZERO: return "DIV_BY_ZERO" + case NullType_OUT_OF_RANGE: return "OUT_OF_RANGE" + } + return "" +} + +func NullTypeFromString(s string) (NullType, error) { + switch s { + case "__NULL__": return NullType___NULL__, nil + case "NaN": return NullType_NaN, nil + case "BAD_DATA": return NullType_BAD_DATA, nil + case "BAD_TYPE": return NullType_BAD_TYPE, nil + case "ERR_OVERFLOW": return NullType_ERR_OVERFLOW, nil + case "UNKNOWN_PROP": return NullType_UNKNOWN_PROP, nil + case "DIV_BY_ZERO": return NullType_DIV_BY_ZERO, nil + case "OUT_OF_RANGE": return NullType_OUT_OF_RANGE, nil + } + return NullType(0), fmt.Errorf("not a valid NullType string") +} + + +func NullTypePtr(v NullType) *NullType { return &v } + +func (p NullType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *NullType) UnmarshalText(text []byte) error { +q, err := NullTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *NullType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = NullType(v) +return nil +} + +func (p * NullType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +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_DURATION PropertyType = 23 + PropertyType_DATE PropertyType = 24 + PropertyType_DATETIME PropertyType = 25 + PropertyType_TIME PropertyType = 26 + PropertyType_GEOGRAPHY PropertyType = 31 +) + +func (p PropertyType) String() string { + switch p { + case PropertyType_UNKNOWN: return "UNKNOWN" + case PropertyType_BOOL: return "BOOL" + case PropertyType_INT64: return "INT64" + case PropertyType_VID: return "VID" + case PropertyType_FLOAT: return "FLOAT" + case PropertyType_DOUBLE: return "DOUBLE" + case PropertyType_STRING: return "STRING" + case PropertyType_FIXED_STRING: return "FIXED_STRING" + case PropertyType_INT8: return "INT8" + case PropertyType_INT16: return "INT16" + case PropertyType_INT32: return "INT32" + case PropertyType_TIMESTAMP: return "TIMESTAMP" + case PropertyType_DURATION: return "DURATION" + case PropertyType_DATE: return "DATE" + case PropertyType_DATETIME: return "DATETIME" + case PropertyType_TIME: return "TIME" + case PropertyType_GEOGRAPHY: return "GEOGRAPHY" + } + return "" +} + +func PropertyTypeFromString(s string) (PropertyType, error) { + switch s { + case "UNKNOWN": return PropertyType_UNKNOWN, nil + case "BOOL": return PropertyType_BOOL, nil + case "INT64": return PropertyType_INT64, nil + case "VID": return PropertyType_VID, nil + case "FLOAT": return PropertyType_FLOAT, nil + case "DOUBLE": return PropertyType_DOUBLE, nil + case "STRING": return PropertyType_STRING, nil + case "FIXED_STRING": return PropertyType_FIXED_STRING, nil + case "INT8": return PropertyType_INT8, nil + case "INT16": return PropertyType_INT16, nil + case "INT32": return PropertyType_INT32, nil + case "TIMESTAMP": return PropertyType_TIMESTAMP, nil + case "DURATION": return PropertyType_DURATION, nil + case "DATE": return PropertyType_DATE, nil + case "DATETIME": return PropertyType_DATETIME, nil + case "TIME": return PropertyType_TIME, nil + case "GEOGRAPHY": return PropertyType_GEOGRAPHY, nil + } + return PropertyType(0), fmt.Errorf("not a valid PropertyType string") +} + + +func PropertyTypePtr(v PropertyType) *PropertyType { return &v } + +func (p PropertyType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *PropertyType) UnmarshalText(text []byte) error { +q, err := PropertyTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *PropertyType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = PropertyType(v) +return nil +} + +func (p * PropertyType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +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_MACHINE_NOT_FOUND ErrorCode = -13 + ErrorCode_E_ZONE_NOT_FOUND ErrorCode = -14 + ErrorCode_E_LISTENER_NOT_FOUND ErrorCode = -15 + ErrorCode_E_PART_NOT_FOUND ErrorCode = -16 + ErrorCode_E_KEY_NOT_FOUND ErrorCode = -17 + ErrorCode_E_USER_NOT_FOUND ErrorCode = -18 + ErrorCode_E_STATS_NOT_FOUND ErrorCode = -19 + ErrorCode_E_SERVICE_NOT_FOUND ErrorCode = -20 + ErrorCode_E_DRAINER_NOT_FOUND ErrorCode = -21 + ErrorCode_E_DRAINER_CLIENT_NOT_FOUND ErrorCode = -22 + ErrorCode_E_PART_STOPPED ErrorCode = -23 + 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_LISTENER_PROGRESS_FAILED ErrorCode = -31 + ErrorCode_E_SYNC_LISTENER_NOT_FOUND ErrorCode = -32 + ErrorCode_E_DRAINER_PROGRESS_FAILED ErrorCode = -33 + ErrorCode_E_PART_DISABLED ErrorCode = -34 + ErrorCode_E_PART_ALREADY_STARTED ErrorCode = -35 + ErrorCode_E_PART_ALREADY_STOPPED ErrorCode = -36 + 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_ZONE_NOT_ENOUGH ErrorCode = -2011 + ErrorCode_E_ZONE_IS_EMPTY ErrorCode = -2012 + ErrorCode_E_LISTENER_CONFLICT ErrorCode = -2013 + ErrorCode_E_SCHEMA_NAME_EXISTS ErrorCode = -2014 + ErrorCode_E_RELATED_INDEX_EXISTS ErrorCode = -2015 + ErrorCode_E_RELATED_SPACE_EXISTS ErrorCode = -2016 + ErrorCode_E_RELATED_FULLTEXT_INDEX_EXISTS ErrorCode = -2017 + ErrorCode_E_HISTORY_CONFLICT ErrorCode = -2018 + 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_CORRUPTED_BALANCE_PLAN ErrorCode = -2027 + ErrorCode_E_NO_INVALID_BALANCE_PLAN ErrorCode = -2028 + ErrorCode_E_NO_VALID_DRAINER ErrorCode = -2029 + 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_PRIVILEGE_ALL_TAG_EDGE_SETTLED ErrorCode = -2036 + ErrorCode_E_PRIVILEGE_NOT_EXIST ErrorCode = -2037 + ErrorCode_E_PRIVILEGE_NEED_BASIC_ROLE ErrorCode = -2038 + ErrorCode_E_PRIVILEGE_ACTION_INVALID ErrorCode = -2039 + ErrorCode_E_SNAPSHOT_FAILURE ErrorCode = -2040 + ErrorCode_E_SNAPSHOT_RUNNING_JOBS ErrorCode = -2056 + ErrorCode_E_SNAPSHOT_NOT_FOUND ErrorCode = -2057 + 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_JOB_NEED_RECOVER ErrorCode = -2051 + ErrorCode_E_JOB_ALREADY_FINISH ErrorCode = -2052 + ErrorCode_E_JOB_SUBMITTED ErrorCode = -2053 + ErrorCode_E_JOB_NOT_STOPPABLE ErrorCode = -2054 + ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE ErrorCode = -2055 + ErrorCode_E_INVALID_JOB ErrorCode = -2065 + ErrorCode_E_BACKUP_RUNNING_JOBS 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_LIST_CLUSTER_NO_AGENT_FAILURE ErrorCode = -2072 + ErrorCode_E_QUERY_NOT_FOUND ErrorCode = -2073 + ErrorCode_E_AGENT_HB_FAILUE ErrorCode = -2074 + ErrorCode_E_INVALID_VARIABLE ErrorCode = -2080 + ErrorCode_E_VARIABLE_TYPE_VALUE_MISMATCH ErrorCode = -2081 + ErrorCode_E_HOST_CAN_NOT_BE_ADDED ErrorCode = -2082 + ErrorCode_E_ACCESS_ES_FAILURE ErrorCode = -2090 + ErrorCode_E_GRAPH_MEMORY_EXCEEDED ErrorCode = -2600 + 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_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_ID_FAILED ErrorCode = -3062 + ErrorCode_E_RAFT_UNKNOWN_PART ErrorCode = -3500 + ErrorCode_E_RAFT_LOG_GAP ErrorCode = -3501 + ErrorCode_E_RAFT_LOG_STALE ErrorCode = -3502 + ErrorCode_E_RAFT_TERM_OUT_OF_DATE ErrorCode = -3503 + ErrorCode_E_RAFT_UNKNOWN_APPEND_LOG ErrorCode = -3504 + ErrorCode_E_RAFT_WAITING_SNAPSHOT ErrorCode = -3511 + ErrorCode_E_RAFT_SENDING_SNAPSHOT ErrorCode = -3512 + ErrorCode_E_RAFT_INVALID_PEER ErrorCode = -3513 + ErrorCode_E_RAFT_NOT_READY ErrorCode = -3514 + ErrorCode_E_RAFT_STOPPED ErrorCode = -3515 + ErrorCode_E_RAFT_BAD_ROLE ErrorCode = -3516 + ErrorCode_E_RAFT_WAL_FAIL ErrorCode = -3521 + ErrorCode_E_RAFT_HOST_STOPPED ErrorCode = -3522 + ErrorCode_E_RAFT_TOO_MANY_REQUESTS ErrorCode = -3523 + ErrorCode_E_RAFT_PERSIST_SNAPSHOT_FAILED ErrorCode = -3524 + ErrorCode_E_RAFT_RPC_EXCEPTION ErrorCode = -3525 + ErrorCode_E_RAFT_NO_WAL_FOUND ErrorCode = -3526 + ErrorCode_E_RAFT_HOST_PAUSED ErrorCode = -3527 + ErrorCode_E_RAFT_WRITE_BLOCKED ErrorCode = -3528 + ErrorCode_E_RAFT_BUFFER_OVERFLOW ErrorCode = -3529 + ErrorCode_E_RAFT_ATOMIC_OP_FAILED ErrorCode = -3530 + ErrorCode_E_LEADER_LEASE_FAILED ErrorCode = -3531 + ErrorCode_E_RAFT_CAUGHT_UP ErrorCode = -3532 + ErrorCode_E_LOG_GAP ErrorCode = -4001 + ErrorCode_E_LOG_STALE ErrorCode = -4002 + ErrorCode_E_INVALID_DRAINER_STORE ErrorCode = -4003 + ErrorCode_E_SPACE_MISMATCH ErrorCode = -4004 + ErrorCode_E_PART_MISMATCH ErrorCode = -4005 + ErrorCode_E_DATA_CONFLICT ErrorCode = -4006 + ErrorCode_E_REQ_CONFLICT ErrorCode = -4007 + ErrorCode_E_DATA_ILLEGAL ErrorCode = -4008 + ErrorCode_E_CACHE_CONFIG_ERROR ErrorCode = -5001 + ErrorCode_E_NOT_ENOUGH_SPACE ErrorCode = -5002 + ErrorCode_E_CACHE_MISS ErrorCode = -5003 + ErrorCode_E_POOL_NOT_FOUND ErrorCode = -5004 + ErrorCode_E_CACHE_WRITE_FAILURE ErrorCode = -5005 + ErrorCode_E_NODE_NUMBER_EXCEED_LIMIT ErrorCode = -7001 + ErrorCode_E_PARSING_LICENSE_FAILURE ErrorCode = -7002 + ErrorCode_E_STORAGE_MEMORY_EXCEEDED ErrorCode = -3600 + ErrorCode_E_UNKNOWN ErrorCode = -8000 +) + +func (p ErrorCode) String() string { + switch p { + case ErrorCode_SUCCEEDED: return "SUCCEEDED" + case ErrorCode_E_DISCONNECTED: return "E_DISCONNECTED" + case ErrorCode_E_FAIL_TO_CONNECT: return "E_FAIL_TO_CONNECT" + case ErrorCode_E_RPC_FAILURE: return "E_RPC_FAILURE" + case ErrorCode_E_LEADER_CHANGED: return "E_LEADER_CHANGED" + case ErrorCode_E_SPACE_NOT_FOUND: return "E_SPACE_NOT_FOUND" + case ErrorCode_E_TAG_NOT_FOUND: return "E_TAG_NOT_FOUND" + case ErrorCode_E_EDGE_NOT_FOUND: return "E_EDGE_NOT_FOUND" + case ErrorCode_E_INDEX_NOT_FOUND: return "E_INDEX_NOT_FOUND" + case ErrorCode_E_EDGE_PROP_NOT_FOUND: return "E_EDGE_PROP_NOT_FOUND" + case ErrorCode_E_TAG_PROP_NOT_FOUND: return "E_TAG_PROP_NOT_FOUND" + case ErrorCode_E_ROLE_NOT_FOUND: return "E_ROLE_NOT_FOUND" + case ErrorCode_E_CONFIG_NOT_FOUND: return "E_CONFIG_NOT_FOUND" + case ErrorCode_E_MACHINE_NOT_FOUND: return "E_MACHINE_NOT_FOUND" + case ErrorCode_E_ZONE_NOT_FOUND: return "E_ZONE_NOT_FOUND" + case ErrorCode_E_LISTENER_NOT_FOUND: return "E_LISTENER_NOT_FOUND" + case ErrorCode_E_PART_NOT_FOUND: return "E_PART_NOT_FOUND" + case ErrorCode_E_KEY_NOT_FOUND: return "E_KEY_NOT_FOUND" + case ErrorCode_E_USER_NOT_FOUND: return "E_USER_NOT_FOUND" + case ErrorCode_E_STATS_NOT_FOUND: return "E_STATS_NOT_FOUND" + case ErrorCode_E_SERVICE_NOT_FOUND: return "E_SERVICE_NOT_FOUND" + case ErrorCode_E_DRAINER_NOT_FOUND: return "E_DRAINER_NOT_FOUND" + case ErrorCode_E_DRAINER_CLIENT_NOT_FOUND: return "E_DRAINER_CLIENT_NOT_FOUND" + case ErrorCode_E_PART_STOPPED: return "E_PART_STOPPED" + case ErrorCode_E_BACKUP_FAILED: return "E_BACKUP_FAILED" + case ErrorCode_E_BACKUP_EMPTY_TABLE: return "E_BACKUP_EMPTY_TABLE" + case ErrorCode_E_BACKUP_TABLE_FAILED: return "E_BACKUP_TABLE_FAILED" + case ErrorCode_E_PARTIAL_RESULT: return "E_PARTIAL_RESULT" + case ErrorCode_E_REBUILD_INDEX_FAILED: return "E_REBUILD_INDEX_FAILED" + case ErrorCode_E_INVALID_PASSWORD: return "E_INVALID_PASSWORD" + case ErrorCode_E_FAILED_GET_ABS_PATH: return "E_FAILED_GET_ABS_PATH" + case ErrorCode_E_LISTENER_PROGRESS_FAILED: return "E_LISTENER_PROGRESS_FAILED" + case ErrorCode_E_SYNC_LISTENER_NOT_FOUND: return "E_SYNC_LISTENER_NOT_FOUND" + case ErrorCode_E_DRAINER_PROGRESS_FAILED: return "E_DRAINER_PROGRESS_FAILED" + case ErrorCode_E_PART_DISABLED: return "E_PART_DISABLED" + case ErrorCode_E_PART_ALREADY_STARTED: return "E_PART_ALREADY_STARTED" + case ErrorCode_E_PART_ALREADY_STOPPED: return "E_PART_ALREADY_STOPPED" + case ErrorCode_E_BAD_USERNAME_PASSWORD: return "E_BAD_USERNAME_PASSWORD" + case ErrorCode_E_SESSION_INVALID: return "E_SESSION_INVALID" + case ErrorCode_E_SESSION_TIMEOUT: return "E_SESSION_TIMEOUT" + case ErrorCode_E_SYNTAX_ERROR: return "E_SYNTAX_ERROR" + case ErrorCode_E_EXECUTION_ERROR: return "E_EXECUTION_ERROR" + case ErrorCode_E_STATEMENT_EMPTY: return "E_STATEMENT_EMPTY" + case ErrorCode_E_BAD_PERMISSION: return "E_BAD_PERMISSION" + case ErrorCode_E_SEMANTIC_ERROR: return "E_SEMANTIC_ERROR" + case ErrorCode_E_TOO_MANY_CONNECTIONS: return "E_TOO_MANY_CONNECTIONS" + case ErrorCode_E_PARTIAL_SUCCEEDED: return "E_PARTIAL_SUCCEEDED" + case ErrorCode_E_NO_HOSTS: return "E_NO_HOSTS" + case ErrorCode_E_EXISTED: return "E_EXISTED" + case ErrorCode_E_INVALID_HOST: return "E_INVALID_HOST" + case ErrorCode_E_UNSUPPORTED: return "E_UNSUPPORTED" + case ErrorCode_E_NOT_DROP: return "E_NOT_DROP" + case ErrorCode_E_BALANCER_RUNNING: return "E_BALANCER_RUNNING" + case ErrorCode_E_CONFIG_IMMUTABLE: return "E_CONFIG_IMMUTABLE" + case ErrorCode_E_CONFLICT: return "E_CONFLICT" + case ErrorCode_E_INVALID_PARM: return "E_INVALID_PARM" + case ErrorCode_E_WRONGCLUSTER: return "E_WRONGCLUSTER" + case ErrorCode_E_ZONE_NOT_ENOUGH: return "E_ZONE_NOT_ENOUGH" + case ErrorCode_E_ZONE_IS_EMPTY: return "E_ZONE_IS_EMPTY" + case ErrorCode_E_LISTENER_CONFLICT: return "E_LISTENER_CONFLICT" + case ErrorCode_E_SCHEMA_NAME_EXISTS: return "E_SCHEMA_NAME_EXISTS" + case ErrorCode_E_RELATED_INDEX_EXISTS: return "E_RELATED_INDEX_EXISTS" + case ErrorCode_E_RELATED_SPACE_EXISTS: return "E_RELATED_SPACE_EXISTS" + case ErrorCode_E_RELATED_FULLTEXT_INDEX_EXISTS: return "E_RELATED_FULLTEXT_INDEX_EXISTS" + case ErrorCode_E_HISTORY_CONFLICT: return "E_HISTORY_CONFLICT" + case ErrorCode_E_STORE_FAILURE: return "E_STORE_FAILURE" + case ErrorCode_E_STORE_SEGMENT_ILLEGAL: return "E_STORE_SEGMENT_ILLEGAL" + case ErrorCode_E_BAD_BALANCE_PLAN: return "E_BAD_BALANCE_PLAN" + case ErrorCode_E_BALANCED: return "E_BALANCED" + case ErrorCode_E_NO_RUNNING_BALANCE_PLAN: return "E_NO_RUNNING_BALANCE_PLAN" + case ErrorCode_E_NO_VALID_HOST: return "E_NO_VALID_HOST" + case ErrorCode_E_CORRUPTED_BALANCE_PLAN: return "E_CORRUPTED_BALANCE_PLAN" + case ErrorCode_E_NO_INVALID_BALANCE_PLAN: return "E_NO_INVALID_BALANCE_PLAN" + case ErrorCode_E_NO_VALID_DRAINER: return "E_NO_VALID_DRAINER" + case ErrorCode_E_IMPROPER_ROLE: return "E_IMPROPER_ROLE" + case ErrorCode_E_INVALID_PARTITION_NUM: return "E_INVALID_PARTITION_NUM" + case ErrorCode_E_INVALID_REPLICA_FACTOR: return "E_INVALID_REPLICA_FACTOR" + case ErrorCode_E_INVALID_CHARSET: return "E_INVALID_CHARSET" + case ErrorCode_E_INVALID_COLLATE: return "E_INVALID_COLLATE" + case ErrorCode_E_CHARSET_COLLATE_NOT_MATCH: return "E_CHARSET_COLLATE_NOT_MATCH" + case ErrorCode_E_PRIVILEGE_ALL_TAG_EDGE_SETTLED: return "E_PRIVILEGE_ALL_TAG_EDGE_SETTLED" + case ErrorCode_E_PRIVILEGE_NOT_EXIST: return "E_PRIVILEGE_NOT_EXIST" + case ErrorCode_E_PRIVILEGE_NEED_BASIC_ROLE: return "E_PRIVILEGE_NEED_BASIC_ROLE" + case ErrorCode_E_PRIVILEGE_ACTION_INVALID: return "E_PRIVILEGE_ACTION_INVALID" + case ErrorCode_E_SNAPSHOT_FAILURE: return "E_SNAPSHOT_FAILURE" + case ErrorCode_E_SNAPSHOT_RUNNING_JOBS: return "E_SNAPSHOT_RUNNING_JOBS" + case ErrorCode_E_SNAPSHOT_NOT_FOUND: return "E_SNAPSHOT_NOT_FOUND" + case ErrorCode_E_BLOCK_WRITE_FAILURE: return "E_BLOCK_WRITE_FAILURE" + case ErrorCode_E_REBUILD_INDEX_FAILURE: return "E_REBUILD_INDEX_FAILURE" + case ErrorCode_E_INDEX_WITH_TTL: return "E_INDEX_WITH_TTL" + case ErrorCode_E_ADD_JOB_FAILURE: return "E_ADD_JOB_FAILURE" + case ErrorCode_E_STOP_JOB_FAILURE: return "E_STOP_JOB_FAILURE" + case ErrorCode_E_SAVE_JOB_FAILURE: return "E_SAVE_JOB_FAILURE" + case ErrorCode_E_BALANCER_FAILURE: return "E_BALANCER_FAILURE" + case ErrorCode_E_JOB_NOT_FINISHED: return "E_JOB_NOT_FINISHED" + case ErrorCode_E_TASK_REPORT_OUT_DATE: return "E_TASK_REPORT_OUT_DATE" + case ErrorCode_E_JOB_NOT_IN_SPACE: return "E_JOB_NOT_IN_SPACE" + case ErrorCode_E_JOB_NEED_RECOVER: return "E_JOB_NEED_RECOVER" + case ErrorCode_E_JOB_ALREADY_FINISH: return "E_JOB_ALREADY_FINISH" + case ErrorCode_E_JOB_SUBMITTED: return "E_JOB_SUBMITTED" + case ErrorCode_E_JOB_NOT_STOPPABLE: return "E_JOB_NOT_STOPPABLE" + case ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE: return "E_JOB_HAS_NO_TARGET_STORAGE" + case ErrorCode_E_INVALID_JOB: return "E_INVALID_JOB" + case ErrorCode_E_BACKUP_RUNNING_JOBS: return "E_BACKUP_RUNNING_JOBS" + case ErrorCode_E_BACKUP_SPACE_NOT_FOUND: return "E_BACKUP_SPACE_NOT_FOUND" + case ErrorCode_E_RESTORE_FAILURE: return "E_RESTORE_FAILURE" + case ErrorCode_E_SESSION_NOT_FOUND: return "E_SESSION_NOT_FOUND" + case ErrorCode_E_LIST_CLUSTER_FAILURE: return "E_LIST_CLUSTER_FAILURE" + case ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE: return "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE" + case ErrorCode_E_LIST_CLUSTER_NO_AGENT_FAILURE: return "E_LIST_CLUSTER_NO_AGENT_FAILURE" + case ErrorCode_E_QUERY_NOT_FOUND: return "E_QUERY_NOT_FOUND" + case ErrorCode_E_AGENT_HB_FAILUE: return "E_AGENT_HB_FAILUE" + case ErrorCode_E_INVALID_VARIABLE: return "E_INVALID_VARIABLE" + case ErrorCode_E_VARIABLE_TYPE_VALUE_MISMATCH: return "E_VARIABLE_TYPE_VALUE_MISMATCH" + case ErrorCode_E_HOST_CAN_NOT_BE_ADDED: return "E_HOST_CAN_NOT_BE_ADDED" + case ErrorCode_E_ACCESS_ES_FAILURE: return "E_ACCESS_ES_FAILURE" + case ErrorCode_E_GRAPH_MEMORY_EXCEEDED: return "E_GRAPH_MEMORY_EXCEEDED" + case ErrorCode_E_CONSENSUS_ERROR: return "E_CONSENSUS_ERROR" + case ErrorCode_E_KEY_HAS_EXISTS: return "E_KEY_HAS_EXISTS" + case ErrorCode_E_DATA_TYPE_MISMATCH: return "E_DATA_TYPE_MISMATCH" + case ErrorCode_E_INVALID_FIELD_VALUE: return "E_INVALID_FIELD_VALUE" + case ErrorCode_E_INVALID_OPERATION: return "E_INVALID_OPERATION" + case ErrorCode_E_NOT_NULLABLE: return "E_NOT_NULLABLE" + case ErrorCode_E_FIELD_UNSET: return "E_FIELD_UNSET" + case ErrorCode_E_OUT_OF_RANGE: return "E_OUT_OF_RANGE" + case ErrorCode_E_DATA_CONFLICT_ERROR: return "E_DATA_CONFLICT_ERROR" + case ErrorCode_E_WRITE_STALLED: return "E_WRITE_STALLED" + case ErrorCode_E_IMPROPER_DATA_TYPE: return "E_IMPROPER_DATA_TYPE" + case ErrorCode_E_INVALID_SPACEVIDLEN: return "E_INVALID_SPACEVIDLEN" + case ErrorCode_E_INVALID_FILTER: return "E_INVALID_FILTER" + case ErrorCode_E_INVALID_UPDATER: return "E_INVALID_UPDATER" + case ErrorCode_E_INVALID_STORE: return "E_INVALID_STORE" + case ErrorCode_E_INVALID_PEER: return "E_INVALID_PEER" + case ErrorCode_E_RETRY_EXHAUSTED: return "E_RETRY_EXHAUSTED" + case ErrorCode_E_TRANSFER_LEADER_FAILED: return "E_TRANSFER_LEADER_FAILED" + case ErrorCode_E_INVALID_STAT_TYPE: return "E_INVALID_STAT_TYPE" + case ErrorCode_E_INVALID_VID: return "E_INVALID_VID" + case ErrorCode_E_NO_TRANSFORMED: return "E_NO_TRANSFORMED" + case ErrorCode_E_LOAD_META_FAILED: return "E_LOAD_META_FAILED" + case ErrorCode_E_FAILED_TO_CHECKPOINT: return "E_FAILED_TO_CHECKPOINT" + case ErrorCode_E_CHECKPOINT_BLOCKED: return "E_CHECKPOINT_BLOCKED" + case ErrorCode_E_FILTER_OUT: return "E_FILTER_OUT" + case ErrorCode_E_INVALID_DATA: return "E_INVALID_DATA" + case ErrorCode_E_MUTATE_EDGE_CONFLICT: return "E_MUTATE_EDGE_CONFLICT" + case ErrorCode_E_MUTATE_TAG_CONFLICT: return "E_MUTATE_TAG_CONFLICT" + case ErrorCode_E_OUTDATED_LOCK: return "E_OUTDATED_LOCK" + case ErrorCode_E_INVALID_TASK_PARA: return "E_INVALID_TASK_PARA" + case ErrorCode_E_USER_CANCEL: return "E_USER_CANCEL" + case ErrorCode_E_TASK_EXECUTION_FAILED: return "E_TASK_EXECUTION_FAILED" + case ErrorCode_E_PLAN_IS_KILLED: return "E_PLAN_IS_KILLED" + case ErrorCode_E_NO_TERM: return "E_NO_TERM" + case ErrorCode_E_OUTDATED_TERM: return "E_OUTDATED_TERM" + case ErrorCode_E_OUTDATED_EDGE: return "E_OUTDATED_EDGE" + case ErrorCode_E_WRITE_WRITE_CONFLICT: return "E_WRITE_WRITE_CONFLICT" + case ErrorCode_E_CLIENT_SERVER_INCOMPATIBLE: return "E_CLIENT_SERVER_INCOMPATIBLE" + case ErrorCode_E_ID_FAILED: return "E_ID_FAILED" + case ErrorCode_E_RAFT_UNKNOWN_PART: return "E_RAFT_UNKNOWN_PART" + case ErrorCode_E_RAFT_LOG_GAP: return "E_RAFT_LOG_GAP" + case ErrorCode_E_RAFT_LOG_STALE: return "E_RAFT_LOG_STALE" + case ErrorCode_E_RAFT_TERM_OUT_OF_DATE: return "E_RAFT_TERM_OUT_OF_DATE" + case ErrorCode_E_RAFT_UNKNOWN_APPEND_LOG: return "E_RAFT_UNKNOWN_APPEND_LOG" + case ErrorCode_E_RAFT_WAITING_SNAPSHOT: return "E_RAFT_WAITING_SNAPSHOT" + case ErrorCode_E_RAFT_SENDING_SNAPSHOT: return "E_RAFT_SENDING_SNAPSHOT" + case ErrorCode_E_RAFT_INVALID_PEER: return "E_RAFT_INVALID_PEER" + case ErrorCode_E_RAFT_NOT_READY: return "E_RAFT_NOT_READY" + case ErrorCode_E_RAFT_STOPPED: return "E_RAFT_STOPPED" + case ErrorCode_E_RAFT_BAD_ROLE: return "E_RAFT_BAD_ROLE" + case ErrorCode_E_RAFT_WAL_FAIL: return "E_RAFT_WAL_FAIL" + case ErrorCode_E_RAFT_HOST_STOPPED: return "E_RAFT_HOST_STOPPED" + case ErrorCode_E_RAFT_TOO_MANY_REQUESTS: return "E_RAFT_TOO_MANY_REQUESTS" + case ErrorCode_E_RAFT_PERSIST_SNAPSHOT_FAILED: return "E_RAFT_PERSIST_SNAPSHOT_FAILED" + case ErrorCode_E_RAFT_RPC_EXCEPTION: return "E_RAFT_RPC_EXCEPTION" + case ErrorCode_E_RAFT_NO_WAL_FOUND: return "E_RAFT_NO_WAL_FOUND" + case ErrorCode_E_RAFT_HOST_PAUSED: return "E_RAFT_HOST_PAUSED" + case ErrorCode_E_RAFT_WRITE_BLOCKED: return "E_RAFT_WRITE_BLOCKED" + case ErrorCode_E_RAFT_BUFFER_OVERFLOW: return "E_RAFT_BUFFER_OVERFLOW" + case ErrorCode_E_RAFT_ATOMIC_OP_FAILED: return "E_RAFT_ATOMIC_OP_FAILED" + case ErrorCode_E_LEADER_LEASE_FAILED: return "E_LEADER_LEASE_FAILED" + case ErrorCode_E_RAFT_CAUGHT_UP: return "E_RAFT_CAUGHT_UP" + case ErrorCode_E_LOG_GAP: return "E_LOG_GAP" + case ErrorCode_E_LOG_STALE: return "E_LOG_STALE" + case ErrorCode_E_INVALID_DRAINER_STORE: return "E_INVALID_DRAINER_STORE" + case ErrorCode_E_SPACE_MISMATCH: return "E_SPACE_MISMATCH" + case ErrorCode_E_PART_MISMATCH: return "E_PART_MISMATCH" + case ErrorCode_E_DATA_CONFLICT: return "E_DATA_CONFLICT" + case ErrorCode_E_REQ_CONFLICT: return "E_REQ_CONFLICT" + case ErrorCode_E_DATA_ILLEGAL: return "E_DATA_ILLEGAL" + case ErrorCode_E_CACHE_CONFIG_ERROR: return "E_CACHE_CONFIG_ERROR" + case ErrorCode_E_NOT_ENOUGH_SPACE: return "E_NOT_ENOUGH_SPACE" + case ErrorCode_E_CACHE_MISS: return "E_CACHE_MISS" + case ErrorCode_E_POOL_NOT_FOUND: return "E_POOL_NOT_FOUND" + case ErrorCode_E_CACHE_WRITE_FAILURE: return "E_CACHE_WRITE_FAILURE" + case ErrorCode_E_NODE_NUMBER_EXCEED_LIMIT: return "E_NODE_NUMBER_EXCEED_LIMIT" + case ErrorCode_E_PARSING_LICENSE_FAILURE: return "E_PARSING_LICENSE_FAILURE" + case ErrorCode_E_STORAGE_MEMORY_EXCEEDED: return "E_STORAGE_MEMORY_EXCEEDED" + case ErrorCode_E_UNKNOWN: return "E_UNKNOWN" + } + return "" +} + +func ErrorCodeFromString(s string) (ErrorCode, error) { + switch s { + case "SUCCEEDED": return ErrorCode_SUCCEEDED, nil + case "E_DISCONNECTED": return ErrorCode_E_DISCONNECTED, nil + case "E_FAIL_TO_CONNECT": return ErrorCode_E_FAIL_TO_CONNECT, nil + case "E_RPC_FAILURE": return ErrorCode_E_RPC_FAILURE, nil + case "E_LEADER_CHANGED": return ErrorCode_E_LEADER_CHANGED, nil + case "E_SPACE_NOT_FOUND": return ErrorCode_E_SPACE_NOT_FOUND, nil + case "E_TAG_NOT_FOUND": return ErrorCode_E_TAG_NOT_FOUND, nil + case "E_EDGE_NOT_FOUND": return ErrorCode_E_EDGE_NOT_FOUND, nil + case "E_INDEX_NOT_FOUND": return ErrorCode_E_INDEX_NOT_FOUND, nil + case "E_EDGE_PROP_NOT_FOUND": return ErrorCode_E_EDGE_PROP_NOT_FOUND, nil + case "E_TAG_PROP_NOT_FOUND": return ErrorCode_E_TAG_PROP_NOT_FOUND, nil + case "E_ROLE_NOT_FOUND": return ErrorCode_E_ROLE_NOT_FOUND, nil + case "E_CONFIG_NOT_FOUND": return ErrorCode_E_CONFIG_NOT_FOUND, nil + case "E_MACHINE_NOT_FOUND": return ErrorCode_E_MACHINE_NOT_FOUND, nil + case "E_ZONE_NOT_FOUND": return ErrorCode_E_ZONE_NOT_FOUND, nil + case "E_LISTENER_NOT_FOUND": return ErrorCode_E_LISTENER_NOT_FOUND, nil + case "E_PART_NOT_FOUND": return ErrorCode_E_PART_NOT_FOUND, nil + case "E_KEY_NOT_FOUND": return ErrorCode_E_KEY_NOT_FOUND, nil + case "E_USER_NOT_FOUND": return ErrorCode_E_USER_NOT_FOUND, nil + case "E_STATS_NOT_FOUND": return ErrorCode_E_STATS_NOT_FOUND, nil + case "E_SERVICE_NOT_FOUND": return ErrorCode_E_SERVICE_NOT_FOUND, nil + case "E_DRAINER_NOT_FOUND": return ErrorCode_E_DRAINER_NOT_FOUND, nil + case "E_DRAINER_CLIENT_NOT_FOUND": return ErrorCode_E_DRAINER_CLIENT_NOT_FOUND, nil + case "E_PART_STOPPED": return ErrorCode_E_PART_STOPPED, nil + case "E_BACKUP_FAILED": return ErrorCode_E_BACKUP_FAILED, nil + case "E_BACKUP_EMPTY_TABLE": return ErrorCode_E_BACKUP_EMPTY_TABLE, nil + case "E_BACKUP_TABLE_FAILED": return ErrorCode_E_BACKUP_TABLE_FAILED, nil + case "E_PARTIAL_RESULT": return ErrorCode_E_PARTIAL_RESULT, nil + case "E_REBUILD_INDEX_FAILED": return ErrorCode_E_REBUILD_INDEX_FAILED, nil + case "E_INVALID_PASSWORD": return ErrorCode_E_INVALID_PASSWORD, nil + case "E_FAILED_GET_ABS_PATH": return ErrorCode_E_FAILED_GET_ABS_PATH, nil + case "E_LISTENER_PROGRESS_FAILED": return ErrorCode_E_LISTENER_PROGRESS_FAILED, nil + case "E_SYNC_LISTENER_NOT_FOUND": return ErrorCode_E_SYNC_LISTENER_NOT_FOUND, nil + case "E_DRAINER_PROGRESS_FAILED": return ErrorCode_E_DRAINER_PROGRESS_FAILED, nil + case "E_PART_DISABLED": return ErrorCode_E_PART_DISABLED, nil + case "E_PART_ALREADY_STARTED": return ErrorCode_E_PART_ALREADY_STARTED, nil + case "E_PART_ALREADY_STOPPED": return ErrorCode_E_PART_ALREADY_STOPPED, nil + case "E_BAD_USERNAME_PASSWORD": return ErrorCode_E_BAD_USERNAME_PASSWORD, nil + case "E_SESSION_INVALID": return ErrorCode_E_SESSION_INVALID, nil + case "E_SESSION_TIMEOUT": return ErrorCode_E_SESSION_TIMEOUT, nil + case "E_SYNTAX_ERROR": return ErrorCode_E_SYNTAX_ERROR, nil + case "E_EXECUTION_ERROR": return ErrorCode_E_EXECUTION_ERROR, nil + case "E_STATEMENT_EMPTY": return ErrorCode_E_STATEMENT_EMPTY, nil + case "E_BAD_PERMISSION": return ErrorCode_E_BAD_PERMISSION, nil + case "E_SEMANTIC_ERROR": return ErrorCode_E_SEMANTIC_ERROR, nil + case "E_TOO_MANY_CONNECTIONS": return ErrorCode_E_TOO_MANY_CONNECTIONS, nil + case "E_PARTIAL_SUCCEEDED": return ErrorCode_E_PARTIAL_SUCCEEDED, nil + case "E_NO_HOSTS": return ErrorCode_E_NO_HOSTS, nil + case "E_EXISTED": return ErrorCode_E_EXISTED, nil + case "E_INVALID_HOST": return ErrorCode_E_INVALID_HOST, nil + case "E_UNSUPPORTED": return ErrorCode_E_UNSUPPORTED, nil + case "E_NOT_DROP": return ErrorCode_E_NOT_DROP, nil + case "E_BALANCER_RUNNING": return ErrorCode_E_BALANCER_RUNNING, nil + case "E_CONFIG_IMMUTABLE": return ErrorCode_E_CONFIG_IMMUTABLE, nil + case "E_CONFLICT": return ErrorCode_E_CONFLICT, nil + case "E_INVALID_PARM": return ErrorCode_E_INVALID_PARM, nil + case "E_WRONGCLUSTER": return ErrorCode_E_WRONGCLUSTER, nil + case "E_ZONE_NOT_ENOUGH": return ErrorCode_E_ZONE_NOT_ENOUGH, nil + case "E_ZONE_IS_EMPTY": return ErrorCode_E_ZONE_IS_EMPTY, nil + case "E_LISTENER_CONFLICT": return ErrorCode_E_LISTENER_CONFLICT, nil + case "E_SCHEMA_NAME_EXISTS": return ErrorCode_E_SCHEMA_NAME_EXISTS, nil + case "E_RELATED_INDEX_EXISTS": return ErrorCode_E_RELATED_INDEX_EXISTS, nil + case "E_RELATED_SPACE_EXISTS": return ErrorCode_E_RELATED_SPACE_EXISTS, nil + case "E_RELATED_FULLTEXT_INDEX_EXISTS": return ErrorCode_E_RELATED_FULLTEXT_INDEX_EXISTS, nil + case "E_HISTORY_CONFLICT": return ErrorCode_E_HISTORY_CONFLICT, nil + case "E_STORE_FAILURE": return ErrorCode_E_STORE_FAILURE, nil + case "E_STORE_SEGMENT_ILLEGAL": return ErrorCode_E_STORE_SEGMENT_ILLEGAL, nil + case "E_BAD_BALANCE_PLAN": return ErrorCode_E_BAD_BALANCE_PLAN, nil + case "E_BALANCED": return ErrorCode_E_BALANCED, nil + case "E_NO_RUNNING_BALANCE_PLAN": return ErrorCode_E_NO_RUNNING_BALANCE_PLAN, nil + case "E_NO_VALID_HOST": return ErrorCode_E_NO_VALID_HOST, nil + case "E_CORRUPTED_BALANCE_PLAN": return ErrorCode_E_CORRUPTED_BALANCE_PLAN, nil + case "E_NO_INVALID_BALANCE_PLAN": return ErrorCode_E_NO_INVALID_BALANCE_PLAN, nil + case "E_NO_VALID_DRAINER": return ErrorCode_E_NO_VALID_DRAINER, nil + case "E_IMPROPER_ROLE": return ErrorCode_E_IMPROPER_ROLE, nil + case "E_INVALID_PARTITION_NUM": return ErrorCode_E_INVALID_PARTITION_NUM, nil + case "E_INVALID_REPLICA_FACTOR": return ErrorCode_E_INVALID_REPLICA_FACTOR, nil + case "E_INVALID_CHARSET": return ErrorCode_E_INVALID_CHARSET, nil + case "E_INVALID_COLLATE": return ErrorCode_E_INVALID_COLLATE, nil + case "E_CHARSET_COLLATE_NOT_MATCH": return ErrorCode_E_CHARSET_COLLATE_NOT_MATCH, nil + case "E_PRIVILEGE_ALL_TAG_EDGE_SETTLED": return ErrorCode_E_PRIVILEGE_ALL_TAG_EDGE_SETTLED, nil + case "E_PRIVILEGE_NOT_EXIST": return ErrorCode_E_PRIVILEGE_NOT_EXIST, nil + case "E_PRIVILEGE_NEED_BASIC_ROLE": return ErrorCode_E_PRIVILEGE_NEED_BASIC_ROLE, nil + case "E_PRIVILEGE_ACTION_INVALID": return ErrorCode_E_PRIVILEGE_ACTION_INVALID, nil + case "E_SNAPSHOT_FAILURE": return ErrorCode_E_SNAPSHOT_FAILURE, nil + case "E_SNAPSHOT_RUNNING_JOBS": return ErrorCode_E_SNAPSHOT_RUNNING_JOBS, nil + case "E_SNAPSHOT_NOT_FOUND": return ErrorCode_E_SNAPSHOT_NOT_FOUND, nil + case "E_BLOCK_WRITE_FAILURE": return ErrorCode_E_BLOCK_WRITE_FAILURE, nil + case "E_REBUILD_INDEX_FAILURE": return ErrorCode_E_REBUILD_INDEX_FAILURE, nil + case "E_INDEX_WITH_TTL": return ErrorCode_E_INDEX_WITH_TTL, nil + case "E_ADD_JOB_FAILURE": return ErrorCode_E_ADD_JOB_FAILURE, nil + case "E_STOP_JOB_FAILURE": return ErrorCode_E_STOP_JOB_FAILURE, nil + case "E_SAVE_JOB_FAILURE": return ErrorCode_E_SAVE_JOB_FAILURE, nil + case "E_BALANCER_FAILURE": return ErrorCode_E_BALANCER_FAILURE, nil + case "E_JOB_NOT_FINISHED": return ErrorCode_E_JOB_NOT_FINISHED, nil + case "E_TASK_REPORT_OUT_DATE": return ErrorCode_E_TASK_REPORT_OUT_DATE, nil + case "E_JOB_NOT_IN_SPACE": return ErrorCode_E_JOB_NOT_IN_SPACE, nil + case "E_JOB_NEED_RECOVER": return ErrorCode_E_JOB_NEED_RECOVER, nil + case "E_JOB_ALREADY_FINISH": return ErrorCode_E_JOB_ALREADY_FINISH, nil + case "E_JOB_SUBMITTED": return ErrorCode_E_JOB_SUBMITTED, nil + case "E_JOB_NOT_STOPPABLE": return ErrorCode_E_JOB_NOT_STOPPABLE, nil + case "E_JOB_HAS_NO_TARGET_STORAGE": return ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE, nil + case "E_INVALID_JOB": return ErrorCode_E_INVALID_JOB, nil + case "E_BACKUP_RUNNING_JOBS": return ErrorCode_E_BACKUP_RUNNING_JOBS, nil + case "E_BACKUP_SPACE_NOT_FOUND": return ErrorCode_E_BACKUP_SPACE_NOT_FOUND, nil + case "E_RESTORE_FAILURE": return ErrorCode_E_RESTORE_FAILURE, nil + case "E_SESSION_NOT_FOUND": return ErrorCode_E_SESSION_NOT_FOUND, nil + case "E_LIST_CLUSTER_FAILURE": return ErrorCode_E_LIST_CLUSTER_FAILURE, nil + case "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE": return ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, nil + case "E_LIST_CLUSTER_NO_AGENT_FAILURE": return ErrorCode_E_LIST_CLUSTER_NO_AGENT_FAILURE, nil + case "E_QUERY_NOT_FOUND": return ErrorCode_E_QUERY_NOT_FOUND, nil + case "E_AGENT_HB_FAILUE": return ErrorCode_E_AGENT_HB_FAILUE, nil + case "E_INVALID_VARIABLE": return ErrorCode_E_INVALID_VARIABLE, nil + case "E_VARIABLE_TYPE_VALUE_MISMATCH": return ErrorCode_E_VARIABLE_TYPE_VALUE_MISMATCH, nil + case "E_HOST_CAN_NOT_BE_ADDED": return ErrorCode_E_HOST_CAN_NOT_BE_ADDED, nil + case "E_ACCESS_ES_FAILURE": return ErrorCode_E_ACCESS_ES_FAILURE, nil + case "E_GRAPH_MEMORY_EXCEEDED": return ErrorCode_E_GRAPH_MEMORY_EXCEEDED, nil + case "E_CONSENSUS_ERROR": return ErrorCode_E_CONSENSUS_ERROR, nil + case "E_KEY_HAS_EXISTS": return ErrorCode_E_KEY_HAS_EXISTS, nil + case "E_DATA_TYPE_MISMATCH": return ErrorCode_E_DATA_TYPE_MISMATCH, nil + case "E_INVALID_FIELD_VALUE": return ErrorCode_E_INVALID_FIELD_VALUE, nil + case "E_INVALID_OPERATION": return ErrorCode_E_INVALID_OPERATION, nil + case "E_NOT_NULLABLE": return ErrorCode_E_NOT_NULLABLE, nil + case "E_FIELD_UNSET": return ErrorCode_E_FIELD_UNSET, nil + case "E_OUT_OF_RANGE": return ErrorCode_E_OUT_OF_RANGE, nil + case "E_DATA_CONFLICT_ERROR": return ErrorCode_E_DATA_CONFLICT_ERROR, nil + case "E_WRITE_STALLED": return ErrorCode_E_WRITE_STALLED, nil + case "E_IMPROPER_DATA_TYPE": return ErrorCode_E_IMPROPER_DATA_TYPE, nil + case "E_INVALID_SPACEVIDLEN": return ErrorCode_E_INVALID_SPACEVIDLEN, nil + case "E_INVALID_FILTER": return ErrorCode_E_INVALID_FILTER, nil + case "E_INVALID_UPDATER": return ErrorCode_E_INVALID_UPDATER, nil + case "E_INVALID_STORE": return ErrorCode_E_INVALID_STORE, nil + case "E_INVALID_PEER": return ErrorCode_E_INVALID_PEER, nil + case "E_RETRY_EXHAUSTED": return ErrorCode_E_RETRY_EXHAUSTED, nil + case "E_TRANSFER_LEADER_FAILED": return ErrorCode_E_TRANSFER_LEADER_FAILED, nil + case "E_INVALID_STAT_TYPE": return ErrorCode_E_INVALID_STAT_TYPE, nil + case "E_INVALID_VID": return ErrorCode_E_INVALID_VID, nil + case "E_NO_TRANSFORMED": return ErrorCode_E_NO_TRANSFORMED, nil + case "E_LOAD_META_FAILED": return ErrorCode_E_LOAD_META_FAILED, nil + case "E_FAILED_TO_CHECKPOINT": return ErrorCode_E_FAILED_TO_CHECKPOINT, nil + case "E_CHECKPOINT_BLOCKED": return ErrorCode_E_CHECKPOINT_BLOCKED, nil + case "E_FILTER_OUT": return ErrorCode_E_FILTER_OUT, nil + case "E_INVALID_DATA": return ErrorCode_E_INVALID_DATA, nil + case "E_MUTATE_EDGE_CONFLICT": return ErrorCode_E_MUTATE_EDGE_CONFLICT, nil + case "E_MUTATE_TAG_CONFLICT": return ErrorCode_E_MUTATE_TAG_CONFLICT, nil + case "E_OUTDATED_LOCK": return ErrorCode_E_OUTDATED_LOCK, nil + case "E_INVALID_TASK_PARA": return ErrorCode_E_INVALID_TASK_PARA, nil + case "E_USER_CANCEL": return ErrorCode_E_USER_CANCEL, nil + case "E_TASK_EXECUTION_FAILED": return ErrorCode_E_TASK_EXECUTION_FAILED, nil + case "E_PLAN_IS_KILLED": return ErrorCode_E_PLAN_IS_KILLED, nil + case "E_NO_TERM": return ErrorCode_E_NO_TERM, nil + case "E_OUTDATED_TERM": return ErrorCode_E_OUTDATED_TERM, nil + case "E_OUTDATED_EDGE": return ErrorCode_E_OUTDATED_EDGE, nil + case "E_WRITE_WRITE_CONFLICT": return ErrorCode_E_WRITE_WRITE_CONFLICT, nil + case "E_CLIENT_SERVER_INCOMPATIBLE": return ErrorCode_E_CLIENT_SERVER_INCOMPATIBLE, nil + case "E_ID_FAILED": return ErrorCode_E_ID_FAILED, nil + case "E_RAFT_UNKNOWN_PART": return ErrorCode_E_RAFT_UNKNOWN_PART, nil + case "E_RAFT_LOG_GAP": return ErrorCode_E_RAFT_LOG_GAP, nil + case "E_RAFT_LOG_STALE": return ErrorCode_E_RAFT_LOG_STALE, nil + case "E_RAFT_TERM_OUT_OF_DATE": return ErrorCode_E_RAFT_TERM_OUT_OF_DATE, nil + case "E_RAFT_UNKNOWN_APPEND_LOG": return ErrorCode_E_RAFT_UNKNOWN_APPEND_LOG, nil + case "E_RAFT_WAITING_SNAPSHOT": return ErrorCode_E_RAFT_WAITING_SNAPSHOT, nil + case "E_RAFT_SENDING_SNAPSHOT": return ErrorCode_E_RAFT_SENDING_SNAPSHOT, nil + case "E_RAFT_INVALID_PEER": return ErrorCode_E_RAFT_INVALID_PEER, nil + case "E_RAFT_NOT_READY": return ErrorCode_E_RAFT_NOT_READY, nil + case "E_RAFT_STOPPED": return ErrorCode_E_RAFT_STOPPED, nil + case "E_RAFT_BAD_ROLE": return ErrorCode_E_RAFT_BAD_ROLE, nil + case "E_RAFT_WAL_FAIL": return ErrorCode_E_RAFT_WAL_FAIL, nil + case "E_RAFT_HOST_STOPPED": return ErrorCode_E_RAFT_HOST_STOPPED, nil + case "E_RAFT_TOO_MANY_REQUESTS": return ErrorCode_E_RAFT_TOO_MANY_REQUESTS, nil + case "E_RAFT_PERSIST_SNAPSHOT_FAILED": return ErrorCode_E_RAFT_PERSIST_SNAPSHOT_FAILED, nil + case "E_RAFT_RPC_EXCEPTION": return ErrorCode_E_RAFT_RPC_EXCEPTION, nil + case "E_RAFT_NO_WAL_FOUND": return ErrorCode_E_RAFT_NO_WAL_FOUND, nil + case "E_RAFT_HOST_PAUSED": return ErrorCode_E_RAFT_HOST_PAUSED, nil + case "E_RAFT_WRITE_BLOCKED": return ErrorCode_E_RAFT_WRITE_BLOCKED, nil + case "E_RAFT_BUFFER_OVERFLOW": return ErrorCode_E_RAFT_BUFFER_OVERFLOW, nil + case "E_RAFT_ATOMIC_OP_FAILED": return ErrorCode_E_RAFT_ATOMIC_OP_FAILED, nil + case "E_LEADER_LEASE_FAILED": return ErrorCode_E_LEADER_LEASE_FAILED, nil + case "E_RAFT_CAUGHT_UP": return ErrorCode_E_RAFT_CAUGHT_UP, nil + case "E_LOG_GAP": return ErrorCode_E_LOG_GAP, nil + case "E_LOG_STALE": return ErrorCode_E_LOG_STALE, nil + case "E_INVALID_DRAINER_STORE": return ErrorCode_E_INVALID_DRAINER_STORE, nil + case "E_SPACE_MISMATCH": return ErrorCode_E_SPACE_MISMATCH, nil + case "E_PART_MISMATCH": return ErrorCode_E_PART_MISMATCH, nil + case "E_DATA_CONFLICT": return ErrorCode_E_DATA_CONFLICT, nil + case "E_REQ_CONFLICT": return ErrorCode_E_REQ_CONFLICT, nil + case "E_DATA_ILLEGAL": return ErrorCode_E_DATA_ILLEGAL, nil + case "E_CACHE_CONFIG_ERROR": return ErrorCode_E_CACHE_CONFIG_ERROR, nil + case "E_NOT_ENOUGH_SPACE": return ErrorCode_E_NOT_ENOUGH_SPACE, nil + case "E_CACHE_MISS": return ErrorCode_E_CACHE_MISS, nil + case "E_POOL_NOT_FOUND": return ErrorCode_E_POOL_NOT_FOUND, nil + case "E_CACHE_WRITE_FAILURE": return ErrorCode_E_CACHE_WRITE_FAILURE, nil + case "E_NODE_NUMBER_EXCEED_LIMIT": return ErrorCode_E_NODE_NUMBER_EXCEED_LIMIT, nil + case "E_PARSING_LICENSE_FAILURE": return ErrorCode_E_PARSING_LICENSE_FAILURE, nil + case "E_STORAGE_MEMORY_EXCEEDED": return ErrorCode_E_STORAGE_MEMORY_EXCEEDED, nil + case "E_UNKNOWN": return ErrorCode_E_UNKNOWN, nil + } + return ErrorCode(0), fmt.Errorf("not a valid ErrorCode string") +} + + +func ErrorCodePtr(v ErrorCode) *ErrorCode { return &v } + +func (p ErrorCode) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *ErrorCode) UnmarshalText(text []byte) error { +q, err := ErrorCodeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *ErrorCode) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = ErrorCode(v) +return nil +} + +func (p * ErrorCode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type ClusterID int64 + +func ClusterIDPtr(v ClusterID) *ClusterID { 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.TagID != nil +} + +func (p *SchemaID) IsSetEdgeType() bool { + return p.EdgeType != nil +} + +func (p *SchemaID) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SchemaID) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := TagID(v) + p.TagID = &temp +} + return nil +} + +func (p *SchemaID) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeType(v) + p.EdgeType = &temp +} + return nil +} + +func (p *SchemaID) Write(ctx context.Context, oprot thrift.TProtocol) 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(ctx, "SchemaID"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SchemaID) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + } + return err +} + +func (p *SchemaID) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + } + return err +} + +func (p *SchemaID) Equals(other *SchemaID) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TagID != other.TagID { + if p.TagID == nil || other.TagID == nil { + return false + } + if (*p.TagID) != (*other.TagID) { return false } + } + if p.EdgeType != other.EdgeType { + if p.EdgeType == nil || other.EdgeType == nil { + return false + } + if (*p.EdgeType) != (*other.EdgeType) { return false } + } + return true +} + +func (p *SchemaID) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SchemaID(%+v)", *p) +} + +func (p *SchemaID) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I16 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Date) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *Date) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *Date) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *Date) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Date"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Date) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(ctx, int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *Date) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *Date) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *Date) Equals(other *Date) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Year != other.Year { return false } + if p.Month != other.Month { return false } + if p.Day != other.Day { return false } + return true +} + +func (p *Date) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Date(%+v)", *p) +} + +func (p *Date) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Time) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *Time) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *Time) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *Time) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *Time) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Time"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Time) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hour", thrift.BYTE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hour: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hour: ", p), err) } + return err +} + +func (p *Time) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "minute", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:minute: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:minute: ", p), err) } + return err +} + +func (p *Time) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sec", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sec: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sec: ", p), err) } + return err +} + +func (p *Time) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "microsec", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:microsec: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:microsec: ", p), err) } + return err +} + +func (p *Time) Equals(other *Time) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Hour != other.Hour { return false } + if p.Minute != other.Minute { return false } + if p.Sec != other.Sec { return false } + if p.Microsec != other.Microsec { return false } + return true +} + +func (p *Time) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Time(%+v)", *p) +} + +func (p *Time) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I16 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BYTE { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DateTime) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Year = v +} + return nil +} + +func (p *DateTime) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := int8(v) + p.Month = temp +} + return nil +} + +func (p *DateTime) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := int8(v) + p.Day = temp +} + return nil +} + +func (p *DateTime) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := int8(v) + p.Hour = temp +} + return nil +} + +func (p *DateTime) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := int8(v) + p.Minute = temp +} + return nil +} + +func (p *DateTime) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadByte(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + temp := int8(v) + p.Sec = temp +} + return nil +} + +func (p *DateTime) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Microsec = v +} + return nil +} + +func (p *DateTime) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DateTime"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DateTime) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "year", thrift.I16, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:year: ", p), err) } + if err := oprot.WriteI16(ctx, int16(p.Year)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.year (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:year: ", p), err) } + return err +} + +func (p *DateTime) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "month", thrift.BYTE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:month: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Month)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.month (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:month: ", p), err) } + return err +} + +func (p *DateTime) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "day", thrift.BYTE, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:day: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Day)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.day (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:day: ", p), err) } + return err +} + +func (p *DateTime) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hour", thrift.BYTE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:hour: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Hour)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hour (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:hour: ", p), err) } + return err +} + +func (p *DateTime) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "minute", thrift.BYTE, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:minute: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Minute)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.minute (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:minute: ", p), err) } + return err +} + +func (p *DateTime) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sec", thrift.BYTE, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:sec: ", p), err) } + if err := oprot.WriteByte(ctx, int8(p.Sec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sec (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:sec: ", p), err) } + return err +} + +func (p *DateTime) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "microsec", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:microsec: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Microsec)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microsec (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:microsec: ", p), err) } + return err +} + +func (p *DateTime) Equals(other *DateTime) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Year != other.Year { return false } + if p.Month != other.Month { return false } + if p.Day != other.Day { return false } + if p.Hour != other.Hour { return false } + if p.Minute != other.Minute { return false } + if p.Sec != other.Sec { return false } + if p.Microsec != other.Microsec { return false } + return true +} + +func (p *DateTime) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DateTime(%+v)", *p) +} + +func (p *DateTime) Validate() error { + return nil +} +// Attributes: +// - NVal +// - BVal +// - IVal +// - FVal +// - SVal +// - DVal +// - TVal +// - DtVal +// - VVal +// - EVal +// - PVal +// - LVal +// - MVal +// - UVal +// - GVal +// - GgVal +// - DuVal +type Value struct { + NVal *NullType `thrift:"nVal,1" db:"nVal" json:"nVal,omitempty"` + BVal *bool `thrift:"bVal,2" db:"bVal" json:"bVal,omitempty"` + 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"` + DuVal *Duration `thrift:"duVal,17" db:"duVal" json:"duVal,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 +} +var Value_DuVal_DEFAULT *Duration +func (p *Value) GetDuVal() *Duration { + if !p.IsSetDuVal() { + return Value_DuVal_DEFAULT + } +return p.DuVal +} +func (p *Value) CountSetFieldsValue() int { + count := 0 + if (p.IsSetNVal()) { + 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++ + } + if (p.IsSetDuVal()) { + 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) IsSetGgVal() bool { + return p.GgVal != nil +} + +func (p *Value) IsSetDuVal() bool { + return p.DuVal != nil +} + +func (p *Value) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField11(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 12: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField12(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 13: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField13(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 14: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField14(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 15: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField15(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 16: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField16(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 17: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField17(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Value) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := NullType(v) + p.NVal = &temp +} + return nil +} + +func (p *Value) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BVal = &v +} + return nil +} + +func (p *Value) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IVal = &v +} + return nil +} + +func (p *Value) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.FVal = &v +} + return nil +} + +func (p *Value) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SVal = v +} + return nil +} + +func (p *Value) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.DVal = &Date{} + if err := p.DVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DVal), err) + } + return nil +} + +func (p *Value) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.TVal = &Time{} + if err := p.TVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TVal), err) + } + return nil +} + +func (p *Value) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + p.DtVal = &DateTime{} + if err := p.DtVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DtVal), err) + } + return nil +} + +func (p *Value) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + p.VVal = &Vertex{} + if err := p.VVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VVal), err) + } + return nil +} + +func (p *Value) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + p.EVal = &Edge{} + if err := p.EVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EVal), err) + } + return nil +} + +func (p *Value) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { + p.PVal = &Path{} + if err := p.PVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PVal), err) + } + return nil +} + +func (p *Value) ReadField12(ctx context.Context, iprot thrift.TProtocol) error { + p.LVal = &NList{} + if err := p.LVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LVal), err) + } + return nil +} + +func (p *Value) ReadField13(ctx context.Context, iprot thrift.TProtocol) error { + p.MVal = &NMap{} + if err := p.MVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.MVal), err) + } + return nil +} + +func (p *Value) ReadField14(ctx context.Context, iprot thrift.TProtocol) error { + p.UVal = &NSet{} + if err := p.UVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UVal), err) + } + return nil +} + +func (p *Value) ReadField15(ctx context.Context, iprot thrift.TProtocol) error { + p.GVal = &DataSet{} + if err := p.GVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GVal), err) + } + return nil +} + +func (p *Value) ReadField16(ctx context.Context, iprot thrift.TProtocol) error { + p.GgVal = &Geography{} + if err := p.GgVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GgVal), err) + } + return nil +} + +func (p *Value) ReadField17(ctx context.Context, iprot thrift.TProtocol) error { + p.DuVal = &Duration{} + if err := p.DuVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DuVal), err) + } + return nil +} + +func (p *Value) Write(ctx context.Context, oprot thrift.TProtocol) 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(ctx, "Value"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + if err := p.writeField11(ctx, oprot); err != nil { return err } + if err := p.writeField12(ctx, oprot); err != nil { return err } + if err := p.writeField13(ctx, oprot); err != nil { return err } + if err := p.writeField14(ctx, oprot); err != nil { return err } + if err := p.writeField15(ctx, oprot); err != nil { return err } + if err := p.writeField16(ctx, oprot); err != nil { return err } + if err := p.writeField17(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Value) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetNVal() { + if err := oprot.WriteFieldBegin(ctx, "nVal", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:nVal: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.NVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nVal (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:nVal: ", p), err) } + } + return err +} + +func (p *Value) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetBVal() { + if err := oprot.WriteFieldBegin(ctx, "bVal", thrift.BOOL, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:bVal: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.BVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.bVal (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:bVal: ", p), err) } + } + return err +} + +func (p *Value) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetIVal() { + if err := oprot.WriteFieldBegin(ctx, "iVal", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:iVal: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.IVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.iVal (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:iVal: ", p), err) } + } + return err +} + +func (p *Value) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetFVal() { + if err := oprot.WriteFieldBegin(ctx, "fVal", thrift.DOUBLE, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fVal: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(*p.FVal)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fVal (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fVal: ", p), err) } + } + return err +} + +func (p *Value) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSVal() { + if err := oprot.WriteFieldBegin(ctx, "sVal", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:sVal: ", p), err) } + if err := oprot.WriteBinary(ctx, p.SVal); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sVal (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:sVal: ", p), err) } + } + return err +} + +func (p *Value) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dVal: ", p), err) } + } + return err +} + +func (p *Value) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:tVal: ", p), err) } + } + return err +} + +func (p *Value) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDtVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DtVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:dtVal: ", p), err) } + } + return err +} + +func (p *Value) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetVVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:vVal: ", p), err) } + } + return err +} + +func (p *Value) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:eVal: ", p), err) } + } + return err +} + +func (p *Value) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetPVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:pVal: ", p), err) } + } + return err +} + +func (p *Value) writeField12(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:lVal: ", p), err) } + } + return err +} + +func (p *Value) writeField13(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetMVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.MVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 13:mVal: ", p), err) } + } + return err +} + +func (p *Value) writeField14(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetUVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 14:uVal: ", p), err) } + } + return err +} + +func (p *Value) writeField15(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetGVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 15:gVal: ", p), err) } + } + return err +} + +func (p *Value) writeField16(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetGgVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GgVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 16:ggVal: ", p), err) } + } + return err +} + +func (p *Value) writeField17(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDuVal() { + if err := oprot.WriteFieldBegin(ctx, "duVal", thrift.STRUCT, 17); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 17:duVal: ", p), err) } + if err := p.DuVal.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DuVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 17:duVal: ", p), err) } + } + return err +} + +func (p *Value) Equals(other *Value) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.NVal != other.NVal { + if p.NVal == nil || other.NVal == nil { + return false + } + if (*p.NVal) != (*other.NVal) { return false } + } + if p.BVal != other.BVal { + if p.BVal == nil || other.BVal == nil { + return false + } + if (*p.BVal) != (*other.BVal) { return false } + } + if p.IVal != other.IVal { + if p.IVal == nil || other.IVal == nil { + return false + } + if (*p.IVal) != (*other.IVal) { return false } + } + if p.FVal != other.FVal { + if p.FVal == nil || other.FVal == nil { + return false + } + if (*p.FVal) != (*other.FVal) { return false } + } + if bytes.Compare(p.SVal, other.SVal) != 0 { return false } + if !p.DVal.Equals(other.DVal) { return false } + if !p.TVal.Equals(other.TVal) { return false } + if !p.DtVal.Equals(other.DtVal) { return false } + if !p.VVal.Equals(other.VVal) { return false } + if !p.EVal.Equals(other.EVal) { return false } + if !p.PVal.Equals(other.PVal) { return false } + if !p.LVal.Equals(other.LVal) { return false } + if !p.MVal.Equals(other.MVal) { return false } + if !p.UVal.Equals(other.UVal) { return false } + if !p.GVal.Equals(other.GVal) { return false } + if !p.GgVal.Equals(other.GgVal) { return false } + if !p.DuVal.Equals(other.DuVal) { return false } + return true +} + +func (p *Value) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Value(%+v)", *p) +} + +func (p *Value) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *NList) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 := &Value{} + if err := _elem0.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Values = append(p.Values, _elem0) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NList) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "NList"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *NList) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *NList) Equals(other *NList) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src1 := other.Values[i] + if !_tgt.Equals(_src1) { return false } + } + return true +} + +func (p *NList) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NList(%+v)", *p) +} + +func (p *NList) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *NMap) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key2 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key2 = v +} + _val3 := &Value{} + if err := _val3.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val3), err) + } + p.Kvs[_key2] = _val3 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *NMap) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "NMap"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *NMap) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "kvs", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:kvs: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:kvs: ", p), err) } + return err +} + +func (p *NMap) Equals(other *NMap) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Kvs) != len(other.Kvs) { return false } + for k, _tgt := range p.Kvs { + _src4 := other.Kvs[k] + if !_tgt.Equals(_src4) { return false } + } + return true +} + +func (p *NMap) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NMap(%+v)", *p) +} + +func (p *NMap) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.SET { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *NSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadSetBegin(ctx) + 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 ++ { + _elem5 := &Value{} + if err := _elem5.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem5), err) + } + p.Values = append(p.Values, _elem5) + } + if err := iprot.ReadSetEnd(ctx); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + return nil +} + +func (p *NSet) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "NSet"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *NSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.SET, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteSetBegin(ctx, thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i" + } + return fmt.Sprintf("NSet(%+v)", *p) +} + +func (p *NSet) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Row) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem7 := &Value{} + if err := _elem7.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem7), err) + } + p.Values = append(p.Values, _elem7) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Row) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Row"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Row) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "values", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:values: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Values)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Values { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:values: ", p), err) } + return err +} + +func (p *Row) Equals(other *Row) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Values) != len(other.Values) { return false } + for i, _tgt := range p.Values { + _src8 := other.Values[i] + if !_tgt.Equals(_src8) { return false } + } + return true +} + +func (p *Row) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Row(%+v)", *p) +} + +func (p *Row) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DataSet) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem9 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem9 = v +} + p.ColumnNames = append(p.ColumnNames, _elem9) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem10 := &Row{} + if err := _elem10.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.Rows = append(p.Rows, _elem10) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DataSet) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DataSet"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DataSet) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.ColumnNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnNames { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:column_names: ", p), err) } + return err +} + +func (p *DataSet) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:rows: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Rows)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Rows { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:rows: ", p), err) } + return err +} + +func (p *DataSet) Equals(other *DataSet) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.ColumnNames) != len(other.ColumnNames) { return false } + for i, _tgt := range p.ColumnNames { + _src11 := other.ColumnNames[i] + if bytes.Compare(_tgt, _src11) != 0 { return false } + } + if len(p.Rows) != len(other.Rows) { return false } + for i, _tgt := range p.Rows { + _src12 := other.Rows[i] + if !_tgt.Equals(_src12) { return false } + } + return true +} + +func (p *DataSet) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DataSet(%+v)", *p) +} + +func (p *DataSet) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Coordinate) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.X = v +} + return nil +} + +func (p *Coordinate) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Y = v +} + return nil +} + +func (p *Coordinate) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Coordinate"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Coordinate) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "x", thrift.DOUBLE, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:x: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(p.X)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.x (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:x: ", p), err) } + return err +} + +func (p *Coordinate) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "y", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:y: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(p.Y)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.y (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:y: ", p), err) } + return err +} + +func (p *Coordinate) Equals(other *Coordinate) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.X != other.X { return false } + if p.Y != other.Y { return false } + return true +} + +func (p *Coordinate) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Coordinate(%+v)", *p) +} + +func (p *Coordinate) Validate() error { + return nil +} +// Attributes: +// - Coord +type Point struct { + Coord *Coordinate `thrift:"coord,1" db:"coord" json:"coord"` +} + +func NewPoint() *Point { + return &Point{} +} + +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.Coord != nil +} + +func (p *Point) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Point) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Coord = &Coordinate{} + if err := p.Coord.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Coord), err) + } + return nil +} + +func (p *Point) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Point"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Point) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Coord), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coord: ", p), err) } + return err +} + +func (p *Point) Equals(other *Point) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Coord.Equals(other.Coord) { return false } + return true +} + +func (p *Point) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Point(%+v)", *p) +} + +func (p *Point) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LineString) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem13 := &Coordinate{} + if err := _elem13.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + } + p.CoordList = append(p.CoordList, _elem13) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LineString) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "LineString"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LineString) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "coordList", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coordList: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.CoordList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.CoordList { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coordList: ", p), err) } + return err +} + +func (p *LineString) Equals(other *LineString) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.CoordList) != len(other.CoordList) { return false } + for i, _tgt := range p.CoordList { + _src14 := other.CoordList[i] + if !_tgt.Equals(_src14) { return false } + } + return true +} + +func (p *LineString) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LineString(%+v)", *p) +} + +func (p *LineString) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Polygon) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Coordinate, 0, size) + _elem15 := tSlice + for i := 0; i < size; i ++ { + _elem16 := &Coordinate{} + if err := _elem16.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) + } + _elem15 = append(_elem15, _elem16) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.CoordListList = append(p.CoordListList, _elem15) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Polygon) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Polygon"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Polygon) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "coordListList", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:coordListList: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.LIST, len(p.CoordListList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.CoordListList { + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:coordListList: ", p), err) } + return err +} + +func (p *Polygon) Equals(other *Polygon) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.CoordListList) != len(other.CoordListList) { return false } + for i, _tgt := range p.CoordListList { + _src17 := other.CoordListList[i] + if len(_tgt) != len(_src17) { return false } + for i, _tgt := range _tgt { + _src18 := _src17[i] + if !_tgt.Equals(_src18) { return false } + } + } + return true +} + +func (p *Polygon) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Polygon(%+v)", *p) +} + +func (p *Polygon) Validate() error { + return nil +} +// 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.PtVal != nil +} + +func (p *Geography) IsSetLsVal() bool { + return p.LsVal != nil +} + +func (p *Geography) IsSetPgVal() bool { + return p.PgVal != nil +} + +func (p *Geography) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Geography) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.PtVal = &Point{} + if err := p.PtVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PtVal), err) + } + return nil +} + +func (p *Geography) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.LsVal = &LineString{} + if err := p.LsVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.LsVal), err) + } + return nil +} + +func (p *Geography) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.PgVal = &Polygon{} + if err := p.PgVal.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PgVal), err) + } + return nil +} + +func (p *Geography) Write(ctx context.Context, oprot thrift.TProtocol) error { + if c := p.CountSetFieldsGeography(); c != 1 { + return fmt.Errorf("%T write union: exactly one field must be set (%d set)", p, c) + } + if err := oprot.WriteStructBegin(ctx, "Geography"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Geography) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetPtVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PtVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ptVal: ", p), err) } + } + return err +} + +func (p *Geography) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLsVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.LsVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:lsVal: ", p), err) } + } + return err +} + +func (p *Geography) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetPgVal() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PgVal), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pgVal: ", p), err) } + } + return err +} + +func (p *Geography) Equals(other *Geography) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.PtVal.Equals(other.PtVal) { return false } + if !p.LsVal.Equals(other.LsVal) { return false } + if !p.PgVal.Equals(other.PgVal) { return false } + return true +} + +func (p *Geography) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Geography(%+v)", *p) +} + +func (p *Geography) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Tag) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Tag) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key19 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key19 = v +} + _val20 := &Value{} + if err := _val20.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val20), err) + } + p.Props[_key19] = _val20 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Tag) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Tag"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Tag) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Tag) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "props", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *Tag) Equals(other *Tag) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if len(p.Props) != len(other.Props) { return false } + for k, _tgt := range p.Props { + _src21 := other.Props[k] + if !_tgt.Equals(_src21) { return false } + } + return true +} + +func (p *Tag) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Tag(%+v)", *p) +} + +func (p *Tag) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Vertex) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Vid = &Value{} + if err := p.Vid.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vid), err) + } + return nil +} + +func (p *Vertex) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem22 := &Tag{} + if err := _elem22.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + p.Tags = append(p.Tags, _elem22) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Vertex) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Vertex"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Vertex) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vid), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:vid: ", p), err) } + return err +} + +func (p *Vertex) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tags: ", p), err) } + return err +} + +func (p *Vertex) Equals(other *Vertex) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Vid.Equals(other.Vid) { return false } + if len(p.Tags) != len(other.Tags) { return false } + for i, _tgt := range p.Tags { + _src23 := other.Tags[i] + if !_tgt.Equals(_src23) { return false } + } + return true +} + +func (p *Vertex) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Vertex(%+v)", *p) +} + +func (p *Vertex) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Edge) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Src = &Value{} + if err := p.Src.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Edge) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Dst = &Value{} + if err := p.Dst.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Edge) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Edge) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Edge) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Edge) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key24 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key24 = v +} + _val25 := &Value{} + if err := _val25.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val25), err) + } + p.Props[_key24] = _val25 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Edge) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Edge"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Edge) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Edge) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dst: ", p), err) } + return err +} + +func (p *Edge) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + return err +} + +func (p *Edge) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:name: ", p), err) } + return err +} + +func (p *Edge) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "ranking", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ranking: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ranking: ", p), err) } + return err +} + +func (p *Edge) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "props", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:props: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:props: ", p), err) } + return err +} + +func (p *Edge) Equals(other *Edge) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Src.Equals(other.Src) { return false } + if !p.Dst.Equals(other.Dst) { return false } + if p.Type != other.Type { return false } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if p.Ranking != other.Ranking { return false } + if len(p.Props) != len(other.Props) { return false } + for k, _tgt := range p.Props { + _src26 := other.Props[k] + if !_tgt.Equals(_src26) { return false } + } + return true +} + +func (p *Edge) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Edge(%+v)", *p) +} + +func (p *Edge) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.MAP { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Step) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Dst = &Vertex{} + if err := p.Dst.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *Step) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *Step) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Step) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *Step) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key27 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key27 = v +} + _val28 := &Value{} + if err := _val28.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val28), err) + } + p.Props[_key27] = _val28 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Step) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Step"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Step) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dst: ", p), err) } + return err +} + +func (p *Step) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *Step) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *Step) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "ranking", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:ranking: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:ranking: ", p), err) } + return err +} + +func (p *Step) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "props", thrift.MAP, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:props: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:props: ", p), err) } + return err +} + +func (p *Step) Equals(other *Step) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Dst.Equals(other.Dst) { return false } + if p.Type != other.Type { return false } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if p.Ranking != other.Ranking { return false } + if len(p.Props) != len(other.Props) { return false } + for k, _tgt := range p.Props { + _src29 := other.Props[k] + if !_tgt.Equals(_src29) { return false } + } + return true +} + +func (p *Step) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Step(%+v)", *p) +} + +func (p *Step) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Path) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Src = &Vertex{} + if err := p.Src.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *Path) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem30 := &Step{} + if err := _elem30.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + } + p.Steps = append(p.Steps, _elem30) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Path) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Path"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Path) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *Path) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "steps", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:steps: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Steps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Steps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:steps: ", p), err) } + return err +} + +func (p *Path) Equals(other *Path) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Src.Equals(other.Src) { return false } + if len(p.Steps) != len(other.Steps) { return false } + for i, _tgt := range p.Steps { + _src31 := other.Steps[i] + if !_tgt.Equals(_src31) { return false } + } + return true +} + +func (p *Path) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Path(%+v)", *p) +} + +func (p *Path) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostAddr) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Host = v +} + return nil +} + +func (p *HostAddr) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := Port(v) + p.Port = temp +} + return nil +} + +func (p *HostAddr) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "HostAddr"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HostAddr) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := oprot.WriteString(ctx, string(p.Host)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *HostAddr) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "port", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:port: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Port)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.port (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:port: ", p), err) } + return err +} + +func (p *HostAddr) Equals(other *HostAddr) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Host != other.Host { return false } + if p.Port != other.Port { return false } + return true +} + +func (p *HostAddr) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostAddr(%+v)", *p) +} + +func (p *HostAddr) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *KeyValue) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *KeyValue) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *KeyValue) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "KeyValue"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *KeyValue) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *KeyValue) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *KeyValue) Equals(other *KeyValue) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Key, other.Key) != 0 { return false } + if bytes.Compare(p.Value, other.Value) != 0 { return false } + return true +} + +func (p *KeyValue) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KeyValue(%+v)", *p) +} + +func (p *KeyValue) Validate() error { + return nil +} +// Attributes: +// - Seconds +// - Microseconds +// - Months +type Duration struct { + Seconds int64 `thrift:"seconds,1" db:"seconds" json:"seconds"` + Microseconds int32 `thrift:"microseconds,2" db:"microseconds" json:"microseconds"` + Months int32 `thrift:"months,3" db:"months" json:"months"` +} + +func NewDuration() *Duration { + return &Duration{} +} + + +func (p *Duration) GetSeconds() int64 { + return p.Seconds +} + +func (p *Duration) GetMicroseconds() int32 { + return p.Microseconds +} + +func (p *Duration) GetMonths() int32 { + return p.Months +} +func (p *Duration) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Duration) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Seconds = v +} + return nil +} + +func (p *Duration) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Microseconds = v +} + return nil +} + +func (p *Duration) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Months = v +} + return nil +} + +func (p *Duration) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Duration"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Duration) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "seconds", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:seconds: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Seconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.seconds (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:seconds: ", p), err) } + return err +} + +func (p *Duration) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "microseconds", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:microseconds: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Microseconds)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.microseconds (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:microseconds: ", p), err) } + return err +} + +func (p *Duration) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "months", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:months: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Months)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.months (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:months: ", p), err) } + return err +} + +func (p *Duration) Equals(other *Duration) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Seconds != other.Seconds { return false } + if p.Microseconds != other.Microseconds { return false } + if p.Months != other.Months { return false } + return true +} + +func (p *Duration) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Duration(%+v)", *p) +} + +func (p *Duration) Validate() error { + return nil +} +// Attributes: +// - LogID +// - TermID +// - CommitLogID +// - CheckpointPath +type LogInfo struct { + LogID LogID `thrift:"log_id,1" db:"log_id" json:"log_id"` + TermID TermID `thrift:"term_id,2" db:"term_id" json:"term_id"` + CommitLogID LogID `thrift:"commit_log_id,3" db:"commit_log_id" json:"commit_log_id"` + CheckpointPath []byte `thrift:"checkpoint_path,4" db:"checkpoint_path" json:"checkpoint_path"` +} + +func NewLogInfo() *LogInfo { + return &LogInfo{} +} + + +func (p *LogInfo) GetLogID() LogID { + return p.LogID +} + +func (p *LogInfo) GetTermID() TermID { + return p.TermID +} + +func (p *LogInfo) GetCommitLogID() LogID { + return p.CommitLogID +} + +func (p *LogInfo) GetCheckpointPath() []byte { + return p.CheckpointPath +} +func (p *LogInfo) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LogInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := LogID(v) + p.LogID = temp +} + return nil +} + +func (p *LogInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := TermID(v) + p.TermID = temp +} + return nil +} + +func (p *LogInfo) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := LogID(v) + p.CommitLogID = temp +} + return nil +} + +func (p *LogInfo) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.CheckpointPath = v +} + return nil +} + +func (p *LogInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "LogInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LogInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.LogID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.log_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:log_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.TermID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "commit_log_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:commit_log_id: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.CommitLogID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.commit_log_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:commit_log_id: ", p), err) } + return err +} + +func (p *LogInfo) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "checkpoint_path", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:checkpoint_path: ", p), err) } + if err := oprot.WriteBinary(ctx, p.CheckpointPath); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.checkpoint_path (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:checkpoint_path: ", p), err) } + return err +} + +func (p *LogInfo) Equals(other *LogInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.LogID != other.LogID { return false } + if p.TermID != other.TermID { return false } + if p.CommitLogID != other.CommitLogID { return false } + if bytes.Compare(p.CheckpointPath, other.CheckpointPath) != 0 { return false } + return true +} + +func (p *LogInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LogInfo(%+v)", *p) +} + +func (p *LogInfo) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DirInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Root = v +} + return nil +} + +func (p *DirInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem32 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem32 = v +} + p.Data = append(p.Data, _elem32) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DirInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DirInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DirInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "root", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:root: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Root); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.root (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:root: ", p), err) } + return err +} + +func (p *DirInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "data", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:data: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Data)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Data { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err) } + return err +} + +func (p *DirInfo) Equals(other *DirInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Root, other.Root) != 0 { return false } + if len(p.Data) != len(other.Data) { return false } + for i, _tgt := range p.Data { + _src33 := other.Data[i] + if bytes.Compare(_tgt, _src33) != 0 { return false } + } + return true +} + +func (p *DirInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DirInfo(%+v)", *p) +} + +func (p *DirInfo) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - DataPath +type CheckpointInfo struct { + SpaceID GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[PartitionID]*LogInfo `thrift:"parts,2" db:"parts" json:"parts"` + DataPath []byte `thrift:"data_path,3" db:"data_path" json:"data_path"` +} + +func NewCheckpointInfo() *CheckpointInfo { + return &CheckpointInfo{} +} + + +func (p *CheckpointInfo) GetSpaceID() GraphSpaceID { + return p.SpaceID +} + +func (p *CheckpointInfo) GetParts() map[PartitionID]*LogInfo { + return p.Parts +} + +func (p *CheckpointInfo) GetDataPath() []byte { + return p.DataPath +} +func (p *CheckpointInfo) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CheckpointInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *CheckpointInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[PartitionID]*LogInfo, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key34 PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := PartitionID(v) + _key34 = temp +} + _val35 := &LogInfo{} + if err := _val35.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val35), err) + } + p.Parts[_key34] = _val35 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *CheckpointInfo) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.DataPath = v +} + return nil +} + +func (p *CheckpointInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CheckpointInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CheckpointInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *CheckpointInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *CheckpointInfo) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "data_path", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:data_path: ", p), err) } + if err := oprot.WriteBinary(ctx, p.DataPath); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.data_path (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data_path: ", p), err) } + return err +} + +func (p *CheckpointInfo) Equals(other *CheckpointInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src36 := other.Parts[k] + if !_tgt.Equals(_src36) { return false } + } + if bytes.Compare(p.DataPath, other.DataPath) != 0 { return false } + return true +} + +func (p *CheckpointInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckpointInfo(%+v)", *p) +} + +func (p *CheckpointInfo) Validate() error { + return nil +} +// Attributes: +// - Cluster +// - LogStr +type LogEntry struct { + Cluster ClusterID `thrift:"cluster,1" db:"cluster" json:"cluster"` + LogStr []byte `thrift:"log_str,2" db:"log_str" json:"log_str"` +} + +func NewLogEntry() *LogEntry { + return &LogEntry{} +} + + +func (p *LogEntry) GetCluster() ClusterID { + return p.Cluster +} + +func (p *LogEntry) GetLogStr() []byte { + return p.LogStr +} +func (p *LogEntry) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LogEntry) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ClusterID(v) + p.Cluster = temp +} + return nil +} + +func (p *LogEntry) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LogStr = v +} + return nil +} + +func (p *LogEntry) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "LogEntry"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LogEntry) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "cluster", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cluster: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Cluster)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cluster: ", p), err) } + return err +} + +func (p *LogEntry) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "log_str", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:log_str: ", p), err) } + if err := oprot.WriteBinary(ctx, p.LogStr); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.log_str (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:log_str: ", p), err) } + return err +} + +func (p *LogEntry) Equals(other *LogEntry) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Cluster != other.Cluster { return false } + if bytes.Compare(p.LogStr, other.LogStr) != 0 { return false } + return true +} + +func (p *LogEntry) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LogEntry(%+v)", *p) +} + +func (p *LogEntry) Validate() error { + return nil +} diff --git a/nebula/constants.go b/nebula/constants.go deleted file mode 100644 index 0f3c8b97..00000000 --- a/nebula/constants.go +++ /dev/null @@ -1,26 +0,0 @@ -// 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/vesoft-inc/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 = "3.0.0" - -func init() { -} - diff --git a/nebula/graph/GoUnusedProtection__.go b/nebula/graph/GoUnusedProtection__.go new file mode 100644 index 00000000..3c8adc2d --- /dev/null +++ b/nebula/graph/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package graph + +var GoUnusedProtection__ int; + diff --git a/nebula/graph/constants.go b/nebula/graph/constants.go deleted file mode 100644 index 3dbaca22..00000000 --- a/nebula/graph/constants.go +++ /dev/null @@ -1,28 +0,0 @@ -// 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/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - -) - -// (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/nebula/graph/graph-consts.go b/nebula/graph/graph-consts.go new file mode 100644 index 00000000..3aac1114 --- /dev/null +++ b/nebula/graph/graph-consts.go @@ -0,0 +1,33 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package graph + +import ( + "bytes" + "context" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" + "github.com/vesoft-inc/nebula-go/v3/nebula" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +var _ = nebula.GoUnusedProtection__ + +func init() { +} + diff --git a/nebula/graph/graph.go b/nebula/graph/graph.go new file mode 100644 index 00000000..cef19371 --- /dev/null +++ b/nebula/graph/graph.go @@ -0,0 +1,4667 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package graph + +import ( + "bytes" + "context" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" + "github.com/vesoft-inc/nebula-go/v3/nebula" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +var _ = nebula.GoUnusedProtection__ +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetRows = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetExecDurationInUs = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetTotalDurationInUs = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetRows{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Rows is not set")); + } + if !issetExecDurationInUs{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ExecDurationInUs is not set")); + } + if !issetTotalDurationInUs{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TotalDurationInUs is not set")); + } + return nil +} + +func (p *ProfilingStats) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Rows = v +} + return nil +} + +func (p *ProfilingStats) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ExecDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TotalDurationInUs = v +} + return nil +} + +func (p *ProfilingStats) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key0 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key0 = v +} +var _val1 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val1 = v +} + p.OtherStats[_key0] = _val1 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ProfilingStats) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ProfilingStats"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ProfilingStats) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "rows", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:rows: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Rows)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.rows (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:rows: ", p), err) } + return err +} + +func (p *ProfilingStats) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); 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(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); 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(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOtherStats() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:other_stats: ", p), err) } + } + return err +} + +func (p *ProfilingStats) Equals(other *ProfilingStats) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Rows != other.Rows { return false } + if p.ExecDurationInUs != other.ExecDurationInUs { return false } + if p.TotalDurationInUs != other.TotalDurationInUs { return false } + if len(p.OtherStats) != len(other.OtherStats) { return false } + for k, _tgt := range p.OtherStats { + _src2 := other.OtherStats[k] + if bytes.Compare(_tgt, _src2) != 0 { return false } + } + return true +} + +func (p *ProfilingStats) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ProfilingStats(%+v)", *p) +} + +func (p *ProfilingStats) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetIsDoBranch = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetConditionNodeID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetIsDoBranch{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field IsDoBranch is not set")); + } + if !issetConditionNodeID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ConditionNodeID is not set")); + } + return nil +} + +func (p *PlanNodeBranchInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.IsDoBranch = v +} + return nil +} + +func (p *PlanNodeBranchInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ConditionNodeID = v +} + return nil +} + +func (p *PlanNodeBranchInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "PlanNodeBranchInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanNodeBranchInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IsDoBranch)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_do_branch (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:is_do_branch: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.ConditionNodeID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition_node_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:condition_node_id: ", p), err) } + return err +} + +func (p *PlanNodeBranchInfo) Equals(other *PlanNodeBranchInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.IsDoBranch != other.IsDoBranch { return false } + if p.ConditionNodeID != other.ConditionNodeID { return false } + return true +} + +func (p *PlanNodeBranchInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PlanNodeBranchInfo(%+v)", *p) +} + +func (p *PlanNodeBranchInfo) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetKey = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetValue = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetKey{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Key is not set")); + } + if !issetValue{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *Pair) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Key = v +} + return nil +} + +func (p *Pair) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *Pair) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Pair"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Pair) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "key", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:key: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Key); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.key (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *Pair) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *Pair) Equals(other *Pair) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Key, other.Key) != 0 { return false } + if bytes.Compare(p.Value, other.Value) != 0 { return false } + return true +} + +func (p *Pair) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Pair(%+v)", *p) +} + +func (p *Pair) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetOutputVar = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.LIST { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetName{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ID is not set")); + } + if !issetOutputVar{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OutputVar is not set")); + } + return nil +} + +func (p *PlanNodeDescription) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ID = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OutputVar = v +} + return nil +} + +func (p *PlanNodeDescription) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 := &Pair{} + if err := _elem3.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) + } + p.Description = append(p.Description, _elem3) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 := &ProfilingStats{} + if err := _elem4.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Profiles = append(p.Profiles, _elem4) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.BranchInfo = &PlanNodeBranchInfo{} + if err := p.BranchInfo.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BranchInfo), err) + } + return nil +} + +func (p *PlanNodeDescription) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.Dependencies = append(p.Dependencies, _elem5) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanNodeDescription) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "PlanNodeDescription"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanNodeDescription) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "id", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:id: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.ID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.OutputVar); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.output_var (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:output_var: ", p), err) } + return err +} + +func (p *PlanNodeDescription) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDescription() { + if err := oprot.WriteFieldBegin(ctx, "description", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:description: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Description)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Description { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:description: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetProfiles() { + if err := oprot.WriteFieldBegin(ctx, "profiles", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:profiles: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Profiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Profiles { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:profiles: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetBranchInfo() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BranchInfo), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:branch_info: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDependencies() { + if err := oprot.WriteFieldBegin(ctx, "dependencies", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:dependencies: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.Dependencies)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Dependencies { + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:dependencies: ", p), err) } + } + return err +} + +func (p *PlanNodeDescription) Equals(other *PlanNodeDescription) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if p.ID != other.ID { return false } + if bytes.Compare(p.OutputVar, other.OutputVar) != 0 { return false } + if len(p.Description) != len(other.Description) { return false } + for i, _tgt := range p.Description { + _src6 := other.Description[i] + if !_tgt.Equals(_src6) { return false } + } + if len(p.Profiles) != len(other.Profiles) { return false } + for i, _tgt := range p.Profiles { + _src7 := other.Profiles[i] + if !_tgt.Equals(_src7) { return false } + } + if !p.BranchInfo.Equals(other.BranchInfo) { return false } + if len(p.Dependencies) != len(other.Dependencies) { return false } + for i, _tgt := range p.Dependencies { + _src8 := other.Dependencies[i] + if _tgt != _src8 { return false } + } + return true +} + +func (p *PlanNodeDescription) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PlanNodeDescription(%+v)", *p) +} + +func (p *PlanNodeDescription) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetPlanNodeDescs = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetNodeIndexMap = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetFormat = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetOptimizeTimeInUs = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetPlanNodeDescs{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PlanNodeDescs is not set")); + } + if !issetNodeIndexMap{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field NodeIndexMap is not set")); + } + if !issetFormat{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Format is not set")); + } + if !issetOptimizeTimeInUs{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field OptimizeTimeInUs is not set")); + } + return nil +} + +func (p *PlanDescription) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem9 := &PlanNodeDescription{} + if err := _elem9.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem9), err) + } + p.PlanNodeDescs = append(p.PlanNodeDescs, _elem9) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key10 int64 + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key10 = v +} +var _val11 int64 + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val11 = v +} + p.NodeIndexMap[_key10] = _val11 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *PlanDescription) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Format = v +} + return nil +} + +func (p *PlanDescription) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.OptimizeTimeInUs = v +} + return nil +} + +func (p *PlanDescription) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "PlanDescription"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PlanDescription) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.PlanNodeDescs)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PlanNodeDescs { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:plan_node_descs: ", p), err) } + return err +} + +func (p *PlanDescription) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:node_index_map: ", p), err) } + return err +} + +func (p *PlanDescription) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "format", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:format: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Format); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.format (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:format: ", p), err) } + return err +} + +func (p *PlanDescription) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:optimize_time_in_us: ", p), err) } + return err +} + +func (p *PlanDescription) Equals(other *PlanDescription) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.PlanNodeDescs) != len(other.PlanNodeDescs) { return false } + for i, _tgt := range p.PlanNodeDescs { + _src12 := other.PlanNodeDescs[i] + if !_tgt.Equals(_src12) { return false } + } + if len(p.NodeIndexMap) != len(other.NodeIndexMap) { return false } + for k, _tgt := range p.NodeIndexMap { + _src13 := other.NodeIndexMap[k] + if _tgt != _src13 { return false } + } + if bytes.Compare(p.Format, other.Format) != 0 { return false } + if p.OptimizeTimeInUs != other.OptimizeTimeInUs { return false } + return true +} + +func (p *PlanDescription) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PlanDescription(%+v)", *p) +} + +func (p *PlanDescription) Validate() error { + return nil +} +// Attributes: +// - ErrorCode +// - LatencyInUs +// - Data +// - SpaceName +// - ErrorMsg +// - PlanDesc +// - Comment +type ExecutionResponse struct { + ErrorCode nebula.ErrorCode `thrift:"error_code,1,required" db:"error_code" json:"error_code"` + LatencyInUs int64 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` + Data *nebula.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() nebula.ErrorCode { + return p.ErrorCode +} + +func (p *ExecutionResponse) GetLatencyInUs() int64 { + return p.LatencyInUs +} +var ExecutionResponse_Data_DEFAULT *nebula.DataSet +func (p *ExecutionResponse) GetData() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetErrorCode = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetLatencyInUs = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetErrorCode{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + if !issetLatencyInUs{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ExecutionResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.ErrorCode = temp +} + return nil +} + +func (p *ExecutionResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ExecutionResponse) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Data = &nebula.DataSet{} + if err := p.Data.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *ExecutionResponse) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *ExecutionResponse) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.PlanDesc = &PlanDescription{} + if err := p.PlanDesc.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.PlanDesc), err) + } + return nil +} + +func (p *ExecutionResponse) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *ExecutionResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ExecutionResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ExecutionResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "latency_in_us", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ExecutionResponse) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSpaceName() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_name: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:error_msg: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetPlanDesc() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.PlanDesc), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:plan_desc: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:comment: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:comment: ", p), err) } + } + return err +} + +func (p *ExecutionResponse) Equals(other *ExecutionResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ErrorCode != other.ErrorCode { return false } + if p.LatencyInUs != other.LatencyInUs { return false } + if !p.Data.Equals(other.Data) { return false } + if bytes.Compare(p.SpaceName, other.SpaceName) != 0 { return false } + if bytes.Compare(p.ErrorMsg, other.ErrorMsg) != 0 { return false } + if !p.PlanDesc.Equals(other.PlanDesc) { return false } + if bytes.Compare(p.Comment, other.Comment) != 0 { return false } + return true +} + +func (p *ExecutionResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExecutionResponse(%+v)", *p) +} + +func (p *ExecutionResponse) Validate() error { + return nil +} +// Attributes: +// - ErrorCode +// - ErrorMsg +// - SessionID +// - TimeZoneOffsetSeconds +// - TimeZoneName +type AuthResponse struct { + ErrorCode nebula.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() nebula.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.ErrorMsg != nil +} + +func (p *AuthResponse) IsSetSessionID() bool { + return p.SessionID != nil +} + +func (p *AuthResponse) IsSetTimeZoneOffsetSeconds() bool { + return p.TimeZoneOffsetSeconds != nil +} + +func (p *AuthResponse) IsSetTimeZoneName() bool { + return p.TimeZoneName != nil +} + +func (p *AuthResponse) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetErrorCode = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetErrorCode{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + return nil +} + +func (p *AuthResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.ErrorCode = temp +} + return nil +} + +func (p *AuthResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *AuthResponse) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SessionID = &v +} + return nil +} + +func (p *AuthResponse) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.TimeZoneOffsetSeconds = &v +} + return nil +} + +func (p *AuthResponse) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.TimeZoneName = v +} + return nil +} + +func (p *AuthResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AuthResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AuthResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *AuthResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:error_msg: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSessionID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session_id: ", p), err) } + } + return err +} + +func (p *AuthResponse) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTimeZoneOffsetSeconds() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); 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(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTimeZoneName() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TimeZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.time_zone_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:time_zone_name: ", p), err) } + } + return err +} + +func (p *AuthResponse) Equals(other *AuthResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ErrorCode != other.ErrorCode { return false } + if bytes.Compare(p.ErrorMsg, other.ErrorMsg) != 0 { return false } + if p.SessionID != other.SessionID { + if p.SessionID == nil || other.SessionID == nil { + return false + } + if (*p.SessionID) != (*other.SessionID) { return false } + } + if p.TimeZoneOffsetSeconds != other.TimeZoneOffsetSeconds { + if p.TimeZoneOffsetSeconds == nil || other.TimeZoneOffsetSeconds == nil { + return false + } + if (*p.TimeZoneOffsetSeconds) != (*other.TimeZoneOffsetSeconds) { return false } + } + if bytes.Compare(p.TimeZoneName, other.TimeZoneName) != 0 { return false } + return true +} + +func (p *AuthResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AuthResponse(%+v)", *p) +} + +func (p *AuthResponse) Validate() error { + return nil +} +// Attributes: +// - ErrorCode +// - ErrorMsg +type VerifyClientVersionResp struct { + ErrorCode nebula.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() nebula.ErrorCode { + return p.ErrorCode +} +var VerifyClientVersionResp_ErrorMsg_DEFAULT []byte + +func (p *VerifyClientVersionResp) GetErrorMsg() []byte { + return p.ErrorMsg +} +func (p *VerifyClientVersionResp) IsSetErrorMsg() bool { + return p.ErrorMsg != nil +} + +func (p *VerifyClientVersionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetErrorCode bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetErrorCode = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetErrorCode{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ErrorCode is not set")); + } + return nil +} + +func (p *VerifyClientVersionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.ErrorCode = temp +} + return nil +} + +func (p *VerifyClientVersionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *VerifyClientVersionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "VerifyClientVersionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *VerifyClientVersionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.ErrorCode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:error_code: ", p), err) } + return err +} + +func (p *VerifyClientVersionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:error_msg: ", p), err) } + } + return err +} + +func (p *VerifyClientVersionResp) Equals(other *VerifyClientVersionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.ErrorCode != other.ErrorCode { return false } + if bytes.Compare(p.ErrorMsg, other.ErrorMsg) != 0 { return false } + return true +} + +func (p *VerifyClientVersionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VerifyClientVersionResp(%+v)", *p) +} + +func (p *VerifyClientVersionResp) Validate() error { + return nil +} +// Attributes: +// - Version +type VerifyClientVersionReq struct { + Version []byte `thrift:"version,1,required" db:"version" json:"version"` +} + +func NewVerifyClientVersionReq() *VerifyClientVersionReq { + return &VerifyClientVersionReq{ +Version: []byte("3.0.0"), +} +} + + +func (p *VerifyClientVersionReq) GetVersion() []byte { + return p.Version +} +func (p *VerifyClientVersionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetVersion bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetVersion = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetVersion{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Version is not set")); + } + return nil +} + +func (p *VerifyClientVersionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *VerifyClientVersionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "VerifyClientVersionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *VerifyClientVersionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:version: ", p), err) } + return err +} + +func (p *VerifyClientVersionReq) Equals(other *VerifyClientVersionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Version, other.Version) != 0 { return false } + return true +} + +func (p *VerifyClientVersionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VerifyClientVersionReq(%+v)", *p) +} + +func (p *VerifyClientVersionReq) Validate() error { + return nil +} +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 + // - ParameterMap + ExecuteWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula.Value) (_r *ExecutionResponse, _err error) + // Parameters: + // - SessionId + // - Stmt + ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, _err error) + // Parameters: + // - SessionId + // - Stmt + // - ParameterMap + ExecuteJsonWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula.Value) (_r []byte, _err error) + // Parameters: + // - Req + VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, _err error) +} + +type GraphServiceClient struct { + c thrift.TClient + meta thrift.ResponseMeta +} + +func NewGraphServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *GraphServiceClient { + return &GraphServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewGraphServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *GraphServiceClient { + return &GraphServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewGraphServiceClient(c thrift.TClient) *GraphServiceClient { + return &GraphServiceClient{ + c: c, + } +} + +func (p *GraphServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *GraphServiceClient) LastResponseMeta_() thrift.ResponseMeta { + return p.meta +} + +func (p *GraphServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { + p.meta = meta +} + +// Parameters: +// - Username +// - Password +func (p *GraphServiceClient) Authenticate(ctx context.Context, username []byte, password []byte) (_r *AuthResponse, _err error) { + var _args14 GraphServiceAuthenticateArgs + _args14.Username = username + _args14.Password = password + var _result16 GraphServiceAuthenticateResult + var _meta15 thrift.ResponseMeta + _meta15, _err = p.Client_().Call(ctx, "authenticate", &_args14, &_result16) + p.SetLastResponseMeta_(_meta15) + if _err != nil { + return + } + if _ret17 := _result16.GetSuccess(); _ret17 != nil { + return _ret17, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "authenticate failed: unknown result") +} + +// Parameters: +// - SessionId +func (p *GraphServiceClient) Signout(ctx context.Context, sessionId int64) (_err error) { + var _args18 GraphServiceSignoutArgs + _args18.SessionId = sessionId + p.SetLastResponseMeta_(thrift.ResponseMeta{}) + if _, err := p.Client_().Call(ctx, "signout", &_args18, nil); err != nil { + return err + } + return nil +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) Execute(ctx context.Context, sessionId int64, stmt []byte) (_r *ExecutionResponse, _err error) { + var _args19 GraphServiceExecuteArgs + _args19.SessionId = sessionId + _args19.Stmt = stmt + var _result21 GraphServiceExecuteResult + var _meta20 thrift.ResponseMeta + _meta20, _err = p.Client_().Call(ctx, "execute", &_args19, &_result21) + p.SetLastResponseMeta_(_meta20) + if _err != nil { + return + } + if _ret22 := _result21.GetSuccess(); _ret22 != nil { + return _ret22, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "execute failed: unknown result") +} + +// Parameters: +// - SessionId +// - Stmt +// - ParameterMap +func (p *GraphServiceClient) ExecuteWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula.Value) (_r *ExecutionResponse, _err error) { + var _args23 GraphServiceExecuteWithParameterArgs + _args23.SessionId = sessionId + _args23.Stmt = stmt + _args23.ParameterMap = parameterMap + var _result25 GraphServiceExecuteWithParameterResult + var _meta24 thrift.ResponseMeta + _meta24, _err = p.Client_().Call(ctx, "executeWithParameter", &_args23, &_result25) + p.SetLastResponseMeta_(_meta24) + if _err != nil { + return + } + if _ret26 := _result25.GetSuccess(); _ret26 != nil { + return _ret26, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "executeWithParameter failed: unknown result") +} + +// Parameters: +// - SessionId +// - Stmt +func (p *GraphServiceClient) ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, _err error) { + var _args27 GraphServiceExecuteJsonArgs + _args27.SessionId = sessionId + _args27.Stmt = stmt + var _result29 GraphServiceExecuteJsonResult + var _meta28 thrift.ResponseMeta + _meta28, _err = p.Client_().Call(ctx, "executeJson", &_args27, &_result29) + p.SetLastResponseMeta_(_meta28) + if _err != nil { + return + } + return _result29.GetSuccess(), nil +} + +// Parameters: +// - SessionId +// - Stmt +// - ParameterMap +func (p *GraphServiceClient) ExecuteJsonWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula.Value) (_r []byte, _err error) { + var _args30 GraphServiceExecuteJsonWithParameterArgs + _args30.SessionId = sessionId + _args30.Stmt = stmt + _args30.ParameterMap = parameterMap + var _result32 GraphServiceExecuteJsonWithParameterResult + var _meta31 thrift.ResponseMeta + _meta31, _err = p.Client_().Call(ctx, "executeJsonWithParameter", &_args30, &_result32) + p.SetLastResponseMeta_(_meta31) + if _err != nil { + return + } + return _result32.GetSuccess(), nil +} + +// Parameters: +// - Req +func (p *GraphServiceClient) VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, _err error) { + var _args33 GraphServiceVerifyClientVersionArgs + _args33.Req = req + var _result35 GraphServiceVerifyClientVersionResult + var _meta34 thrift.ResponseMeta + _meta34, _err = p.Client_().Call(ctx, "verifyClientVersion", &_args33, &_result35) + p.SetLastResponseMeta_(_meta34) + if _err != nil { + return + } + if _ret36 := _result35.GetSuccess(); _ret36 != nil { + return _ret36, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "verifyClientVersion failed: unknown result") +} + +type GraphServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler GraphService +} + +func (p *GraphServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *GraphServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *GraphServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewGraphServiceProcessor(handler GraphService) *GraphServiceProcessor { + + self37 := &GraphServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self37.processorMap["authenticate"] = &graphServiceProcessorAuthenticate{handler:handler} + self37.processorMap["signout"] = &graphServiceProcessorSignout{handler:handler} + self37.processorMap["execute"] = &graphServiceProcessorExecute{handler:handler} + self37.processorMap["executeWithParameter"] = &graphServiceProcessorExecuteWithParameter{handler:handler} + self37.processorMap["executeJson"] = &graphServiceProcessorExecuteJson{handler:handler} + self37.processorMap["executeJsonWithParameter"] = &graphServiceProcessorExecuteJsonWithParameter{handler:handler} + self37.processorMap["verifyClientVersion"] = &graphServiceProcessorVerifyClientVersion{handler:handler} +return self37 +} + +func (p *GraphServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { return false, thrift.WrapTException(err2) } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x38 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x38.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x38 + +} + +type graphServiceProcessorAuthenticate struct { + handler GraphService +} + +func (p *graphServiceProcessorAuthenticate) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err39 error + args := GraphServiceAuthenticateArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "authenticate", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphServiceAuthenticateResult{} + if retval, err2 := p.handler.Authenticate(ctx, args.Username, args.Password); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc40 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing authenticate: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "authenticate", thrift.EXCEPTION, seqId); err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if err2 := _exc40.Write(ctx, oprot); _write_err39 == nil && err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err39 == nil && err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err39 == nil && err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if _write_err39 != nil { + return false, thrift.WrapTException(_write_err39) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "authenticate", thrift.REPLY, seqId); err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err39 == nil && err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err39 == nil && err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err39 == nil && err2 != nil { + _write_err39 = thrift.WrapTException(err2) + } + if _write_err39 != nil { + return false, thrift.WrapTException(_write_err39) + } + return true, err +} + +type graphServiceProcessorSignout struct { + handler GraphService +} + +func (p *graphServiceProcessorSignout) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := GraphServiceSignoutArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + _ = tickerCancel + + if err2 := p.handler.Signout(ctx, args.SessionId); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + } + tickerCancel() + return true, err +} + +type graphServiceProcessorExecute struct { + handler GraphService +} + +func (p *graphServiceProcessorExecute) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err41 error + args := GraphServiceExecuteArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "execute", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphServiceExecuteResult{} + if retval, err2 := p.handler.Execute(ctx, args.SessionId, args.Stmt); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc42 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing execute: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "execute", thrift.EXCEPTION, seqId); err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if err2 := _exc42.Write(ctx, oprot); _write_err41 == nil && err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err41 == nil && err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err41 == nil && err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if _write_err41 != nil { + return false, thrift.WrapTException(_write_err41) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "execute", thrift.REPLY, seqId); err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err41 == nil && err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err41 == nil && err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err41 == nil && err2 != nil { + _write_err41 = thrift.WrapTException(err2) + } + if _write_err41 != nil { + return false, thrift.WrapTException(_write_err41) + } + return true, err +} + +type graphServiceProcessorExecuteWithParameter struct { + handler GraphService +} + +func (p *graphServiceProcessorExecuteWithParameter) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err43 error + args := GraphServiceExecuteWithParameterArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "executeWithParameter", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphServiceExecuteWithParameterResult{} + if retval, err2 := p.handler.ExecuteWithParameter(ctx, args.SessionId, args.Stmt, args.ParameterMap); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc44 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeWithParameter: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "executeWithParameter", thrift.EXCEPTION, seqId); err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if err2 := _exc44.Write(ctx, oprot); _write_err43 == nil && err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err43 == nil && err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err43 == nil && err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if _write_err43 != nil { + return false, thrift.WrapTException(_write_err43) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "executeWithParameter", thrift.REPLY, seqId); err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err43 == nil && err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err43 == nil && err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err43 == nil && err2 != nil { + _write_err43 = thrift.WrapTException(err2) + } + if _write_err43 != nil { + return false, thrift.WrapTException(_write_err43) + } + return true, err +} + +type graphServiceProcessorExecuteJson struct { + handler GraphService +} + +func (p *graphServiceProcessorExecuteJson) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err45 error + args := GraphServiceExecuteJsonArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "executeJson", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphServiceExecuteJsonResult{} + if retval, err2 := p.handler.ExecuteJson(ctx, args.SessionId, args.Stmt); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc46 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeJson: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "executeJson", thrift.EXCEPTION, seqId); err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if err2 := _exc46.Write(ctx, oprot); _write_err45 == nil && err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err45 == nil && err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err45 == nil && err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if _write_err45 != nil { + return false, thrift.WrapTException(_write_err45) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "executeJson", thrift.REPLY, seqId); err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err45 == nil && err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err45 == nil && err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err45 == nil && err2 != nil { + _write_err45 = thrift.WrapTException(err2) + } + if _write_err45 != nil { + return false, thrift.WrapTException(_write_err45) + } + return true, err +} + +type graphServiceProcessorExecuteJsonWithParameter struct { + handler GraphService +} + +func (p *graphServiceProcessorExecuteJsonWithParameter) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err47 error + args := GraphServiceExecuteJsonWithParameterArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "executeJsonWithParameter", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphServiceExecuteJsonWithParameterResult{} + if retval, err2 := p.handler.ExecuteJsonWithParameter(ctx, args.SessionId, args.Stmt, args.ParameterMap); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc48 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeJsonWithParameter: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "executeJsonWithParameter", thrift.EXCEPTION, seqId); err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if err2 := _exc48.Write(ctx, oprot); _write_err47 == nil && err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err47 == nil && err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err47 == nil && err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if _write_err47 != nil { + return false, thrift.WrapTException(_write_err47) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "executeJsonWithParameter", thrift.REPLY, seqId); err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err47 == nil && err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err47 == nil && err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err47 == nil && err2 != nil { + _write_err47 = thrift.WrapTException(err2) + } + if _write_err47 != nil { + return false, thrift.WrapTException(_write_err47) + } + return true, err +} + +type graphServiceProcessorVerifyClientVersion struct { + handler GraphService +} + +func (p *graphServiceProcessorVerifyClientVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err49 error + args := GraphServiceVerifyClientVersionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "verifyClientVersion", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphServiceVerifyClientVersionResult{} + if retval, err2 := p.handler.VerifyClientVersion(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc50 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing verifyClientVersion: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "verifyClientVersion", thrift.EXCEPTION, seqId); err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if err2 := _exc50.Write(ctx, oprot); _write_err49 == nil && err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err49 == nil && err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err49 == nil && err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if _write_err49 != nil { + return false, thrift.WrapTException(_write_err49) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "verifyClientVersion", thrift.REPLY, seqId); err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err49 == nil && err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err49 == nil && err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err49 == nil && err2 != nil { + _write_err49 = thrift.WrapTException(err2) + } + if _write_err49 != nil { + return false, thrift.WrapTException(_write_err49) + } + return true, err +} + + +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceAuthenticateArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Username = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Password = v +} + return nil +} + +func (p *GraphServiceAuthenticateArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "authenticate_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceAuthenticateArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "username", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:username: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Username); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.username (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:username: ", p), err) } + return err +} + +func (p *GraphServiceAuthenticateArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "password", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:password: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Password); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.password (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceAuthenticateResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AuthResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceAuthenticateResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "authenticate_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceAuthenticateResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceSignoutArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceSignoutArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "signout_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceSignoutArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "execute_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecutionResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceExecuteResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "execute_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 +// - ParameterMap +type GraphServiceExecuteWithParameterArgs struct { + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` + ParameterMap map[string]*nebula.Value `thrift:"parameterMap,3" db:"parameterMap" json:"parameterMap"` +} + +func NewGraphServiceExecuteWithParameterArgs() *GraphServiceExecuteWithParameterArgs { + return &GraphServiceExecuteWithParameterArgs{} +} + + +func (p *GraphServiceExecuteWithParameterArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteWithParameterArgs) GetStmt() []byte { + return p.Stmt +} + +func (p *GraphServiceExecuteWithParameterArgs) GetParameterMap() map[string]*nebula.Value { + return p.ParameterMap +} +func (p *GraphServiceExecuteWithParameterArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteWithParameterArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteWithParameterArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteWithParameterArgs) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*nebula.Value, size) + p.ParameterMap = tMap + for i := 0; i < size; i ++ { +var _key51 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key51 = v +} + _val52 := &nebula.Value{} + if err := _val52.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val52), err) + } + p.ParameterMap[_key51] = _val52 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GraphServiceExecuteWithParameterArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "executeWithParameter_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteWithParameterArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteWithParameterArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteWithParameterArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parameterMap", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameterMap: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.ParameterMap)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ParameterMap { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parameterMap: ", p), err) } + return err +} + +func (p *GraphServiceExecuteWithParameterArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteWithParameterArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphServiceExecuteWithParameterResult struct { + Success *ExecutionResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteWithParameterResult() *GraphServiceExecuteWithParameterResult { + return &GraphServiceExecuteWithParameterResult{} +} + +var GraphServiceExecuteWithParameterResult_Success_DEFAULT *ExecutionResponse +func (p *GraphServiceExecuteWithParameterResult) GetSuccess() *ExecutionResponse { + if !p.IsSetSuccess() { + return GraphServiceExecuteWithParameterResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphServiceExecuteWithParameterResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphServiceExecuteWithParameterResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteWithParameterResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecutionResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceExecuteWithParameterResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "executeWithParameter_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteWithParameterResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphServiceExecuteWithParameterResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteWithParameterResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteJsonArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteJsonArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "executeJson_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteJsonArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRING { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteJsonResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + p.Success = v +} + return nil +} + +func (p *GraphServiceExecuteJsonResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "executeJson_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteJsonResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRING, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Success); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); 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) +} + +// Attributes: +// - SessionId +// - Stmt +// - ParameterMap +type GraphServiceExecuteJsonWithParameterArgs struct { + SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` + Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` + ParameterMap map[string]*nebula.Value `thrift:"parameterMap,3" db:"parameterMap" json:"parameterMap"` +} + +func NewGraphServiceExecuteJsonWithParameterArgs() *GraphServiceExecuteJsonWithParameterArgs { + return &GraphServiceExecuteJsonWithParameterArgs{} +} + + +func (p *GraphServiceExecuteJsonWithParameterArgs) GetSessionId() int64 { + return p.SessionId +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) GetStmt() []byte { + return p.Stmt +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) GetParameterMap() map[string]*nebula.Value { + return p.ParameterMap +} +func (p *GraphServiceExecuteJsonWithParameterArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SessionId = v +} + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Stmt = v +} + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*nebula.Value, size) + p.ParameterMap = tMap + for i := 0; i < size; i ++ { +var _key53 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key53 = v +} + _val54 := &nebula.Value{} + if err := _val54.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val54), err) + } + p.ParameterMap[_key53] = _val54 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "executeJsonWithParameter_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessionId", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessionId: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.SessionId)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sessionId (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessionId: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stmt", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:stmt: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Stmt); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stmt (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stmt: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parameterMap", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameterMap: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(p.ParameterMap)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ParameterMap { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parameterMap: ", p), err) } + return err +} + +func (p *GraphServiceExecuteJsonWithParameterArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteJsonWithParameterArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphServiceExecuteJsonWithParameterResult struct { + Success []byte `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphServiceExecuteJsonWithParameterResult() *GraphServiceExecuteJsonWithParameterResult { + return &GraphServiceExecuteJsonWithParameterResult{} +} + +var GraphServiceExecuteJsonWithParameterResult_Success_DEFAULT []byte + +func (p *GraphServiceExecuteJsonWithParameterResult) GetSuccess() []byte { + return p.Success +} +func (p *GraphServiceExecuteJsonWithParameterResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphServiceExecuteJsonWithParameterResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRING { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + p.Success = v +} + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "executeJsonWithParameter_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceExecuteJsonWithParameterResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRING, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Success); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.success (0) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphServiceExecuteJsonWithParameterResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphServiceExecuteJsonWithParameterResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphServiceVerifyClientVersionArgs struct { + Req *VerifyClientVersionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphServiceVerifyClientVersionArgs() *GraphServiceVerifyClientVersionArgs { + return &GraphServiceVerifyClientVersionArgs{} +} + +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.Req != nil +} + +func (p *GraphServiceVerifyClientVersionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceVerifyClientVersionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &VerifyClientVersionReq{ + Version: []byte("3.0.0"), +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphServiceVerifyClientVersionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "verifyClientVersion_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceVerifyClientVersionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphServiceVerifyClientVersionArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphServiceVerifyClientVersionResult struct { + 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.Success != nil +} + +func (p *GraphServiceVerifyClientVersionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphServiceVerifyClientVersionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &VerifyClientVersionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphServiceVerifyClientVersionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "verifyClientVersion_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphServiceVerifyClientVersionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphServiceVerifyClientVersionResult(%+v)", *p) +} + + diff --git a/nebula/graph/graph_service-remote/graph_service-remote.go b/nebula/graph/graph_service-remote/graph_service-remote.go new file mode 100755 index 00000000..fd2ace08 --- /dev/null +++ b/nebula/graph/graph_service-remote/graph_service-remote.go @@ -0,0 +1,313 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package main + +import ( + "context" + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/apache/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-go/v3/nebula" + "github.com/vesoft-inc/nebula-go/v3/nebula/graph" +) + +var _ = nebula.GoUnusedProtection__ +var _ = graph.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " 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, " ExecutionResponse executeWithParameter(i64 sessionId, string stmt, parameterMap)") + fmt.Fprintln(os.Stderr, " string executeJson(i64 sessionId, string stmt)") + fmt.Fprintln(os.Stderr, " string executeJsonWithParameter(i64 sessionId, string stmt, parameterMap)") + fmt.Fprintln(os.Stderr, " VerifyClientVersionResp verifyClientVersion(VerifyClientVersionReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + var cfg *thrift.TConfiguration = nil + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransportConf(trans, cfg) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg) + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg) + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg) + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := graph.NewGraphServiceClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "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(context.Background(), value0, value1)) + fmt.Print("\n") + break + case "signout": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Signout requires 1 args") + flag.Usage() + } + argvalue0, err57 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err57 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Signout(context.Background(), value0)) + fmt.Print("\n") + break + case "execute": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "Execute requires 2 args") + flag.Usage() + } + argvalue0, err58 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err58 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.Execute(context.Background(), value0, value1)) + fmt.Print("\n") + break + case "executeWithParameter": + if flag.NArg() - 1 != 3 { + fmt.Fprintln(os.Stderr, "ExecuteWithParameter requires 3 args") + flag.Usage() + } + argvalue0, err60 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err60 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + arg62 := flag.Arg(3) + mbTrans63 := thrift.NewTMemoryBufferLen(len(arg62)) + defer mbTrans63.Close() + _, err64 := mbTrans63.WriteString(arg62) + if err64 != nil { + Usage() + return + } + factory65 := thrift.NewTJSONProtocolFactory() + jsProt66 := factory65.GetProtocol(mbTrans63) + containerStruct2 := graph.NewGraphServiceExecuteWithParameterArgs() + err67 := containerStruct2.ReadField3(context.Background(), jsProt66) + if err67 != nil { + Usage() + return + } + argvalue2 := containerStruct2.ParameterMap + value2 := argvalue2 + fmt.Print(client.ExecuteWithParameter(context.Background(), value0, value1, value2)) + fmt.Print("\n") + break + case "executeJson": + if flag.NArg() - 1 != 2 { + fmt.Fprintln(os.Stderr, "ExecuteJson requires 2 args") + flag.Usage() + } + argvalue0, err68 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err68 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + fmt.Print(client.ExecuteJson(context.Background(), value0, value1)) + fmt.Print("\n") + break + case "executeJsonWithParameter": + if flag.NArg() - 1 != 3 { + fmt.Fprintln(os.Stderr, "ExecuteJsonWithParameter requires 3 args") + flag.Usage() + } + argvalue0, err70 := (strconv.ParseInt(flag.Arg(1), 10, 64)) + if err70 != nil { + Usage() + return + } + value0 := argvalue0 + argvalue1 := []byte(flag.Arg(2)) + value1 := argvalue1 + arg72 := flag.Arg(3) + mbTrans73 := thrift.NewTMemoryBufferLen(len(arg72)) + defer mbTrans73.Close() + _, err74 := mbTrans73.WriteString(arg72) + if err74 != nil { + Usage() + return + } + factory75 := thrift.NewTJSONProtocolFactory() + jsProt76 := factory75.GetProtocol(mbTrans73) + containerStruct2 := graph.NewGraphServiceExecuteJsonWithParameterArgs() + err77 := containerStruct2.ReadField3(context.Background(), jsProt76) + if err77 != nil { + Usage() + return + } + argvalue2 := containerStruct2.ParameterMap + value2 := argvalue2 + fmt.Print(client.ExecuteJsonWithParameter(context.Background(), value0, value1, value2)) + fmt.Print("\n") + break + case "verifyClientVersion": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "VerifyClientVersion requires 1 args") + flag.Usage() + } + arg78 := flag.Arg(1) + mbTrans79 := thrift.NewTMemoryBufferLen(len(arg78)) + defer mbTrans79.Close() + _, err80 := mbTrans79.WriteString(arg78) + if err80 != nil { + Usage() + return + } + factory81 := thrift.NewTJSONProtocolFactory() + jsProt82 := factory81.GetProtocol(mbTrans79) + argvalue0 := graph.NewVerifyClientVersionReq() + err83 := argvalue0.Read(context.Background(), jsProt82) + if err83 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.VerifyClientVersion(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/nebula/graph/graphservice.go b/nebula/graph/graphservice.go deleted file mode 100644 index 3361d7fe..00000000 --- a/nebula/graph/graphservice.go +++ /dev/null @@ -1,3730 +0,0 @@ -// 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/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - -) - -// (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 - // - ParameterMap - ExecuteWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r *ExecutionResponse, err error) - // Parameters: - // - SessionId - // - Stmt - // - ParameterMap - // - Timeout - ExecuteWithTimeout(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value, timeout int64) (_r *ExecutionResponse, err error) - // Parameters: - // - SessionId - // - Stmt - ExecuteJson(ctx context.Context, sessionId int64, stmt []byte) (_r []byte, err error) - // Parameters: - // - SessionId - // - Stmt - // - ParameterMap - ExecuteJsonWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r []byte, err error) - // Parameters: - // - Req - VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) - Health(ctx context.Context) (_r *HealthResp, 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 - // - ParameterMap - ExecuteWithParameter(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r *ExecutionResponse, err error) - // Parameters: - // - SessionId - // - Stmt - // - ParameterMap - // - Timeout - ExecuteWithTimeout(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value, timeout int64) (_r *ExecutionResponse, err error) - // Parameters: - // - SessionId - // - Stmt - ExecuteJson(sessionId int64, stmt []byte) (_r []byte, err error) - // Parameters: - // - SessionId - // - Stmt - // - ParameterMap - ExecuteJsonWithParameter(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r []byte, err error) - // Parameters: - // - Req - VerifyClientVersion(req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, err error) - Health() (_r *HealthResp, 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 -// - ParameterMap -func (p *GraphServiceClient) ExecuteWithParameter(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r *ExecutionResponse, err error) { - args := GraphServiceExecuteWithParameterArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - } - err = p.CC.SendMsg("executeWithParameter", &args, thrift.CALL) - if err != nil { return } - return p.recvExecuteWithParameter() -} - - -func (p *GraphServiceClient) recvExecuteWithParameter() (value *ExecutionResponse, err error) { - var result GraphServiceExecuteWithParameterResult - err = p.CC.RecvMsg("executeWithParameter", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - SessionId -// - Stmt -// - ParameterMap -// - Timeout -func (p *GraphServiceClient) ExecuteWithTimeout(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value, timeout int64) (_r *ExecutionResponse, err error) { - args := GraphServiceExecuteWithTimeoutArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - Timeout : timeout, - } - err = p.CC.SendMsg("executeWithTimeout", &args, thrift.CALL) - if err != nil { return } - return p.recvExecuteWithTimeout() -} - - -func (p *GraphServiceClient) recvExecuteWithTimeout() (value *ExecutionResponse, err error) { - var result GraphServiceExecuteWithTimeoutResult - err = p.CC.RecvMsg("executeWithTimeout", &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: -// - SessionId -// - Stmt -// - ParameterMap -func (p *GraphServiceClient) ExecuteJsonWithParameter(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r []byte, err error) { - args := GraphServiceExecuteJsonWithParameterArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - } - err = p.CC.SendMsg("executeJsonWithParameter", &args, thrift.CALL) - if err != nil { return } - return p.recvExecuteJsonWithParameter() -} - - -func (p *GraphServiceClient) recvExecuteJsonWithParameter() (value []byte, err error) { - var result GraphServiceExecuteJsonWithParameterResult - err = p.CC.RecvMsg("executeJsonWithParameter", &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 -} - -func (p *GraphServiceClient) Health() (_r *HealthResp, err error) { - var args GraphServiceHealthArgs - err = p.CC.SendMsg("health", &args, thrift.CALL) - if err != nil { return } - return p.recvHealth() -} - - -func (p *GraphServiceClient) recvHealth() (value *HealthResp, err error) { - var result GraphServiceHealthResult - err = p.CC.RecvMsg("health", &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 -// - ParameterMap -func (p *GraphServiceThreadsafeClient) ExecuteWithParameter(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r *ExecutionResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphServiceExecuteWithParameterArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - } - err = p.CC.SendMsg("executeWithParameter", &args, thrift.CALL) - if err != nil { return } - return p.recvExecuteWithParameter() -} - - -func (p *GraphServiceThreadsafeClient) recvExecuteWithParameter() (value *ExecutionResponse, err error) { - var result GraphServiceExecuteWithParameterResult - err = p.CC.RecvMsg("executeWithParameter", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - SessionId -// - Stmt -// - ParameterMap -// - Timeout -func (p *GraphServiceThreadsafeClient) ExecuteWithTimeout(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value, timeout int64) (_r *ExecutionResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphServiceExecuteWithTimeoutArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - Timeout : timeout, - } - err = p.CC.SendMsg("executeWithTimeout", &args, thrift.CALL) - if err != nil { return } - return p.recvExecuteWithTimeout() -} - - -func (p *GraphServiceThreadsafeClient) recvExecuteWithTimeout() (value *ExecutionResponse, err error) { - var result GraphServiceExecuteWithTimeoutResult - err = p.CC.RecvMsg("executeWithTimeout", &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: -// - SessionId -// - Stmt -// - ParameterMap -func (p *GraphServiceThreadsafeClient) ExecuteJsonWithParameter(sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r []byte, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphServiceExecuteJsonWithParameterArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - } - err = p.CC.SendMsg("executeJsonWithParameter", &args, thrift.CALL) - if err != nil { return } - return p.recvExecuteJsonWithParameter() -} - - -func (p *GraphServiceThreadsafeClient) recvExecuteJsonWithParameter() (value []byte, err error) { - var result GraphServiceExecuteJsonWithParameterResult - err = p.CC.RecvMsg("executeJsonWithParameter", &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 -} - -func (p *GraphServiceThreadsafeClient) Health() (_r *HealthResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - var args GraphServiceHealthArgs - err = p.CC.SendMsg("health", &args, thrift.CALL) - if err != nil { return } - return p.recvHealth() -} - - -func (p *GraphServiceThreadsafeClient) recvHealth() (value *HealthResp, err error) { - var result GraphServiceHealthResult - err = p.CC.RecvMsg("health", &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 -// - ParameterMap -func (p *GraphServiceChannelClient) ExecuteWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r *ExecutionResponse, err error) { - args := GraphServiceExecuteWithParameterArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - } - var result GraphServiceExecuteWithParameterResult - err = p.RequestChannel.Call(ctx, "executeWithParameter", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - SessionId -// - Stmt -// - ParameterMap -// - Timeout -func (p *GraphServiceChannelClient) ExecuteWithTimeout(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value, timeout int64) (_r *ExecutionResponse, err error) { - args := GraphServiceExecuteWithTimeoutArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - Timeout : timeout, - } - var result GraphServiceExecuteWithTimeoutResult - err = p.RequestChannel.Call(ctx, "executeWithTimeout", &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: -// - SessionId -// - Stmt -// - ParameterMap -func (p *GraphServiceChannelClient) ExecuteJsonWithParameter(ctx context.Context, sessionId int64, stmt []byte, parameterMap map[string]*nebula0.Value) (_r []byte, err error) { - args := GraphServiceExecuteJsonWithParameterArgs{ - SessionId : sessionId, - Stmt : stmt, - ParameterMap : parameterMap, - } - var result GraphServiceExecuteJsonWithParameterResult - err = p.RequestChannel.Call(ctx, "executeJsonWithParameter", &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 -} - -func (p *GraphServiceChannelClient) Health(ctx context.Context) (_r *HealthResp, err error) { - args := GraphServiceHealthArgs{ - } - var result GraphServiceHealthResult - err = p.RequestChannel.Call(ctx, "health", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - - -type GraphServiceProcessor struct { - processorMap map[string]thrift.ProcessorFunctionContext - functionServiceMap map[string]string - handler GraphService -} - -func (p *GraphServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { - p.processorMap[key] = processor -} - -func (p *GraphServiceProcessor) AddToFunctionServiceMap(key, service string) { - p.functionServiceMap[key] = service -} - -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 (p *GraphServiceProcessor) FunctionServiceMap() map[string]string { - return p.functionServiceMap -} - -func NewGraphServiceProcessor(handler GraphService) *GraphServiceProcessor { - self9 := &GraphServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} - self9.processorMap["authenticate"] = &graphServiceProcessorAuthenticate{handler:handler} - self9.processorMap["signout"] = &graphServiceProcessorSignout{handler:handler} - self9.processorMap["execute"] = &graphServiceProcessorExecute{handler:handler} - self9.processorMap["executeWithParameter"] = &graphServiceProcessorExecuteWithParameter{handler:handler} - self9.processorMap["executeWithTimeout"] = &graphServiceProcessorExecuteWithTimeout{handler:handler} - self9.processorMap["executeJson"] = &graphServiceProcessorExecuteJson{handler:handler} - self9.processorMap["executeJsonWithParameter"] = &graphServiceProcessorExecuteJsonWithParameter{handler:handler} - self9.processorMap["verifyClientVersion"] = &graphServiceProcessorVerifyClientVersion{handler:handler} - self9.processorMap["health"] = &graphServiceProcessorHealth{handler:handler} - self9.functionServiceMap["authenticate"] = "GraphService" - self9.functionServiceMap["signout"] = "GraphService" - self9.functionServiceMap["execute"] = "GraphService" - self9.functionServiceMap["executeWithParameter"] = "GraphService" - self9.functionServiceMap["executeWithTimeout"] = "GraphService" - self9.functionServiceMap["executeJson"] = "GraphService" - self9.functionServiceMap["executeJsonWithParameter"] = "GraphService" - self9.functionServiceMap["verifyClientVersion"] = "GraphService" - self9.functionServiceMap["health"] = "GraphService" - return self9 -} - -type graphServiceProcessorAuthenticate struct { - handler GraphService -} - -func (p *GraphServiceAuthenticateResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphServiceExecuteResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 graphServiceProcessorExecuteWithParameter struct { - handler GraphService -} - -func (p *GraphServiceExecuteWithParameterResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphServiceProcessorExecuteWithParameter) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphServiceExecuteWithParameterArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphServiceProcessorExecuteWithParameter) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("executeWithParameter", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *graphServiceProcessorExecuteWithParameter) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphServiceExecuteWithParameterArgs) - var result GraphServiceExecuteWithParameterResult - if retval, err := p.handler.ExecuteWithParameter(ctx, args.SessionId, args.Stmt, args.ParameterMap); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeWithParameter: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type graphServiceProcessorExecuteWithTimeout struct { - handler GraphService -} - -func (p *GraphServiceExecuteWithTimeoutResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphServiceProcessorExecuteWithTimeout) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphServiceExecuteWithTimeoutArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphServiceProcessorExecuteWithTimeout) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("executeWithTimeout", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *graphServiceProcessorExecuteWithTimeout) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphServiceExecuteWithTimeoutArgs) - var result GraphServiceExecuteWithTimeoutResult - if retval, err := p.handler.ExecuteWithTimeout(ctx, args.SessionId, args.Stmt, args.ParameterMap, args.Timeout); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeWithTimeout: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type graphServiceProcessorExecuteJson struct { - handler GraphService -} - -func (p *GraphServiceExecuteJsonResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 graphServiceProcessorExecuteJsonWithParameter struct { - handler GraphService -} - -func (p *GraphServiceExecuteJsonWithParameterResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphServiceProcessorExecuteJsonWithParameter) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphServiceExecuteJsonWithParameterArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphServiceProcessorExecuteJsonWithParameter) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("executeJsonWithParameter", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *graphServiceProcessorExecuteJsonWithParameter) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphServiceExecuteJsonWithParameterArgs) - var result GraphServiceExecuteJsonWithParameterResult - if retval, err := p.handler.ExecuteJsonWithParameter(ctx, args.SessionId, args.Stmt, args.ParameterMap); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing executeJsonWithParameter: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type graphServiceProcessorVerifyClientVersion struct { - handler GraphService -} - -func (p *GraphServiceVerifyClientVersionResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 -} - -type graphServiceProcessorHealth struct { - handler GraphService -} - -func (p *GraphServiceHealthResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphServiceProcessorHealth) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphServiceHealthArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphServiceProcessorHealth) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("health", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *graphServiceProcessorHealth) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - var result GraphServiceHealthResult - if retval, err := p.handler.Health(ctx); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing health: " + 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 -} -type GraphServiceAuthenticateArgsBuilder struct { - obj *GraphServiceAuthenticateArgs -} - -func NewGraphServiceAuthenticateArgsBuilder() *GraphServiceAuthenticateArgsBuilder{ - return &GraphServiceAuthenticateArgsBuilder{ - obj: NewGraphServiceAuthenticateArgs(), - } -} - -func (p GraphServiceAuthenticateArgsBuilder) Emit() *GraphServiceAuthenticateArgs{ - return &GraphServiceAuthenticateArgs{ - Username: p.obj.Username, - Password: p.obj.Password, - } -} - -func (g *GraphServiceAuthenticateArgsBuilder) Username(username []byte) *GraphServiceAuthenticateArgsBuilder { - g.obj.Username = username - return g -} - -func (g *GraphServiceAuthenticateArgsBuilder) Password(password []byte) *GraphServiceAuthenticateArgsBuilder { - g.obj.Password = password - return g -} - -func (g *GraphServiceAuthenticateArgs) SetUsername(username []byte) *GraphServiceAuthenticateArgs { - g.Username = username - return g -} - -func (g *GraphServiceAuthenticateArgs) SetPassword(password []byte) *GraphServiceAuthenticateArgs { - g.Password = password - return g -} - -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,optional" 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 -} - -type GraphServiceAuthenticateResultBuilder struct { - obj *GraphServiceAuthenticateResult -} - -func NewGraphServiceAuthenticateResultBuilder() *GraphServiceAuthenticateResultBuilder{ - return &GraphServiceAuthenticateResultBuilder{ - obj: NewGraphServiceAuthenticateResult(), - } -} - -func (p GraphServiceAuthenticateResultBuilder) Emit() *GraphServiceAuthenticateResult{ - return &GraphServiceAuthenticateResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceAuthenticateResultBuilder) Success(success *AuthResponse) *GraphServiceAuthenticateResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceAuthenticateResult) SetSuccess(success *AuthResponse) *GraphServiceAuthenticateResult { - g.Success = success - return g -} - -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 -} -type GraphServiceSignoutArgsBuilder struct { - obj *GraphServiceSignoutArgs -} - -func NewGraphServiceSignoutArgsBuilder() *GraphServiceSignoutArgsBuilder{ - return &GraphServiceSignoutArgsBuilder{ - obj: NewGraphServiceSignoutArgs(), - } -} - -func (p GraphServiceSignoutArgsBuilder) Emit() *GraphServiceSignoutArgs{ - return &GraphServiceSignoutArgs{ - SessionId: p.obj.SessionId, - } -} - -func (g *GraphServiceSignoutArgsBuilder) SessionId(sessionId int64) *GraphServiceSignoutArgsBuilder { - g.obj.SessionId = sessionId - return g -} - -func (g *GraphServiceSignoutArgs) SetSessionId(sessionId int64) *GraphServiceSignoutArgs { - g.SessionId = sessionId - return g -} - -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 -} -type GraphServiceExecuteArgsBuilder struct { - obj *GraphServiceExecuteArgs -} - -func NewGraphServiceExecuteArgsBuilder() *GraphServiceExecuteArgsBuilder{ - return &GraphServiceExecuteArgsBuilder{ - obj: NewGraphServiceExecuteArgs(), - } -} - -func (p GraphServiceExecuteArgsBuilder) Emit() *GraphServiceExecuteArgs{ - return &GraphServiceExecuteArgs{ - SessionId: p.obj.SessionId, - Stmt: p.obj.Stmt, - } -} - -func (g *GraphServiceExecuteArgsBuilder) SessionId(sessionId int64) *GraphServiceExecuteArgsBuilder { - g.obj.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteArgsBuilder) Stmt(stmt []byte) *GraphServiceExecuteArgsBuilder { - g.obj.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteArgs) SetSessionId(sessionId int64) *GraphServiceExecuteArgs { - g.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteArgs) SetStmt(stmt []byte) *GraphServiceExecuteArgs { - g.Stmt = stmt - return g -} - -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,optional" 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 -} - -type GraphServiceExecuteResultBuilder struct { - obj *GraphServiceExecuteResult -} - -func NewGraphServiceExecuteResultBuilder() *GraphServiceExecuteResultBuilder{ - return &GraphServiceExecuteResultBuilder{ - obj: NewGraphServiceExecuteResult(), - } -} - -func (p GraphServiceExecuteResultBuilder) Emit() *GraphServiceExecuteResult{ - return &GraphServiceExecuteResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceExecuteResultBuilder) Success(success *ExecutionResponse) *GraphServiceExecuteResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceExecuteResult) SetSuccess(success *ExecutionResponse) *GraphServiceExecuteResult { - g.Success = success - return g -} - -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 -// - ParameterMap -type GraphServiceExecuteWithParameterArgs struct { - thrift.IRequest - SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` - Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` - ParameterMap map[string]*nebula0.Value `thrift:"parameterMap,3" db:"parameterMap" json:"parameterMap"` -} - -func NewGraphServiceExecuteWithParameterArgs() *GraphServiceExecuteWithParameterArgs { - return &GraphServiceExecuteWithParameterArgs{} -} - - -func (p *GraphServiceExecuteWithParameterArgs) GetSessionId() int64 { - return p.SessionId -} - -func (p *GraphServiceExecuteWithParameterArgs) GetStmt() []byte { - return p.Stmt -} - -func (p *GraphServiceExecuteWithParameterArgs) GetParameterMap() map[string]*nebula0.Value { - return p.ParameterMap -} -type GraphServiceExecuteWithParameterArgsBuilder struct { - obj *GraphServiceExecuteWithParameterArgs -} - -func NewGraphServiceExecuteWithParameterArgsBuilder() *GraphServiceExecuteWithParameterArgsBuilder{ - return &GraphServiceExecuteWithParameterArgsBuilder{ - obj: NewGraphServiceExecuteWithParameterArgs(), - } -} - -func (p GraphServiceExecuteWithParameterArgsBuilder) Emit() *GraphServiceExecuteWithParameterArgs{ - return &GraphServiceExecuteWithParameterArgs{ - SessionId: p.obj.SessionId, - Stmt: p.obj.Stmt, - ParameterMap: p.obj.ParameterMap, - } -} - -func (g *GraphServiceExecuteWithParameterArgsBuilder) SessionId(sessionId int64) *GraphServiceExecuteWithParameterArgsBuilder { - g.obj.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteWithParameterArgsBuilder) Stmt(stmt []byte) *GraphServiceExecuteWithParameterArgsBuilder { - g.obj.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteWithParameterArgsBuilder) ParameterMap(parameterMap map[string]*nebula0.Value) *GraphServiceExecuteWithParameterArgsBuilder { - g.obj.ParameterMap = parameterMap - return g -} - -func (g *GraphServiceExecuteWithParameterArgs) SetSessionId(sessionId int64) *GraphServiceExecuteWithParameterArgs { - g.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteWithParameterArgs) SetStmt(stmt []byte) *GraphServiceExecuteWithParameterArgs { - g.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteWithParameterArgs) SetParameterMap(parameterMap map[string]*nebula0.Value) *GraphServiceExecuteWithParameterArgs { - g.ParameterMap = parameterMap - return g -} - -func (p *GraphServiceExecuteWithParameterArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphServiceExecuteWithParameterArgs) 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 *GraphServiceExecuteWithParameterArgs) 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 *GraphServiceExecuteWithParameterArgs) 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.Value, size) - p.ParameterMap = tMap - for i := 0; i < size; i ++ { - var _key11 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key11 = v - } - _val12 := nebula0.NewValue() - if err := _val12.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val12), err) - } - p.ParameterMap[_key11] = _val12 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *GraphServiceExecuteWithParameterArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("executeWithParameter_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphServiceExecuteWithParameterArgs) 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 *GraphServiceExecuteWithParameterArgs) 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 *GraphServiceExecuteWithParameterArgs) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("parameterMap", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameterMap: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.ParameterMap)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ParameterMap { - 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:parameterMap: ", p), err) } - return err -} - -func (p *GraphServiceExecuteWithParameterArgs) String() string { - if p == nil { - return "" - } - - sessionIdVal := fmt.Sprintf("%v", p.SessionId) - stmtVal := fmt.Sprintf("%v", p.Stmt) - parameterMapVal := fmt.Sprintf("%v", p.ParameterMap) - return fmt.Sprintf("GraphServiceExecuteWithParameterArgs({SessionId:%s Stmt:%s ParameterMap:%s})", sessionIdVal, stmtVal, parameterMapVal) -} - -// Attributes: -// - Success -type GraphServiceExecuteWithParameterResult struct { - thrift.IResponse - Success *ExecutionResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphServiceExecuteWithParameterResult() *GraphServiceExecuteWithParameterResult { - return &GraphServiceExecuteWithParameterResult{} -} - -var GraphServiceExecuteWithParameterResult_Success_DEFAULT *ExecutionResponse -func (p *GraphServiceExecuteWithParameterResult) GetSuccess() *ExecutionResponse { - if !p.IsSetSuccess() { - return GraphServiceExecuteWithParameterResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphServiceExecuteWithParameterResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphServiceExecuteWithParameterResultBuilder struct { - obj *GraphServiceExecuteWithParameterResult -} - -func NewGraphServiceExecuteWithParameterResultBuilder() *GraphServiceExecuteWithParameterResultBuilder{ - return &GraphServiceExecuteWithParameterResultBuilder{ - obj: NewGraphServiceExecuteWithParameterResult(), - } -} - -func (p GraphServiceExecuteWithParameterResultBuilder) Emit() *GraphServiceExecuteWithParameterResult{ - return &GraphServiceExecuteWithParameterResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceExecuteWithParameterResultBuilder) Success(success *ExecutionResponse) *GraphServiceExecuteWithParameterResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceExecuteWithParameterResult) SetSuccess(success *ExecutionResponse) *GraphServiceExecuteWithParameterResult { - g.Success = success - return g -} - -func (p *GraphServiceExecuteWithParameterResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphServiceExecuteWithParameterResult) 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 *GraphServiceExecuteWithParameterResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("executeWithParameter_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphServiceExecuteWithParameterResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphServiceExecuteWithParameterResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphServiceExecuteWithParameterResult({Success:%s})", successVal) -} - -// Attributes: -// - SessionId -// - Stmt -// - ParameterMap -// - Timeout -type GraphServiceExecuteWithTimeoutArgs struct { - thrift.IRequest - SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` - Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` - ParameterMap map[string]*nebula0.Value `thrift:"parameterMap,3" db:"parameterMap" json:"parameterMap"` - Timeout int64 `thrift:"timeout,4" db:"timeout" json:"timeout"` -} - -func NewGraphServiceExecuteWithTimeoutArgs() *GraphServiceExecuteWithTimeoutArgs { - return &GraphServiceExecuteWithTimeoutArgs{} -} - - -func (p *GraphServiceExecuteWithTimeoutArgs) GetSessionId() int64 { - return p.SessionId -} - -func (p *GraphServiceExecuteWithTimeoutArgs) GetStmt() []byte { - return p.Stmt -} - -func (p *GraphServiceExecuteWithTimeoutArgs) GetParameterMap() map[string]*nebula0.Value { - return p.ParameterMap -} - -func (p *GraphServiceExecuteWithTimeoutArgs) GetTimeout() int64 { - return p.Timeout -} -type GraphServiceExecuteWithTimeoutArgsBuilder struct { - obj *GraphServiceExecuteWithTimeoutArgs -} - -func NewGraphServiceExecuteWithTimeoutArgsBuilder() *GraphServiceExecuteWithTimeoutArgsBuilder{ - return &GraphServiceExecuteWithTimeoutArgsBuilder{ - obj: NewGraphServiceExecuteWithTimeoutArgs(), - } -} - -func (p GraphServiceExecuteWithTimeoutArgsBuilder) Emit() *GraphServiceExecuteWithTimeoutArgs{ - return &GraphServiceExecuteWithTimeoutArgs{ - SessionId: p.obj.SessionId, - Stmt: p.obj.Stmt, - ParameterMap: p.obj.ParameterMap, - Timeout: p.obj.Timeout, - } -} - -func (g *GraphServiceExecuteWithTimeoutArgsBuilder) SessionId(sessionId int64) *GraphServiceExecuteWithTimeoutArgsBuilder { - g.obj.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteWithTimeoutArgsBuilder) Stmt(stmt []byte) *GraphServiceExecuteWithTimeoutArgsBuilder { - g.obj.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteWithTimeoutArgsBuilder) ParameterMap(parameterMap map[string]*nebula0.Value) *GraphServiceExecuteWithTimeoutArgsBuilder { - g.obj.ParameterMap = parameterMap - return g -} - -func (g *GraphServiceExecuteWithTimeoutArgsBuilder) Timeout(timeout int64) *GraphServiceExecuteWithTimeoutArgsBuilder { - g.obj.Timeout = timeout - return g -} - -func (g *GraphServiceExecuteWithTimeoutArgs) SetSessionId(sessionId int64) *GraphServiceExecuteWithTimeoutArgs { - g.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteWithTimeoutArgs) SetStmt(stmt []byte) *GraphServiceExecuteWithTimeoutArgs { - g.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteWithTimeoutArgs) SetParameterMap(parameterMap map[string]*nebula0.Value) *GraphServiceExecuteWithTimeoutArgs { - g.ParameterMap = parameterMap - return g -} - -func (g *GraphServiceExecuteWithTimeoutArgs) SetTimeout(timeout int64) *GraphServiceExecuteWithTimeoutArgs { - g.Timeout = timeout - return g -} - -func (p *GraphServiceExecuteWithTimeoutArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - 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 *GraphServiceExecuteWithTimeoutArgs) 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 *GraphServiceExecuteWithTimeoutArgs) 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 *GraphServiceExecuteWithTimeoutArgs) 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.Value, size) - p.ParameterMap = 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 := nebula0.NewValue() - if err := _val14.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val14), err) - } - p.ParameterMap[_key13] = _val14 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *GraphServiceExecuteWithTimeoutArgs) ReadField4(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.Timeout = v - } - return nil -} - -func (p *GraphServiceExecuteWithTimeoutArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("executeWithTimeout_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *GraphServiceExecuteWithTimeoutArgs) 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 *GraphServiceExecuteWithTimeoutArgs) 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 *GraphServiceExecuteWithTimeoutArgs) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("parameterMap", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameterMap: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.ParameterMap)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ParameterMap { - 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:parameterMap: ", p), err) } - return err -} - -func (p *GraphServiceExecuteWithTimeoutArgs) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("timeout", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:timeout: ", p), err) } - if err := oprot.WriteI64(int64(p.Timeout)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.timeout (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:timeout: ", p), err) } - return err -} - -func (p *GraphServiceExecuteWithTimeoutArgs) String() string { - if p == nil { - return "" - } - - sessionIdVal := fmt.Sprintf("%v", p.SessionId) - stmtVal := fmt.Sprintf("%v", p.Stmt) - parameterMapVal := fmt.Sprintf("%v", p.ParameterMap) - timeoutVal := fmt.Sprintf("%v", p.Timeout) - return fmt.Sprintf("GraphServiceExecuteWithTimeoutArgs({SessionId:%s Stmt:%s ParameterMap:%s Timeout:%s})", sessionIdVal, stmtVal, parameterMapVal, timeoutVal) -} - -// Attributes: -// - Success -type GraphServiceExecuteWithTimeoutResult struct { - thrift.IResponse - Success *ExecutionResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphServiceExecuteWithTimeoutResult() *GraphServiceExecuteWithTimeoutResult { - return &GraphServiceExecuteWithTimeoutResult{} -} - -var GraphServiceExecuteWithTimeoutResult_Success_DEFAULT *ExecutionResponse -func (p *GraphServiceExecuteWithTimeoutResult) GetSuccess() *ExecutionResponse { - if !p.IsSetSuccess() { - return GraphServiceExecuteWithTimeoutResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphServiceExecuteWithTimeoutResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphServiceExecuteWithTimeoutResultBuilder struct { - obj *GraphServiceExecuteWithTimeoutResult -} - -func NewGraphServiceExecuteWithTimeoutResultBuilder() *GraphServiceExecuteWithTimeoutResultBuilder{ - return &GraphServiceExecuteWithTimeoutResultBuilder{ - obj: NewGraphServiceExecuteWithTimeoutResult(), - } -} - -func (p GraphServiceExecuteWithTimeoutResultBuilder) Emit() *GraphServiceExecuteWithTimeoutResult{ - return &GraphServiceExecuteWithTimeoutResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceExecuteWithTimeoutResultBuilder) Success(success *ExecutionResponse) *GraphServiceExecuteWithTimeoutResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceExecuteWithTimeoutResult) SetSuccess(success *ExecutionResponse) *GraphServiceExecuteWithTimeoutResult { - g.Success = success - return g -} - -func (p *GraphServiceExecuteWithTimeoutResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphServiceExecuteWithTimeoutResult) 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 *GraphServiceExecuteWithTimeoutResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("executeWithTimeout_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphServiceExecuteWithTimeoutResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphServiceExecuteWithTimeoutResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphServiceExecuteWithTimeoutResult({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 -} -type GraphServiceExecuteJsonArgsBuilder struct { - obj *GraphServiceExecuteJsonArgs -} - -func NewGraphServiceExecuteJsonArgsBuilder() *GraphServiceExecuteJsonArgsBuilder{ - return &GraphServiceExecuteJsonArgsBuilder{ - obj: NewGraphServiceExecuteJsonArgs(), - } -} - -func (p GraphServiceExecuteJsonArgsBuilder) Emit() *GraphServiceExecuteJsonArgs{ - return &GraphServiceExecuteJsonArgs{ - SessionId: p.obj.SessionId, - Stmt: p.obj.Stmt, - } -} - -func (g *GraphServiceExecuteJsonArgsBuilder) SessionId(sessionId int64) *GraphServiceExecuteJsonArgsBuilder { - g.obj.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteJsonArgsBuilder) Stmt(stmt []byte) *GraphServiceExecuteJsonArgsBuilder { - g.obj.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteJsonArgs) SetSessionId(sessionId int64) *GraphServiceExecuteJsonArgs { - g.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteJsonArgs) SetStmt(stmt []byte) *GraphServiceExecuteJsonArgs { - g.Stmt = stmt - return g -} - -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,optional" 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 -} - -type GraphServiceExecuteJsonResultBuilder struct { - obj *GraphServiceExecuteJsonResult -} - -func NewGraphServiceExecuteJsonResultBuilder() *GraphServiceExecuteJsonResultBuilder{ - return &GraphServiceExecuteJsonResultBuilder{ - obj: NewGraphServiceExecuteJsonResult(), - } -} - -func (p GraphServiceExecuteJsonResultBuilder) Emit() *GraphServiceExecuteJsonResult{ - return &GraphServiceExecuteJsonResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceExecuteJsonResultBuilder) Success(success []byte) *GraphServiceExecuteJsonResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceExecuteJsonResult) SetSuccess(success []byte) *GraphServiceExecuteJsonResult { - g.Success = success - return g -} - -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: -// - SessionId -// - Stmt -// - ParameterMap -type GraphServiceExecuteJsonWithParameterArgs struct { - thrift.IRequest - SessionId int64 `thrift:"sessionId,1" db:"sessionId" json:"sessionId"` - Stmt []byte `thrift:"stmt,2" db:"stmt" json:"stmt"` - ParameterMap map[string]*nebula0.Value `thrift:"parameterMap,3" db:"parameterMap" json:"parameterMap"` -} - -func NewGraphServiceExecuteJsonWithParameterArgs() *GraphServiceExecuteJsonWithParameterArgs { - return &GraphServiceExecuteJsonWithParameterArgs{} -} - - -func (p *GraphServiceExecuteJsonWithParameterArgs) GetSessionId() int64 { - return p.SessionId -} - -func (p *GraphServiceExecuteJsonWithParameterArgs) GetStmt() []byte { - return p.Stmt -} - -func (p *GraphServiceExecuteJsonWithParameterArgs) GetParameterMap() map[string]*nebula0.Value { - return p.ParameterMap -} -type GraphServiceExecuteJsonWithParameterArgsBuilder struct { - obj *GraphServiceExecuteJsonWithParameterArgs -} - -func NewGraphServiceExecuteJsonWithParameterArgsBuilder() *GraphServiceExecuteJsonWithParameterArgsBuilder{ - return &GraphServiceExecuteJsonWithParameterArgsBuilder{ - obj: NewGraphServiceExecuteJsonWithParameterArgs(), - } -} - -func (p GraphServiceExecuteJsonWithParameterArgsBuilder) Emit() *GraphServiceExecuteJsonWithParameterArgs{ - return &GraphServiceExecuteJsonWithParameterArgs{ - SessionId: p.obj.SessionId, - Stmt: p.obj.Stmt, - ParameterMap: p.obj.ParameterMap, - } -} - -func (g *GraphServiceExecuteJsonWithParameterArgsBuilder) SessionId(sessionId int64) *GraphServiceExecuteJsonWithParameterArgsBuilder { - g.obj.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteJsonWithParameterArgsBuilder) Stmt(stmt []byte) *GraphServiceExecuteJsonWithParameterArgsBuilder { - g.obj.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteJsonWithParameterArgsBuilder) ParameterMap(parameterMap map[string]*nebula0.Value) *GraphServiceExecuteJsonWithParameterArgsBuilder { - g.obj.ParameterMap = parameterMap - return g -} - -func (g *GraphServiceExecuteJsonWithParameterArgs) SetSessionId(sessionId int64) *GraphServiceExecuteJsonWithParameterArgs { - g.SessionId = sessionId - return g -} - -func (g *GraphServiceExecuteJsonWithParameterArgs) SetStmt(stmt []byte) *GraphServiceExecuteJsonWithParameterArgs { - g.Stmt = stmt - return g -} - -func (g *GraphServiceExecuteJsonWithParameterArgs) SetParameterMap(parameterMap map[string]*nebula0.Value) *GraphServiceExecuteJsonWithParameterArgs { - g.ParameterMap = parameterMap - return g -} - -func (p *GraphServiceExecuteJsonWithParameterArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphServiceExecuteJsonWithParameterArgs) 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 *GraphServiceExecuteJsonWithParameterArgs) 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 *GraphServiceExecuteJsonWithParameterArgs) 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.Value, size) - p.ParameterMap = 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 := nebula0.NewValue() - if err := _val16.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val16), err) - } - p.ParameterMap[_key15] = _val16 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *GraphServiceExecuteJsonWithParameterArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("executeJsonWithParameter_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphServiceExecuteJsonWithParameterArgs) 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 *GraphServiceExecuteJsonWithParameterArgs) 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 *GraphServiceExecuteJsonWithParameterArgs) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("parameterMap", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parameterMap: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.ParameterMap)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ParameterMap { - 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:parameterMap: ", p), err) } - return err -} - -func (p *GraphServiceExecuteJsonWithParameterArgs) String() string { - if p == nil { - return "" - } - - sessionIdVal := fmt.Sprintf("%v", p.SessionId) - stmtVal := fmt.Sprintf("%v", p.Stmt) - parameterMapVal := fmt.Sprintf("%v", p.ParameterMap) - return fmt.Sprintf("GraphServiceExecuteJsonWithParameterArgs({SessionId:%s Stmt:%s ParameterMap:%s})", sessionIdVal, stmtVal, parameterMapVal) -} - -// Attributes: -// - Success -type GraphServiceExecuteJsonWithParameterResult struct { - thrift.IResponse - Success []byte `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphServiceExecuteJsonWithParameterResult() *GraphServiceExecuteJsonWithParameterResult { - return &GraphServiceExecuteJsonWithParameterResult{} -} - -var GraphServiceExecuteJsonWithParameterResult_Success_DEFAULT []byte - -func (p *GraphServiceExecuteJsonWithParameterResult) GetSuccess() []byte { - return p.Success -} -func (p *GraphServiceExecuteJsonWithParameterResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphServiceExecuteJsonWithParameterResultBuilder struct { - obj *GraphServiceExecuteJsonWithParameterResult -} - -func NewGraphServiceExecuteJsonWithParameterResultBuilder() *GraphServiceExecuteJsonWithParameterResultBuilder{ - return &GraphServiceExecuteJsonWithParameterResultBuilder{ - obj: NewGraphServiceExecuteJsonWithParameterResult(), - } -} - -func (p GraphServiceExecuteJsonWithParameterResultBuilder) Emit() *GraphServiceExecuteJsonWithParameterResult{ - return &GraphServiceExecuteJsonWithParameterResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceExecuteJsonWithParameterResultBuilder) Success(success []byte) *GraphServiceExecuteJsonWithParameterResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceExecuteJsonWithParameterResult) SetSuccess(success []byte) *GraphServiceExecuteJsonWithParameterResult { - g.Success = success - return g -} - -func (p *GraphServiceExecuteJsonWithParameterResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphServiceExecuteJsonWithParameterResult) 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 *GraphServiceExecuteJsonWithParameterResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("executeJsonWithParameter_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphServiceExecuteJsonWithParameterResult) 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 *GraphServiceExecuteJsonWithParameterResult) String() string { - if p == nil { - return "" - } - - successVal := fmt.Sprintf("%v", p.Success) - return fmt.Sprintf("GraphServiceExecuteJsonWithParameterResult({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 -} - -type GraphServiceVerifyClientVersionArgsBuilder struct { - obj *GraphServiceVerifyClientVersionArgs -} - -func NewGraphServiceVerifyClientVersionArgsBuilder() *GraphServiceVerifyClientVersionArgsBuilder{ - return &GraphServiceVerifyClientVersionArgsBuilder{ - obj: NewGraphServiceVerifyClientVersionArgs(), - } -} - -func (p GraphServiceVerifyClientVersionArgsBuilder) Emit() *GraphServiceVerifyClientVersionArgs{ - return &GraphServiceVerifyClientVersionArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphServiceVerifyClientVersionArgsBuilder) Req(req *VerifyClientVersionReq) *GraphServiceVerifyClientVersionArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphServiceVerifyClientVersionArgs) SetReq(req *VerifyClientVersionReq) *GraphServiceVerifyClientVersionArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphServiceVerifyClientVersionResultBuilder struct { - obj *GraphServiceVerifyClientVersionResult -} - -func NewGraphServiceVerifyClientVersionResultBuilder() *GraphServiceVerifyClientVersionResultBuilder{ - return &GraphServiceVerifyClientVersionResultBuilder{ - obj: NewGraphServiceVerifyClientVersionResult(), - } -} - -func (p GraphServiceVerifyClientVersionResultBuilder) Emit() *GraphServiceVerifyClientVersionResult{ - return &GraphServiceVerifyClientVersionResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceVerifyClientVersionResultBuilder) Success(success *VerifyClientVersionResp) *GraphServiceVerifyClientVersionResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceVerifyClientVersionResult) SetSuccess(success *VerifyClientVersionResp) *GraphServiceVerifyClientVersionResult { - g.Success = success - return g -} - -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) -} - -type GraphServiceHealthArgs struct { - thrift.IRequest -} - -func NewGraphServiceHealthArgs() *GraphServiceHealthArgs { - return &GraphServiceHealthArgs{} -} - -type GraphServiceHealthArgsBuilder struct { - obj *GraphServiceHealthArgs -} - -func NewGraphServiceHealthArgsBuilder() *GraphServiceHealthArgsBuilder{ - return &GraphServiceHealthArgsBuilder{ - obj: NewGraphServiceHealthArgs(), - } -} - -func (p GraphServiceHealthArgsBuilder) Emit() *GraphServiceHealthArgs{ - return &GraphServiceHealthArgs{ - } -} - -func (p *GraphServiceHealthArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, 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 *GraphServiceHealthArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("health_args"); 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 *GraphServiceHealthArgs) String() string { - if p == nil { - return "" - } - - return fmt.Sprintf("GraphServiceHealthArgs({})") -} - -// Attributes: -// - Success -type GraphServiceHealthResult struct { - thrift.IResponse - Success *HealthResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphServiceHealthResult() *GraphServiceHealthResult { - return &GraphServiceHealthResult{} -} - -var GraphServiceHealthResult_Success_DEFAULT *HealthResp -func (p *GraphServiceHealthResult) GetSuccess() *HealthResp { - if !p.IsSetSuccess() { - return GraphServiceHealthResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphServiceHealthResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphServiceHealthResultBuilder struct { - obj *GraphServiceHealthResult -} - -func NewGraphServiceHealthResultBuilder() *GraphServiceHealthResultBuilder{ - return &GraphServiceHealthResultBuilder{ - obj: NewGraphServiceHealthResult(), - } -} - -func (p GraphServiceHealthResultBuilder) Emit() *GraphServiceHealthResult{ - return &GraphServiceHealthResult{ - Success: p.obj.Success, - } -} - -func (g *GraphServiceHealthResultBuilder) Success(success *HealthResp) *GraphServiceHealthResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphServiceHealthResult) SetSuccess(success *HealthResp) *GraphServiceHealthResult { - g.Success = success - return g -} - -func (p *GraphServiceHealthResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphServiceHealthResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewHealthResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *GraphServiceHealthResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("health_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphServiceHealthResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphServiceHealthResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphServiceHealthResult({Success:%s})", successVal) -} - - diff --git a/nebula/graph/ttypes.go b/nebula/graph/ttypes.go deleted file mode 100644 index 14ad6f8c..00000000 --- a/nebula/graph/ttypes.go +++ /dev/null @@ -1,2570 +0,0 @@ -// 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/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - -) - -// (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,optional" 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 -} - -type ProfilingStatsBuilder struct { - obj *ProfilingStats -} - -func NewProfilingStatsBuilder() *ProfilingStatsBuilder{ - return &ProfilingStatsBuilder{ - obj: NewProfilingStats(), - } -} - -func (p ProfilingStatsBuilder) Emit() *ProfilingStats{ - return &ProfilingStats{ - Rows: p.obj.Rows, - ExecDurationInUs: p.obj.ExecDurationInUs, - TotalDurationInUs: p.obj.TotalDurationInUs, - OtherStats: p.obj.OtherStats, - } -} - -func (p *ProfilingStatsBuilder) Rows(rows int64) *ProfilingStatsBuilder { - p.obj.Rows = rows - return p -} - -func (p *ProfilingStatsBuilder) ExecDurationInUs(execDurationInUs int64) *ProfilingStatsBuilder { - p.obj.ExecDurationInUs = execDurationInUs - return p -} - -func (p *ProfilingStatsBuilder) TotalDurationInUs(totalDurationInUs int64) *ProfilingStatsBuilder { - p.obj.TotalDurationInUs = totalDurationInUs - return p -} - -func (p *ProfilingStatsBuilder) OtherStats(otherStats map[string][]byte) *ProfilingStatsBuilder { - p.obj.OtherStats = otherStats - return p -} - -func (p *ProfilingStats) SetRows(rows int64) *ProfilingStats { - p.Rows = rows - return p -} - -func (p *ProfilingStats) SetExecDurationInUs(execDurationInUs int64) *ProfilingStats { - p.ExecDurationInUs = execDurationInUs - return p -} - -func (p *ProfilingStats) SetTotalDurationInUs(totalDurationInUs int64) *ProfilingStats { - p.TotalDurationInUs = totalDurationInUs - return p -} - -func (p *ProfilingStats) SetOtherStats(otherStats map[string][]byte) *ProfilingStats { - p.OtherStats = otherStats - return p -} - -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 -} -type PlanNodeBranchInfoBuilder struct { - obj *PlanNodeBranchInfo -} - -func NewPlanNodeBranchInfoBuilder() *PlanNodeBranchInfoBuilder{ - return &PlanNodeBranchInfoBuilder{ - obj: NewPlanNodeBranchInfo(), - } -} - -func (p PlanNodeBranchInfoBuilder) Emit() *PlanNodeBranchInfo{ - return &PlanNodeBranchInfo{ - IsDoBranch: p.obj.IsDoBranch, - ConditionNodeID: p.obj.ConditionNodeID, - } -} - -func (p *PlanNodeBranchInfoBuilder) IsDoBranch(isDoBranch bool) *PlanNodeBranchInfoBuilder { - p.obj.IsDoBranch = isDoBranch - return p -} - -func (p *PlanNodeBranchInfoBuilder) ConditionNodeID(conditionNodeID int64) *PlanNodeBranchInfoBuilder { - p.obj.ConditionNodeID = conditionNodeID - return p -} - -func (p *PlanNodeBranchInfo) SetIsDoBranch(isDoBranch bool) *PlanNodeBranchInfo { - p.IsDoBranch = isDoBranch - return p -} - -func (p *PlanNodeBranchInfo) SetConditionNodeID(conditionNodeID int64) *PlanNodeBranchInfo { - p.ConditionNodeID = conditionNodeID - return p -} - -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 -} -type PairBuilder struct { - obj *Pair -} - -func NewPairBuilder() *PairBuilder{ - return &PairBuilder{ - obj: NewPair(), - } -} - -func (p PairBuilder) Emit() *Pair{ - return &Pair{ - Key: p.obj.Key, - Value: p.obj.Value, - } -} - -func (p *PairBuilder) Key(key []byte) *PairBuilder { - p.obj.Key = key - return p -} - -func (p *PairBuilder) Value(value []byte) *PairBuilder { - p.obj.Value = value - return p -} - -func (p *Pair) SetKey(key []byte) *Pair { - p.Key = key - return p -} - -func (p *Pair) SetValue(value []byte) *Pair { - p.Value = value - return p -} - -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,optional" db:"description" json:"description,omitempty"` - Profiles []*ProfilingStats `thrift:"profiles,5,optional" db:"profiles" json:"profiles,omitempty"` - BranchInfo *PlanNodeBranchInfo `thrift:"branch_info,6,optional" db:"branch_info" json:"branch_info,omitempty"` - Dependencies []int64 `thrift:"dependencies,7,optional" 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 -} - -type PlanNodeDescriptionBuilder struct { - obj *PlanNodeDescription -} - -func NewPlanNodeDescriptionBuilder() *PlanNodeDescriptionBuilder{ - return &PlanNodeDescriptionBuilder{ - obj: NewPlanNodeDescription(), - } -} - -func (p PlanNodeDescriptionBuilder) Emit() *PlanNodeDescription{ - return &PlanNodeDescription{ - Name: p.obj.Name, - Id: p.obj.Id, - OutputVar: p.obj.OutputVar, - Description: p.obj.Description, - Profiles: p.obj.Profiles, - BranchInfo: p.obj.BranchInfo, - Dependencies: p.obj.Dependencies, - } -} - -func (p *PlanNodeDescriptionBuilder) Name(name []byte) *PlanNodeDescriptionBuilder { - p.obj.Name = name - return p -} - -func (p *PlanNodeDescriptionBuilder) Id(id int64) *PlanNodeDescriptionBuilder { - p.obj.Id = id - return p -} - -func (p *PlanNodeDescriptionBuilder) OutputVar(outputVar []byte) *PlanNodeDescriptionBuilder { - p.obj.OutputVar = outputVar - return p -} - -func (p *PlanNodeDescriptionBuilder) Description(description []*Pair) *PlanNodeDescriptionBuilder { - p.obj.Description = description - return p -} - -func (p *PlanNodeDescriptionBuilder) Profiles(profiles []*ProfilingStats) *PlanNodeDescriptionBuilder { - p.obj.Profiles = profiles - return p -} - -func (p *PlanNodeDescriptionBuilder) BranchInfo(branchInfo *PlanNodeBranchInfo) *PlanNodeDescriptionBuilder { - p.obj.BranchInfo = branchInfo - return p -} - -func (p *PlanNodeDescriptionBuilder) Dependencies(dependencies []int64) *PlanNodeDescriptionBuilder { - p.obj.Dependencies = dependencies - return p -} - -func (p *PlanNodeDescription) SetName(name []byte) *PlanNodeDescription { - p.Name = name - return p -} - -func (p *PlanNodeDescription) SetId(id int64) *PlanNodeDescription { - p.Id = id - return p -} - -func (p *PlanNodeDescription) SetOutputVar(outputVar []byte) *PlanNodeDescription { - p.OutputVar = outputVar - return p -} - -func (p *PlanNodeDescription) SetDescription(description []*Pair) *PlanNodeDescription { - p.Description = description - return p -} - -func (p *PlanNodeDescription) SetProfiles(profiles []*ProfilingStats) *PlanNodeDescription { - p.Profiles = profiles - return p -} - -func (p *PlanNodeDescription) SetBranchInfo(branchInfo *PlanNodeBranchInfo) *PlanNodeDescription { - p.BranchInfo = branchInfo - return p -} - -func (p *PlanNodeDescription) SetDependencies(dependencies []int64) *PlanNodeDescription { - p.Dependencies = dependencies - return p -} - -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 -} -type PlanDescriptionBuilder struct { - obj *PlanDescription -} - -func NewPlanDescriptionBuilder() *PlanDescriptionBuilder{ - return &PlanDescriptionBuilder{ - obj: NewPlanDescription(), - } -} - -func (p PlanDescriptionBuilder) Emit() *PlanDescription{ - return &PlanDescription{ - PlanNodeDescs: p.obj.PlanNodeDescs, - NodeIndexMap: p.obj.NodeIndexMap, - Format: p.obj.Format, - OptimizeTimeInUs: p.obj.OptimizeTimeInUs, - } -} - -func (p *PlanDescriptionBuilder) PlanNodeDescs(planNodeDescs []*PlanNodeDescription) *PlanDescriptionBuilder { - p.obj.PlanNodeDescs = planNodeDescs - return p -} - -func (p *PlanDescriptionBuilder) NodeIndexMap(nodeIndexMap map[int64]int64) *PlanDescriptionBuilder { - p.obj.NodeIndexMap = nodeIndexMap - return p -} - -func (p *PlanDescriptionBuilder) Format(format []byte) *PlanDescriptionBuilder { - p.obj.Format = format - return p -} - -func (p *PlanDescriptionBuilder) OptimizeTimeInUs(optimizeTimeInUs int32) *PlanDescriptionBuilder { - p.obj.OptimizeTimeInUs = optimizeTimeInUs - return p -} - -func (p *PlanDescription) SetPlanNodeDescs(planNodeDescs []*PlanNodeDescription) *PlanDescription { - p.PlanNodeDescs = planNodeDescs - return p -} - -func (p *PlanDescription) SetNodeIndexMap(nodeIndexMap map[int64]int64) *PlanDescription { - p.NodeIndexMap = nodeIndexMap - return p -} - -func (p *PlanDescription) SetFormat(format []byte) *PlanDescription { - p.Format = format - return p -} - -func (p *PlanDescription) SetOptimizeTimeInUs(optimizeTimeInUs int32) *PlanDescription { - p.OptimizeTimeInUs = optimizeTimeInUs - return p -} - -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 int64 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` - Data *nebula0.DataSet `thrift:"data,3,optional" db:"data" json:"data,omitempty"` - SpaceName []byte `thrift:"space_name,4,optional" db:"space_name" json:"space_name,omitempty"` - ErrorMsg []byte `thrift:"error_msg,5,optional" db:"error_msg" json:"error_msg,omitempty"` - PlanDesc *PlanDescription `thrift:"plan_desc,6,optional" db:"plan_desc" json:"plan_desc,omitempty"` - Comment []byte `thrift:"comment,7,optional" db:"comment" json:"comment,omitempty"` -} - -func NewExecutionResponse() *ExecutionResponse { - return &ExecutionResponse{} -} - - -func (p *ExecutionResponse) GetErrorCode() nebula0.ErrorCode { - return p.ErrorCode -} - -func (p *ExecutionResponse) GetLatencyInUs() int64 { - 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 -} - -type ExecutionResponseBuilder struct { - obj *ExecutionResponse -} - -func NewExecutionResponseBuilder() *ExecutionResponseBuilder{ - return &ExecutionResponseBuilder{ - obj: NewExecutionResponse(), - } -} - -func (p ExecutionResponseBuilder) Emit() *ExecutionResponse{ - return &ExecutionResponse{ - ErrorCode: p.obj.ErrorCode, - LatencyInUs: p.obj.LatencyInUs, - Data: p.obj.Data, - SpaceName: p.obj.SpaceName, - ErrorMsg: p.obj.ErrorMsg, - PlanDesc: p.obj.PlanDesc, - Comment: p.obj.Comment, - } -} - -func (e *ExecutionResponseBuilder) ErrorCode(errorCode nebula0.ErrorCode) *ExecutionResponseBuilder { - e.obj.ErrorCode = errorCode - return e -} - -func (e *ExecutionResponseBuilder) LatencyInUs(latencyInUs int64) *ExecutionResponseBuilder { - e.obj.LatencyInUs = latencyInUs - return e -} - -func (e *ExecutionResponseBuilder) Data(data *nebula0.DataSet) *ExecutionResponseBuilder { - e.obj.Data = data - return e -} - -func (e *ExecutionResponseBuilder) SpaceName(spaceName []byte) *ExecutionResponseBuilder { - e.obj.SpaceName = spaceName - return e -} - -func (e *ExecutionResponseBuilder) ErrorMsg(errorMsg []byte) *ExecutionResponseBuilder { - e.obj.ErrorMsg = errorMsg - return e -} - -func (e *ExecutionResponseBuilder) PlanDesc(planDesc *PlanDescription) *ExecutionResponseBuilder { - e.obj.PlanDesc = planDesc - return e -} - -func (e *ExecutionResponseBuilder) Comment(comment []byte) *ExecutionResponseBuilder { - e.obj.Comment = comment - return e -} - -func (e *ExecutionResponse) SetErrorCode(errorCode nebula0.ErrorCode) *ExecutionResponse { - e.ErrorCode = errorCode - return e -} - -func (e *ExecutionResponse) SetLatencyInUs(latencyInUs int64) *ExecutionResponse { - e.LatencyInUs = latencyInUs - return e -} - -func (e *ExecutionResponse) SetData(data *nebula0.DataSet) *ExecutionResponse { - e.Data = data - return e -} - -func (e *ExecutionResponse) SetSpaceName(spaceName []byte) *ExecutionResponse { - e.SpaceName = spaceName - return e -} - -func (e *ExecutionResponse) SetErrorMsg(errorMsg []byte) *ExecutionResponse { - e.ErrorMsg = errorMsg - return e -} - -func (e *ExecutionResponse) SetPlanDesc(planDesc *PlanDescription) *ExecutionResponse { - e.PlanDesc = planDesc - return e -} - -func (e *ExecutionResponse) SetComment(comment []byte) *ExecutionResponse { - e.Comment = comment - return e -} - -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.ReadI64(); 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.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } - if err := oprot.WriteI64(int64(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,optional" db:"error_msg" json:"error_msg,omitempty"` - SessionID *int64 `thrift:"session_id,3,optional" db:"session_id" json:"session_id,omitempty"` - TimeZoneOffsetSeconds *int32 `thrift:"time_zone_offset_seconds,4,optional" db:"time_zone_offset_seconds" json:"time_zone_offset_seconds,omitempty"` - TimeZoneName []byte `thrift:"time_zone_name,5,optional" 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 -} - -type AuthResponseBuilder struct { - obj *AuthResponse -} - -func NewAuthResponseBuilder() *AuthResponseBuilder{ - return &AuthResponseBuilder{ - obj: NewAuthResponse(), - } -} - -func (p AuthResponseBuilder) Emit() *AuthResponse{ - return &AuthResponse{ - ErrorCode: p.obj.ErrorCode, - ErrorMsg: p.obj.ErrorMsg, - SessionID: p.obj.SessionID, - TimeZoneOffsetSeconds: p.obj.TimeZoneOffsetSeconds, - TimeZoneName: p.obj.TimeZoneName, - } -} - -func (a *AuthResponseBuilder) ErrorCode(errorCode nebula0.ErrorCode) *AuthResponseBuilder { - a.obj.ErrorCode = errorCode - return a -} - -func (a *AuthResponseBuilder) ErrorMsg(errorMsg []byte) *AuthResponseBuilder { - a.obj.ErrorMsg = errorMsg - return a -} - -func (a *AuthResponseBuilder) SessionID(sessionID *int64) *AuthResponseBuilder { - a.obj.SessionID = sessionID - return a -} - -func (a *AuthResponseBuilder) TimeZoneOffsetSeconds(timeZoneOffsetSeconds *int32) *AuthResponseBuilder { - a.obj.TimeZoneOffsetSeconds = timeZoneOffsetSeconds - return a -} - -func (a *AuthResponseBuilder) TimeZoneName(timeZoneName []byte) *AuthResponseBuilder { - a.obj.TimeZoneName = timeZoneName - return a -} - -func (a *AuthResponse) SetErrorCode(errorCode nebula0.ErrorCode) *AuthResponse { - a.ErrorCode = errorCode - return a -} - -func (a *AuthResponse) SetErrorMsg(errorMsg []byte) *AuthResponse { - a.ErrorMsg = errorMsg - return a -} - -func (a *AuthResponse) SetSessionID(sessionID *int64) *AuthResponse { - a.SessionID = sessionID - return a -} - -func (a *AuthResponse) SetTimeZoneOffsetSeconds(timeZoneOffsetSeconds *int32) *AuthResponse { - a.TimeZoneOffsetSeconds = timeZoneOffsetSeconds - return a -} - -func (a *AuthResponse) SetTimeZoneName(timeZoneName []byte) *AuthResponse { - a.TimeZoneName = timeZoneName - return a -} - -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,optional" 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 -} - -type VerifyClientVersionRespBuilder struct { - obj *VerifyClientVersionResp -} - -func NewVerifyClientVersionRespBuilder() *VerifyClientVersionRespBuilder{ - return &VerifyClientVersionRespBuilder{ - obj: NewVerifyClientVersionResp(), - } -} - -func (p VerifyClientVersionRespBuilder) Emit() *VerifyClientVersionResp{ - return &VerifyClientVersionResp{ - ErrorCode: p.obj.ErrorCode, - ErrorMsg: p.obj.ErrorMsg, - } -} - -func (v *VerifyClientVersionRespBuilder) ErrorCode(errorCode nebula0.ErrorCode) *VerifyClientVersionRespBuilder { - v.obj.ErrorCode = errorCode - return v -} - -func (v *VerifyClientVersionRespBuilder) ErrorMsg(errorMsg []byte) *VerifyClientVersionRespBuilder { - v.obj.ErrorMsg = errorMsg - return v -} - -func (v *VerifyClientVersionResp) SetErrorCode(errorCode nebula0.ErrorCode) *VerifyClientVersionResp { - v.ErrorCode = errorCode - return v -} - -func (v *VerifyClientVersionResp) SetErrorMsg(errorMsg []byte) *VerifyClientVersionResp { - v.ErrorMsg = errorMsg - return v -} - -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("3.0.0"), - } -} - - -func (p *VerifyClientVersionReq) GetVersion() []byte { - return p.Version -} -type VerifyClientVersionReqBuilder struct { - obj *VerifyClientVersionReq -} - -func NewVerifyClientVersionReqBuilder() *VerifyClientVersionReqBuilder{ - return &VerifyClientVersionReqBuilder{ - obj: NewVerifyClientVersionReq(), - } -} - -func (p VerifyClientVersionReqBuilder) Emit() *VerifyClientVersionReq{ - return &VerifyClientVersionReq{ - Version: p.obj.Version, - } -} - -func (v *VerifyClientVersionReqBuilder) Version(version []byte) *VerifyClientVersionReqBuilder { - v.obj.Version = version - return v -} - -func (v *VerifyClientVersionReq) SetVersion(version []byte) *VerifyClientVersionReq { - v.Version = version - return v -} - -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) -} - -// Attributes: -// - ErrorCode -type HealthResp struct { - ErrorCode int64 `thrift:"error_code,1,required" db:"error_code" json:"error_code"` -} - -func NewHealthResp() *HealthResp { - return &HealthResp{} -} - - -func (p *HealthResp) GetErrorCode() int64 { - return p.ErrorCode -} -type HealthRespBuilder struct { - obj *HealthResp -} - -func NewHealthRespBuilder() *HealthRespBuilder{ - return &HealthRespBuilder{ - obj: NewHealthResp(), - } -} - -func (p HealthRespBuilder) Emit() *HealthResp{ - return &HealthResp{ - ErrorCode: p.obj.ErrorCode, - } -} - -func (h *HealthRespBuilder) ErrorCode(errorCode int64) *HealthRespBuilder { - h.obj.ErrorCode = errorCode - return h -} - -func (h *HealthResp) SetErrorCode(errorCode int64) *HealthResp { - h.ErrorCode = errorCode - return h -} - -func (p *HealthResp) 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 - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := 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 *HealthResp) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.ErrorCode = v - } - return nil -} - -func (p *HealthResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("HealthResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *HealthResp) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("error_code", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:error_code: ", p), err) } - if err := oprot.WriteI64(int64(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 *HealthResp) String() string { - if p == nil { - return "" - } - - errorCodeVal := fmt.Sprintf("%v", p.ErrorCode) - return fmt.Sprintf("HealthResp({ErrorCode:%s})", errorCodeVal) -} - diff --git a/nebula/meta/GoUnusedProtection__.go b/nebula/meta/GoUnusedProtection__.go new file mode 100644 index 00000000..00e58d24 --- /dev/null +++ b/nebula/meta/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package meta + +var GoUnusedProtection__ int; + diff --git a/nebula/meta/constants.go b/nebula/meta/constants.go deleted file mode 100644 index 15ec7ebe..00000000 --- a/nebula/meta/constants.go +++ /dev/null @@ -1,29 +0,0 @@ -// 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/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - -) - -// (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/nebula/meta/meta-consts.go b/nebula/meta/meta-consts.go new file mode 100644 index 00000000..8a541c5f --- /dev/null +++ b/nebula/meta/meta-consts.go @@ -0,0 +1,33 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package meta + +import ( + "bytes" + "context" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" + "github.com/vesoft-inc/nebula-go/v3/nebula" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +var _ = nebula.GoUnusedProtection__ + +func init() { +} + diff --git a/nebula/meta/meta.go b/nebula/meta/meta.go new file mode 100644 index 00000000..e061e1a9 --- /dev/null +++ b/nebula/meta/meta.go @@ -0,0 +1,59771 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package meta + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" + "github.com/vesoft-inc/nebula-go/v3/nebula" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +var _ = nebula.GoUnusedProtection__ +type AlterSchemaOp int64 +const ( + AlterSchemaOp_ADD AlterSchemaOp = 1 + AlterSchemaOp_CHANGE AlterSchemaOp = 2 + AlterSchemaOp_DROP AlterSchemaOp = 3 + AlterSchemaOp_UNKNOWN AlterSchemaOp = 4 +) + +func (p AlterSchemaOp) String() string { + switch p { + case AlterSchemaOp_ADD: return "ADD" + case AlterSchemaOp_CHANGE: return "CHANGE" + case AlterSchemaOp_DROP: return "DROP" + case AlterSchemaOp_UNKNOWN: return "UNKNOWN" + } + return "" +} + +func AlterSchemaOpFromString(s string) (AlterSchemaOp, error) { + switch s { + case "ADD": return AlterSchemaOp_ADD, nil + case "CHANGE": return AlterSchemaOp_CHANGE, nil + case "DROP": return AlterSchemaOp_DROP, nil + case "UNKNOWN": return AlterSchemaOp_UNKNOWN, nil + } + return AlterSchemaOp(0), fmt.Errorf("not a valid AlterSchemaOp string") +} + + +func AlterSchemaOpPtr(v AlterSchemaOp) *AlterSchemaOp { return &v } + +func (p AlterSchemaOp) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *AlterSchemaOp) UnmarshalText(text []byte) error { +q, err := AlterSchemaOpFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *AlterSchemaOp) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = AlterSchemaOp(v) +return nil +} + +func (p * AlterSchemaOp) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type RoleType int64 +const ( + RoleType_GOD RoleType = 1 + RoleType_ADMIN RoleType = 2 + RoleType_DBA RoleType = 3 + RoleType_USER RoleType = 4 + RoleType_GUEST RoleType = 5 +) + +func (p RoleType) String() string { + switch p { + case RoleType_GOD: return "GOD" + case RoleType_ADMIN: return "ADMIN" + case RoleType_DBA: return "DBA" + case RoleType_USER: return "USER" + case RoleType_GUEST: return "GUEST" + } + return "" +} + +func RoleTypeFromString(s string) (RoleType, error) { + switch s { + case "GOD": return RoleType_GOD, nil + case "ADMIN": return RoleType_ADMIN, nil + case "DBA": return RoleType_DBA, nil + case "USER": return RoleType_USER, nil + case "GUEST": return RoleType_GUEST, nil + } + return RoleType(0), fmt.Errorf("not a valid RoleType string") +} + + +func RoleTypePtr(v RoleType) *RoleType { return &v } + +func (p RoleType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *RoleType) UnmarshalText(text []byte) error { +q, err := RoleTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *RoleType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = RoleType(v) +return nil +} + +func (p * RoleType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type GeoShape int64 +const ( + GeoShape_ANY GeoShape = 0 + GeoShape_POINT GeoShape = 1 + GeoShape_LINESTRING GeoShape = 2 + GeoShape_POLYGON GeoShape = 3 +) + +func (p GeoShape) String() string { + switch p { + case GeoShape_ANY: return "ANY" + case GeoShape_POINT: return "POINT" + case GeoShape_LINESTRING: return "LINESTRING" + case GeoShape_POLYGON: return "POLYGON" + } + return "" +} + +func GeoShapeFromString(s string) (GeoShape, error) { + switch s { + case "ANY": return GeoShape_ANY, nil + case "POINT": return GeoShape_POINT, nil + case "LINESTRING": return GeoShape_LINESTRING, nil + case "POLYGON": return GeoShape_POLYGON, nil + } + return GeoShape(0), fmt.Errorf("not a valid GeoShape string") +} + + +func GeoShapePtr(v GeoShape) *GeoShape { return &v } + +func (p GeoShape) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *GeoShape) UnmarshalText(text []byte) error { +q, err := GeoShapeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *GeoShape) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = GeoShape(v) +return nil +} + +func (p * GeoShape) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type IsolationLevel int64 +const ( + IsolationLevel_DEFAULT IsolationLevel = 0 + IsolationLevel_TOSS IsolationLevel = 1 +) + +func (p IsolationLevel) String() string { + switch p { + case IsolationLevel_DEFAULT: return "DEFAULT" + case IsolationLevel_TOSS: return "TOSS" + } + return "" +} + +func IsolationLevelFromString(s string) (IsolationLevel, error) { + switch s { + case "DEFAULT": return IsolationLevel_DEFAULT, nil + case "TOSS": return IsolationLevel_TOSS, nil + } + return IsolationLevel(0), fmt.Errorf("not a valid IsolationLevel string") +} + + +func IsolationLevelPtr(v IsolationLevel) *IsolationLevel { return &v } + +func (p IsolationLevel) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *IsolationLevel) UnmarshalText(text []byte) error { +q, err := IsolationLevelFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *IsolationLevel) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = IsolationLevel(v) +return nil +} + +func (p * IsolationLevel) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type HostStatus int64 +const ( + HostStatus_ONLINE HostStatus = 0 + HostStatus_OFFLINE HostStatus = 1 + HostStatus_UNKNOWN HostStatus = 2 +) + +func (p HostStatus) String() string { + switch p { + case HostStatus_ONLINE: return "ONLINE" + case HostStatus_OFFLINE: return "OFFLINE" + case HostStatus_UNKNOWN: return "UNKNOWN" + } + return "" +} + +func HostStatusFromString(s string) (HostStatus, error) { + switch s { + case "ONLINE": return HostStatus_ONLINE, nil + case "OFFLINE": return HostStatus_OFFLINE, nil + case "UNKNOWN": return HostStatus_UNKNOWN, nil + } + return HostStatus(0), fmt.Errorf("not a valid HostStatus string") +} + + +func HostStatusPtr(v HostStatus) *HostStatus { return &v } + +func (p HostStatus) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *HostStatus) UnmarshalText(text []byte) error { +q, err := HostStatusFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *HostStatus) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = HostStatus(v) +return nil +} + +func (p * HostStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type SnapshotStatus int64 +const ( + SnapshotStatus_VALID SnapshotStatus = 0 + SnapshotStatus_INVALID SnapshotStatus = 1 +) + +func (p SnapshotStatus) String() string { + switch p { + case SnapshotStatus_VALID: return "VALID" + case SnapshotStatus_INVALID: return "INVALID" + } + return "" +} + +func SnapshotStatusFromString(s string) (SnapshotStatus, error) { + switch s { + case "VALID": return SnapshotStatus_VALID, nil + case "INVALID": return SnapshotStatus_INVALID, nil + } + return SnapshotStatus(0), fmt.Errorf("not a valid SnapshotStatus string") +} + + +func SnapshotStatusPtr(v SnapshotStatus) *SnapshotStatus { return &v } + +func (p SnapshotStatus) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *SnapshotStatus) UnmarshalText(text []byte) error { +q, err := SnapshotStatusFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *SnapshotStatus) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = SnapshotStatus(v) +return nil +} + +func (p * SnapshotStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type AlterSpaceOp int64 +const ( + AlterSpaceOp_ADD_ZONE AlterSpaceOp = 1 +) + +func (p AlterSpaceOp) String() string { + switch p { + case AlterSpaceOp_ADD_ZONE: return "ADD_ZONE" + } + return "" +} + +func AlterSpaceOpFromString(s string) (AlterSpaceOp, error) { + switch s { + case "ADD_ZONE": return AlterSpaceOp_ADD_ZONE, nil + } + return AlterSpaceOp(0), fmt.Errorf("not a valid AlterSpaceOp string") +} + + +func AlterSpaceOpPtr(v AlterSpaceOp) *AlterSpaceOp { return &v } + +func (p AlterSpaceOp) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *AlterSpaceOp) UnmarshalText(text []byte) error { +q, err := AlterSpaceOpFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *AlterSpaceOp) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = AlterSpaceOp(v) +return nil +} + +func (p * AlterSpaceOp) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type JobOp int64 +const ( + JobOp_ADD JobOp = 1 + JobOp_SHOW_All JobOp = 2 + JobOp_SHOW JobOp = 3 + JobOp_STOP JobOp = 4 + JobOp_RECOVER JobOp = 5 +) + +func (p JobOp) String() string { + switch p { + case JobOp_ADD: return "ADD" + case JobOp_SHOW_All: return "SHOW_All" + case JobOp_SHOW: return "SHOW" + case JobOp_STOP: return "STOP" + case JobOp_RECOVER: return "RECOVER" + } + return "" +} + +func JobOpFromString(s string) (JobOp, error) { + switch s { + case "ADD": return JobOp_ADD, nil + case "SHOW_All": return JobOp_SHOW_All, nil + case "SHOW": return JobOp_SHOW, nil + case "STOP": return JobOp_STOP, nil + case "RECOVER": return JobOp_RECOVER, nil + } + return JobOp(0), fmt.Errorf("not a valid JobOp string") +} + + +func JobOpPtr(v JobOp) *JobOp { return &v } + +func (p JobOp) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *JobOp) UnmarshalText(text []byte) error { +q, err := JobOpFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *JobOp) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = JobOp(v) +return nil +} + +func (p * JobOp) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type JobType int64 +const ( + JobType_COMPACT JobType = 0 + JobType_FLUSH JobType = 1 + JobType_REBUILD_TAG_INDEX JobType = 2 + JobType_REBUILD_EDGE_INDEX JobType = 3 + JobType_REBUILD_FULLTEXT_INDEX JobType = 4 + JobType_STATS JobType = 5 + JobType_DATA_BALANCE JobType = 6 + JobType_DOWNLOAD JobType = 7 + JobType_INGEST JobType = 8 + JobType_LEADER_BALANCE JobType = 9 + JobType_ZONE_BALANCE JobType = 10 + JobType_UNKNOWN JobType = 99 +) + +func (p JobType) String() string { + switch p { + case JobType_COMPACT: return "COMPACT" + case JobType_FLUSH: return "FLUSH" + case JobType_REBUILD_TAG_INDEX: return "REBUILD_TAG_INDEX" + case JobType_REBUILD_EDGE_INDEX: return "REBUILD_EDGE_INDEX" + case JobType_REBUILD_FULLTEXT_INDEX: return "REBUILD_FULLTEXT_INDEX" + case JobType_STATS: return "STATS" + case JobType_DATA_BALANCE: return "DATA_BALANCE" + case JobType_DOWNLOAD: return "DOWNLOAD" + case JobType_INGEST: return "INGEST" + case JobType_LEADER_BALANCE: return "LEADER_BALANCE" + case JobType_ZONE_BALANCE: return "ZONE_BALANCE" + case JobType_UNKNOWN: return "UNKNOWN" + } + return "" +} + +func JobTypeFromString(s string) (JobType, error) { + switch s { + case "COMPACT": return JobType_COMPACT, nil + case "FLUSH": return JobType_FLUSH, nil + case "REBUILD_TAG_INDEX": return JobType_REBUILD_TAG_INDEX, nil + case "REBUILD_EDGE_INDEX": return JobType_REBUILD_EDGE_INDEX, nil + case "REBUILD_FULLTEXT_INDEX": return JobType_REBUILD_FULLTEXT_INDEX, nil + case "STATS": return JobType_STATS, nil + case "DATA_BALANCE": return JobType_DATA_BALANCE, nil + case "DOWNLOAD": return JobType_DOWNLOAD, nil + case "INGEST": return JobType_INGEST, nil + case "LEADER_BALANCE": return JobType_LEADER_BALANCE, nil + case "ZONE_BALANCE": return JobType_ZONE_BALANCE, nil + case "UNKNOWN": return JobType_UNKNOWN, nil + } + return JobType(0), fmt.Errorf("not a valid JobType string") +} + + +func JobTypePtr(v JobType) *JobType { return &v } + +func (p JobType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *JobType) UnmarshalText(text []byte) error { +q, err := JobTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *JobType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = JobType(v) +return nil +} + +func (p * JobType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +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 +) + +func (p JobStatus) String() string { + switch p { + case JobStatus_QUEUE: return "QUEUE" + case JobStatus_RUNNING: return "RUNNING" + case JobStatus_FINISHED: return "FINISHED" + case JobStatus_FAILED: return "FAILED" + case JobStatus_STOPPED: return "STOPPED" + case JobStatus_INVALID: return "INVALID" + } + return "" +} + +func JobStatusFromString(s string) (JobStatus, error) { + switch s { + case "QUEUE": return JobStatus_QUEUE, nil + case "RUNNING": return JobStatus_RUNNING, nil + case "FINISHED": return JobStatus_FINISHED, nil + case "FAILED": return JobStatus_FAILED, nil + case "STOPPED": return JobStatus_STOPPED, nil + case "INVALID": return JobStatus_INVALID, nil + } + return JobStatus(0), fmt.Errorf("not a valid JobStatus string") +} + + +func JobStatusPtr(v JobStatus) *JobStatus { return &v } + +func (p JobStatus) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *JobStatus) UnmarshalText(text []byte) error { +q, err := JobStatusFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *JobStatus) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = JobStatus(v) +return nil +} + +func (p * JobStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type ListHostType int64 +const ( + ListHostType_ALLOC ListHostType = 0 + ListHostType_GRAPH ListHostType = 1 + ListHostType_META ListHostType = 2 + ListHostType_STORAGE ListHostType = 3 + ListHostType_AGENT ListHostType = 4 + ListHostType_STORAGE_LISTENER ListHostType = 5 +) + +func (p ListHostType) String() string { + switch p { + case ListHostType_ALLOC: return "ALLOC" + case ListHostType_GRAPH: return "GRAPH" + case ListHostType_META: return "META" + case ListHostType_STORAGE: return "STORAGE" + case ListHostType_AGENT: return "AGENT" + case ListHostType_STORAGE_LISTENER: return "STORAGE_LISTENER" + } + return "" +} + +func ListHostTypeFromString(s string) (ListHostType, error) { + switch s { + case "ALLOC": return ListHostType_ALLOC, nil + case "GRAPH": return ListHostType_GRAPH, nil + case "META": return ListHostType_META, nil + case "STORAGE": return ListHostType_STORAGE, nil + case "AGENT": return ListHostType_AGENT, nil + case "STORAGE_LISTENER": return ListHostType_STORAGE_LISTENER, nil + } + return ListHostType(0), fmt.Errorf("not a valid ListHostType string") +} + + +func ListHostTypePtr(v ListHostType) *ListHostType { return &v } + +func (p ListHostType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *ListHostType) UnmarshalText(text []byte) error { +q, err := ListHostTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *ListHostType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = ListHostType(v) +return nil +} + +func (p * ListHostType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type HostRole int64 +const ( + HostRole_GRAPH HostRole = 0 + HostRole_META HostRole = 1 + HostRole_STORAGE HostRole = 2 + HostRole_STORAGE_LISTENER HostRole = 3 + HostRole_AGENT HostRole = 4 + HostRole_UNKNOWN HostRole = 5 +) + +func (p HostRole) String() string { + switch p { + case HostRole_GRAPH: return "GRAPH" + case HostRole_META: return "META" + case HostRole_STORAGE: return "STORAGE" + case HostRole_STORAGE_LISTENER: return "STORAGE_LISTENER" + case HostRole_AGENT: return "AGENT" + case HostRole_UNKNOWN: return "UNKNOWN" + } + return "" +} + +func HostRoleFromString(s string) (HostRole, error) { + switch s { + case "GRAPH": return HostRole_GRAPH, nil + case "META": return HostRole_META, nil + case "STORAGE": return HostRole_STORAGE, nil + case "STORAGE_LISTENER": return HostRole_STORAGE_LISTENER, nil + case "AGENT": return HostRole_AGENT, nil + case "UNKNOWN": return HostRole_UNKNOWN, nil + } + return HostRole(0), fmt.Errorf("not a valid HostRole string") +} + + +func HostRolePtr(v HostRole) *HostRole { return &v } + +func (p HostRole) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *HostRole) UnmarshalText(text []byte) error { +q, err := HostRoleFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *HostRole) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = HostRole(v) +return nil +} + +func (p * HostRole) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type TaskResult_ int64 +const ( + TaskResult__SUCCEEDED TaskResult_ = 0 + TaskResult__FAILED TaskResult_ = 1 + TaskResult__IN_PROGRESS TaskResult_ = 2 + TaskResult__INVALID TaskResult_ = 3 +) + +func (p TaskResult_) String() string { + switch p { + case TaskResult__SUCCEEDED: return "SUCCEEDED" + case TaskResult__FAILED: return "FAILED" + case TaskResult__IN_PROGRESS: return "IN_PROGRESS" + case TaskResult__INVALID: return "INVALID" + } + return "" +} + +func TaskResult_FromString(s string) (TaskResult_, error) { + switch s { + case "SUCCEEDED": return TaskResult__SUCCEEDED, nil + case "FAILED": return TaskResult__FAILED, nil + case "IN_PROGRESS": return TaskResult__IN_PROGRESS, nil + case "INVALID": return TaskResult__INVALID, nil + } + return TaskResult_(0), fmt.Errorf("not a valid TaskResult_ string") +} + + +func TaskResult_Ptr(v TaskResult_) *TaskResult_ { return &v } + +func (p TaskResult_) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *TaskResult_) UnmarshalText(text []byte) error { +q, err := TaskResult_FromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *TaskResult_) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = TaskResult_(v) +return nil +} + +func (p * TaskResult_) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type ConfigModule int64 +const ( + ConfigModule_UNKNOWN ConfigModule = 0 + ConfigModule_ALL ConfigModule = 1 + ConfigModule_GRAPH ConfigModule = 2 + ConfigModule_META ConfigModule = 3 + ConfigModule_STORAGE ConfigModule = 4 +) + +func (p ConfigModule) String() string { + switch p { + case ConfigModule_UNKNOWN: return "UNKNOWN" + case ConfigModule_ALL: return "ALL" + case ConfigModule_GRAPH: return "GRAPH" + case ConfigModule_META: return "META" + case ConfigModule_STORAGE: return "STORAGE" + } + return "" +} + +func ConfigModuleFromString(s string) (ConfigModule, error) { + switch s { + case "UNKNOWN": return ConfigModule_UNKNOWN, nil + case "ALL": return ConfigModule_ALL, nil + case "GRAPH": return ConfigModule_GRAPH, nil + case "META": return ConfigModule_META, nil + case "STORAGE": return ConfigModule_STORAGE, nil + } + return ConfigModule(0), fmt.Errorf("not a valid ConfigModule string") +} + + +func ConfigModulePtr(v ConfigModule) *ConfigModule { return &v } + +func (p ConfigModule) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *ConfigModule) UnmarshalText(text []byte) error { +q, err := ConfigModuleFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *ConfigModule) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = ConfigModule(v) +return nil +} + +func (p * ConfigModule) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type ConfigMode int64 +const ( + ConfigMode_IMMUTABLE ConfigMode = 0 + ConfigMode_REBOOT ConfigMode = 1 + ConfigMode_MUTABLE ConfigMode = 2 + ConfigMode_IGNORED ConfigMode = 3 +) + +func (p ConfigMode) String() string { + switch p { + case ConfigMode_IMMUTABLE: return "IMMUTABLE" + case ConfigMode_REBOOT: return "REBOOT" + case ConfigMode_MUTABLE: return "MUTABLE" + case ConfigMode_IGNORED: return "IGNORED" + } + return "" +} + +func ConfigModeFromString(s string) (ConfigMode, error) { + switch s { + case "IMMUTABLE": return ConfigMode_IMMUTABLE, nil + case "REBOOT": return ConfigMode_REBOOT, nil + case "MUTABLE": return ConfigMode_MUTABLE, nil + case "IGNORED": return ConfigMode_IGNORED, nil + } + return ConfigMode(0), fmt.Errorf("not a valid ConfigMode string") +} + + +func ConfigModePtr(v ConfigMode) *ConfigMode { return &v } + +func (p ConfigMode) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *ConfigMode) UnmarshalText(text []byte) error { +q, err := ConfigModeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *ConfigMode) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = ConfigMode(v) +return nil +} + +func (p * ConfigMode) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type ListenerType int64 +const ( + ListenerType_UNKNOWN ListenerType = 0 + ListenerType_ELASTICSEARCH ListenerType = 1 +) + +func (p ListenerType) String() string { + switch p { + case ListenerType_UNKNOWN: return "UNKNOWN" + case ListenerType_ELASTICSEARCH: return "ELASTICSEARCH" + } + return "" +} + +func ListenerTypeFromString(s string) (ListenerType, error) { + switch s { + case "UNKNOWN": return ListenerType_UNKNOWN, nil + case "ELASTICSEARCH": return ListenerType_ELASTICSEARCH, nil + } + return ListenerType(0), fmt.Errorf("not a valid ListenerType string") +} + + +func ListenerTypePtr(v ListenerType) *ListenerType { return &v } + +func (p ListenerType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *ListenerType) UnmarshalText(text []byte) error { +q, err := ListenerTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *ListenerType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = ListenerType(v) +return nil +} + +func (p * ListenerType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type ExternalServiceType int64 +const ( + ExternalServiceType_ELASTICSEARCH ExternalServiceType = 1 +) + +func (p ExternalServiceType) String() string { + switch p { + case ExternalServiceType_ELASTICSEARCH: return "ELASTICSEARCH" + } + return "" +} + +func ExternalServiceTypeFromString(s string) (ExternalServiceType, error) { + switch s { + case "ELASTICSEARCH": return ExternalServiceType_ELASTICSEARCH, nil + } + return ExternalServiceType(0), fmt.Errorf("not a valid ExternalServiceType string") +} + + +func ExternalServiceTypePtr(v ExternalServiceType) *ExternalServiceType { return &v } + +func (p ExternalServiceType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *ExternalServiceType) UnmarshalText(text []byte) error { +q, err := ExternalServiceTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *ExternalServiceType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = ExternalServiceType(v) +return nil +} + +func (p * ExternalServiceType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type QueryStatus int64 +const ( + QueryStatus_RUNNING QueryStatus = 1 + QueryStatus_KILLING QueryStatus = 2 +) + +func (p QueryStatus) String() string { + switch p { + case QueryStatus_RUNNING: return "RUNNING" + case QueryStatus_KILLING: return "KILLING" + } + return "" +} + +func QueryStatusFromString(s string) (QueryStatus, error) { + switch s { + case "RUNNING": return QueryStatus_RUNNING, nil + case "KILLING": return QueryStatus_KILLING, nil + } + return QueryStatus(0), fmt.Errorf("not a valid QueryStatus string") +} + + +func QueryStatusPtr(v QueryStatus) *QueryStatus { return &v } + +func (p QueryStatus) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *QueryStatus) UnmarshalText(text []byte) error { +q, err := QueryStatusFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *QueryStatus) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = QueryStatus(v) +return nil +} + +func (p * QueryStatus) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +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 *nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id,omitempty"` + TagID *nebula.TagID `thrift:"tag_id,2" db:"tag_id" json:"tag_id,omitempty"` + EdgeType *nebula.EdgeType `thrift:"edge_type,3" db:"edge_type" json:"edge_type,omitempty"` + IndexID *nebula.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 nebula.GraphSpaceID +func (p *ID) GetSpaceID() nebula.GraphSpaceID { + if !p.IsSetSpaceID() { + return ID_SpaceID_DEFAULT + } +return *p.SpaceID +} +var ID_TagID_DEFAULT nebula.TagID +func (p *ID) GetTagID() nebula.TagID { + if !p.IsSetTagID() { + return ID_TagID_DEFAULT + } +return *p.TagID +} +var ID_EdgeType_DEFAULT nebula.EdgeType +func (p *ID) GetEdgeType() nebula.EdgeType { + if !p.IsSetEdgeType() { + return ID_EdgeType_DEFAULT + } +return *p.EdgeType +} +var ID_IndexID_DEFAULT nebula.IndexID +func (p *ID) GetIndexID() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ID) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = &temp +} + return nil +} + +func (p *ID) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.TagID(v) + p.TagID = &temp +} + return nil +} + +func (p *ID) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula.EdgeType(v) + p.EdgeType = &temp +} + return nil +} + +func (p *ID) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula.IndexID(v) + p.IndexID = &temp +} + return nil +} + +func (p *ID) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := ClusterID(v) + p.ClusterID = &temp +} + return nil +} + +func (p *ID) Write(ctx context.Context, oprot thrift.TProtocol) 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(ctx, "ID"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ID) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSpaceID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + } + return err +} + +func (p *ID) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTagID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_id: ", p), err) } + } + return err +} + +func (p *ID) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEdgeType() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_type: ", p), err) } + } + return err +} + +func (p *ID) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetIndexID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:index_id: ", p), err) } + } + return err +} + +func (p *ID) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetClusterID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:cluster_id: ", p), err) } + } + return err +} + +func (p *ID) Equals(other *ID) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { + if p.SpaceID == nil || other.SpaceID == nil { + return false + } + if (*p.SpaceID) != (*other.SpaceID) { return false } + } + if p.TagID != other.TagID { + if p.TagID == nil || other.TagID == nil { + return false + } + if (*p.TagID) != (*other.TagID) { return false } + } + if p.EdgeType != other.EdgeType { + if p.EdgeType == nil || other.EdgeType == nil { + return false + } + if (*p.EdgeType) != (*other.EdgeType) { return false } + } + if p.IndexID != other.IndexID { + if p.IndexID == nil || other.IndexID == nil { + return false + } + if (*p.IndexID) != (*other.IndexID) { return false } + } + if p.ClusterID != other.ClusterID { + if p.ClusterID == nil || other.ClusterID == nil { + return false + } + if (*p.ClusterID) != (*other.ClusterID) { return false } + } + return true +} + +func (p *ID) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ID(%+v)", *p) +} + +func (p *ID) Validate() error { + return nil +} +// Attributes: +// - Type +// - TypeLength +// - GeoShape +type ColumnTypeDef struct { + Type nebula.PropertyType `thrift:"type,1,required" db:"type" json:"type"` + TypeLength int16 `thrift:"type_length,2" db:"type_length" json:"type_length"` + GeoShape *GeoShape `thrift:"geo_shape,3" db:"geo_shape" json:"geo_shape,omitempty"` +} + +func NewColumnTypeDef() *ColumnTypeDef { + return &ColumnTypeDef{} +} + + +func (p *ColumnTypeDef) GetType() nebula.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.TypeLength != ColumnTypeDef_TypeLength_DEFAULT +} + +func (p *ColumnTypeDef) IsSetGeoShape() bool { + return p.GeoShape != nil +} + +func (p *ColumnTypeDef) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetType bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I16 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetType{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); + } + return nil +} + +func (p *ColumnTypeDef) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.PropertyType(v) + p.Type = temp +} + return nil +} + +func (p *ColumnTypeDef) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TypeLength = v +} + return nil +} + +func (p *ColumnTypeDef) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := GeoShape(v) + p.GeoShape = &temp +} + return nil +} + +func (p *ColumnTypeDef) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ColumnTypeDef"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ColumnTypeDef) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ColumnTypeDef) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int16(p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) } + } + return err +} + +func (p *ColumnTypeDef) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetGeoShape() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.GeoShape)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.geo_shape (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:geo_shape: ", p), err) } + } + return err +} + +func (p *ColumnTypeDef) Equals(other *ColumnTypeDef) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + if p.TypeLength != other.TypeLength { return false } + if p.GeoShape != other.GeoShape { + if p.GeoShape == nil || other.GeoShape == nil { + return false + } + if (*p.GeoShape) != (*other.GeoShape) { return false } + } + return true +} + +func (p *ColumnTypeDef) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnTypeDef(%+v)", *p) +} + +func (p *ColumnTypeDef) Validate() error { + return nil +} +// 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"` + Comment []byte `thrift:"comment,5" db:"comment" json:"comment,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 +} +var ColumnDef_Comment_DEFAULT []byte + +func (p *ColumnDef) GetComment() []byte { + return p.Comment +} +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) IsSetComment() bool { + return p.Comment != nil +} + +func (p *ColumnDef) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetType = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetName{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetType{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Type is not set")); + } + return nil +} + +func (p *ColumnDef) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *ColumnDef) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Type = &ColumnTypeDef{} + if err := p.Type.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Type), err) + } + return nil +} + +func (p *ColumnDef) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.DefaultValue = v +} + return nil +} + +func (p *ColumnDef) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Nullable = v +} + return nil +} + +func (p *ColumnDef) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *ColumnDef) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ColumnDef"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ColumnDef) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *ColumnDef) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Type), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *ColumnDef) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDefaultValue() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.DefaultValue); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.default_value (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:default_value: ", p), err) } + } + return err +} + +func (p *ColumnDef) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetNullable() { + if err := oprot.WriteFieldBegin(ctx, "nullable", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:nullable: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.Nullable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.nullable (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:nullable: ", p), err) } + } + return err +} + +func (p *ColumnDef) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:comment: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:comment: ", p), err) } + } + return err +} + +func (p *ColumnDef) Equals(other *ColumnDef) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if !p.Type.Equals(other.Type) { return false } + if bytes.Compare(p.DefaultValue, other.DefaultValue) != 0 { return false } + if p.Nullable != other.Nullable { return false } + if bytes.Compare(p.Comment, other.Comment) != 0 { return false } + return true +} + +func (p *ColumnDef) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ColumnDef(%+v)", *p) +} + +func (p *ColumnDef) Validate() error { + return nil +} +// 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.TTLDuration != nil +} + +func (p *SchemaProp) IsSetTTLCol() bool { + return p.TTLCol != nil +} + +func (p *SchemaProp) IsSetComment() bool { + return p.Comment != nil +} + +func (p *SchemaProp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SchemaProp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.TTLDuration = &v +} + return nil +} + +func (p *SchemaProp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TTLCol = v +} + return nil +} + +func (p *SchemaProp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *SchemaProp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SchemaProp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SchemaProp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTTLDuration() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.TTLDuration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_duration (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:ttl_duration: ", p), err) } + } + return err +} + +func (p *SchemaProp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTTLCol() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TTLCol); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ttl_col (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:ttl_col: ", p), err) } + } + return err +} + +func (p *SchemaProp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:comment: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:comment: ", p), err) } + } + return err +} + +func (p *SchemaProp) Equals(other *SchemaProp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TTLDuration != other.TTLDuration { + if p.TTLDuration == nil || other.TTLDuration == nil { + return false + } + if (*p.TTLDuration) != (*other.TTLDuration) { return false } + } + if bytes.Compare(p.TTLCol, other.TTLCol) != 0 { return false } + if bytes.Compare(p.Comment, other.Comment) != 0 { return false } + return true +} + +func (p *SchemaProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SchemaProp(%+v)", *p) +} + +func (p *SchemaProp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Schema) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem0 := &ColumnDef{} + if err := _elem0.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.Columns = append(p.Columns, _elem0) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Schema) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.SchemaProp = &SchemaProp{} + if err := p.SchemaProp.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *Schema) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Schema"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Schema) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "columns", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:columns: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Columns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Columns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:columns: ", p), err) } + return err +} + +func (p *Schema) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema_prop: ", p), err) } + return err +} + +func (p *Schema) Equals(other *Schema) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Columns) != len(other.Columns) { return false } + for i, _tgt := range p.Columns { + _src1 := other.Columns[i] + if !_tgt.Equals(_src1) { return false } + } + if !p.SchemaProp.Equals(other.SchemaProp) { return false } + return true +} + +func (p *Schema) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Schema(%+v)", *p) +} + +func (p *Schema) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IdName) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.ID = &ID{} + if err := p.ID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ID), err) + } + return nil +} + +func (p *IdName) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IdName) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IdName"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IdName) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *IdName) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *IdName) Equals(other *IdName) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.ID.Equals(other.ID) { return false } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + return true +} + +func (p *IdName) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IdName(%+v)", *p) +} + +func (p *IdName) Validate() error { + return nil +} +// Attributes: +// - SpaceName +// - PartitionNum +// - ReplicaFactor +// - CharsetName +// - CollateName +// - VidType +// - ZoneNames +// - 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"` + ZoneNames [][]byte `thrift:"zone_names,7" db:"zone_names" json:"zone_names"` + IsolationLevel *IsolationLevel `thrift:"isolation_level,8" db:"isolation_level" json:"isolation_level,omitempty"` + Comment []byte `thrift:"comment,9" db:"comment" json:"comment,omitempty"` +} + +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 +} + +func (p *SpaceDesc) GetZoneNames() [][]byte { + return p.ZoneNames +} +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.VidType != nil +} + +func (p *SpaceDesc) IsSetIsolationLevel() bool { + return p.IsolationLevel != nil +} + +func (p *SpaceDesc) IsSetComment() bool { + return p.Comment != nil +} + +func (p *SpaceDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.LIST { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I32 { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRING { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SpaceDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *SpaceDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.PartitionNum = v +} + return nil +} + +func (p *SpaceDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReplicaFactor = v +} + return nil +} + +func (p *SpaceDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.CharsetName = v +} + return nil +} + +func (p *SpaceDesc) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.CollateName = v +} + return nil +} + +func (p *SpaceDesc) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.VidType = &ColumnTypeDef{} + if err := p.VidType.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VidType), err) + } + return nil +} + +func (p *SpaceDesc) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.ZoneNames = tSlice + for i := 0; i < size; i ++ { +var _elem2 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem2 = v +} + p.ZoneNames = append(p.ZoneNames, _elem2) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SpaceDesc) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + temp := IsolationLevel(v) + p.IsolationLevel = &temp +} + return nil +} + +func (p *SpaceDesc) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *SpaceDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SpaceDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SpaceDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartitionNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.partition_num (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:partition_num: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.ReplicaFactor)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.replica_factor (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:replica_factor: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.CharsetName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.charset_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:charset_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.CollateName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.collate_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:collate_name: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VidType), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:vid_type: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "zone_names", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:zone_names: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.ZoneNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ZoneNames { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:zone_names: ", p), err) } + return err +} + +func (p *SpaceDesc) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetIsolationLevel() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.IsolationLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.isolation_level (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:isolation_level: ", p), err) } + } + return err +} + +func (p *SpaceDesc) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:comment: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:comment: ", p), err) } + } + return err +} + +func (p *SpaceDesc) Equals(other *SpaceDesc) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.SpaceName, other.SpaceName) != 0 { return false } + if p.PartitionNum != other.PartitionNum { return false } + if p.ReplicaFactor != other.ReplicaFactor { return false } + if bytes.Compare(p.CharsetName, other.CharsetName) != 0 { return false } + if bytes.Compare(p.CollateName, other.CollateName) != 0 { return false } + if !p.VidType.Equals(other.VidType) { return false } + if len(p.ZoneNames) != len(other.ZoneNames) { return false } + for i, _tgt := range p.ZoneNames { + _src3 := other.ZoneNames[i] + if bytes.Compare(_tgt, _src3) != 0 { return false } + } + if p.IsolationLevel != other.IsolationLevel { + if p.IsolationLevel == nil || other.IsolationLevel == nil { + return false + } + if (*p.IsolationLevel) != (*other.IsolationLevel) { return false } + } + if bytes.Compare(p.Comment, other.Comment) != 0 { return false } + return true +} + +func (p *SpaceDesc) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SpaceDesc(%+v)", *p) +} + +func (p *SpaceDesc) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Properties +type SpaceItem struct { + SpaceID nebula.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() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SpaceItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *SpaceItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Properties = &SpaceDesc{} + if err := p.Properties.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *SpaceItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SpaceItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SpaceItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *SpaceItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:properties: ", p), err) } + return err +} + +func (p *SpaceItem) Equals(other *SpaceItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if !p.Properties.Equals(other.Properties) { return false } + return true +} + +func (p *SpaceItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SpaceItem(%+v)", *p) +} + +func (p *SpaceItem) Validate() error { + return nil +} +// Attributes: +// - TagID +// - TagName +// - Version +// - Schema +type TagItem struct { + TagID nebula.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() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TagItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *TagItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *TagItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *TagItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &Schema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *TagItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TagItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TagItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *TagItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *TagItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *TagItem) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) } + return err +} + +func (p *TagItem) Equals(other *TagItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TagID != other.TagID { return false } + if bytes.Compare(p.TagName, other.TagName) != 0 { return false } + if p.Version != other.Version { return false } + if !p.Schema.Equals(other.Schema) { return false } + return true +} + +func (p *TagItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TagItem(%+v)", *p) +} + +func (p *TagItem) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterSchemaItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := AlterSchemaOp(v) + p.Op = temp +} + return nil +} + +func (p *AlterSchemaItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &Schema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *AlterSchemaItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AlterSchemaItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterSchemaItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "op", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:op: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:op: ", p), err) } + return err +} + +func (p *AlterSchemaItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema: ", p), err) } + return err +} + +func (p *AlterSchemaItem) Equals(other *AlterSchemaItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Op != other.Op { return false } + if !p.Schema.Equals(other.Schema) { return false } + return true +} + +func (p *AlterSchemaItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterSchemaItem(%+v)", *p) +} + +func (p *AlterSchemaItem) Validate() error { + return nil +} +// Attributes: +// - EdgeType +// - EdgeName +// - Version +// - Schema +type EdgeItem struct { + EdgeType nebula.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() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *EdgeItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *EdgeItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &Schema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *EdgeItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "EdgeItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:edge_type: ", p), err) } + return err +} + +func (p *EdgeItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *EdgeItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *EdgeItem) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema: ", p), err) } + return err +} + +func (p *EdgeItem) Equals(other *EdgeItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.EdgeType != other.EdgeType { return false } + if bytes.Compare(p.EdgeName, other.EdgeName) != 0 { return false } + if p.Version != other.Version { return false } + if !p.Schema.Equals(other.Schema) { return false } + return true +} + +func (p *EdgeItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EdgeItem(%+v)", *p) +} + +func (p *EdgeItem) Validate() error { + return nil +} +// Attributes: +// - S2MaxLevel +// - S2MaxCells +type IndexParams struct { + S2MaxLevel *int32 `thrift:"s2_max_level,1" db:"s2_max_level" json:"s2_max_level,omitempty"` + S2MaxCells *int32 `thrift:"s2_max_cells,2" db:"s2_max_cells" json:"s2_max_cells,omitempty"` +} + +func NewIndexParams() *IndexParams { + return &IndexParams{} +} + +var IndexParams_S2MaxLevel_DEFAULT int32 +func (p *IndexParams) GetS2MaxLevel() int32 { + if !p.IsSetS2MaxLevel() { + return IndexParams_S2MaxLevel_DEFAULT + } +return *p.S2MaxLevel +} +var IndexParams_S2MaxCells_DEFAULT int32 +func (p *IndexParams) GetS2MaxCells() int32 { + if !p.IsSetS2MaxCells() { + return IndexParams_S2MaxCells_DEFAULT + } +return *p.S2MaxCells +} +func (p *IndexParams) IsSetS2MaxLevel() bool { + return p.S2MaxLevel != nil +} + +func (p *IndexParams) IsSetS2MaxCells() bool { + return p.S2MaxCells != nil +} + +func (p *IndexParams) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexParams) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.S2MaxLevel = &v +} + return nil +} + +func (p *IndexParams) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.S2MaxCells = &v +} + return nil +} + +func (p *IndexParams) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IndexParams"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexParams) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetS2MaxLevel() { + if err := oprot.WriteFieldBegin(ctx, "s2_max_level", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:s2_max_level: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.S2MaxLevel)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.s2_max_level (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:s2_max_level: ", p), err) } + } + return err +} + +func (p *IndexParams) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetS2MaxCells() { + if err := oprot.WriteFieldBegin(ctx, "s2_max_cells", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:s2_max_cells: ", p), err) } + if err := oprot.WriteI32(ctx, int32(*p.S2MaxCells)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.s2_max_cells (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:s2_max_cells: ", p), err) } + } + return err +} + +func (p *IndexParams) Equals(other *IndexParams) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.S2MaxLevel != other.S2MaxLevel { + if p.S2MaxLevel == nil || other.S2MaxLevel == nil { + return false + } + if (*p.S2MaxLevel) != (*other.S2MaxLevel) { return false } + } + if p.S2MaxCells != other.S2MaxCells { + if p.S2MaxCells == nil || other.S2MaxCells == nil { + return false + } + if (*p.S2MaxCells) != (*other.S2MaxCells) { return false } + } + return true +} + +func (p *IndexParams) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexParams(%+v)", *p) +} + +func (p *IndexParams) Validate() error { + return nil +} +// Attributes: +// - IndexID +// - IndexName +// - SchemaID +// - SchemaName +// - Fields +// - Comment +// - IndexParams +type IndexItem struct { + IndexID nebula.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` + IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` + SchemaID *nebula.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"` + IndexParams *IndexParams `thrift:"index_params,7" db:"index_params" json:"index_params,omitempty"` +} + +func NewIndexItem() *IndexItem { + return &IndexItem{} +} + + +func (p *IndexItem) GetIndexID() nebula.IndexID { + return p.IndexID +} + +func (p *IndexItem) GetIndexName() []byte { + return p.IndexName +} +var IndexItem_SchemaID_DEFAULT *nebula.SchemaID +func (p *IndexItem) GetSchemaID() *nebula.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 +} +var IndexItem_IndexParams_DEFAULT *IndexParams +func (p *IndexItem) GetIndexParams() *IndexParams { + if !p.IsSetIndexParams() { + return IndexItem_IndexParams_DEFAULT + } +return p.IndexParams +} +func (p *IndexItem) IsSetSchemaID() bool { + return p.SchemaID != nil +} + +func (p *IndexItem) IsSetComment() bool { + return p.Comment != nil +} + +func (p *IndexItem) IsSetIndexParams() bool { + return p.IndexParams != nil +} + +func (p *IndexItem) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *IndexItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.SchemaID = &nebula.SchemaID{} + if err := p.SchemaID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaID), err) + } + return nil +} + +func (p *IndexItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SchemaName = v +} + return nil +} + +func (p *IndexItem) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem4 := &ColumnDef{} + if err := _elem4.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem4), err) + } + p.Fields = append(p.Fields, _elem4) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexItem) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *IndexItem) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.IndexParams = &IndexParams{} + if err := p.IndexParams.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) + } + return nil +} + +func (p *IndexItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IndexItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *IndexItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema_id: ", p), err) } + return err +} + +func (p *IndexItem) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SchemaName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.schema_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_name: ", p), err) } + return err +} + +func (p *IndexItem) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "fields", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:fields: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:fields: ", p), err) } + return err +} + +func (p *IndexItem) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) } + } + return err +} + +func (p *IndexItem) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetIndexParams() { + if err := oprot.WriteFieldBegin(ctx, "index_params", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } + if err := p.IndexParams.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } + } + return err +} + +func (p *IndexItem) Equals(other *IndexItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.IndexID != other.IndexID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + if !p.SchemaID.Equals(other.SchemaID) { return false } + if bytes.Compare(p.SchemaName, other.SchemaName) != 0 { return false } + if len(p.Fields) != len(other.Fields) { return false } + for i, _tgt := range p.Fields { + _src5 := other.Fields[i] + if !_tgt.Equals(_src5) { return false } + } + if bytes.Compare(p.Comment, other.Comment) != 0 { return false } + if !p.IndexParams.Equals(other.IndexParams) { return false } + return true +} + +func (p *IndexItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexItem(%+v)", *p) +} + +func (p *IndexItem) Validate() error { + return nil +} +// Attributes: +// - HostAddr +// - Status +// - LeaderParts +// - AllParts +// - Role +// - GitInfoSha +// - ZoneName +// - Version +type HostItem struct { + HostAddr *nebula.HostAddr `thrift:"hostAddr,1" db:"hostAddr" json:"hostAddr"` + Status HostStatus `thrift:"status,2" db:"status" json:"status"` + LeaderParts map[string][]nebula.PartitionID `thrift:"leader_parts,3" db:"leader_parts" json:"leader_parts"` + AllParts map[string][]nebula.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{} +} + +var HostItem_HostAddr_DEFAULT *nebula.HostAddr +func (p *HostItem) GetHostAddr() *nebula.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][]nebula.PartitionID { + return p.LeaderParts +} + +func (p *HostItem) GetAllParts() map[string][]nebula.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.HostAddr != nil +} + +func (p *HostItem) IsSetZoneName() bool { + return p.ZoneName != nil +} + +func (p *HostItem) IsSetVersion() bool { + return p.Version != nil +} + +func (p *HostItem) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.HostAddr = &nebula.HostAddr{} + if err := p.HostAddr.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.HostAddr), err) + } + return nil +} + +func (p *HostItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := HostStatus(v) + p.Status = temp +} + return nil +} + +func (p *HostItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key6 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key6 = v +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + _val7 := tSlice + for i := 0; i < size; i ++ { +var _elem8 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem8 = temp +} + _val7 = append(_val7, _elem8) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key6] = _val7 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]nebula.PartitionID, size) + p.AllParts = tMap + for i := 0; i < size; i ++ { +var _key9 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key9 = v +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + _val10 := tSlice + for i := 0; i < size; i ++ { +var _elem11 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem11 = temp +} + _val10 = append(_val10, _elem11) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.AllParts[_key9] = _val10 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HostItem) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := HostRole(v) + p.Role = temp +} + return nil +} + +func (p *HostItem) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.GitInfoSha = v +} + return nil +} + +func (p *HostItem) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *HostItem) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *HostItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "HostItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HostItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.HostAddr), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hostAddr: ", p), err) } + return err +} + +func (p *HostItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *HostItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:leader_parts: ", p), err) } + return err +} + +func (p *HostItem) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:all_parts: ", p), err) } + return err +} + +func (p *HostItem) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "role", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:role: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:role: ", p), err) } + return err +} + +func (p *HostItem) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:git_info_sha: ", p), err) } + return err +} + +func (p *HostItem) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetZoneName() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:zone_name: ", p), err) } + } + return err +} + +func (p *HostItem) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:version: ", p), err) } + } + return err +} + +func (p *HostItem) Equals(other *HostItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.HostAddr.Equals(other.HostAddr) { return false } + if p.Status != other.Status { return false } + if len(p.LeaderParts) != len(other.LeaderParts) { return false } + for k, _tgt := range p.LeaderParts { + _src12 := other.LeaderParts[k] + if len(_tgt) != len(_src12) { return false } + for i, _tgt := range _tgt { + _src13 := _src12[i] + if _tgt != _src13 { return false } + } + } + if len(p.AllParts) != len(other.AllParts) { return false } + for k, _tgt := range p.AllParts { + _src14 := other.AllParts[k] + if len(_tgt) != len(_src14) { return false } + for i, _tgt := range _tgt { + _src15 := _src14[i] + if _tgt != _src15 { return false } + } + } + if p.Role != other.Role { return false } + if bytes.Compare(p.GitInfoSha, other.GitInfoSha) != 0 { return false } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + if bytes.Compare(p.Version, other.Version) != 0 { return false } + return true +} + +func (p *HostItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostItem(%+v)", *p) +} + +func (p *HostItem) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I32 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UserItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *UserItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IsLock = v +} + return nil +} + +func (p *UserItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.MaxQueriesPerHour = v +} + return nil +} + +func (p *UserItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.MaxUpdatesPerHour = v +} + return nil +} + +func (p *UserItem) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.MaxConnectionsPerHour = v +} + return nil +} + +func (p *UserItem) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.MaxUserConnections = v +} + return nil +} + +func (p *UserItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "UserItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UserItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *UserItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IsLock)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_lock (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:is_lock: ", p), err) } + return err +} + +func (p *UserItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); 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(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); 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(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); 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(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.MaxUserConnections)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.max_user_connections (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:max_user_connections: ", p), err) } + return err +} + +func (p *UserItem) Equals(other *UserItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Account, other.Account) != 0 { return false } + if p.IsLock != other.IsLock { return false } + if p.MaxQueriesPerHour != other.MaxQueriesPerHour { return false } + if p.MaxUpdatesPerHour != other.MaxUpdatesPerHour { return false } + if p.MaxConnectionsPerHour != other.MaxConnectionsPerHour { return false } + if p.MaxUserConnections != other.MaxUserConnections { return false } + return true +} + +func (p *UserItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UserItem(%+v)", *p) +} + +func (p *UserItem) Validate() error { + return nil +} +// Attributes: +// - UserID +// - SpaceID +// - RoleType +type RoleItem struct { + UserID []byte `thrift:"user_id,1" db:"user_id" json:"user_id"` + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *RoleItem) GetRoleType() RoleType { + return p.RoleType +} +func (p *RoleItem) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RoleItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.UserID = v +} + return nil +} + +func (p *RoleItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *RoleItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := RoleType(v) + p.RoleType = temp +} + return nil +} + +func (p *RoleItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RoleItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RoleItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.UserID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user_id: ", p), err) } + return err +} + +func (p *RoleItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) } + return err +} + +func (p *RoleItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.RoleType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role_type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:role_type: ", p), err) } + return err +} + +func (p *RoleItem) Equals(other *RoleItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.UserID, other.UserID) != 0 { return false } + if p.SpaceID != other.SpaceID { return false } + if p.RoleType != other.RoleType { return false } + return true +} + +func (p *RoleItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RoleItem(%+v)", *p) +} + +func (p *RoleItem) Validate() error { + return nil +} +// Attributes: +// - Code +// - ID +// - Leader +type ExecResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + ID *ID `thrift:"id,2" db:"id" json:"id"` + Leader *nebula.HostAddr `thrift:"leader,3" db:"leader" json:"leader"` +} + +func NewExecResp() *ExecResp { + return &ExecResp{} +} + + +func (p *ExecResp) GetCode() nebula.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 *nebula.HostAddr +func (p *ExecResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ExecResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ExecResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ID = &ID{} + if err := p.ID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ID), err) + } + return nil +} + +func (p *ExecResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ExecResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ExecResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ExecResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ExecResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *ExecResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:leader: ", p), err) } + return err +} + +func (p *ExecResp) Equals(other *ExecResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.ID.Equals(other.ID) { return false } + if !p.Leader.Equals(other.Leader) { return false } + return true +} + +func (p *ExecResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExecResp(%+v)", *p) +} + +func (p *ExecResp) Validate() error { + return nil +} +// Attributes: +// - SpaceName +// - Op +// - Paras +type AlterSpaceReq struct { + SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` + Op AlterSpaceOp `thrift:"op,2" db:"op" json:"op"` + Paras [][]byte `thrift:"paras,3" db:"paras" json:"paras"` +} + +func NewAlterSpaceReq() *AlterSpaceReq { + return &AlterSpaceReq{} +} + + +func (p *AlterSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *AlterSpaceReq) GetOp() AlterSpaceOp { + return p.Op +} + +func (p *AlterSpaceReq) GetParas() [][]byte { + return p.Paras +} +func (p *AlterSpaceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterSpaceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *AlterSpaceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := AlterSpaceOp(v) + p.Op = temp +} + return nil +} + +func (p *AlterSpaceReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem16 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem16 = v +} + p.Paras = append(p.Paras, _elem16) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterSpaceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AlterSpaceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterSpaceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *AlterSpaceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "op", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:op: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:op: ", p), err) } + return err +} + +func (p *AlterSpaceReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:paras: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:paras: ", p), err) } + return err +} + +func (p *AlterSpaceReq) Equals(other *AlterSpaceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.SpaceName, other.SpaceName) != 0 { return false } + if p.Op != other.Op { return false } + if len(p.Paras) != len(other.Paras) { return false } + for i, _tgt := range p.Paras { + _src17 := other.Paras[i] + if bytes.Compare(_tgt, _src17) != 0 { return false } + } + return true +} + +func (p *AlterSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterSpaceReq(%+v)", *p) +} + +func (p *AlterSpaceReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Op +// - Type +// - Paras +type AdminJobReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Op JobOp `thrift:"op,2" db:"op" json:"op"` + Type JobType `thrift:"type,3" db:"type" json:"type"` + Paras [][]byte `thrift:"paras,4" db:"paras" json:"paras"` +} + +func NewAdminJobReq() *AdminJobReq { + return &AdminJobReq{} +} + + +func (p *AdminJobReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *AdminJobReq) GetOp() JobOp { + return p.Op +} + +func (p *AdminJobReq) GetType() JobType { + return p.Type +} + +func (p *AdminJobReq) GetParas() [][]byte { + return p.Paras +} +func (p *AdminJobReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AdminJobReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AdminJobReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := JobOp(v) + p.Op = temp +} + return nil +} + +func (p *AdminJobReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := JobType(v) + p.Type = temp +} + return nil +} + +func (p *AdminJobReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem18 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem18 = v +} + p.Paras = append(p.Paras, _elem18) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AdminJobReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AdminJobReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AdminJobReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "op", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:op: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Op)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.op (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:op: ", p), err) } + return err +} + +func (p *AdminJobReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + return err +} + +func (p *AdminJobReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "paras", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:paras: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:paras: ", p), err) } + return err +} + +func (p *AdminJobReq) Equals(other *AdminJobReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.Op != other.Op { return false } + if p.Type != other.Type { return false } + if len(p.Paras) != len(other.Paras) { return false } + for i, _tgt := range p.Paras { + _src19 := other.Paras[i] + if bytes.Compare(_tgt, _src19) != 0 { return false } + } + return true +} + +func (p *AdminJobReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminJobReq(%+v)", *p) +} + +func (p *AdminJobReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - JobID +// - Type +// - Paras +// - Status +// - StartTime +// - StopTime +// - Code +type JobDesc struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + Type JobType `thrift:"type,3" db:"type" json:"type"` + Paras []string `thrift:"paras,4" db:"paras" json:"paras"` + Status JobStatus `thrift:"status,5" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,6" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,7" db:"stop_time" json:"stop_time"` + Code nebula.ErrorCode `thrift:"code,8" db:"code" json:"code"` +} + +func NewJobDesc() *JobDesc { + return &JobDesc{} +} + + +func (p *JobDesc) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *JobDesc) GetJobID() int32 { + return p.JobID +} + +func (p *JobDesc) GetType() JobType { + return p.Type +} + +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) GetCode() nebula.ErrorCode { + return p.Code +} +func (p *JobDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I32 { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *JobDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *JobDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *JobDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := JobType(v) + p.Type = temp +} + return nil +} + +func (p *JobDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem20 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem20 = v +} + p.Paras = append(p.Paras, _elem20) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *JobDesc) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *JobDesc) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *JobDesc) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.StopTime = v +} + return nil +} + +func (p *JobDesc) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *JobDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "JobDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *JobDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *JobDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *JobDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:type: ", p), err) } + return err +} + +func (p *JobDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "paras", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:paras: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Paras)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Paras { + if err := oprot.WriteString(ctx, string(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:paras: ", p), err) } + return err +} + +func (p *JobDesc) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:status: ", p), err) } + return err +} + +func (p *JobDesc) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + return err +} + +func (p *JobDesc) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stop_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stop_time: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stop_time: ", p), err) } + return err +} + +func (p *JobDesc) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:code: ", p), err) } + return err +} + +func (p *JobDesc) Equals(other *JobDesc) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.JobID != other.JobID { return false } + if p.Type != other.Type { return false } + if len(p.Paras) != len(other.Paras) { return false } + for i, _tgt := range p.Paras { + _src21 := other.Paras[i] + if _tgt != _src21 { return false } + } + if p.Status != other.Status { return false } + if p.StartTime != other.StartTime { return false } + if p.StopTime != other.StopTime { return false } + if p.Code != other.Code { return false } + return true +} + +func (p *JobDesc) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("JobDesc(%+v)", *p) +} + +func (p *JobDesc) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - JobID +// - TaskID +// - Host +// - Status +// - StartTime +// - StopTime +// - Code +type TaskDesc struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` + Host *nebula.HostAddr `thrift:"host,4" db:"host" json:"host"` + Status JobStatus `thrift:"status,5" db:"status" json:"status"` + StartTime int64 `thrift:"start_time,6" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,7" db:"stop_time" json:"stop_time"` + Code nebula.ErrorCode `thrift:"code,8" db:"code" json:"code"` +} + +func NewTaskDesc() *TaskDesc { + return &TaskDesc{} +} + + +func (p *TaskDesc) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *TaskDesc) GetJobID() int32 { + return p.JobID +} + +func (p *TaskDesc) GetTaskID() int32 { + return p.TaskID +} +var TaskDesc_Host_DEFAULT *nebula.HostAddr +func (p *TaskDesc) GetHost() *nebula.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) GetCode() nebula.ErrorCode { + return p.Code +} +func (p *TaskDesc) IsSetHost() bool { + return p.Host != nil +} + +func (p *TaskDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I64 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I32 { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TaskDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *TaskDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *TaskDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *TaskDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *TaskDesc) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *TaskDesc) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *TaskDesc) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.StopTime = v +} + return nil +} + +func (p *TaskDesc) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *TaskDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TaskDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TaskDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *TaskDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *TaskDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *TaskDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRUCT, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:host: ", p), err) } + if err := p.Host.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:host: ", p), err) } + return err +} + +func (p *TaskDesc) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:status: ", p), err) } + return err +} + +func (p *TaskDesc) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:start_time: ", p), err) } + return err +} + +func (p *TaskDesc) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stop_time", thrift.I64, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stop_time: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stop_time: ", p), err) } + return err +} + +func (p *TaskDesc) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:code: ", p), err) } + return err +} + +func (p *TaskDesc) Equals(other *TaskDesc) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.JobID != other.JobID { return false } + if p.TaskID != other.TaskID { return false } + if !p.Host.Equals(other.Host) { return false } + if p.Status != other.Status { return false } + if p.StartTime != other.StartTime { return false } + if p.StopTime != other.StopTime { return false } + if p.Code != other.Code { return false } + return true +} + +func (p *TaskDesc) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TaskDesc(%+v)", *p) +} + +func (p *TaskDesc) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AdminJobResult_) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = &v +} + return nil +} + +func (p *AdminJobResult_) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem22 := &JobDesc{} + if err := _elem22.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem22), err) + } + p.JobDesc = append(p.JobDesc, _elem22) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem23 := &TaskDesc{} + if err := _elem23.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) + } + p.TaskDesc = append(p.TaskDesc, _elem23) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AdminJobResult_) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.RecoveredJobNum = &v +} + return nil +} + +func (p *AdminJobResult_) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AdminJobResult"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AdminJobResult_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetJobID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetJobDesc() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.JobDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.JobDesc { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_desc: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTaskDesc() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.TaskDesc)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskDesc { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_desc: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetRecoveredJobNum() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(*p.RecoveredJobNum)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.recovered_job_num (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:recovered_job_num: ", p), err) } + } + return err +} + +func (p *AdminJobResult_) Equals(other *AdminJobResult_) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.JobID != other.JobID { + if p.JobID == nil || other.JobID == nil { + return false + } + if (*p.JobID) != (*other.JobID) { return false } + } + if len(p.JobDesc) != len(other.JobDesc) { return false } + for i, _tgt := range p.JobDesc { + _src24 := other.JobDesc[i] + if !_tgt.Equals(_src24) { return false } + } + if len(p.TaskDesc) != len(other.TaskDesc) { return false } + for i, _tgt := range p.TaskDesc { + _src25 := other.TaskDesc[i] + if !_tgt.Equals(_src25) { return false } + } + if p.RecoveredJobNum != other.RecoveredJobNum { + if p.RecoveredJobNum == nil || other.RecoveredJobNum == nil { + return false + } + if (*p.RecoveredJobNum) != (*other.RecoveredJobNum) { return false } + } + return true +} + +func (p *AdminJobResult_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminJobResult_(%+v)", *p) +} + +func (p *AdminJobResult_) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Result_ +type AdminJobResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var AdminJobResp_Leader_DEFAULT *nebula.HostAddr +func (p *AdminJobResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AdminJobResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *AdminJobResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *AdminJobResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &AdminJobResult_{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *AdminJobResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AdminJobResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AdminJobResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *AdminJobResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *AdminJobResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:result: ", p), err) } + return err +} + +func (p *AdminJobResp) Equals(other *AdminJobResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Result_.Equals(other.Result_) { return false } + return true +} + +func (p *AdminJobResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminJobResp(%+v)", *p) +} + +func (p *AdminJobResp) Validate() error { + return nil +} +// Attributes: +// - PartID +// - Proportion +type Correlativity struct { + PartID nebula.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() nebula.PartitionID { + return p.PartID +} + +func (p *Correlativity) GetProportion() float64 { + return p.Proportion +} +func (p *Correlativity) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.DOUBLE { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Correlativity) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *Correlativity) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadDouble(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Proportion = v +} + return nil +} + +func (p *Correlativity) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Correlativity"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Correlativity) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_id: ", p), err) } + return err +} + +func (p *Correlativity) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "proportion", thrift.DOUBLE, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:proportion: ", p), err) } + if err := oprot.WriteDouble(ctx, float64(p.Proportion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.proportion (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:proportion: ", p), err) } + return err +} + +func (p *Correlativity) Equals(other *Correlativity) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.PartID != other.PartID { return false } + if p.Proportion != other.Proportion { return false } + return true +} + +func (p *Correlativity) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Correlativity(%+v)", *p) +} + +func (p *Correlativity) Validate() error { + return nil +} +// 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[nebula.PartitionID][]*Correlativity `thrift:"positive_part_correlativity,5" db:"positive_part_correlativity" json:"positive_part_correlativity"` + NegativePartCorrelativity map[nebula.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[nebula.PartitionID][]*Correlativity { + return p.PositivePartCorrelativity +} + +func (p *StatsItem) GetNegativePartCorrelativity() map[nebula.PartitionID][]*Correlativity { + return p.NegativePartCorrelativity +} + +func (p *StatsItem) GetStatus() JobStatus { + return p.Status +} +func (p *StatsItem) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.MAP { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StatsItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key26 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key26 = v +} +var _val27 int64 + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val27 = v +} + p.TagVertices[_key26] = _val27 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key28 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key28 = v +} +var _val29 int64 + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val29 = v +} + p.Edges[_key28] = _val29 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SpaceVertices = v +} + return nil +} + +func (p *StatsItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.SpaceEdges = v +} + return nil +} + +func (p *StatsItem) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*Correlativity, size) + p.PositivePartCorrelativity = tMap + for i := 0; i < size; i ++ { +var _key30 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key30 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val31 := tSlice + for i := 0; i < size; i ++ { + _elem32 := &Correlativity{} + if err := _elem32.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) + } + _val31 = append(_val31, _elem32) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PositivePartCorrelativity[_key30] = _val31 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*Correlativity, size) + p.NegativePartCorrelativity = tMap + for i := 0; i < size; i ++ { +var _key33 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key33 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*Correlativity, 0, size) + _val34 := tSlice + for i := 0; i < size; i ++ { + _elem35 := &Correlativity{} + if err := _elem35.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem35), err) + } + _val34 = append(_val34, _elem35) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.NegativePartCorrelativity[_key33] = _val34 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *StatsItem) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + temp := JobStatus(v) + p.Status = temp +} + return nil +} + +func (p *StatsItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "StatsItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StatsItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_vertices: ", p), err) } + return err +} + +func (p *StatsItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "edges", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:edges: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edges: ", p), err) } + return err +} + +func (p *StatsItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.SpaceVertices)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_vertices (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:space_vertices: ", p), err) } + return err +} + +func (p *StatsItem) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.SpaceEdges)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_edges (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_edges: ", p), err) } + return err +} + +func (p *StatsItem) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:positive_part_correlativity: ", p), err) } + return err +} + +func (p *StatsItem) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:negative_part_correlativity: ", p), err) } + return err +} + +func (p *StatsItem) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:status: ", p), err) } + return err +} + +func (p *StatsItem) Equals(other *StatsItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.TagVertices) != len(other.TagVertices) { return false } + for k, _tgt := range p.TagVertices { + _src36 := other.TagVertices[k] + if _tgt != _src36 { return false } + } + if len(p.Edges) != len(other.Edges) { return false } + for k, _tgt := range p.Edges { + _src37 := other.Edges[k] + if _tgt != _src37 { return false } + } + if p.SpaceVertices != other.SpaceVertices { return false } + if p.SpaceEdges != other.SpaceEdges { return false } + if len(p.PositivePartCorrelativity) != len(other.PositivePartCorrelativity) { return false } + for k, _tgt := range p.PositivePartCorrelativity { + _src38 := other.PositivePartCorrelativity[k] + if len(_tgt) != len(_src38) { return false } + for i, _tgt := range _tgt { + _src39 := _src38[i] + if !_tgt.Equals(_src39) { return false } + } + } + if len(p.NegativePartCorrelativity) != len(other.NegativePartCorrelativity) { return false } + for k, _tgt := range p.NegativePartCorrelativity { + _src40 := other.NegativePartCorrelativity[k] + if len(_tgt) != len(_src40) { return false } + for i, _tgt := range _tgt { + _src41 := _src40[i] + if !_tgt.Equals(_src41) { return false } + } + } + if p.Status != other.Status { return false } + return true +} + +func (p *StatsItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StatsItem(%+v)", *p) +} + +func (p *StatsItem) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSpaceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Properties = &SpaceDesc{} + if err := p.Properties.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Properties), err) + } + return nil +} + +func (p *CreateSpaceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateSpaceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateSpaceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateSpaceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Properties), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:properties: ", p), err) } + return err +} + +func (p *CreateSpaceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_not_exists: ", p), err) } + return err +} + +func (p *CreateSpaceReq) Equals(other *CreateSpaceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Properties.Equals(other.Properties) { return false } + if p.IfNotExists != other.IfNotExists { return false } + return true +} + +func (p *CreateSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSpaceReq(%+v)", *p) +} + +func (p *CreateSpaceReq) Validate() error { + return nil +} +// Attributes: +// - OldSpaceName +// - NewSpaceName_ +// - IfNotExists +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"` + IfNotExists bool `thrift:"if_not_exists,3" db:"if_not_exists" json:"if_not_exists"` +} + +func NewCreateSpaceAsReq() *CreateSpaceAsReq { + return &CreateSpaceAsReq{} +} + + +func (p *CreateSpaceAsReq) GetOldSpaceName() []byte { + return p.OldSpaceName +} + +func (p *CreateSpaceAsReq) GetNewSpaceName_() []byte { + return p.NewSpaceName_ +} + +func (p *CreateSpaceAsReq) GetIfNotExists() bool { + return p.IfNotExists +} +func (p *CreateSpaceAsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSpaceAsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.OldSpaceName = v +} + return nil +} + +func (p *CreateSpaceAsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.NewSpaceName_ = v +} + return nil +} + +func (p *CreateSpaceAsReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateSpaceAsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateSpaceAsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateSpaceAsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.OldSpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:old_space_name: ", p), err) } + return err +} + +func (p *CreateSpaceAsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.NewSpaceName_); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_space_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_space_name: ", p), err) } + return err +} + +func (p *CreateSpaceAsReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_not_exists: ", p), err) } + return err +} + +func (p *CreateSpaceAsReq) Equals(other *CreateSpaceAsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.OldSpaceName, other.OldSpaceName) != 0 { return false } + if bytes.Compare(p.NewSpaceName_, other.NewSpaceName_) != 0 { return false } + if p.IfNotExists != other.IfNotExists { return false } + return true +} + +func (p *CreateSpaceAsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSpaceAsReq(%+v)", *p) +} + +func (p *CreateSpaceAsReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropSpaceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *DropSpaceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropSpaceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropSpaceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropSpaceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *DropSpaceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) } + return err +} + +func (p *DropSpaceReq) Equals(other *DropSpaceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.SpaceName, other.SpaceName) != 0 { return false } + if p.IfExists != other.IfExists { return false } + return true +} + +func (p *DropSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropSpaceReq(%+v)", *p) +} + +func (p *DropSpaceReq) Validate() error { + return nil +} +// Attributes: +// - SpaceName +// - IfExists +type ClearSpaceReq 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 NewClearSpaceReq() *ClearSpaceReq { + return &ClearSpaceReq{} +} + + +func (p *ClearSpaceReq) GetSpaceName() []byte { + return p.SpaceName +} + +func (p *ClearSpaceReq) GetIfExists() bool { + return p.IfExists +} +func (p *ClearSpaceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ClearSpaceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *ClearSpaceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *ClearSpaceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ClearSpaceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ClearSpaceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *ClearSpaceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) } + return err +} + +func (p *ClearSpaceReq) Equals(other *ClearSpaceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.SpaceName, other.SpaceName) != 0 { return false } + if p.IfExists != other.IfExists { return false } + return true +} + +func (p *ClearSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ClearSpaceReq(%+v)", *p) +} + +func (p *ClearSpaceReq) Validate() error { + return nil +} +type ListSpacesReq struct { +} + +func NewListSpacesReq() *ListSpacesReq { + return &ListSpacesReq{} +} + +func (p *ListSpacesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSpacesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListSpacesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSpacesReq) Equals(other *ListSpacesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListSpacesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSpacesReq(%+v)", *p) +} + +func (p *ListSpacesReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Spaces +type ListSpacesResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListSpacesResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListSpacesResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSpacesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListSpacesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListSpacesResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem42 := &IdName{} + if err := _elem42.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem42), err) + } + p.Spaces = append(p.Spaces, _elem42) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSpacesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListSpacesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSpacesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListSpacesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListSpacesResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "spaces", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:spaces: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:spaces: ", p), err) } + return err +} + +func (p *ListSpacesResp) Equals(other *ListSpacesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Spaces) != len(other.Spaces) { return false } + for i, _tgt := range p.Spaces { + _src43 := other.Spaces[i] + if !_tgt.Equals(_src43) { return false } + } + return true +} + +func (p *ListSpacesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSpacesResp(%+v)", *p) +} + +func (p *ListSpacesResp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetSpaceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *GetSpaceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSpaceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetSpaceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_name: ", p), err) } + return err +} + +func (p *GetSpaceReq) Equals(other *GetSpaceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.SpaceName, other.SpaceName) != 0 { return false } + return true +} + +func (p *GetSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSpaceReq(%+v)", *p) +} + +func (p *GetSpaceReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Item +type GetSpaceResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var GetSpaceResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetSpaceResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetSpaceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetSpaceResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetSpaceResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Item = &SpaceItem{} + if err := p.Item.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetSpaceResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSpaceResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetSpaceResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetSpaceResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetSpaceResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetSpaceResp) Equals(other *GetSpaceResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Item.Equals(other.Item) { return false } + return true +} + +func (p *GetSpaceResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSpaceResp(%+v)", *p) +} + +func (p *GetSpaceResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - TagName +// - Schema +// - IfNotExists +type CreateTagReq struct { + SpaceID nebula.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() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *CreateTagReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *CreateTagReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &Schema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateTagReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateTagReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateTagReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateTagReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *CreateTagReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *CreateTagReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *CreateTagReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *CreateTagReq) Equals(other *CreateTagReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.TagName, other.TagName) != 0 { return false } + if !p.Schema.Equals(other.Schema) { return false } + if p.IfNotExists != other.IfNotExists { return false } + return true +} + +func (p *CreateTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTagReq(%+v)", *p) +} + +func (p *CreateTagReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - TagName +// - TagItems +// - SchemaProp +type AlterTagReq struct { + SpaceID nebula.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() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterTagReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AlterTagReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *AlterTagReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem44 := &AlterSchemaItem{} + if err := _elem44.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem44), err) + } + p.TagItems = append(p.TagItems, _elem44) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterTagReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.SchemaProp = &SchemaProp{} + if err := p.SchemaProp.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterTagReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AlterTagReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterTagReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AlterTagReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *AlterTagReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.TagItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TagItems { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_items: ", p), err) } + return err +} + +func (p *AlterTagReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) } + return err +} + +func (p *AlterTagReq) Equals(other *AlterTagReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.TagName, other.TagName) != 0 { return false } + if len(p.TagItems) != len(other.TagItems) { return false } + for i, _tgt := range p.TagItems { + _src45 := other.TagItems[i] + if !_tgt.Equals(_src45) { return false } + } + if !p.SchemaProp.Equals(other.SchemaProp) { return false } + return true +} + +func (p *AlterTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterTagReq(%+v)", *p) +} + +func (p *AlterTagReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - TagName +// - IfExists +type DropTagReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *DropTagReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropTagReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DropTagReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *DropTagReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropTagReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropTagReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropTagReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DropTagReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *DropTagReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropTagReq) Equals(other *DropTagReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.TagName, other.TagName) != 0 { return false } + if p.IfExists != other.IfExists { return false } + return true +} + +func (p *DropTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropTagReq(%+v)", *p) +} + +func (p *DropTagReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ListTagsReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagsReq() *ListTagsReq { + return &ListTagsReq{} +} + + +func (p *ListTagsReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListTagsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListTagsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListTagsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListTagsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListTagsReq) Equals(other *ListTagsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ListTagsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagsReq(%+v)", *p) +} + +func (p *ListTagsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Tags +type ListTagsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListTagsResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListTagsResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListTagsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListTagsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListTagsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem46 := &TagItem{} + if err := _elem46.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem46), err) + } + p.Tags = append(p.Tags, _elem46) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListTagsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListTagsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListTagsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListTagsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:tags: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tags: ", p), err) } + return err +} + +func (p *ListTagsResp) Equals(other *ListTagsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Tags) != len(other.Tags) { return false } + for i, _tgt := range p.Tags { + _src47 := other.Tags[i] + if !_tgt.Equals(_src47) { return false } + } + return true +} + +func (p *ListTagsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagsResp(%+v)", *p) +} + +func (p *ListTagsResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - TagName +// - Version +type GetTagReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagReq) GetTagName() []byte { + return p.TagName +} + +func (p *GetTagReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetTagReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetTagReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetTagReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *GetTagReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *GetTagReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTagReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetTagReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetTagReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tag_name: ", p), err) } + return err +} + +func (p *GetTagReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *GetTagReq) Equals(other *GetTagReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.TagName, other.TagName) != 0 { return false } + if p.Version != other.Version { return false } + return true +} + +func (p *GetTagReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagReq(%+v)", *p) +} + +func (p *GetTagReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Schema +type GetTagResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var GetTagResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetTagResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetTagResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetTagResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetTagResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &Schema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetTagResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTagResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetTagResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetTagResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetTagResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *GetTagResp) Equals(other *GetTagResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Schema.Equals(other.Schema) { return false } + return true +} + +func (p *GetTagResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagResp(%+v)", *p) +} + +func (p *GetTagResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - EdgeName +// - Schema +// - IfNotExists +type CreateEdgeReq struct { + SpaceID nebula.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() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *CreateEdgeReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *CreateEdgeReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &Schema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *CreateEdgeReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateEdgeReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateEdgeReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateEdgeReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *CreateEdgeReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *CreateEdgeReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *CreateEdgeReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *CreateEdgeReq) Equals(other *CreateEdgeReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.EdgeName, other.EdgeName) != 0 { return false } + if !p.Schema.Equals(other.Schema) { return false } + if p.IfNotExists != other.IfNotExists { return false } + return true +} + +func (p *CreateEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateEdgeReq(%+v)", *p) +} + +func (p *CreateEdgeReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - EdgeName +// - EdgeItems +// - SchemaProp +type AlterEdgeReq struct { + SpaceID nebula.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() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterEdgeReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AlterEdgeReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *AlterEdgeReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem48 := &AlterSchemaItem{} + if err := _elem48.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) + } + p.EdgeItems = append(p.EdgeItems, _elem48) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AlterEdgeReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.SchemaProp = &SchemaProp{} + if err := p.SchemaProp.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaProp), err) + } + return nil +} + +func (p *AlterEdgeReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AlterEdgeReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterEdgeReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AlterEdgeReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *AlterEdgeReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.EdgeItems)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeItems { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_items: ", p), err) } + return err +} + +func (p *AlterEdgeReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaProp), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:schema_prop: ", p), err) } + return err +} + +func (p *AlterEdgeReq) Equals(other *AlterEdgeReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.EdgeName, other.EdgeName) != 0 { return false } + if len(p.EdgeItems) != len(other.EdgeItems) { return false } + for i, _tgt := range p.EdgeItems { + _src49 := other.EdgeItems[i] + if !_tgt.Equals(_src49) { return false } + } + if !p.SchemaProp.Equals(other.SchemaProp) { return false } + return true +} + +func (p *AlterEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterEdgeReq(%+v)", *p) +} + +func (p *AlterEdgeReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - EdgeName +// - Version +type GetEdgeReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *GetEdgeReq) GetVersion() SchemaVer { + return p.Version +} +func (p *GetEdgeReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetEdgeReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetEdgeReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *GetEdgeReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := SchemaVer(v) + p.Version = temp +} + return nil +} + +func (p *GetEdgeReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetEdgeReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetEdgeReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetEdgeReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *GetEdgeReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Version)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + return err +} + +func (p *GetEdgeReq) Equals(other *GetEdgeReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.EdgeName, other.EdgeName) != 0 { return false } + if p.Version != other.Version { return false } + return true +} + +func (p *GetEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeReq(%+v)", *p) +} + +func (p *GetEdgeReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Schema +type GetEdgeResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var GetEdgeResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetEdgeResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetEdgeResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetEdgeResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetEdgeResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Schema = &Schema{} + if err := p.Schema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Schema), err) + } + return nil +} + +func (p *GetEdgeResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetEdgeResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetEdgeResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetEdgeResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetEdgeResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Schema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:schema: ", p), err) } + return err +} + +func (p *GetEdgeResp) Equals(other *GetEdgeResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Schema.Equals(other.Schema) { return false } + return true +} + +func (p *GetEdgeResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeResp(%+v)", *p) +} + +func (p *GetEdgeResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - EdgeName +// - IfExists +type DropEdgeReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeReq) GetEdgeName() []byte { + return p.EdgeName +} + +func (p *DropEdgeReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropEdgeReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DropEdgeReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *DropEdgeReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropEdgeReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropEdgeReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropEdgeReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DropEdgeReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_name: ", p), err) } + return err +} + +func (p *DropEdgeReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropEdgeReq) Equals(other *DropEdgeReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.EdgeName, other.EdgeName) != 0 { return false } + if p.IfExists != other.IfExists { return false } + return true +} + +func (p *DropEdgeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropEdgeReq(%+v)", *p) +} + +func (p *DropEdgeReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ListEdgesReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgesReq() *ListEdgesReq { + return &ListEdgesReq{} +} + + +func (p *ListEdgesReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListEdgesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListEdgesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListEdgesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListEdgesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListEdgesReq) Equals(other *ListEdgesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ListEdgesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgesReq(%+v)", *p) +} + +func (p *ListEdgesReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Edges +type ListEdgesResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListEdgesResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListEdgesResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListEdgesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListEdgesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListEdgesResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem50 := &EdgeItem{} + if err := _elem50.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) + } + p.Edges = append(p.Edges, _elem50) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListEdgesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListEdgesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListEdgesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListEdgesResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "edges", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edges: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Edges)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Edges { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edges: ", p), err) } + return err +} + +func (p *ListEdgesResp) Equals(other *ListEdgesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Edges) != len(other.Edges) { return false } + for i, _tgt := range p.Edges { + _src51 := other.Edges[i] + if !_tgt.Equals(_src51) { return false } + } + return true +} + +func (p *ListEdgesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgesResp(%+v)", *p) +} + +func (p *ListEdgesResp) Validate() error { + return nil +} +// Attributes: +// - Hosts +type AddHostsReq struct { + Hosts []*nebula.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewAddHostsReq() *AddHostsReq { + return &AddHostsReq{} +} + + +func (p *AddHostsReq) GetHosts() []*nebula.HostAddr { + return p.Hosts +} +func (p *AddHostsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddHostsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem52 := &nebula.HostAddr{} + if err := _elem52.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.Hosts = append(p.Hosts, _elem52) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddHostsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddHostsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddHostsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } + return err +} + +func (p *AddHostsReq) Equals(other *AddHostsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src53 := other.Hosts[i] + if !_tgt.Equals(_src53) { return false } + } + return true +} + +func (p *AddHostsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddHostsReq(%+v)", *p) +} + +func (p *AddHostsReq) Validate() error { + return nil +} +// Attributes: +// - Hosts +type DropHostsReq struct { + Hosts []*nebula.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` +} + +func NewDropHostsReq() *DropHostsReq { + return &DropHostsReq{} +} + + +func (p *DropHostsReq) GetHosts() []*nebula.HostAddr { + return p.Hosts +} +func (p *DropHostsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropHostsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem54 := &nebula.HostAddr{} + if err := _elem54.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) + } + p.Hosts = append(p.Hosts, _elem54) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DropHostsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropHostsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropHostsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } + return err +} + +func (p *DropHostsReq) Equals(other *DropHostsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src55 := other.Hosts[i] + if !_tgt.Equals(_src55) { return false } + } + return true +} + +func (p *DropHostsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropHostsReq(%+v)", *p) +} + +func (p *DropHostsReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListHostsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ListHostType(v) + p.Type = temp +} + return nil +} + +func (p *ListHostsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListHostsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListHostsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ListHostsReq) Equals(other *ListHostsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + return true +} + +func (p *ListHostsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListHostsReq(%+v)", *p) +} + +func (p *ListHostsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Hosts +type ListHostsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListHostsResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListHostsResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListHostsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListHostsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListHostsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem56 := &HostItem{} + if err := _elem56.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + p.Hosts = append(p.Hosts, _elem56) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListHostsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListHostsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListHostsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListHostsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListHostsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) } + return err +} + +func (p *ListHostsResp) Equals(other *ListHostsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src57 := other.Hosts[i] + if !_tgt.Equals(_src57) { return false } + } + return true +} + +func (p *ListHostsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListHostsResp(%+v)", *p) +} + +func (p *ListHostsResp) Validate() error { + return nil +} +// Attributes: +// - PartID +// - Leader +// - Peers +// - Losts +type PartItem struct { + PartID nebula.PartitionID `thrift:"part_id,1,required" db:"part_id" json:"part_id"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader,omitempty"` + Peers []*nebula.HostAddr `thrift:"peers,3,required" db:"peers" json:"peers"` + Losts []*nebula.HostAddr `thrift:"losts,4,required" db:"losts" json:"losts"` +} + +func NewPartItem() *PartItem { + return &PartItem{} +} + + +func (p *PartItem) GetPartID() nebula.PartitionID { + return p.PartID +} +var PartItem_Leader_DEFAULT *nebula.HostAddr +func (p *PartItem) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return PartItem_Leader_DEFAULT + } +return p.Leader +} + +func (p *PartItem) GetPeers() []*nebula.HostAddr { + return p.Peers +} + +func (p *PartItem) GetLosts() []*nebula.HostAddr { + return p.Losts +} +func (p *PartItem) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *PartItem) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetPartID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + issetPeers = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetLosts = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetPartID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + if !issetPeers{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Peers is not set")); + } + if !issetLosts{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Losts is not set")); + } + return nil +} + +func (p *PartItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *PartItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *PartItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Peers = tSlice + for i := 0; i < size; i ++ { + _elem58 := &nebula.HostAddr{} + if err := _elem58.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) + } + p.Peers = append(p.Peers, _elem58) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Losts = tSlice + for i := 0; i < size; i ++ { + _elem59 := &nebula.HostAddr{} + if err := _elem59.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) + } + p.Losts = append(p.Losts, _elem59) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "PartItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PartItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_id: ", p), err) } + return err +} + +func (p *PartItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLeader() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + } + return err +} + +func (p *PartItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *PartItem) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "losts", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:losts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Losts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Losts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:losts: ", p), err) } + return err +} + +func (p *PartItem) Equals(other *PartItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.PartID != other.PartID { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Peers) != len(other.Peers) { return false } + for i, _tgt := range p.Peers { + _src60 := other.Peers[i] + if !_tgt.Equals(_src60) { return false } + } + if len(p.Losts) != len(other.Losts) { return false } + for i, _tgt := range p.Losts { + _src61 := other.Losts[i] + if !_tgt.Equals(_src61) { return false } + } + return true +} + +func (p *PartItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartItem(%+v)", *p) +} + +func (p *PartItem) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartIds +type ListPartsReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartIds []nebula.PartitionID `thrift:"part_ids,2" db:"part_ids" json:"part_ids"` +} + +func NewListPartsReq() *ListPartsReq { + return &ListPartsReq{} +} + + +func (p *ListPartsReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *ListPartsReq) GetPartIds() []nebula.PartitionID { + return p.PartIds +} +func (p *ListPartsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListPartsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListPartsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + p.PartIds = tSlice + for i := 0; i < size; i ++ { +var _elem62 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem62 = temp +} + p.PartIds = append(p.PartIds, _elem62) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListPartsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListPartsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListPartsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.I32, len(p.PartIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartIds { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_ids: ", p), err) } + return err +} + +func (p *ListPartsReq) Equals(other *ListPartsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.PartIds) != len(other.PartIds) { return false } + for i, _tgt := range p.PartIds { + _src63 := other.PartIds[i] + if _tgt != _src63 { return false } + } + return true +} + +func (p *ListPartsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListPartsReq(%+v)", *p) +} + +func (p *ListPartsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Parts +type ListPartsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListPartsResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListPartsResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListPartsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListPartsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListPartsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem64 := &PartItem{} + if err := _elem64.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) + } + p.Parts = append(p.Parts, _elem64) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListPartsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListPartsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListPartsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListPartsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListPartsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) } + return err +} + +func (p *ListPartsResp) Equals(other *ListPartsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Parts) != len(other.Parts) { return false } + for i, _tgt := range p.Parts { + _src65 := other.Parts[i] + if !_tgt.Equals(_src65) { return false } + } + return true +} + +func (p *ListPartsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListPartsResp(%+v)", *p) +} + +func (p *ListPartsResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type GetPartsAllocReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetPartsAllocReq() *GetPartsAllocReq { + return &GetPartsAllocReq{} +} + + +func (p *GetPartsAllocReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *GetPartsAllocReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPartsAllocReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetPartsAllocReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetPartsAllocReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPartsAllocReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetPartsAllocReq) Equals(other *GetPartsAllocReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *GetPartsAllocReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartsAllocReq(%+v)", *p) +} + +func (p *GetPartsAllocReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Parts +// - Terms +type GetPartsAllocResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Parts map[nebula.PartitionID][]*nebula.HostAddr `thrift:"parts,3" db:"parts" json:"parts"` + Terms map[nebula.PartitionID]int64 `thrift:"terms,4" db:"terms" json:"terms,omitempty"` +} + +func NewGetPartsAllocResp() *GetPartsAllocResp { + return &GetPartsAllocResp{} +} + + +func (p *GetPartsAllocResp) GetCode() nebula.ErrorCode { + return p.Code +} +var GetPartsAllocResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetPartsAllocResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return GetPartsAllocResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetPartsAllocResp) GetParts() map[nebula.PartitionID][]*nebula.HostAddr { + return p.Parts +} +var GetPartsAllocResp_Terms_DEFAULT map[nebula.PartitionID]int64 + +func (p *GetPartsAllocResp) GetTerms() map[nebula.PartitionID]int64 { + return p.Terms +} +func (p *GetPartsAllocResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetPartsAllocResp) IsSetTerms() bool { + return p.Terms != nil +} + +func (p *GetPartsAllocResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPartsAllocResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetPartsAllocResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetPartsAllocResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*nebula.HostAddr, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key66 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key66 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + _val67 := tSlice + for i := 0; i < size; i ++ { + _elem68 := &nebula.HostAddr{} + if err := _elem68.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) + } + _val67 = append(_val67, _elem68) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key66] = _val67 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID]int64, size) + p.Terms = tMap + for i := 0; i < size; i ++ { +var _key69 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key69 = temp +} +var _val70 int64 + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val70 = v +} + p.Terms[_key69] = _val70 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPartsAllocResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetPartsAllocResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPartsAllocResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetPartsAllocResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetPartsAllocResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) } + return err +} + +func (p *GetPartsAllocResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTerms() { + if err := oprot.WriteFieldBegin(ctx, "terms", thrift.MAP, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:terms: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:terms: ", p), err) } + } + return err +} + +func (p *GetPartsAllocResp) Equals(other *GetPartsAllocResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src71 := other.Parts[k] + if len(_tgt) != len(_src71) { return false } + for i, _tgt := range _tgt { + _src72 := _src71[i] + if !_tgt.Equals(_src72) { return false } + } + } + if len(p.Terms) != len(other.Terms) { return false } + for k, _tgt := range p.Terms { + _src73 := other.Terms[k] + if _tgt != _src73 { return false } + } + return true +} + +func (p *GetPartsAllocResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPartsAllocResp(%+v)", *p) +} + +func (p *GetPartsAllocResp) Validate() error { + return nil +} +// Attributes: +// - Host +type GetWorkerIdReq struct { + Host []byte `thrift:"host,1" db:"host" json:"host"` +} + +func NewGetWorkerIdReq() *GetWorkerIdReq { + return &GetWorkerIdReq{} +} + + +func (p *GetWorkerIdReq) GetHost() []byte { + return p.Host +} +func (p *GetWorkerIdReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetWorkerIdReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Host = v +} + return nil +} + +func (p *GetWorkerIdReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetWorkerIdReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetWorkerIdReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "host", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:host: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Host); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.host (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *GetWorkerIdReq) Equals(other *GetWorkerIdReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Host, other.Host) != 0 { return false } + return true +} + +func (p *GetWorkerIdReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetWorkerIdReq(%+v)", *p) +} + +func (p *GetWorkerIdReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Workerid +type GetWorkerIdResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Workerid int64 `thrift:"workerid,3" db:"workerid" json:"workerid"` +} + +func NewGetWorkerIdResp() *GetWorkerIdResp { + return &GetWorkerIdResp{} +} + + +func (p *GetWorkerIdResp) GetCode() nebula.ErrorCode { + return p.Code +} +var GetWorkerIdResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetWorkerIdResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return GetWorkerIdResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetWorkerIdResp) GetWorkerid() int64 { + return p.Workerid +} +func (p *GetWorkerIdResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetWorkerIdResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetWorkerIdResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetWorkerIdResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetWorkerIdResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Workerid = v +} + return nil +} + +func (p *GetWorkerIdResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetWorkerIdResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetWorkerIdResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetWorkerIdResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetWorkerIdResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "workerid", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:workerid: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Workerid)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.workerid (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:workerid: ", p), err) } + return err +} + +func (p *GetWorkerIdResp) Equals(other *GetWorkerIdResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if p.Workerid != other.Workerid { return false } + return true +} + +func (p *GetWorkerIdResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetWorkerIdResp(%+v)", *p) +} + +func (p *GetWorkerIdResp) Validate() error { + return nil +} +// Attributes: +// - Length +type GetSegmentIdReq struct { + Length int64 `thrift:"length,1" db:"length" json:"length"` +} + +func NewGetSegmentIdReq() *GetSegmentIdReq { + return &GetSegmentIdReq{} +} + + +func (p *GetSegmentIdReq) GetLength() int64 { + return p.Length +} +func (p *GetSegmentIdReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetSegmentIdReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Length = v +} + return nil +} + +func (p *GetSegmentIdReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSegmentIdReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetSegmentIdReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "length", thrift.I64, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:length: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Length)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.length (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:length: ", p), err) } + return err +} + +func (p *GetSegmentIdReq) Equals(other *GetSegmentIdReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Length != other.Length { return false } + return true +} + +func (p *GetSegmentIdReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSegmentIdReq(%+v)", *p) +} + +func (p *GetSegmentIdReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - SegmentID +type GetSegmentIdResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + SegmentID int64 `thrift:"segment_id,3" db:"segment_id" json:"segment_id"` +} + +func NewGetSegmentIdResp() *GetSegmentIdResp { + return &GetSegmentIdResp{} +} + + +func (p *GetSegmentIdResp) GetCode() nebula.ErrorCode { + return p.Code +} +var GetSegmentIdResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetSegmentIdResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return GetSegmentIdResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetSegmentIdResp) GetSegmentID() int64 { + return p.SegmentID +} +func (p *GetSegmentIdResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetSegmentIdResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetSegmentIdResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetSegmentIdResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetSegmentIdResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.SegmentID = v +} + return nil +} + +func (p *GetSegmentIdResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSegmentIdResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetSegmentIdResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetSegmentIdResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetSegmentIdResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "segment_id", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:segment_id: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.SegmentID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.segment_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:segment_id: ", p), err) } + return err +} + +func (p *GetSegmentIdResp) Equals(other *GetSegmentIdResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if p.SegmentID != other.SegmentID { return false } + return true +} + +func (p *GetSegmentIdResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSegmentIdResp(%+v)", *p) +} + +func (p *GetSegmentIdResp) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - ClusterID +// - LastUpdateTimeInMs +// - MetaVersion +type HBResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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{} +} + + +func (p *HBResp) GetCode() nebula.ErrorCode { + return p.Code +} +var HBResp_Leader_DEFAULT *nebula.HostAddr +func (p *HBResp) GetLeader() *nebula.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.Leader != nil +} + +func (p *HBResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I32 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *HBResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *HBResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := ClusterID(v) + p.ClusterID = temp +} + return nil +} + +func (p *HBResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.LastUpdateTimeInMs = v +} + return nil +} + +func (p *HBResp) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.MetaVersion = v +} + return nil +} + +func (p *HBResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "HBResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HBResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *HBResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *HBResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cluster_id: ", p), err) } + return err +} + +func (p *HBResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx); 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(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.MetaVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.meta_version (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:meta_version: ", p), err) } + return err +} + +func (p *HBResp) Equals(other *HBResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if p.ClusterID != other.ClusterID { return false } + if p.LastUpdateTimeInMs != other.LastUpdateTimeInMs { return false } + if p.MetaVersion != other.MetaVersion { return false } + return true +} + +func (p *HBResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HBResp(%+v)", *p) +} + +func (p *HBResp) Validate() error { + return nil +} +// Attributes: +// - PartID +// - Term +type LeaderInfo struct { + PartID nebula.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() nebula.PartitionID { + return p.PartID +} + +func (p *LeaderInfo) GetTerm() int64 { + return p.Term +} +func (p *LeaderInfo) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *LeaderInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *LeaderInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Term = v +} + return nil +} + +func (p *LeaderInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "LeaderInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LeaderInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_id: ", p), err) } + return err +} + +func (p *LeaderInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "term", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term: ", p), err) } + return err +} + +func (p *LeaderInfo) Equals(other *LeaderInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.PartID != other.PartID { return false } + if p.Term != other.Term { return false } + return true +} + +func (p *LeaderInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LeaderInfo(%+v)", *p) +} + +func (p *LeaderInfo) Validate() error { + return nil +} +// Attributes: +// - PartList +type PartitionList struct { + PartList []nebula.PartitionID `thrift:"part_list,1" db:"part_list" json:"part_list"` +} + +func NewPartitionList() *PartitionList { + return &PartitionList{} +} + + +func (p *PartitionList) GetPartList() []nebula.PartitionID { + return p.PartList +} +func (p *PartitionList) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *PartitionList) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + p.PartList = tSlice + for i := 0; i < size; i ++ { +var _elem74 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem74 = temp +} + p.PartList = append(p.PartList, _elem74) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartitionList) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "PartitionList"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PartitionList) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "part_list", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:part_list: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.PartList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PartList { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_list: ", p), err) } + return err +} + +func (p *PartitionList) Equals(other *PartitionList) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.PartList) != len(other.PartList) { return false } + for i, _tgt := range p.PartList { + _src75 := other.PartList[i] + if _tgt != _src75 { return false } + } + return true +} + +func (p *PartitionList) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionList(%+v)", *p) +} + +func (p *PartitionList) Validate() error { + return nil +} +// Attributes: +// - Role +// - Host +// - ClusterID +// - LeaderPartIds +// - GitInfoSha +// - DiskParts +// - Dir +// - Version +type HBReq struct { + Role HostRole `thrift:"role,1" db:"role" json:"role"` + Host *nebula.HostAddr `thrift:"host,2" db:"host" json:"host"` + ClusterID ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id"` + LeaderPartIds map[nebula.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"` + DiskParts map[nebula.GraphSpaceID]map[string]*PartitionList `thrift:"disk_parts,6" db:"disk_parts" json:"disk_parts,omitempty"` + Dir *nebula.DirInfo `thrift:"dir,7" db:"dir" json:"dir,omitempty"` + Version []byte `thrift:"version,8" db:"version" json:"version,omitempty"` +} + +func NewHBReq() *HBReq { + return &HBReq{} +} + + +func (p *HBReq) GetRole() HostRole { + return p.Role +} +var HBReq_Host_DEFAULT *nebula.HostAddr +func (p *HBReq) GetHost() *nebula.HostAddr { + if !p.IsSetHost() { + return HBReq_Host_DEFAULT + } +return p.Host +} + +func (p *HBReq) GetClusterID() ClusterID { + return p.ClusterID +} +var HBReq_LeaderPartIds_DEFAULT map[nebula.GraphSpaceID][]*LeaderInfo + +func (p *HBReq) GetLeaderPartIds() map[nebula.GraphSpaceID][]*LeaderInfo { + return p.LeaderPartIds +} + +func (p *HBReq) GetGitInfoSha() []byte { + return p.GitInfoSha +} +var HBReq_DiskParts_DEFAULT map[nebula.GraphSpaceID]map[string]*PartitionList + +func (p *HBReq) GetDiskParts() map[nebula.GraphSpaceID]map[string]*PartitionList { + return p.DiskParts +} +var HBReq_Dir_DEFAULT *nebula.DirInfo +func (p *HBReq) GetDir() *nebula.DirInfo { + if !p.IsSetDir() { + return HBReq_Dir_DEFAULT + } +return p.Dir +} +var HBReq_Version_DEFAULT []byte + +func (p *HBReq) GetVersion() []byte { + return p.Version +} +func (p *HBReq) IsSetHost() bool { + return p.Host != nil +} + +func (p *HBReq) IsSetLeaderPartIds() bool { + return p.LeaderPartIds != nil +} + +func (p *HBReq) IsSetDiskParts() bool { + return p.DiskParts != nil +} + +func (p *HBReq) IsSetDir() bool { + return p.Dir != nil +} + +func (p *HBReq) IsSetVersion() bool { + return p.Version != nil +} + +func (p *HBReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.MAP { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.MAP { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HBReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := HostRole(v) + p.Role = temp +} + return nil +} + +func (p *HBReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *HBReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := ClusterID(v) + p.ClusterID = temp +} + return nil +} + +func (p *HBReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.GraphSpaceID][]*LeaderInfo, size) + p.LeaderPartIds = tMap + for i := 0; i < size; i ++ { +var _key76 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _key76 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*LeaderInfo, 0, size) + _val77 := tSlice + for i := 0; i < size; i ++ { + _elem78 := &LeaderInfo{} + if err := _elem78.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem78), err) + } + _val77 = append(_val77, _elem78) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderPartIds[_key76] = _val77 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HBReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.GitInfoSha = v +} + return nil +} + +func (p *HBReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.GraphSpaceID]map[string]*PartitionList, size) + p.DiskParts = tMap + for i := 0; i < size; i ++ { +var _key79 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _key79 = temp +} + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*PartitionList, size) + _val80 := tMap + for i := 0; i < size; i ++ { +var _key81 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key81 = v +} + _val82 := &PartitionList{} + if err := _val82.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val82), err) + } + _val80[_key81] = _val82 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.DiskParts[_key79] = _val80 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *HBReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.Dir = &nebula.DirInfo{} + if err := p.Dir.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *HBReq) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *HBReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "HBReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HBReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "role", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:role: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role: ", p), err) } + return err +} + +func (p *HBReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *HBReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cluster_id: ", p), err) } + return err +} + +func (p *HBReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLeaderPartIds() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:leader_partIds: ", p), err) } + } + return err +} + +func (p *HBReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:git_info_sha: ", p), err) } + return err +} + +func (p *HBReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDiskParts() { + if err := oprot.WriteFieldBegin(ctx, "disk_parts", thrift.MAP, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:disk_parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.MAP, len(p.DiskParts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.DiskParts { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range v { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:disk_parts: ", p), err) } + } + return err +} + +func (p *HBReq) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDir() { + if err := oprot.WriteFieldBegin(ctx, "dir", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:dir: ", p), err) } + if err := p.Dir.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:dir: ", p), err) } + } + return err +} + +func (p *HBReq) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:version: ", p), err) } + } + return err +} + +func (p *HBReq) Equals(other *HBReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Role != other.Role { return false } + if !p.Host.Equals(other.Host) { return false } + if p.ClusterID != other.ClusterID { return false } + if len(p.LeaderPartIds) != len(other.LeaderPartIds) { return false } + for k, _tgt := range p.LeaderPartIds { + _src83 := other.LeaderPartIds[k] + if len(_tgt) != len(_src83) { return false } + for i, _tgt := range _tgt { + _src84 := _src83[i] + if !_tgt.Equals(_src84) { return false } + } + } + if bytes.Compare(p.GitInfoSha, other.GitInfoSha) != 0 { return false } + if len(p.DiskParts) != len(other.DiskParts) { return false } + for k, _tgt := range p.DiskParts { + _src85 := other.DiskParts[k] + if len(_tgt) != len(_src85) { return false } + for k, _tgt := range _tgt { + _src86 := _src85[k] + if !_tgt.Equals(_src86) { return false } + } + } + if !p.Dir.Equals(other.Dir) { return false } + if bytes.Compare(p.Version, other.Version) != 0 { return false } + return true +} + +func (p *HBReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HBReq(%+v)", *p) +} + +func (p *HBReq) Validate() error { + return nil +} +// Attributes: +// - Dir +// - Addr +// - Role +type ServiceInfo struct { + Dir *nebula.DirInfo `thrift:"dir,1" db:"dir" json:"dir"` + Addr *nebula.HostAddr `thrift:"addr,2" db:"addr" json:"addr"` + Role HostRole `thrift:"role,3" db:"role" json:"role"` +} + +func NewServiceInfo() *ServiceInfo { + return &ServiceInfo{} +} + +var ServiceInfo_Dir_DEFAULT *nebula.DirInfo +func (p *ServiceInfo) GetDir() *nebula.DirInfo { + if !p.IsSetDir() { + return ServiceInfo_Dir_DEFAULT + } +return p.Dir +} +var ServiceInfo_Addr_DEFAULT *nebula.HostAddr +func (p *ServiceInfo) GetAddr() *nebula.HostAddr { + if !p.IsSetAddr() { + return ServiceInfo_Addr_DEFAULT + } +return p.Addr +} + +func (p *ServiceInfo) GetRole() HostRole { + return p.Role +} +func (p *ServiceInfo) IsSetDir() bool { + return p.Dir != nil +} + +func (p *ServiceInfo) IsSetAddr() bool { + return p.Addr != nil +} + +func (p *ServiceInfo) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ServiceInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Dir = &nebula.DirInfo{} + if err := p.Dir.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *ServiceInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Addr = &nebula.HostAddr{} + if err := p.Addr.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Addr), err) + } + return nil +} + +func (p *ServiceInfo) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := HostRole(v) + p.Role = temp +} + return nil +} + +func (p *ServiceInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ServiceInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ServiceInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "dir", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:dir: ", p), err) } + if err := p.Dir.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:dir: ", p), err) } + return err +} + +func (p *ServiceInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "addr", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:addr: ", p), err) } + if err := p.Addr.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Addr), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:addr: ", p), err) } + return err +} + +func (p *ServiceInfo) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "role", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:role: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Role)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.role (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:role: ", p), err) } + return err +} + +func (p *ServiceInfo) Equals(other *ServiceInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Dir.Equals(other.Dir) { return false } + if !p.Addr.Equals(other.Addr) { return false } + if p.Role != other.Role { return false } + return true +} + +func (p *ServiceInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ServiceInfo(%+v)", *p) +} + +func (p *ServiceInfo) Validate() error { + return nil +} +// Attributes: +// - Host +// - GitInfoSha +// - Version +type AgentHBReq struct { + Host *nebula.HostAddr `thrift:"host,1" db:"host" json:"host"` + GitInfoSha []byte `thrift:"git_info_sha,2" db:"git_info_sha" json:"git_info_sha"` + Version []byte `thrift:"version,3" db:"version" json:"version,omitempty"` +} + +func NewAgentHBReq() *AgentHBReq { + return &AgentHBReq{} +} + +var AgentHBReq_Host_DEFAULT *nebula.HostAddr +func (p *AgentHBReq) GetHost() *nebula.HostAddr { + if !p.IsSetHost() { + return AgentHBReq_Host_DEFAULT + } +return p.Host +} + +func (p *AgentHBReq) GetGitInfoSha() []byte { + return p.GitInfoSha +} +var AgentHBReq_Version_DEFAULT []byte + +func (p *AgentHBReq) GetVersion() []byte { + return p.Version +} +func (p *AgentHBReq) IsSetHost() bool { + return p.Host != nil +} + +func (p *AgentHBReq) IsSetVersion() bool { + return p.Version != nil +} + +func (p *AgentHBReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AgentHBReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *AgentHBReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.GitInfoSha = v +} + return nil +} + +func (p *AgentHBReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Version = v +} + return nil +} + +func (p *AgentHBReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AgentHBReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AgentHBReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *AgentHBReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "git_info_sha", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:git_info_sha: ", p), err) } + if err := oprot.WriteBinary(ctx, p.GitInfoSha); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:git_info_sha: ", p), err) } + return err +} + +func (p *AgentHBReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetVersion() { + if err := oprot.WriteFieldBegin(ctx, "version", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Version); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:version: ", p), err) } + } + return err +} + +func (p *AgentHBReq) Equals(other *AgentHBReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Host.Equals(other.Host) { return false } + if bytes.Compare(p.GitInfoSha, other.GitInfoSha) != 0 { return false } + if bytes.Compare(p.Version, other.Version) != 0 { return false } + return true +} + +func (p *AgentHBReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AgentHBReq(%+v)", *p) +} + +func (p *AgentHBReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - ServiceList +type AgentHBResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ServiceList []*ServiceInfo `thrift:"service_list,3" db:"service_list" json:"service_list"` +} + +func NewAgentHBResp() *AgentHBResp { + return &AgentHBResp{} +} + + +func (p *AgentHBResp) GetCode() nebula.ErrorCode { + return p.Code +} +var AgentHBResp_Leader_DEFAULT *nebula.HostAddr +func (p *AgentHBResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return AgentHBResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *AgentHBResp) GetServiceList() []*ServiceInfo { + return p.ServiceList +} +func (p *AgentHBResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *AgentHBResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AgentHBResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *AgentHBResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *AgentHBResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ServiceInfo, 0, size) + p.ServiceList = tSlice + for i := 0; i < size; i ++ { + _elem87 := &ServiceInfo{} + if err := _elem87.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem87), err) + } + p.ServiceList = append(p.ServiceList, _elem87) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AgentHBResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AgentHBResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AgentHBResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *AgentHBResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *AgentHBResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "service_list", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:service_list: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ServiceList)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ServiceList { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:service_list: ", p), err) } + return err +} + +func (p *AgentHBResp) Equals(other *AgentHBResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.ServiceList) != len(other.ServiceList) { return false } + for i, _tgt := range p.ServiceList { + _src88 := other.ServiceList[i] + if !_tgt.Equals(_src88) { return false } + } + return true +} + +func (p *AgentHBResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AgentHBResp(%+v)", *p) +} + +func (p *AgentHBResp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetName bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I16 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetName{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + return nil +} + +func (p *IndexFieldDef) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IndexFieldDef) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI16(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TypeLength = &v +} + return nil +} + +func (p *IndexFieldDef) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IndexFieldDef"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexFieldDef) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *IndexFieldDef) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTypeLength() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int16(*p.TypeLength)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type_length (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type_length: ", p), err) } + } + return err +} + +func (p *IndexFieldDef) Equals(other *IndexFieldDef) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if p.TypeLength != other.TypeLength { + if p.TypeLength == nil || other.TypeLength == nil { + return false + } + if (*p.TypeLength) != (*other.TypeLength) { return false } + } + return true +} + +func (p *IndexFieldDef) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexFieldDef(%+v)", *p) +} + +func (p *IndexFieldDef) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - IndexName +// - TagName +// - Fields +// - IfNotExists +// - Comment +// - IndexParams +type CreateTagIndexReq struct { + SpaceID nebula.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"` + IndexParams *IndexParams `thrift:"index_params,7" db:"index_params" json:"index_params,omitempty"` +} + +func NewCreateTagIndexReq() *CreateTagIndexReq { + return &CreateTagIndexReq{} +} + + +func (p *CreateTagIndexReq) GetSpaceID() nebula.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 +} +var CreateTagIndexReq_IndexParams_DEFAULT *IndexParams +func (p *CreateTagIndexReq) GetIndexParams() *IndexParams { + if !p.IsSetIndexParams() { + return CreateTagIndexReq_IndexParams_DEFAULT + } +return p.IndexParams +} +func (p *CreateTagIndexReq) IsSetComment() bool { + return p.Comment != nil +} + +func (p *CreateTagIndexReq) IsSetIndexParams() bool { + return p.IndexParams != nil +} + +func (p *CreateTagIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateTagIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *CreateTagIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TagName = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem89 := &IndexFieldDef{} + if err := _elem89.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem89), err) + } + p.Fields = append(p.Fields, _elem89) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateTagIndexReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *CreateTagIndexReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.IndexParams = &IndexParams{} + if err := p.IndexParams.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) + } + return nil +} + +func (p *CreateTagIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateTagIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateTagIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.TagName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:tag_name: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) } + return err +} + +func (p *CreateTagIndexReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) } + } + return err +} + +func (p *CreateTagIndexReq) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetIndexParams() { + if err := oprot.WriteFieldBegin(ctx, "index_params", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } + if err := p.IndexParams.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } + } + return err +} + +func (p *CreateTagIndexReq) Equals(other *CreateTagIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + if bytes.Compare(p.TagName, other.TagName) != 0 { return false } + if len(p.Fields) != len(other.Fields) { return false } + for i, _tgt := range p.Fields { + _src90 := other.Fields[i] + if !_tgt.Equals(_src90) { return false } + } + if p.IfNotExists != other.IfNotExists { return false } + if bytes.Compare(p.Comment, other.Comment) != 0 { return false } + if !p.IndexParams.Equals(other.IndexParams) { return false } + return true +} + +func (p *CreateTagIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateTagIndexReq(%+v)", *p) +} + +func (p *CreateTagIndexReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropTagIndexReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DropTagIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropTagIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropTagIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropTagIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DropTagIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *DropTagIndexReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropTagIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropTagIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropTagIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DropTagIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *DropTagIndexReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropTagIndexReq) Equals(other *DropTagIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + if p.IfExists != other.IfExists { return false } + return true +} + +func (p *DropTagIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropTagIndexReq(%+v)", *p) +} + +func (p *DropTagIndexReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - IndexName +type GetTagIndexReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetTagIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetTagIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetTagIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetTagIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *GetTagIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTagIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetTagIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetTagIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *GetTagIndexReq) Equals(other *GetTagIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + return true +} + +func (p *GetTagIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagIndexReq(%+v)", *p) +} + +func (p *GetTagIndexReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Item +type GetTagIndexResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var GetTagIndexResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetTagIndexResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetTagIndexResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetTagIndexResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetTagIndexResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Item = &IndexItem{} + if err := p.Item.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetTagIndexResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetTagIndexResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetTagIndexResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetTagIndexResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetTagIndexResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetTagIndexResp) Equals(other *GetTagIndexResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Item.Equals(other.Item) { return false } + return true +} + +func (p *GetTagIndexResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetTagIndexResp(%+v)", *p) +} + +func (p *GetTagIndexResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ListTagIndexesReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListTagIndexesReq() *ListTagIndexesReq { + return &ListTagIndexesReq{} +} + + +func (p *ListTagIndexesReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ListTagIndexesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListTagIndexesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListTagIndexesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListTagIndexesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListTagIndexesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListTagIndexesReq) Equals(other *ListTagIndexesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ListTagIndexesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagIndexesReq(%+v)", *p) +} + +func (p *ListTagIndexesReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Items +type ListTagIndexesResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListTagIndexesResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListTagIndexesResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListTagIndexesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListTagIndexesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListTagIndexesResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem91 := &IndexItem{} + if err := _elem91.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) + } + p.Items = append(p.Items, _elem91) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListTagIndexesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListTagIndexesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListTagIndexesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListTagIndexesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListTagIndexesResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListTagIndexesResp) Equals(other *ListTagIndexesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Items) != len(other.Items) { return false } + for i, _tgt := range p.Items { + _src92 := other.Items[i] + if !_tgt.Equals(_src92) { return false } + } + return true +} + +func (p *ListTagIndexesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListTagIndexesResp(%+v)", *p) +} + +func (p *ListTagIndexesResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - IndexName +// - EdgeName +// - Fields +// - IfNotExists +// - Comment +// - IndexParams +type CreateEdgeIndexReq struct { + SpaceID nebula.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"` + IndexParams *IndexParams `thrift:"index_params,7" db:"index_params" json:"index_params,omitempty"` +} + +func NewCreateEdgeIndexReq() *CreateEdgeIndexReq { + return &CreateEdgeIndexReq{} +} + + +func (p *CreateEdgeIndexReq) GetSpaceID() nebula.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 +} +var CreateEdgeIndexReq_IndexParams_DEFAULT *IndexParams +func (p *CreateEdgeIndexReq) GetIndexParams() *IndexParams { + if !p.IsSetIndexParams() { + return CreateEdgeIndexReq_IndexParams_DEFAULT + } +return p.IndexParams +} +func (p *CreateEdgeIndexReq) IsSetComment() bool { + return p.Comment != nil +} + +func (p *CreateEdgeIndexReq) IsSetIndexParams() bool { + return p.IndexParams != nil +} + +func (p *CreateEdgeIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRING { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.EdgeName = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem93 := &IndexFieldDef{} + if err := _elem93.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem93), err) + } + p.Fields = append(p.Fields, _elem93) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateEdgeIndexReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Comment = v +} + return nil +} + +func (p *CreateEdgeIndexReq) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + p.IndexParams = &IndexParams{} + if err := p.IndexParams.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) + } + return nil +} + +func (p *CreateEdgeIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateEdgeIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateEdgeIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EdgeName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_name: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "fields", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:fields: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:fields: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:if_not_exists: ", p), err) } + return err +} + +func (p *CreateEdgeIndexReq) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetComment() { + if err := oprot.WriteFieldBegin(ctx, "comment", thrift.STRING, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:comment: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Comment); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.comment (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:comment: ", p), err) } + } + return err +} + +func (p *CreateEdgeIndexReq) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetIndexParams() { + if err := oprot.WriteFieldBegin(ctx, "index_params", thrift.STRUCT, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } + if err := p.IndexParams.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } + } + return err +} + +func (p *CreateEdgeIndexReq) Equals(other *CreateEdgeIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + if bytes.Compare(p.EdgeName, other.EdgeName) != 0 { return false } + if len(p.Fields) != len(other.Fields) { return false } + for i, _tgt := range p.Fields { + _src94 := other.Fields[i] + if !_tgt.Equals(_src94) { return false } + } + if p.IfNotExists != other.IfNotExists { return false } + if bytes.Compare(p.Comment, other.Comment) != 0 { return false } + if !p.IndexParams.Equals(other.IndexParams) { return false } + return true +} + +func (p *CreateEdgeIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateEdgeIndexReq(%+v)", *p) +} + +func (p *CreateEdgeIndexReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - IndexName +// - IfExists +type DropEdgeIndexReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DropEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} + +func (p *DropEdgeIndexReq) GetIfExists() bool { + return p.IfExists +} +func (p *DropEdgeIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropEdgeIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DropEdgeIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *DropEdgeIndexReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropEdgeIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropEdgeIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropEdgeIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DropEdgeIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *DropEdgeIndexReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_exists: ", p), err) } + return err +} + +func (p *DropEdgeIndexReq) Equals(other *DropEdgeIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + if p.IfExists != other.IfExists { return false } + return true +} + +func (p *DropEdgeIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropEdgeIndexReq(%+v)", *p) +} + +func (p *DropEdgeIndexReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - IndexName +type GetEdgeIndexReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetEdgeIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *GetEdgeIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetEdgeIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetEdgeIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *GetEdgeIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetEdgeIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetEdgeIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetEdgeIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *GetEdgeIndexReq) Equals(other *GetEdgeIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + return true +} + +func (p *GetEdgeIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeIndexReq(%+v)", *p) +} + +func (p *GetEdgeIndexReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Item +type GetEdgeIndexResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var GetEdgeIndexResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetEdgeIndexResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetEdgeIndexResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetEdgeIndexResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetEdgeIndexResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Item = &IndexItem{} + if err := p.Item.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetEdgeIndexResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetEdgeIndexResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetEdgeIndexResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetEdgeIndexResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetEdgeIndexResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:item: ", p), err) } + return err +} + +func (p *GetEdgeIndexResp) Equals(other *GetEdgeIndexResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Item.Equals(other.Item) { return false } + return true +} + +func (p *GetEdgeIndexResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetEdgeIndexResp(%+v)", *p) +} + +func (p *GetEdgeIndexResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ListEdgeIndexesReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListEdgeIndexesReq() *ListEdgeIndexesReq { + return &ListEdgeIndexesReq{} +} + + +func (p *ListEdgeIndexesReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ListEdgeIndexesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListEdgeIndexesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListEdgeIndexesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListEdgeIndexesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListEdgeIndexesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListEdgeIndexesReq) Equals(other *ListEdgeIndexesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ListEdgeIndexesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgeIndexesReq(%+v)", *p) +} + +func (p *ListEdgeIndexesReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Items +type ListEdgeIndexesResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListEdgeIndexesResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListEdgeIndexesResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListEdgeIndexesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListEdgeIndexesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListEdgeIndexesResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem95 := &IndexItem{} + if err := _elem95.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem95), err) + } + p.Items = append(p.Items, _elem95) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListEdgeIndexesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListEdgeIndexesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListEdgeIndexesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListEdgeIndexesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListEdgeIndexesResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListEdgeIndexesResp) Equals(other *ListEdgeIndexesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Items) != len(other.Items) { return false } + for i, _tgt := range p.Items { + _src96 := other.Items[i] + if !_tgt.Equals(_src96) { return false } + } + return true +} + +func (p *ListEdgeIndexesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListEdgeIndexesResp(%+v)", *p) +} + +func (p *ListEdgeIndexesResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - IndexName +type RebuildIndexReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexReq) GetIndexName() []byte { + return p.IndexName +} +func (p *RebuildIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RebuildIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *RebuildIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IndexName = v +} + return nil +} + +func (p *RebuildIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RebuildIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RebuildIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *RebuildIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.IndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index_name: ", p), err) } + return err +} + +func (p *RebuildIndexReq) Equals(other *RebuildIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.IndexName, other.IndexName) != 0 { return false } + return true +} + +func (p *RebuildIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RebuildIndexReq(%+v)", *p) +} + +func (p *RebuildIndexReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateUserReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *CreateUserReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EncodedPwd = v +} + return nil +} + +func (p *CreateUserReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *CreateUserReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateUserReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateUserReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *CreateUserReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) } + return err +} + +func (p *CreateUserReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:if_not_exists: ", p), err) } + return err +} + +func (p *CreateUserReq) Equals(other *CreateUserReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Account, other.Account) != 0 { return false } + if bytes.Compare(p.EncodedPwd, other.EncodedPwd) != 0 { return false } + if p.IfNotExists != other.IfNotExists { return false } + return true +} + +func (p *CreateUserReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateUserReq(%+v)", *p) +} + +func (p *CreateUserReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropUserReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *DropUserReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.IfExists = v +} + return nil +} + +func (p *DropUserReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropUserReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropUserReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *DropUserReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_exists (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:if_exists: ", p), err) } + return err +} + +func (p *DropUserReq) Equals(other *DropUserReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Account, other.Account) != 0 { return false } + if p.IfExists != other.IfExists { return false } + return true +} + +func (p *DropUserReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropUserReq(%+v)", *p) +} + +func (p *DropUserReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AlterUserReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *AlterUserReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.EncodedPwd = v +} + return nil +} + +func (p *AlterUserReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AlterUserReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AlterUserReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *AlterUserReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.EncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:encoded_pwd: ", p), err) } + return err +} + +func (p *AlterUserReq) Equals(other *AlterUserReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Account, other.Account) != 0 { return false } + if bytes.Compare(p.EncodedPwd, other.EncodedPwd) != 0 { return false } + return true +} + +func (p *AlterUserReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AlterUserReq(%+v)", *p) +} + +func (p *AlterUserReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GrantRoleReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.RoleItem = &RoleItem{} + if err := p.RoleItem.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *GrantRoleReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GrantRoleReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GrantRoleReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) } + return err +} + +func (p *GrantRoleReq) Equals(other *GrantRoleReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.RoleItem.Equals(other.RoleItem) { return false } + return true +} + +func (p *GrantRoleReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GrantRoleReq(%+v)", *p) +} + +func (p *GrantRoleReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RevokeRoleReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.RoleItem = &RoleItem{} + if err := p.RoleItem.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.RoleItem), err) + } + return nil +} + +func (p *RevokeRoleReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RevokeRoleReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RevokeRoleReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.RoleItem), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:role_item: ", p), err) } + return err +} + +func (p *RevokeRoleReq) Equals(other *RevokeRoleReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.RoleItem.Equals(other.RoleItem) { return false } + return true +} + +func (p *RevokeRoleReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RevokeRoleReq(%+v)", *p) +} + +func (p *RevokeRoleReq) Validate() error { + return nil +} +type ListUsersReq struct { +} + +func NewListUsersReq() *ListUsersReq { + return &ListUsersReq{} +} + +func (p *ListUsersReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListUsersReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListUsersReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListUsersReq) Equals(other *ListUsersReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListUsersReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListUsersReq(%+v)", *p) +} + +func (p *ListUsersReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Users +type ListUsersResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListUsersResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListUsersResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListUsersResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListUsersResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListUsersResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key97 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key97 = v +} +var _val98 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val98 = v +} + p.Users[_key97] = _val98 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListUsersResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListUsersResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListUsersResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListUsersResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListUsersResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "users", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:users: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:users: ", p), err) } + return err +} + +func (p *ListUsersResp) Equals(other *ListUsersResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Users) != len(other.Users) { return false } + for k, _tgt := range p.Users { + _src99 := other.Users[k] + if bytes.Compare(_tgt, _src99) != 0 { return false } + } + return true +} + +func (p *ListUsersResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListUsersResp(%+v)", *p) +} + +func (p *ListUsersResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ListRolesReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListRolesReq() *ListRolesReq { + return &ListRolesReq{} +} + + +func (p *ListRolesReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ListRolesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListRolesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListRolesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListRolesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListRolesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListRolesReq) Equals(other *ListRolesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ListRolesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListRolesReq(%+v)", *p) +} + +func (p *ListRolesReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Roles +type ListRolesResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListRolesResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListRolesResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListRolesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListRolesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListRolesResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem100 := &RoleItem{} + if err := _elem100.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem100), err) + } + p.Roles = append(p.Roles, _elem100) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListRolesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListRolesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListRolesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListRolesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListRolesResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "roles", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:roles: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Roles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Roles { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:roles: ", p), err) } + return err +} + +func (p *ListRolesResp) Equals(other *ListRolesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Roles) != len(other.Roles) { return false } + for i, _tgt := range p.Roles { + _src101 := other.Roles[i] + if !_tgt.Equals(_src101) { return false } + } + return true +} + +func (p *ListRolesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListRolesResp(%+v)", *p) +} + +func (p *ListRolesResp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetUserRolesReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *GetUserRolesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetUserRolesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetUserRolesReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *GetUserRolesReq) Equals(other *GetUserRolesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Account, other.Account) != 0 { return false } + return true +} + +func (p *GetUserRolesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUserRolesReq(%+v)", *p) +} + +func (p *GetUserRolesReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ChangePasswordReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Account = v +} + return nil +} + +func (p *ChangePasswordReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.NewEncodedPwd_ = v +} + return nil +} + +func (p *ChangePasswordReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.OldEncodedPwd = v +} + return nil +} + +func (p *ChangePasswordReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ChangePasswordReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ChangePasswordReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "account", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:account: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Account); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.account (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:account: ", p), err) } + return err +} + +func (p *ChangePasswordReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.NewEncodedPwd_); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.new_encoded_pwd (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:new_encoded_pwd: ", p), err) } + return err +} + +func (p *ChangePasswordReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.OldEncodedPwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.old_encoded_pwd (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:old_encoded_pwd: ", p), err) } + return err +} + +func (p *ChangePasswordReq) Equals(other *ChangePasswordReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Account, other.Account) != 0 { return false } + if bytes.Compare(p.NewEncodedPwd_, other.NewEncodedPwd_) != 0 { return false } + if bytes.Compare(p.OldEncodedPwd, other.OldEncodedPwd) != 0 { return false } + return true +} + +func (p *ChangePasswordReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChangePasswordReq(%+v)", *p) +} + +func (p *ChangePasswordReq) Validate() error { + return nil +} +// Attributes: +// - ID +// - Command +// - Result_ +// - StartTime +// - StopTime +type BalanceTask struct { + ID []byte `thrift:"id,1" db:"id" json:"id"` + Command []byte `thrift:"command,2" db:"command" json:"command"` + Result_ TaskResult_ `thrift:"result,3" db:"result" json:"result"` + StartTime int64 `thrift:"start_time,4" db:"start_time" json:"start_time"` + StopTime int64 `thrift:"stop_time,5" db:"stop_time" json:"stop_time"` +} + +func NewBalanceTask() *BalanceTask { + return &BalanceTask{} +} + + +func (p *BalanceTask) GetID() []byte { + return p.ID +} + +func (p *BalanceTask) GetCommand() []byte { + return p.Command +} + +func (p *BalanceTask) GetResult_() TaskResult_ { + return p.Result_ +} + +func (p *BalanceTask) GetStartTime() int64 { + return p.StartTime +} + +func (p *BalanceTask) GetStopTime() int64 { + return p.StopTime +} +func (p *BalanceTask) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BalanceTask) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ID = v +} + return nil +} + +func (p *BalanceTask) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Command = v +} + return nil +} + +func (p *BalanceTask) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := TaskResult_(v) + p.Result_ = temp +} + return nil +} + +func (p *BalanceTask) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.StartTime = v +} + return nil +} + +func (p *BalanceTask) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.StopTime = v +} + return nil +} + +func (p *BalanceTask) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "BalanceTask"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *BalanceTask) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "id", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:id: ", p), err) } + if err := oprot.WriteBinary(ctx, p.ID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *BalanceTask) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "command", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:command: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Command); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.command (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:command: ", p), err) } + return err +} + +func (p *BalanceTask) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "result", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:result: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Result_)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.result (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:result: ", p), err) } + return err +} + +func (p *BalanceTask) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:start_time: ", p), err) } + return err +} + +func (p *BalanceTask) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.StopTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stop_time (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:stop_time: ", p), err) } + return err +} + +func (p *BalanceTask) Equals(other *BalanceTask) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ID, other.ID) != 0 { return false } + if bytes.Compare(p.Command, other.Command) != 0 { return false } + if p.Result_ != other.Result_ { return false } + if p.StartTime != other.StartTime { return false } + if p.StopTime != other.StopTime { return false } + return true +} + +func (p *BalanceTask) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BalanceTask(%+v)", *p) +} + +func (p *BalanceTask) Validate() error { + return nil +} +// 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 *nebula.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 *nebula.Value +func (p *ConfigItem) GetValue() *nebula.Value { + if !p.IsSetValue() { + return ConfigItem_Value_DEFAULT + } +return p.Value +} +func (p *ConfigItem) IsSetValue() bool { + return p.Value != nil +} + +func (p *ConfigItem) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ConfigItem) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ConfigModule(v) + p.Module = temp +} + return nil +} + +func (p *ConfigItem) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *ConfigItem) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := ConfigMode(v) + p.Mode = temp +} + return nil +} + +func (p *ConfigItem) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Value = &nebula.Value{} + if err := p.Value.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Value), err) + } + return nil +} + +func (p *ConfigItem) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ConfigItem"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ConfigItem) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "module", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:module: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:module: ", p), err) } + return err +} + +func (p *ConfigItem) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *ConfigItem) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "mode", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:mode: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Mode)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.mode (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:mode: ", p), err) } + return err +} + +func (p *ConfigItem) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Value), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:value: ", p), err) } + return err +} + +func (p *ConfigItem) Equals(other *ConfigItem) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Module != other.Module { return false } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if p.Mode != other.Mode { return false } + if !p.Value.Equals(other.Value) { return false } + return true +} + +func (p *ConfigItem) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ConfigItem(%+v)", *p) +} + +func (p *ConfigItem) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RegConfigReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem102 := &ConfigItem{} + if err := _elem102.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem102), err) + } + p.Items = append(p.Items, _elem102) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RegConfigReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RegConfigReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RegConfigReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "items", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:items: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:items: ", p), err) } + return err +} + +func (p *RegConfigReq) Equals(other *RegConfigReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Items) != len(other.Items) { return false } + for i, _tgt := range p.Items { + _src103 := other.Items[i] + if !_tgt.Equals(_src103) { return false } + } + return true +} + +func (p *RegConfigReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RegConfigReq(%+v)", *p) +} + +func (p *RegConfigReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetConfigReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Item = &ConfigItem{} + if err := p.Item.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *GetConfigReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetConfigReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetConfigReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) } + return err +} + +func (p *GetConfigReq) Equals(other *GetConfigReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Item.Equals(other.Item) { return false } + return true +} + +func (p *GetConfigReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetConfigReq(%+v)", *p) +} + +func (p *GetConfigReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Items +type GetConfigResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var GetConfigResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetConfigResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetConfigResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetConfigResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetConfigResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem104 := &ConfigItem{} + if err := _elem104.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem104), err) + } + p.Items = append(p.Items, _elem104) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetConfigResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetConfigResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetConfigResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetConfigResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetConfigResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *GetConfigResp) Equals(other *GetConfigResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Items) != len(other.Items) { return false } + for i, _tgt := range p.Items { + _src105 := other.Items[i] + if !_tgt.Equals(_src105) { return false } + } + return true +} + +func (p *GetConfigResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetConfigResp(%+v)", *p) +} + +func (p *GetConfigResp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SetConfigReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Item = &ConfigItem{} + if err := p.Item.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Item), err) + } + return nil +} + +func (p *SetConfigReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SetConfigReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SetConfigReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Item), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:item: ", p), err) } + return err +} + +func (p *SetConfigReq) Equals(other *SetConfigReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Item.Equals(other.Item) { return false } + return true +} + +func (p *SetConfigReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SetConfigReq(%+v)", *p) +} + +func (p *SetConfigReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListConfigsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Space = v +} + return nil +} + +func (p *ListConfigsReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ConfigModule(v) + p.Module = temp +} + return nil +} + +func (p *ListConfigsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListConfigsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListConfigsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "space", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Space); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) } + return err +} + +func (p *ListConfigsReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "module", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:module: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Module)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.module (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:module: ", p), err) } + return err +} + +func (p *ListConfigsReq) Equals(other *ListConfigsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Space, other.Space) != 0 { return false } + if p.Module != other.Module { return false } + return true +} + +func (p *ListConfigsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListConfigsReq(%+v)", *p) +} + +func (p *ListConfigsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Items +type ListConfigsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListConfigsResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListConfigsResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListConfigsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListConfigsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListConfigsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem106 := &ConfigItem{} + if err := _elem106.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem106), err) + } + p.Items = append(p.Items, _elem106) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListConfigsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListConfigsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListConfigsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListConfigsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListConfigsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "items", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:items: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Items)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Items { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:items: ", p), err) } + return err +} + +func (p *ListConfigsResp) Equals(other *ListConfigsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Items) != len(other.Items) { return false } + for i, _tgt := range p.Items { + _src107 := other.Items[i] + if !_tgt.Equals(_src107) { return false } + } + return true +} + +func (p *ListConfigsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListConfigsResp(%+v)", *p) +} + +func (p *ListConfigsResp) Validate() error { + return nil +} +type CreateSnapshotReq struct { +} + +func NewCreateSnapshotReq() *CreateSnapshotReq { + return &CreateSnapshotReq{} +} + +func (p *CreateSnapshotReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSnapshotReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateSnapshotReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateSnapshotReq) Equals(other *CreateSnapshotReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *CreateSnapshotReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSnapshotReq(%+v)", *p) +} + +func (p *CreateSnapshotReq) Validate() error { + return nil +} +// Attributes: +// - Names +type DropSnapshotReq struct { + Names [][]byte `thrift:"names,1" db:"names" json:"names"` +} + +func NewDropSnapshotReq() *DropSnapshotReq { + return &DropSnapshotReq{} +} + + +func (p *DropSnapshotReq) GetNames() [][]byte { + return p.Names +} +func (p *DropSnapshotReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropSnapshotReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Names = tSlice + for i := 0; i < size; i ++ { +var _elem108 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem108 = v +} + p.Names = append(p.Names, _elem108) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DropSnapshotReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropSnapshotReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropSnapshotReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "names", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:names: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Names)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Names { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:names: ", p), err) } + return err +} + +func (p *DropSnapshotReq) Equals(other *DropSnapshotReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Names) != len(other.Names) { return false } + for i, _tgt := range p.Names { + _src109 := other.Names[i] + if bytes.Compare(_tgt, _src109) != 0 { return false } + } + return true +} + +func (p *DropSnapshotReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropSnapshotReq(%+v)", *p) +} + +func (p *DropSnapshotReq) Validate() error { + return nil +} +type ListSnapshotsReq struct { +} + +func NewListSnapshotsReq() *ListSnapshotsReq { + return &ListSnapshotsReq{} +} + +func (p *ListSnapshotsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSnapshotsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListSnapshotsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSnapshotsReq) Equals(other *ListSnapshotsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListSnapshotsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSnapshotsReq(%+v)", *p) +} + +func (p *ListSnapshotsReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Snapshot) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *Snapshot) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := SnapshotStatus(v) + p.Status = temp +} + return nil +} + +func (p *Snapshot) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Hosts = v +} + return nil +} + +func (p *Snapshot) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Snapshot"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Snapshot) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *Snapshot) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *Snapshot) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Hosts); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.hosts (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) } + return err +} + +func (p *Snapshot) Equals(other *Snapshot) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if p.Status != other.Status { return false } + if bytes.Compare(p.Hosts, other.Hosts) != 0 { return false } + return true +} + +func (p *Snapshot) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Snapshot(%+v)", *p) +} + +func (p *Snapshot) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Snapshots +type ListSnapshotsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListSnapshotsResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListSnapshotsResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSnapshotsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListSnapshotsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListSnapshotsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem110 := &Snapshot{} + if err := _elem110.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem110), err) + } + p.Snapshots = append(p.Snapshots, _elem110) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSnapshotsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListSnapshotsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSnapshotsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListSnapshotsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListSnapshotsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "snapshots", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:snapshots: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Snapshots)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Snapshots { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:snapshots: ", p), err) } + return err +} + +func (p *ListSnapshotsResp) Equals(other *ListSnapshotsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Snapshots) != len(other.Snapshots) { return false } + for i, _tgt := range p.Snapshots { + _src111 := other.Snapshots[i] + if !_tgt.Equals(_src111) { return false } + } + return true +} + +func (p *ListSnapshotsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSnapshotsResp(%+v)", *p) +} + +func (p *ListSnapshotsResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ListIndexStatusReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListIndexStatusReq() *ListIndexStatusReq { + return &ListIndexStatusReq{} +} + + +func (p *ListIndexStatusReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ListIndexStatusReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListIndexStatusReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListIndexStatusReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListIndexStatusReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListIndexStatusReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListIndexStatusReq) Equals(other *ListIndexStatusReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ListIndexStatusReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListIndexStatusReq(%+v)", *p) +} + +func (p *ListIndexStatusReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexStatus) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *IndexStatus) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Status = v +} + return nil +} + +func (p *IndexStatus) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IndexStatus"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexStatus) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *IndexStatus) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Status); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *IndexStatus) Equals(other *IndexStatus) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if bytes.Compare(p.Status, other.Status) != 0 { return false } + return true +} + +func (p *IndexStatus) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexStatus(%+v)", *p) +} + +func (p *IndexStatus) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Statuses +type ListIndexStatusResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListIndexStatusResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListIndexStatusResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListIndexStatusResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListIndexStatusResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListIndexStatusResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem112 := &IndexStatus{} + if err := _elem112.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem112), err) + } + p.Statuses = append(p.Statuses, _elem112) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListIndexStatusResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListIndexStatusResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListIndexStatusResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "statuses", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Statuses)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Statuses { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statuses: ", p), err) } + return err +} + +func (p *ListIndexStatusResp) Equals(other *ListIndexStatusResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Statuses) != len(other.Statuses) { return false } + for i, _tgt := range p.Statuses { + _src113 := other.Statuses[i] + if !_tgt.Equals(_src113) { return false } + } + return true +} + +func (p *ListIndexStatusResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListIndexStatusResp(%+v)", *p) +} + +func (p *ListIndexStatusResp) Validate() error { + return nil +} +// Attributes: +// - Zones +// - ZoneName +type MergeZoneReq struct { + Zones [][]byte `thrift:"zones,1" db:"zones" json:"zones"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewMergeZoneReq() *MergeZoneReq { + return &MergeZoneReq{} +} + + +func (p *MergeZoneReq) GetZones() [][]byte { + return p.Zones +} + +func (p *MergeZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *MergeZoneReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MergeZoneReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.Zones = tSlice + for i := 0; i < size; i ++ { +var _elem114 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem114 = v +} + p.Zones = append(p.Zones, _elem114) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *MergeZoneReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *MergeZoneReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "MergeZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MergeZoneReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "zones", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zones: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Zones)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Zones { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zones: ", p), err) } + return err +} + +func (p *MergeZoneReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *MergeZoneReq) Equals(other *MergeZoneReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Zones) != len(other.Zones) { return false } + for i, _tgt := range p.Zones { + _src115 := other.Zones[i] + if bytes.Compare(_tgt, _src115) != 0 { return false } + } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + return true +} + +func (p *MergeZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MergeZoneReq(%+v)", *p) +} + +func (p *MergeZoneReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropZoneReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DropZoneReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropZoneReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *DropZoneReq) Equals(other *DropZoneReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + return true +} + +func (p *DropZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropZoneReq(%+v)", *p) +} + +func (p *DropZoneReq) Validate() error { + return nil +} +// Attributes: +// - ZoneName +// - ZoneItems +type DivideZoneReq struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + ZoneItems map[string][]*nebula.HostAddr `thrift:"zone_items,2" db:"zone_items" json:"zone_items"` +} + +func NewDivideZoneReq() *DivideZoneReq { + return &DivideZoneReq{} +} + + +func (p *DivideZoneReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *DivideZoneReq) GetZoneItems() map[string][]*nebula.HostAddr { + return p.ZoneItems +} +func (p *DivideZoneReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DivideZoneReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *DivideZoneReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]*nebula.HostAddr, size) + p.ZoneItems = tMap + for i := 0; i < size; i ++ { +var _key116 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key116 = v +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + _val117 := tSlice + for i := 0; i < size; i ++ { + _elem118 := &nebula.HostAddr{} + if err := _elem118.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem118), err) + } + _val117 = append(_val117, _elem118) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.ZoneItems[_key116] = _val117 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DivideZoneReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DivideZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DivideZoneReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *DivideZoneReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "zone_items", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_items: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.LIST, len(p.ZoneItems)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.ZoneItems { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_items: ", p), err) } + return err +} + +func (p *DivideZoneReq) Equals(other *DivideZoneReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + if len(p.ZoneItems) != len(other.ZoneItems) { return false } + for k, _tgt := range p.ZoneItems { + _src119 := other.ZoneItems[k] + if len(_tgt) != len(_src119) { return false } + for i, _tgt := range _tgt { + _src120 := _src119[i] + if !_tgt.Equals(_src120) { return false } + } + } + return true +} + +func (p *DivideZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DivideZoneReq(%+v)", *p) +} + +func (p *DivideZoneReq) Validate() error { + return nil +} +// Attributes: +// - OriginalZoneName +// - ZoneName +type RenameZoneReq struct { + OriginalZoneName []byte `thrift:"original_zone_name,1" db:"original_zone_name" json:"original_zone_name"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` +} + +func NewRenameZoneReq() *RenameZoneReq { + return &RenameZoneReq{} +} + + +func (p *RenameZoneReq) GetOriginalZoneName() []byte { + return p.OriginalZoneName +} + +func (p *RenameZoneReq) GetZoneName() []byte { + return p.ZoneName +} +func (p *RenameZoneReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RenameZoneReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.OriginalZoneName = v +} + return nil +} + +func (p *RenameZoneReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *RenameZoneReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RenameZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RenameZoneReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "original_zone_name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:original_zone_name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.OriginalZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.original_zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:original_zone_name: ", p), err) } + return err +} + +func (p *RenameZoneReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *RenameZoneReq) Equals(other *RenameZoneReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.OriginalZoneName, other.OriginalZoneName) != 0 { return false } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + return true +} + +func (p *RenameZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RenameZoneReq(%+v)", *p) +} + +func (p *RenameZoneReq) Validate() error { + return nil +} +// Attributes: +// - Hosts +// - ZoneName +// - IsNew +type AddHostsIntoZoneReq struct { + Hosts []*nebula.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` + ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` + IsNew bool `thrift:"is_new,3" db:"is_new" json:"is_new"` +} + +func NewAddHostsIntoZoneReq() *AddHostsIntoZoneReq { + return &AddHostsIntoZoneReq{} +} + + +func (p *AddHostsIntoZoneReq) GetHosts() []*nebula.HostAddr { + return p.Hosts +} + +func (p *AddHostsIntoZoneReq) GetZoneName() []byte { + return p.ZoneName +} + +func (p *AddHostsIntoZoneReq) GetIsNew() bool { + return p.IsNew +} +func (p *AddHostsIntoZoneReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddHostsIntoZoneReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem121 := &nebula.HostAddr{} + if err := _elem121.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem121), err) + } + p.Hosts = append(p.Hosts, _elem121) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddHostsIntoZoneReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *AddHostsIntoZoneReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.IsNew = v +} + return nil +} + +func (p *AddHostsIntoZoneReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddHostsIntoZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddHostsIntoZoneReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } + return err +} + +func (p *AddHostsIntoZoneReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } + return err +} + +func (p *AddHostsIntoZoneReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "is_new", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:is_new: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.IsNew)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.is_new (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:is_new: ", p), err) } + return err +} + +func (p *AddHostsIntoZoneReq) Equals(other *AddHostsIntoZoneReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src122 := other.Hosts[i] + if !_tgt.Equals(_src122) { return false } + } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + if p.IsNew != other.IsNew { return false } + return true +} + +func (p *AddHostsIntoZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddHostsIntoZoneReq(%+v)", *p) +} + +func (p *AddHostsIntoZoneReq) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetZoneReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *GetZoneReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetZoneReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetZoneReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *GetZoneReq) Equals(other *GetZoneReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + return true +} + +func (p *GetZoneReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetZoneReq(%+v)", *p) +} + +func (p *GetZoneReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Hosts +type GetZoneResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Hosts []*nebula.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewGetZoneResp() *GetZoneResp { + return &GetZoneResp{} +} + + +func (p *GetZoneResp) GetCode() nebula.ErrorCode { + return p.Code +} +var GetZoneResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetZoneResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return GetZoneResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *GetZoneResp) GetHosts() []*nebula.HostAddr { + return p.Hosts +} +func (p *GetZoneResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *GetZoneResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetZoneResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetZoneResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetZoneResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem123 := &nebula.HostAddr{} + if err := _elem123.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem123), err) + } + p.Hosts = append(p.Hosts, _elem123) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetZoneResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetZoneResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetZoneResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetZoneResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetZoneResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) } + return err +} + +func (p *GetZoneResp) Equals(other *GetZoneResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src124 := other.Hosts[i] + if !_tgt.Equals(_src124) { return false } + } + return true +} + +func (p *GetZoneResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetZoneResp(%+v)", *p) +} + +func (p *GetZoneResp) Validate() error { + return nil +} +type ListZonesReq struct { +} + +func NewListZonesReq() *ListZonesReq { + return &ListZonesReq{} +} + +func (p *ListZonesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListZonesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListZonesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListZonesReq) Equals(other *ListZonesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListZonesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListZonesReq(%+v)", *p) +} + +func (p *ListZonesReq) Validate() error { + return nil +} +// Attributes: +// - ZoneName +// - Nodes +type Zone struct { + ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` + Nodes []*nebula.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() []*nebula.HostAddr { + return p.Nodes +} +func (p *Zone) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Zone) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ZoneName = v +} + return nil +} + +func (p *Zone) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Nodes = tSlice + for i := 0; i < size; i ++ { + _elem125 := &nebula.HostAddr{} + if err := _elem125.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem125), err) + } + p.Nodes = append(p.Nodes, _elem125) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *Zone) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Zone"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Zone) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ZoneName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.zone_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zone_name: ", p), err) } + return err +} + +func (p *Zone) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "nodes", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:nodes: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Nodes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Nodes { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:nodes: ", p), err) } + return err +} + +func (p *Zone) Equals(other *Zone) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ZoneName, other.ZoneName) != 0 { return false } + if len(p.Nodes) != len(other.Nodes) { return false } + for i, _tgt := range p.Nodes { + _src126 := other.Nodes[i] + if !_tgt.Equals(_src126) { return false } + } + return true +} + +func (p *Zone) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Zone(%+v)", *p) +} + +func (p *Zone) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Zones +type ListZonesResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListZonesResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListZonesResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListZonesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListZonesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListZonesResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem127 := &Zone{} + if err := _elem127.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem127), err) + } + p.Zones = append(p.Zones, _elem127) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListZonesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListZonesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListZonesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListZonesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListZonesResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "zones", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:zones: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Zones)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Zones { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:zones: ", p), err) } + return err +} + +func (p *ListZonesResp) Equals(other *ListZonesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Zones) != len(other.Zones) { return false } + for i, _tgt := range p.Zones { + _src128 := other.Zones[i] + if !_tgt.Equals(_src128) { return false } + } + return true +} + +func (p *ListZonesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListZonesResp(%+v)", *p) +} + +func (p *ListZonesResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Type +// - Hosts +type AddListenerReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Type ListenerType `thrift:"type,2" db:"type" json:"type"` + Hosts []*nebula.HostAddr `thrift:"hosts,3" db:"hosts" json:"hosts"` +} + +func NewAddListenerReq() *AddListenerReq { + return &AddListenerReq{} +} + + +func (p *AddListenerReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *AddListenerReq) GetType() ListenerType { + return p.Type +} + +func (p *AddListenerReq) GetHosts() []*nebula.HostAddr { + return p.Hosts +} +func (p *AddListenerReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddListenerReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AddListenerReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *AddListenerReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem129 := &nebula.HostAddr{} + if err := _elem129.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem129), err) + } + p.Hosts = append(p.Hosts, _elem129) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddListenerReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddListenerReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddListenerReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AddListenerReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *AddListenerReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:hosts: ", p), err) } + return err +} + +func (p *AddListenerReq) Equals(other *AddListenerReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.Type != other.Type { return false } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src130 := other.Hosts[i] + if !_tgt.Equals(_src130) { return false } + } + return true +} + +func (p *AddListenerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddListenerReq(%+v)", *p) +} + +func (p *AddListenerReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Type +type RemoveListenerReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *RemoveListenerReq) GetType() ListenerType { + return p.Type +} +func (p *RemoveListenerReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RemoveListenerReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *RemoveListenerReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *RemoveListenerReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RemoveListenerReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RemoveListenerReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *RemoveListenerReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:type: ", p), err) } + return err +} + +func (p *RemoveListenerReq) Equals(other *RemoveListenerReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.Type != other.Type { return false } + return true +} + +func (p *RemoveListenerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoveListenerReq(%+v)", *p) +} + +func (p *RemoveListenerReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ListListenerReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewListListenerReq() *ListListenerReq { + return &ListListenerReq{} +} + + +func (p *ListListenerReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ListListenerReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListListenerReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ListListenerReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListListenerReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListListenerReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ListListenerReq) Equals(other *ListListenerReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ListListenerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListListenerReq(%+v)", *p) +} + +func (p *ListListenerReq) Validate() error { + return nil +} +// Attributes: +// - Type +// - Host +// - PartID +// - Status +type ListenerInfo struct { + Type ListenerType `thrift:"type,1" db:"type" json:"type"` + Host *nebula.HostAddr `thrift:"host,2" db:"host" json:"host"` + PartID nebula.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 *nebula.HostAddr +func (p *ListenerInfo) GetHost() *nebula.HostAddr { + if !p.IsSetHost() { + return ListenerInfo_Host_DEFAULT + } +return p.Host +} + +func (p *ListenerInfo) GetPartID() nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListenerInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ListenerType(v) + p.Type = temp +} + return nil +} + +func (p *ListenerInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *ListenerInfo) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *ListenerInfo) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := HostStatus(v) + p.Status = temp +} + return nil +} + +func (p *ListenerInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListenerInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListenerInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_id: ", p), err) } + return err +} + +func (p *ListenerInfo) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:status: ", p), err) } + return err +} + +func (p *ListenerInfo) Equals(other *ListenerInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + if !p.Host.Equals(other.Host) { return false } + if p.PartID != other.PartID { return false } + if p.Status != other.Status { return false } + return true +} + +func (p *ListenerInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListenerInfo(%+v)", *p) +} + +func (p *ListenerInfo) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Listeners +type ListListenerResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListListenerResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListListenerResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListListenerResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListListenerResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListListenerResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem131 := &ListenerInfo{} + if err := _elem131.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem131), err) + } + p.Listeners = append(p.Listeners, _elem131) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListListenerResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListListenerResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListListenerResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListListenerResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListListenerResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "listeners", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:listeners: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Listeners)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Listeners { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:listeners: ", p), err) } + return err +} + +func (p *ListListenerResp) Equals(other *ListListenerResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Listeners) != len(other.Listeners) { return false } + for i, _tgt := range p.Listeners { + _src132 := other.Listeners[i] + if !_tgt.Equals(_src132) { return false } + } + return true +} + +func (p *ListListenerResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListListenerResp(%+v)", *p) +} + +func (p *ListListenerResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type GetStatsReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewGetStatsReq() *GetStatsReq { + return &GetStatsReq{} +} + + +func (p *GetStatsReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *GetStatsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetStatsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetStatsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetStatsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetStatsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetStatsReq) Equals(other *GetStatsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *GetStatsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetStatsReq(%+v)", *p) +} + +func (p *GetStatsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Stats +type GetStatsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Stats *StatsItem `thrift:"stats,3" db:"stats" json:"stats"` +} + +func NewGetStatsResp() *GetStatsResp { + return &GetStatsResp{} +} + + +func (p *GetStatsResp) GetCode() nebula.ErrorCode { + return p.Code +} +var GetStatsResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetStatsResp) GetLeader() *nebula.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.Leader != nil +} + +func (p *GetStatsResp) IsSetStats() bool { + return p.Stats != nil +} + +func (p *GetStatsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetStatsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetStatsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetStatsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Stats = &StatsItem{} + if err := p.Stats.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) + } + return nil +} + +func (p *GetStatsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetStatsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetStatsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetStatsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetStatsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stats: ", p), err) } + return err +} + +func (p *GetStatsResp) Equals(other *GetStatsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Stats.Equals(other.Stats) { return false } + return true +} + +func (p *GetStatsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetStatsResp(%+v)", *p) +} + +func (p *GetStatsResp) Validate() error { + return nil +} +// Attributes: +// - Host +// - Checkpoints +type HostBackupInfo struct { + Host *nebula.HostAddr `thrift:"host,1" db:"host" json:"host"` + Checkpoints []*nebula.CheckpointInfo `thrift:"checkpoints,2" db:"checkpoints" json:"checkpoints"` +} + +func NewHostBackupInfo() *HostBackupInfo { + return &HostBackupInfo{} +} + +var HostBackupInfo_Host_DEFAULT *nebula.HostAddr +func (p *HostBackupInfo) GetHost() *nebula.HostAddr { + if !p.IsSetHost() { + return HostBackupInfo_Host_DEFAULT + } +return p.Host +} + +func (p *HostBackupInfo) GetCheckpoints() []*nebula.CheckpointInfo { + return p.Checkpoints +} +func (p *HostBackupInfo) IsSetHost() bool { + return p.Host != nil +} + +func (p *HostBackupInfo) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostBackupInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *HostBackupInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.CheckpointInfo, 0, size) + p.Checkpoints = tSlice + for i := 0; i < size; i ++ { + _elem133 := &nebula.CheckpointInfo{} + if err := _elem133.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem133), err) + } + p.Checkpoints = append(p.Checkpoints, _elem133) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *HostBackupInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "HostBackupInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HostBackupInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *HostBackupInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "checkpoints", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:checkpoints: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Checkpoints)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Checkpoints { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:checkpoints: ", p), err) } + return err +} + +func (p *HostBackupInfo) Equals(other *HostBackupInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Host.Equals(other.Host) { return false } + if len(p.Checkpoints) != len(other.Checkpoints) { return false } + for i, _tgt := range p.Checkpoints { + _src134 := other.Checkpoints[i] + if !_tgt.Equals(_src134) { return false } + } + return true +} + +func (p *HostBackupInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostBackupInfo(%+v)", *p) +} + +func (p *HostBackupInfo) Validate() error { + return nil +} +// Attributes: +// - Space +// - HostBackups +type SpaceBackupInfo struct { + Space *SpaceDesc `thrift:"space,1" db:"space" json:"space"` + HostBackups []*HostBackupInfo `thrift:"host_backups,2" db:"host_backups" json:"host_backups"` +} + +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 +} + +func (p *SpaceBackupInfo) GetHostBackups() []*HostBackupInfo { + return p.HostBackups +} +func (p *SpaceBackupInfo) IsSetSpace() bool { + return p.Space != nil +} + +func (p *SpaceBackupInfo) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SpaceBackupInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Space = &SpaceDesc{} + if err := p.Space.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Space), err) + } + return nil +} + +func (p *SpaceBackupInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*HostBackupInfo, 0, size) + p.HostBackups = tSlice + for i := 0; i < size; i ++ { + _elem135 := &HostBackupInfo{} + if err := _elem135.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem135), err) + } + p.HostBackups = append(p.HostBackups, _elem135) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SpaceBackupInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SpaceBackupInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SpaceBackupInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Space), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space: ", p), err) } + return err +} + +func (p *SpaceBackupInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "host_backups", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host_backups: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.HostBackups)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.HostBackups { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host_backups: ", p), err) } + return err +} + +func (p *SpaceBackupInfo) Equals(other *SpaceBackupInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Space.Equals(other.Space) { return false } + if len(p.HostBackups) != len(other.HostBackups) { return false } + for i, _tgt := range p.HostBackups { + _src136 := other.HostBackups[i] + if !_tgt.Equals(_src136) { return false } + } + return true +} + +func (p *SpaceBackupInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SpaceBackupInfo(%+v)", *p) +} + +func (p *SpaceBackupInfo) Validate() error { + return nil +} +// Attributes: +// - SpaceBackups +// - MetaFiles +// - BackupName +// - Full +// - AllSpaces +// - CreateTime +// - BaseBackupName +// - StorageHosts +// - ClusterID +type BackupMeta struct { + SpaceBackups map[nebula.GraphSpaceID]*SpaceBackupInfo `thrift:"space_backups,1" db:"space_backups" json:"space_backups"` + 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"` + AllSpaces bool `thrift:"all_spaces,5" db:"all_spaces" json:"all_spaces"` + CreateTime int64 `thrift:"create_time,6" db:"create_time" json:"create_time"` + BaseBackupName []byte `thrift:"base_backup_name,7" db:"base_backup_name" json:"base_backup_name"` + StorageHosts []*nebula.HostAddr `thrift:"storage_hosts,8" db:"storage_hosts" json:"storage_hosts"` + ClusterID ClusterID `thrift:"cluster_id,9" db:"cluster_id" json:"cluster_id"` +} + +func NewBackupMeta() *BackupMeta { + return &BackupMeta{} +} + + +func (p *BackupMeta) GetSpaceBackups() map[nebula.GraphSpaceID]*SpaceBackupInfo { + return p.SpaceBackups +} + +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) GetAllSpaces() bool { + return p.AllSpaces +} + +func (p *BackupMeta) GetCreateTime() int64 { + return p.CreateTime +} + +func (p *BackupMeta) GetBaseBackupName() []byte { + return p.BaseBackupName +} + +func (p *BackupMeta) GetStorageHosts() []*nebula.HostAddr { + return p.StorageHosts +} + +func (p *BackupMeta) GetClusterID() ClusterID { + return p.ClusterID +} +func (p *BackupMeta) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.LIST { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.I64 { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BackupMeta) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.GraphSpaceID]*SpaceBackupInfo, size) + p.SpaceBackups = tMap + for i := 0; i < size; i ++ { +var _key137 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _key137 = temp +} + _val138 := &SpaceBackupInfo{} + if err := _val138.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val138), err) + } + p.SpaceBackups[_key137] = _val138 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem139 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem139 = v +} + p.MetaFiles = append(p.MetaFiles, _elem139) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.BackupName = v +} + return nil +} + +func (p *BackupMeta) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Full = v +} + return nil +} + +func (p *BackupMeta) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.AllSpaces = v +} + return nil +} + +func (p *BackupMeta) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.CreateTime = v +} + return nil +} + +func (p *BackupMeta) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.BaseBackupName = v +} + return nil +} + +func (p *BackupMeta) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.StorageHosts = tSlice + for i := 0; i < size; i ++ { + _elem140 := &nebula.HostAddr{} + if err := _elem140.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem140), err) + } + p.StorageHosts = append(p.StorageHosts, _elem140) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BackupMeta) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + temp := ClusterID(v) + p.ClusterID = temp +} + return nil +} + +func (p *BackupMeta) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "BackupMeta"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *BackupMeta) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "space_backups", thrift.MAP, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_backups: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.STRUCT, len(p.SpaceBackups)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.SpaceBackups { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_backups: ", p), err) } + return err +} + +func (p *BackupMeta) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.MetaFiles)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.MetaFiles { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:meta_files: ", p), err) } + return err +} + +func (p *BackupMeta) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.BackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.backup_name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:backup_name: ", p), err) } + return err +} + +func (p *BackupMeta) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "full", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:full: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.Full)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.full (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:full: ", p), err) } + return err +} + +func (p *BackupMeta) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "all_spaces", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:all_spaces: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.AllSpaces)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.all_spaces (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:all_spaces: ", p), err) } + return err +} + +func (p *BackupMeta) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:create_time: ", p), err) } + return err +} + +func (p *BackupMeta) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "base_backup_name", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:base_backup_name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.BaseBackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.base_backup_name (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:base_backup_name: ", p), err) } + return err +} + +func (p *BackupMeta) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "storage_hosts", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:storage_hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.StorageHosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StorageHosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:storage_hosts: ", p), err) } + return err +} + +func (p *BackupMeta) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "cluster_id", thrift.I64, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:cluster_id: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:cluster_id: ", p), err) } + return err +} + +func (p *BackupMeta) Equals(other *BackupMeta) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.SpaceBackups) != len(other.SpaceBackups) { return false } + for k, _tgt := range p.SpaceBackups { + _src141 := other.SpaceBackups[k] + if !_tgt.Equals(_src141) { return false } + } + if len(p.MetaFiles) != len(other.MetaFiles) { return false } + for i, _tgt := range p.MetaFiles { + _src142 := other.MetaFiles[i] + if bytes.Compare(_tgt, _src142) != 0 { return false } + } + if bytes.Compare(p.BackupName, other.BackupName) != 0 { return false } + if p.Full != other.Full { return false } + if p.AllSpaces != other.AllSpaces { return false } + if p.CreateTime != other.CreateTime { return false } + if bytes.Compare(p.BaseBackupName, other.BaseBackupName) != 0 { return false } + if len(p.StorageHosts) != len(other.StorageHosts) { return false } + for i, _tgt := range p.StorageHosts { + _src143 := other.StorageHosts[i] + if !_tgt.Equals(_src143) { return false } + } + if p.ClusterID != other.ClusterID { return false } + return true +} + +func (p *BackupMeta) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BackupMeta(%+v)", *p) +} + +func (p *BackupMeta) Validate() error { + return nil +} +// Attributes: +// - Spaces +// - BaseBackupName +// - ClusterID +type CreateBackupReq struct { + Spaces [][]byte `thrift:"spaces,1" db:"spaces" json:"spaces,omitempty"` + BaseBackupName []byte `thrift:"base_backup_name,2" db:"base_backup_name" json:"base_backup_name,omitempty"` + ClusterID *ClusterID `thrift:"cluster_id,3" db:"cluster_id" json:"cluster_id,omitempty"` +} + +func NewCreateBackupReq() *CreateBackupReq { + return &CreateBackupReq{} +} + +var CreateBackupReq_Spaces_DEFAULT [][]byte + +func (p *CreateBackupReq) GetSpaces() [][]byte { + return p.Spaces +} +var CreateBackupReq_BaseBackupName_DEFAULT []byte + +func (p *CreateBackupReq) GetBaseBackupName() []byte { + return p.BaseBackupName +} +var CreateBackupReq_ClusterID_DEFAULT ClusterID +func (p *CreateBackupReq) GetClusterID() ClusterID { + if !p.IsSetClusterID() { + return CreateBackupReq_ClusterID_DEFAULT + } +return *p.ClusterID +} +func (p *CreateBackupReq) IsSetSpaces() bool { + return p.Spaces != nil +} + +func (p *CreateBackupReq) IsSetBaseBackupName() bool { + return p.BaseBackupName != nil +} + +func (p *CreateBackupReq) IsSetClusterID() bool { + return p.ClusterID != nil +} + +func (p *CreateBackupReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateBackupReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem144 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem144 = v +} + p.Spaces = append(p.Spaces, _elem144) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateBackupReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.BaseBackupName = v +} + return nil +} + +func (p *CreateBackupReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := ClusterID(v) + p.ClusterID = &temp +} + return nil +} + +func (p *CreateBackupReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateBackupReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateBackupReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSpaces() { + if err := oprot.WriteFieldBegin(ctx, "spaces", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:spaces: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Spaces)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Spaces { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:spaces: ", p), err) } + } + return err +} + +func (p *CreateBackupReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetBaseBackupName() { + if err := oprot.WriteFieldBegin(ctx, "base_backup_name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:base_backup_name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.BaseBackupName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.base_backup_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:base_backup_name: ", p), err) } + } + return err +} + +func (p *CreateBackupReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetClusterID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.ClusterID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.cluster_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cluster_id: ", p), err) } + } + return err +} + +func (p *CreateBackupReq) Equals(other *CreateBackupReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Spaces) != len(other.Spaces) { return false } + for i, _tgt := range p.Spaces { + _src145 := other.Spaces[i] + if bytes.Compare(_tgt, _src145) != 0 { return false } + } + if bytes.Compare(p.BaseBackupName, other.BaseBackupName) != 0 { return false } + if p.ClusterID != other.ClusterID { + if p.ClusterID == nil || other.ClusterID == nil { + return false + } + if (*p.ClusterID) != (*other.ClusterID) { return false } + } + return true +} + +func (p *CreateBackupReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateBackupReq(%+v)", *p) +} + +func (p *CreateBackupReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Meta +type CreateBackupResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var CreateBackupResp_Leader_DEFAULT *nebula.HostAddr +func (p *CreateBackupResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateBackupResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *CreateBackupResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *CreateBackupResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Meta = &BackupMeta{} + if err := p.Meta.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Meta), err) + } + return nil +} + +func (p *CreateBackupResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateBackupResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateBackupResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *CreateBackupResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *CreateBackupResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Meta), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:meta: ", p), err) } + return err +} + +func (p *CreateBackupResp) Equals(other *CreateBackupResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Meta.Equals(other.Meta) { return false } + return true +} + +func (p *CreateBackupResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateBackupResp(%+v)", *p) +} + +func (p *CreateBackupResp) Validate() error { + return nil +} +// Attributes: +// - FromHost +// - ToHost +type HostPair struct { + FromHost *nebula.HostAddr `thrift:"from_host,1" db:"from_host" json:"from_host"` + ToHost *nebula.HostAddr `thrift:"to_host,2" db:"to_host" json:"to_host"` +} + +func NewHostPair() *HostPair { + return &HostPair{} +} + +var HostPair_FromHost_DEFAULT *nebula.HostAddr +func (p *HostPair) GetFromHost() *nebula.HostAddr { + if !p.IsSetFromHost() { + return HostPair_FromHost_DEFAULT + } +return p.FromHost +} +var HostPair_ToHost_DEFAULT *nebula.HostAddr +func (p *HostPair) GetToHost() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *HostPair) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.FromHost = &nebula.HostAddr{} + if err := p.FromHost.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.FromHost), err) + } + return nil +} + +func (p *HostPair) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ToHost = &nebula.HostAddr{} + if err := p.ToHost.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ToHost), err) + } + return nil +} + +func (p *HostPair) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "HostPair"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *HostPair) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.FromHost), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:from_host: ", p), err) } + return err +} + +func (p *HostPair) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ToHost), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:to_host: ", p), err) } + return err +} + +func (p *HostPair) Equals(other *HostPair) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.FromHost.Equals(other.FromHost) { return false } + if !p.ToHost.Equals(other.ToHost) { return false } + return true +} + +func (p *HostPair) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("HostPair(%+v)", *p) +} + +func (p *HostPair) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RestoreMetaReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem146 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem146 = v +} + p.Files = append(p.Files, _elem146) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem147 := &HostPair{} + if err := _elem147.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem147), err) + } + p.Hosts = append(p.Hosts, _elem147) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RestoreMetaReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RestoreMetaReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RestoreMetaReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "files", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:files: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Files)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Files { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:files: ", p), err) } + return err +} + +func (p *RestoreMetaReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hosts: ", p), err) } + return err +} + +func (p *RestoreMetaReq) Equals(other *RestoreMetaReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Files) != len(other.Files) { return false } + for i, _tgt := range p.Files { + _src148 := other.Files[i] + if bytes.Compare(_tgt, _src148) != 0 { return false } + } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src149 := other.Hosts[i] + if !_tgt.Equals(_src149) { return false } + } + return true +} + +func (p *RestoreMetaReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RestoreMetaReq(%+v)", *p) +} + +func (p *RestoreMetaReq) Validate() error { + return nil +} +// Attributes: +// - PartID +// - Hosts +type PartInfo struct { + PartID nebula.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` + Hosts []*nebula.HostAddr `thrift:"hosts,2" db:"hosts" json:"hosts"` +} + +func NewPartInfo() *PartInfo { + return &PartInfo{} +} + + +func (p *PartInfo) GetPartID() nebula.PartitionID { + return p.PartID +} + +func (p *PartInfo) GetHosts() []*nebula.HostAddr { + return p.Hosts +} +func (p *PartInfo) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *PartInfo) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *PartInfo) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Hosts = tSlice + for i := 0; i < size; i ++ { + _elem150 := &nebula.HostAddr{} + if err := _elem150.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem150), err) + } + p.Hosts = append(p.Hosts, _elem150) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *PartInfo) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "PartInfo"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PartInfo) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_id: ", p), err) } + return err +} + +func (p *PartInfo) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "hosts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hosts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Hosts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Hosts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hosts: ", p), err) } + return err +} + +func (p *PartInfo) Equals(other *PartInfo) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.PartID != other.PartID { return false } + if len(p.Hosts) != len(other.Hosts) { return false } + for i, _tgt := range p.Hosts { + _src151 := other.Hosts[i] + if !_tgt.Equals(_src151) { return false } + } + return true +} + +func (p *PartInfo) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartInfo(%+v)", *p) +} + +func (p *PartInfo) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - PartHosts +type RestoreMetaResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + PartHosts map[nebula.GraphSpaceID][]*PartInfo `thrift:"part_hosts,3" db:"part_hosts" json:"part_hosts"` +} + +func NewRestoreMetaResp() *RestoreMetaResp { + return &RestoreMetaResp{} +} + + +func (p *RestoreMetaResp) GetCode() nebula.ErrorCode { + return p.Code +} +var RestoreMetaResp_Leader_DEFAULT *nebula.HostAddr +func (p *RestoreMetaResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return RestoreMetaResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *RestoreMetaResp) GetPartHosts() map[nebula.GraphSpaceID][]*PartInfo { + return p.PartHosts +} +func (p *RestoreMetaResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *RestoreMetaResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RestoreMetaResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *RestoreMetaResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *RestoreMetaResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.GraphSpaceID][]*PartInfo, size) + p.PartHosts = tMap + for i := 0; i < size; i ++ { +var _key152 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _key152 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*PartInfo, 0, size) + _val153 := tSlice + for i := 0; i < size; i ++ { + _elem154 := &PartInfo{} + if err := _elem154.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem154), err) + } + _val153 = append(_val153, _elem154) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PartHosts[_key152] = _val153 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *RestoreMetaResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RestoreMetaResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RestoreMetaResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *RestoreMetaResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *RestoreMetaResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "part_hosts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_hosts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.LIST, len(p.PartHosts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.PartHosts { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_hosts: ", p), err) } + return err +} + +func (p *RestoreMetaResp) Equals(other *RestoreMetaResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.PartHosts) != len(other.PartHosts) { return false } + for k, _tgt := range p.PartHosts { + _src155 := other.PartHosts[k] + if len(_tgt) != len(_src155) { return false } + for i, _tgt := range _tgt { + _src156 := _src155[i] + if !_tgt.Equals(_src156) { return false } + } + } + return true +} + +func (p *RestoreMetaResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RestoreMetaResp(%+v)", *p) +} + +func (p *RestoreMetaResp) Validate() error { + return nil +} +// Attributes: +// - Host +// - User +// - Pwd +// - ConnType +type ServiceClient struct { + Host *nebula.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"` + ConnType []byte `thrift:"conn_type,4" db:"conn_type" json:"conn_type,omitempty"` +} + +func NewServiceClient() *ServiceClient { + return &ServiceClient{} +} + +var ServiceClient_Host_DEFAULT *nebula.HostAddr +func (p *ServiceClient) GetHost() *nebula.HostAddr { + if !p.IsSetHost() { + return ServiceClient_Host_DEFAULT + } +return p.Host +} +var ServiceClient_User_DEFAULT []byte + +func (p *ServiceClient) GetUser() []byte { + return p.User +} +var ServiceClient_Pwd_DEFAULT []byte + +func (p *ServiceClient) GetPwd() []byte { + return p.Pwd +} +var ServiceClient_ConnType_DEFAULT []byte + +func (p *ServiceClient) GetConnType() []byte { + return p.ConnType +} +func (p *ServiceClient) IsSetHost() bool { + return p.Host != nil +} + +func (p *ServiceClient) IsSetUser() bool { + return p.User != nil +} + +func (p *ServiceClient) IsSetPwd() bool { + return p.Pwd != nil +} + +func (p *ServiceClient) IsSetConnType() bool { + return p.ConnType != nil +} + +func (p *ServiceClient) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetHost bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetHost = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetHost{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Host is not set")); + } + return nil +} + +func (p *ServiceClient) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *ServiceClient) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.User = v +} + return nil +} + +func (p *ServiceClient) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Pwd = v +} + return nil +} + +func (p *ServiceClient) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.ConnType = v +} + return nil +} + +func (p *ServiceClient) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ServiceClient"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ServiceClient) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:host: ", p), err) } + return err +} + +func (p *ServiceClient) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetUser() { + if err := oprot.WriteFieldBegin(ctx, "user", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:user: ", p), err) } + if err := oprot.WriteBinary(ctx, p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:user: ", p), err) } + } + return err +} + +func (p *ServiceClient) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetPwd() { + if err := oprot.WriteFieldBegin(ctx, "pwd", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:pwd: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Pwd); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.pwd (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:pwd: ", p), err) } + } + return err +} + +func (p *ServiceClient) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetConnType() { + if err := oprot.WriteFieldBegin(ctx, "conn_type", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:conn_type: ", p), err) } + if err := oprot.WriteBinary(ctx, p.ConnType); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.conn_type (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:conn_type: ", p), err) } + } + return err +} + +func (p *ServiceClient) Equals(other *ServiceClient) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Host.Equals(other.Host) { return false } + if bytes.Compare(p.User, other.User) != 0 { return false } + if bytes.Compare(p.Pwd, other.Pwd) != 0 { return false } + if bytes.Compare(p.ConnType, other.ConnType) != 0 { return false } + return true +} + +func (p *ServiceClient) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ServiceClient(%+v)", *p) +} + +func (p *ServiceClient) Validate() error { + return nil +} +// Attributes: +// - Type +// - Clients +type SignInServiceReq struct { + Type ExternalServiceType `thrift:"type,1" db:"type" json:"type"` + Clients []*ServiceClient `thrift:"clients,2" db:"clients" json:"clients"` +} + +func NewSignInServiceReq() *SignInServiceReq { + return &SignInServiceReq{} +} + + +func (p *SignInServiceReq) GetType() ExternalServiceType { + return p.Type +} + +func (p *SignInServiceReq) GetClients() []*ServiceClient { + return p.Clients +} +func (p *SignInServiceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SignInServiceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ExternalServiceType(v) + p.Type = temp +} + return nil +} + +func (p *SignInServiceReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ServiceClient, 0, size) + p.Clients = tSlice + for i := 0; i < size; i ++ { + _elem157 := &ServiceClient{} + if err := _elem157.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem157), err) + } + p.Clients = append(p.Clients, _elem157) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *SignInServiceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SignInServiceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SignInServiceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *SignInServiceReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "clients", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:clients: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Clients)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Clients { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:clients: ", p), err) } + return err +} + +func (p *SignInServiceReq) Equals(other *SignInServiceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + if len(p.Clients) != len(other.Clients) { return false } + for i, _tgt := range p.Clients { + _src158 := other.Clients[i] + if !_tgt.Equals(_src158) { return false } + } + return true +} + +func (p *SignInServiceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SignInServiceReq(%+v)", *p) +} + +func (p *SignInServiceReq) Validate() error { + return nil +} +// Attributes: +// - Type +type SignOutServiceReq struct { + Type ExternalServiceType `thrift:"type,1" db:"type" json:"type"` +} + +func NewSignOutServiceReq() *SignOutServiceReq { + return &SignOutServiceReq{} +} + + +func (p *SignOutServiceReq) GetType() ExternalServiceType { + return p.Type +} +func (p *SignOutServiceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SignOutServiceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ExternalServiceType(v) + p.Type = temp +} + return nil +} + +func (p *SignOutServiceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SignOutServiceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SignOutServiceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *SignOutServiceReq) Equals(other *SignOutServiceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + return true +} + +func (p *SignOutServiceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SignOutServiceReq(%+v)", *p) +} + +func (p *SignOutServiceReq) Validate() error { + return nil +} +// Attributes: +// - Type +type ListServiceClientsReq struct { + Type ExternalServiceType `thrift:"type,1" db:"type" json:"type"` +} + +func NewListServiceClientsReq() *ListServiceClientsReq { + return &ListServiceClientsReq{} +} + + +func (p *ListServiceClientsReq) GetType() ExternalServiceType { + return p.Type +} +func (p *ListServiceClientsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListServiceClientsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := ExternalServiceType(v) + p.Type = temp +} + return nil +} + +func (p *ListServiceClientsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListServiceClientsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListServiceClientsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *ListServiceClientsReq) Equals(other *ListServiceClientsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + return true +} + +func (p *ListServiceClientsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListServiceClientsReq(%+v)", *p) +} + +func (p *ListServiceClientsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Clients +type ListServiceClientsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Clients map[ExternalServiceType][]*ServiceClient `thrift:"clients,3" db:"clients" json:"clients"` +} + +func NewListServiceClientsResp() *ListServiceClientsResp { + return &ListServiceClientsResp{} +} + + +func (p *ListServiceClientsResp) GetCode() nebula.ErrorCode { + return p.Code +} +var ListServiceClientsResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListServiceClientsResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return ListServiceClientsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListServiceClientsResp) GetClients() map[ExternalServiceType][]*ServiceClient { + return p.Clients +} +func (p *ListServiceClientsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListServiceClientsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListServiceClientsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListServiceClientsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListServiceClientsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[ExternalServiceType][]*ServiceClient, size) + p.Clients = tMap + for i := 0; i < size; i ++ { +var _key159 ExternalServiceType + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := ExternalServiceType(v) + _key159 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ServiceClient, 0, size) + _val160 := tSlice + for i := 0; i < size; i ++ { + _elem161 := &ServiceClient{} + if err := _elem161.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem161), err) + } + _val160 = append(_val160, _elem161) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Clients[_key159] = _val160 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListServiceClientsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListServiceClientsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListServiceClientsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListServiceClientsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListServiceClientsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "clients", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:clients: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.LIST, len(p.Clients)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Clients { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:clients: ", p), err) } + return err +} + +func (p *ListServiceClientsResp) Equals(other *ListServiceClientsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Clients) != len(other.Clients) { return false } + for k, _tgt := range p.Clients { + _src162 := other.Clients[k] + if len(_tgt) != len(_src162) { return false } + for i, _tgt := range _tgt { + _src163 := _src162[i] + if !_tgt.Equals(_src163) { return false } + } + } + return true +} + +func (p *ListServiceClientsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListServiceClientsResp(%+v)", *p) +} + +func (p *ListServiceClientsResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - DependSchema +// - Fields +// - Analyzer +type FTIndex struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + DependSchema *nebula.SchemaID `thrift:"depend_schema,2" db:"depend_schema" json:"depend_schema"` + Fields [][]byte `thrift:"fields,3" db:"fields" json:"fields"` + Analyzer []byte `thrift:"analyzer,4" db:"analyzer" json:"analyzer"` +} + +func NewFTIndex() *FTIndex { + return &FTIndex{} +} + + +func (p *FTIndex) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +var FTIndex_DependSchema_DEFAULT *nebula.SchemaID +func (p *FTIndex) GetDependSchema() *nebula.SchemaID { + if !p.IsSetDependSchema() { + return FTIndex_DependSchema_DEFAULT + } +return p.DependSchema +} + +func (p *FTIndex) GetFields() [][]byte { + return p.Fields +} + +func (p *FTIndex) GetAnalyzer() []byte { + return p.Analyzer +} +func (p *FTIndex) IsSetDependSchema() bool { + return p.DependSchema != nil +} + +func (p *FTIndex) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *FTIndex) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *FTIndex) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.DependSchema = &nebula.SchemaID{} + if err := p.DependSchema.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DependSchema), err) + } + return nil +} + +func (p *FTIndex) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem164 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem164 = v +} + p.Fields = append(p.Fields, _elem164) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *FTIndex) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Analyzer = v +} + return nil +} + +func (p *FTIndex) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "FTIndex"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *FTIndex) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *FTIndex) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DependSchema), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:depend_schema: ", p), err) } + return err +} + +func (p *FTIndex) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "fields", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:fields: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Fields)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Fields { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:fields: ", p), err) } + return err +} + +func (p *FTIndex) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "analyzer", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:analyzer: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Analyzer); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.analyzer (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:analyzer: ", p), err) } + return err +} + +func (p *FTIndex) Equals(other *FTIndex) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if !p.DependSchema.Equals(other.DependSchema) { return false } + if len(p.Fields) != len(other.Fields) { return false } + for i, _tgt := range p.Fields { + _src165 := other.Fields[i] + if bytes.Compare(_tgt, _src165) != 0 { return false } + } + if bytes.Compare(p.Analyzer, other.Analyzer) != 0 { return false } + return true +} + +func (p *FTIndex) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FTIndex(%+v)", *p) +} + +func (p *FTIndex) Validate() error { + return nil +} +// 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{} +} + + +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.Index != nil +} + +func (p *CreateFTIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateFTIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.FulltextIndexName = v +} + return nil +} + +func (p *CreateFTIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Index = &FTIndex{} + if err := p.Index.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Index), err) + } + return nil +} + +func (p *CreateFTIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateFTIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateFTIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:fulltext_index_name: ", p), err) } + return err +} + +func (p *CreateFTIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Index), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:index: ", p), err) } + return err +} + +func (p *CreateFTIndexReq) Equals(other *CreateFTIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.FulltextIndexName, other.FulltextIndexName) != 0 { return false } + if !p.Index.Equals(other.Index) { return false } + return true +} + +func (p *CreateFTIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateFTIndexReq(%+v)", *p) +} + +func (p *CreateFTIndexReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - FulltextIndexName +type DropFTIndexReq struct { + SpaceID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DropFTIndexReq) GetFulltextIndexName() []byte { + return p.FulltextIndexName +} +func (p *DropFTIndexReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropFTIndexReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DropFTIndexReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.FulltextIndexName = v +} + return nil +} + +func (p *DropFTIndexReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropFTIndexReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropFTIndexReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DropFTIndexReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.FulltextIndexName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.fulltext_index_name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:fulltext_index_name: ", p), err) } + return err +} + +func (p *DropFTIndexReq) Equals(other *DropFTIndexReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if bytes.Compare(p.FulltextIndexName, other.FulltextIndexName) != 0 { return false } + return true +} + +func (p *DropFTIndexReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropFTIndexReq(%+v)", *p) +} + +func (p *DropFTIndexReq) Validate() error { + return nil +} +type ListFTIndexesReq struct { +} + +func NewListFTIndexesReq() *ListFTIndexesReq { + return &ListFTIndexesReq{} +} + +func (p *ListFTIndexesReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTIndexesReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListFTIndexesReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListFTIndexesReq) Equals(other *ListFTIndexesReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListFTIndexesReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListFTIndexesReq(%+v)", *p) +} + +func (p *ListFTIndexesReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Indexes +type ListFTIndexesResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + Indexes map[string]*FTIndex `thrift:"indexes,3" db:"indexes" json:"indexes"` +} + +func NewListFTIndexesResp() *ListFTIndexesResp { + return &ListFTIndexesResp{} +} + + +func (p *ListFTIndexesResp) GetCode() nebula.ErrorCode { + return p.Code +} +var ListFTIndexesResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListFTIndexesResp) GetLeader() *nebula.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.Leader != nil +} + +func (p *ListFTIndexesResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListFTIndexesResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListFTIndexesResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListFTIndexesResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key166 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key166 = v +} + _val167 := &FTIndex{} + if err := _val167.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val167), err) + } + p.Indexes[_key166] = _val167 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListFTIndexesResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListFTIndexesResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListFTIndexesResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListFTIndexesResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListFTIndexesResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "indexes", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:indexes: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indexes: ", p), err) } + return err +} + +func (p *ListFTIndexesResp) Equals(other *ListFTIndexesResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Indexes) != len(other.Indexes) { return false } + for k, _tgt := range p.Indexes { + _src168 := other.Indexes[k] + if !_tgt.Equals(_src168) { return false } + } + return true +} + +func (p *ListFTIndexesResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListFTIndexesResp(%+v)", *p) +} + +func (p *ListFTIndexesResp) Validate() error { + return nil +} +// Attributes: +// - StartTime +// - Status +// - Duration +// - Query +// - GraphAddr +type QueryDesc struct { + StartTime nebula.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 *nebula.HostAddr `thrift:"graph_addr,5" db:"graph_addr" json:"graph_addr"` +} + +func NewQueryDesc() *QueryDesc { + return &QueryDesc{} +} + + +func (p *QueryDesc) GetStartTime() nebula.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 *nebula.HostAddr +func (p *QueryDesc) GetGraphAddr() *nebula.HostAddr { + if !p.IsSetGraphAddr() { + return QueryDesc_GraphAddr_DEFAULT + } +return p.GraphAddr +} +func (p *QueryDesc) IsSetGraphAddr() bool { + return p.GraphAddr != nil +} + +func (p *QueryDesc) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *QueryDesc) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.Timestamp(v) + p.StartTime = temp +} + return nil +} + +func (p *QueryDesc) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := QueryStatus(v) + p.Status = temp +} + return nil +} + +func (p *QueryDesc) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Duration = v +} + return nil +} + +func (p *QueryDesc) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Query = v +} + return nil +} + +func (p *QueryDesc) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.GraphAddr = &nebula.HostAddr{} + if err := p.GraphAddr.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *QueryDesc) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "QueryDesc"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *QueryDesc) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:start_time: ", p), err) } + return err +} + +func (p *QueryDesc) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "status", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:status: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Status)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.status (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:status: ", p), err) } + return err +} + +func (p *QueryDesc) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "duration", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:duration: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Duration)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.duration (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:duration: ", p), err) } + return err +} + +func (p *QueryDesc) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "query", thrift.STRING, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:query: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Query); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.query (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:query: ", p), err) } + return err +} + +func (p *QueryDesc) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:graph_addr: ", p), err) } + return err +} + +func (p *QueryDesc) Equals(other *QueryDesc) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.StartTime != other.StartTime { return false } + if p.Status != other.Status { return false } + if p.Duration != other.Duration { return false } + if bytes.Compare(p.Query, other.Query) != 0 { return false } + if !p.GraphAddr.Equals(other.GraphAddr) { return false } + return true +} + +func (p *QueryDesc) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("QueryDesc(%+v)", *p) +} + +func (p *QueryDesc) Validate() error { + return nil +} +// Attributes: +// - SessionID +// - CreateTime +// - UpdateTime +// - UserName +// - SpaceName +// - GraphAddr +// - Timezone +// - ClientIP +// - Configs +// - Queries +type Session struct { + SessionID nebula.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` + CreateTime nebula.Timestamp `thrift:"create_time,2" db:"create_time" json:"create_time"` + UpdateTime nebula.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 *nebula.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]*nebula.Value `thrift:"configs,9" db:"configs" json:"configs"` + Queries map[nebula.ExecutionPlanID]*QueryDesc `thrift:"queries,10" db:"queries" json:"queries"` +} + +func NewSession() *Session { + return &Session{} +} + + +func (p *Session) GetSessionID() nebula.SessionID { + return p.SessionID +} + +func (p *Session) GetCreateTime() nebula.Timestamp { + return p.CreateTime +} + +func (p *Session) GetUpdateTime() nebula.Timestamp { + return p.UpdateTime +} + +func (p *Session) GetUserName() []byte { + return p.UserName +} + +func (p *Session) GetSpaceName() []byte { + return p.SpaceName +} +var Session_GraphAddr_DEFAULT *nebula.HostAddr +func (p *Session) GetGraphAddr() *nebula.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]*nebula.Value { + return p.Configs +} + +func (p *Session) GetQueries() map[nebula.ExecutionPlanID]*QueryDesc { + return p.Queries +} +func (p *Session) IsSetGraphAddr() bool { + return p.GraphAddr != nil +} + +func (p *Session) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRING { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRING { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.I32 { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.MAP { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.MAP { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Session) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *Session) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.Timestamp(v) + p.CreateTime = temp +} + return nil +} + +func (p *Session) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula.Timestamp(v) + p.UpdateTime = temp +} + return nil +} + +func (p *Session) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.UserName = v +} + return nil +} + +func (p *Session) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.SpaceName = v +} + return nil +} + +func (p *Session) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.GraphAddr = &nebula.HostAddr{} + if err := p.GraphAddr.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *Session) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Timezone = v +} + return nil +} + +func (p *Session) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.ClientIP = v +} + return nil +} + +func (p *Session) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string]*nebula.Value, size) + p.Configs = tMap + for i := 0; i < size; i ++ { +var _key169 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key169 = v +} + _val170 := &nebula.Value{} + if err := _val170.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val170), err) + } + p.Configs[_key169] = _val170 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.ExecutionPlanID]*QueryDesc, size) + p.Queries = tMap + for i := 0; i < size; i ++ { +var _key171 nebula.ExecutionPlanID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.ExecutionPlanID(v) + _key171 = temp +} + _val172 := &QueryDesc{} + if err := _val172.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val172), err) + } + p.Queries[_key171] = _val172 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *Session) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Session"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Session) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *Session) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.CreateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.create_time (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:create_time: ", p), err) } + return err +} + +func (p *Session) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.UpdateTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.update_time (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:update_time: ", p), err) } + return err +} + +func (p *Session) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.UserName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user_name (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:user_name: ", p), err) } + return err +} + +func (p *Session) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.SpaceName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_name (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:space_name: ", p), err) } + return err +} + +func (p *Session) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:graph_addr: ", p), err) } + return err +} + +func (p *Session) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "timezone", thrift.I32, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:timezone: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Timezone)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.timezone (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:timezone: ", p), err) } + return err +} + +func (p *Session) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:client_ip: ", p), err) } + return err +} + +func (p *Session) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "configs", thrift.MAP, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:configs: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:configs: ", p), err) } + return err +} + +func (p *Session) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "queries", thrift.MAP, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:queries: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:queries: ", p), err) } + return err +} + +func (p *Session) Equals(other *Session) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SessionID != other.SessionID { return false } + if p.CreateTime != other.CreateTime { return false } + if p.UpdateTime != other.UpdateTime { return false } + if bytes.Compare(p.UserName, other.UserName) != 0 { return false } + if bytes.Compare(p.SpaceName, other.SpaceName) != 0 { return false } + if !p.GraphAddr.Equals(other.GraphAddr) { return false } + if p.Timezone != other.Timezone { return false } + if bytes.Compare(p.ClientIP, other.ClientIP) != 0 { return false } + if len(p.Configs) != len(other.Configs) { return false } + for k, _tgt := range p.Configs { + _src173 := other.Configs[k] + if !_tgt.Equals(_src173) { return false } + } + if len(p.Queries) != len(other.Queries) { return false } + for k, _tgt := range p.Queries { + _src174 := other.Queries[k] + if !_tgt.Equals(_src174) { return false } + } + return true +} + +func (p *Session) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Session(%+v)", *p) +} + +func (p *Session) Validate() error { + return nil +} +// Attributes: +// - User +// - GraphAddr +// - ClientIP +type CreateSessionReq struct { + User []byte `thrift:"user,1" db:"user" json:"user"` + GraphAddr *nebula.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 *nebula.HostAddr +func (p *CreateSessionReq) GetGraphAddr() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.User = v +} + return nil +} + +func (p *CreateSessionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.GraphAddr = &nebula.HostAddr{} + if err := p.GraphAddr.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.GraphAddr), err) + } + return nil +} + +func (p *CreateSessionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ClientIP = v +} + return nil +} + +func (p *CreateSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateSessionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "user", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:user: ", p), err) } + if err := oprot.WriteBinary(ctx, p.User); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.user (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:user: ", p), err) } + return err +} + +func (p *CreateSessionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.GraphAddr), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:graph_addr: ", p), err) } + return err +} + +func (p *CreateSessionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ClientIP); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_ip (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:client_ip: ", p), err) } + return err +} + +func (p *CreateSessionReq) Equals(other *CreateSessionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.User, other.User) != 0 { return false } + if !p.GraphAddr.Equals(other.GraphAddr) { return false } + if bytes.Compare(p.ClientIP, other.ClientIP) != 0 { return false } + return true +} + +func (p *CreateSessionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSessionReq(%+v)", *p) +} + +func (p *CreateSessionReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Session +type CreateSessionResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var CreateSessionResp_Leader_DEFAULT *nebula.HostAddr +func (p *CreateSessionResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *CreateSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *CreateSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Session = &Session{} + if err := p.Session.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *CreateSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateSessionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *CreateSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *CreateSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) } + return err +} + +func (p *CreateSessionResp) Equals(other *CreateSessionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Session.Equals(other.Session) { return false } + return true +} + +func (p *CreateSessionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateSessionResp(%+v)", *p) +} + +func (p *CreateSessionResp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UpdateSessionsReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem175 := &Session{} + if err := _elem175.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem175), err) + } + p.Sessions = append(p.Sessions, _elem175) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateSessionsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "UpdateSessionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateSessionsReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessions", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:sessions: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:sessions: ", p), err) } + return err +} + +func (p *UpdateSessionsReq) Equals(other *UpdateSessionsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Sessions) != len(other.Sessions) { return false } + for i, _tgt := range p.Sessions { + _src176 := other.Sessions[i] + if !_tgt.Equals(_src176) { return false } + } + return true +} + +func (p *UpdateSessionsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateSessionsReq(%+v)", *p) +} + +func (p *UpdateSessionsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - KilledQueries +// - KilledSessions +type UpdateSessionsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + KilledQueries map[nebula.SessionID]map[nebula.ExecutionPlanID]*QueryDesc `thrift:"killed_queries,3" db:"killed_queries" json:"killed_queries"` + KilledSessions []nebula.SessionID `thrift:"killed_sessions,4" db:"killed_sessions" json:"killed_sessions"` +} + +func NewUpdateSessionsResp() *UpdateSessionsResp { + return &UpdateSessionsResp{} +} + + +func (p *UpdateSessionsResp) GetCode() nebula.ErrorCode { + return p.Code +} +var UpdateSessionsResp_Leader_DEFAULT *nebula.HostAddr +func (p *UpdateSessionsResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return UpdateSessionsResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *UpdateSessionsResp) GetKilledQueries() map[nebula.SessionID]map[nebula.ExecutionPlanID]*QueryDesc { + return p.KilledQueries +} + +func (p *UpdateSessionsResp) GetKilledSessions() []nebula.SessionID { + return p.KilledSessions +} +func (p *UpdateSessionsResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *UpdateSessionsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UpdateSessionsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *UpdateSessionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *UpdateSessionsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.SessionID]map[nebula.ExecutionPlanID]*QueryDesc, size) + p.KilledQueries = tMap + for i := 0; i < size; i ++ { +var _key177 nebula.SessionID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.SessionID(v) + _key177 = temp +} + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.ExecutionPlanID]*QueryDesc, size) + _val178 := tMap + for i := 0; i < size; i ++ { +var _key179 nebula.ExecutionPlanID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.ExecutionPlanID(v) + _key179 = temp +} + _val180 := &QueryDesc{} + if err := _val180.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val180), err) + } + _val178[_key179] = _val180 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + p.KilledQueries[_key177] = _val178 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *UpdateSessionsResp) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.SessionID, 0, size) + p.KilledSessions = tSlice + for i := 0; i < size; i ++ { +var _elem181 nebula.SessionID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.SessionID(v) + _elem181 = temp +} + p.KilledSessions = append(p.KilledSessions, _elem181) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateSessionsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "UpdateSessionsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateSessionsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *UpdateSessionsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *UpdateSessionsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:killed_queries: ", p), err) } + return err +} + +func (p *UpdateSessionsResp) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "killed_sessions", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:killed_sessions: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.KilledSessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.KilledSessions { + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:killed_sessions: ", p), err) } + return err +} + +func (p *UpdateSessionsResp) Equals(other *UpdateSessionsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.KilledQueries) != len(other.KilledQueries) { return false } + for k, _tgt := range p.KilledQueries { + _src182 := other.KilledQueries[k] + if len(_tgt) != len(_src182) { return false } + for k, _tgt := range _tgt { + _src183 := _src182[k] + if !_tgt.Equals(_src183) { return false } + } + } + if len(p.KilledSessions) != len(other.KilledSessions) { return false } + for i, _tgt := range p.KilledSessions { + _src184 := other.KilledSessions[i] + if _tgt != _src184 { return false } + } + return true +} + +func (p *UpdateSessionsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateSessionsResp(%+v)", *p) +} + +func (p *UpdateSessionsResp) Validate() error { + return nil +} +type ListSessionsReq struct { +} + +func NewListSessionsReq() *ListSessionsReq { + return &ListSessionsReq{} +} + +func (p *ListSessionsReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSessionsReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListSessionsReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSessionsReq) Equals(other *ListSessionsReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListSessionsReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSessionsReq(%+v)", *p) +} + +func (p *ListSessionsReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Sessions +type ListSessionsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var ListSessionsResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListSessionsResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListSessionsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListSessionsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListSessionsResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem185 := &Session{} + if err := _elem185.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem185), err) + } + p.Sessions = append(p.Sessions, _elem185) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ListSessionsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListSessionsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListSessionsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListSessionsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListSessionsResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sessions", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:sessions: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Sessions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Sessions { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:sessions: ", p), err) } + return err +} + +func (p *ListSessionsResp) Equals(other *ListSessionsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.Sessions) != len(other.Sessions) { return false } + for i, _tgt := range p.Sessions { + _src186 := other.Sessions[i] + if !_tgt.Equals(_src186) { return false } + } + return true +} + +func (p *ListSessionsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListSessionsResp(%+v)", *p) +} + +func (p *ListSessionsResp) Validate() error { + return nil +} +// Attributes: +// - SessionID +type GetSessionReq struct { + SessionID nebula.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id"` +} + +func NewGetSessionReq() *GetSessionReq { + return &GetSessionReq{} +} + + +func (p *GetSessionReq) GetSessionID() nebula.SessionID { + return p.SessionID +} +func (p *GetSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.SessionID(v) + p.SessionID = temp +} + return nil +} + +func (p *GetSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSessionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + return err +} + +func (p *GetSessionReq) Equals(other *GetSessionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SessionID != other.SessionID { return false } + return true +} + +func (p *GetSessionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSessionReq(%+v)", *p) +} + +func (p *GetSessionReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - Session +type GetSessionResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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() nebula.ErrorCode { + return p.Code +} +var GetSessionResp_Leader_DEFAULT *nebula.HostAddr +func (p *GetSessionResp) GetLeader() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *GetSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Session = &Session{} + if err := p.Session.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Session), err) + } + return nil +} + +func (p *GetSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetSessionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *GetSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Session), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:session: ", p), err) } + return err +} + +func (p *GetSessionResp) Equals(other *GetSessionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if !p.Session.Equals(other.Session) { return false } + return true +} + +func (p *GetSessionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetSessionResp(%+v)", *p) +} + +func (p *GetSessionResp) Validate() error { + return nil +} +// Attributes: +// - SessionIds +type RemoveSessionReq struct { + SessionIds []nebula.SessionID `thrift:"session_ids,1" db:"session_ids" json:"session_ids"` +} + +func NewRemoveSessionReq() *RemoveSessionReq { + return &RemoveSessionReq{} +} + + +func (p *RemoveSessionReq) GetSessionIds() []nebula.SessionID { + return p.SessionIds +} +func (p *RemoveSessionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RemoveSessionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.SessionID, 0, size) + p.SessionIds = tSlice + for i := 0; i < size; i ++ { +var _elem187 nebula.SessionID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.SessionID(v) + _elem187 = temp +} + p.SessionIds = append(p.SessionIds, _elem187) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RemoveSessionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RemoveSessionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RemoveSessionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "session_ids", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:session_ids: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.SessionIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.SessionIds { + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_ids: ", p), err) } + return err +} + +func (p *RemoveSessionReq) Equals(other *RemoveSessionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.SessionIds) != len(other.SessionIds) { return false } + for i, _tgt := range p.SessionIds { + _src188 := other.SessionIds[i] + if _tgt != _src188 { return false } + } + return true +} + +func (p *RemoveSessionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoveSessionReq(%+v)", *p) +} + +func (p *RemoveSessionReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - RemovedSessionIds +type RemoveSessionResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + RemovedSessionIds []nebula.SessionID `thrift:"removed_session_ids,3" db:"removed_session_ids" json:"removed_session_ids"` +} + +func NewRemoveSessionResp() *RemoveSessionResp { + return &RemoveSessionResp{} +} + + +func (p *RemoveSessionResp) GetCode() nebula.ErrorCode { + return p.Code +} +var RemoveSessionResp_Leader_DEFAULT *nebula.HostAddr +func (p *RemoveSessionResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return RemoveSessionResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *RemoveSessionResp) GetRemovedSessionIds() []nebula.SessionID { + return p.RemovedSessionIds +} +func (p *RemoveSessionResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *RemoveSessionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RemoveSessionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *RemoveSessionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *RemoveSessionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.SessionID, 0, size) + p.RemovedSessionIds = tSlice + for i := 0; i < size; i ++ { +var _elem189 nebula.SessionID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.SessionID(v) + _elem189 = temp +} + p.RemovedSessionIds = append(p.RemovedSessionIds, _elem189) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RemoveSessionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RemoveSessionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RemoveSessionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *RemoveSessionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *RemoveSessionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "removed_session_ids", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:removed_session_ids: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I64, len(p.RemovedSessionIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.RemovedSessionIds { + if err := oprot.WriteI64(ctx, int64(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:removed_session_ids: ", p), err) } + return err +} + +func (p *RemoveSessionResp) Equals(other *RemoveSessionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.RemovedSessionIds) != len(other.RemovedSessionIds) { return false } + for i, _tgt := range p.RemovedSessionIds { + _src190 := other.RemovedSessionIds[i] + if _tgt != _src190 { return false } + } + return true +} + +func (p *RemoveSessionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemoveSessionResp(%+v)", *p) +} + +func (p *RemoveSessionResp) Validate() error { + return nil +} +// Attributes: +// - KillQueries +type KillQueryReq struct { + KillQueries map[nebula.SessionID][]nebula.ExecutionPlanID `thrift:"kill_queries,1" db:"kill_queries" json:"kill_queries"` +} + +func NewKillQueryReq() *KillQueryReq { + return &KillQueryReq{} +} + + +func (p *KillQueryReq) GetKillQueries() map[nebula.SessionID][]nebula.ExecutionPlanID { + return p.KillQueries +} +func (p *KillQueryReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.MAP { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *KillQueryReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.SessionID][]nebula.ExecutionPlanID, size) + p.KillQueries = tMap + for i := 0; i < size; i ++ { +var _key191 nebula.SessionID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.SessionID(v) + _key191 = temp +} + _, size, err := iprot.ReadSetBegin(ctx) + if err != nil { + return thrift.PrependError("error reading set begin: ", err) + } + tSet := make([]nebula.ExecutionPlanID, 0, size) + _val192 := tSet + for i := 0; i < size; i ++ { +var _elem193 nebula.ExecutionPlanID + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.ExecutionPlanID(v) + _elem193 = temp +} + _val192 = append(_val192, _elem193) + } + if err := iprot.ReadSetEnd(ctx); err != nil { + return thrift.PrependError("error reading set end: ", err) + } + p.KillQueries[_key191] = _val192 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KillQueryReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "KillQueryReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *KillQueryReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int64(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteSetBegin(ctx, thrift.I64, len(v)); err != nil { + return thrift.PrependError("error writing set begin: ", err) + } + for i := 0; i" + } + return fmt.Sprintf("KillQueryReq(%+v)", *p) +} + +func (p *KillQueryReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - SpaceID +// - JobID +// - TaskID +// - Stats +type ReportTaskReq struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + SpaceID nebula.GraphSpaceID `thrift:"space_id,2" db:"space_id" json:"space_id"` + JobID int32 `thrift:"job_id,3" db:"job_id" json:"job_id"` + TaskID int32 `thrift:"task_id,4" db:"task_id" json:"task_id"` + Stats *StatsItem `thrift:"stats,5" db:"stats" json:"stats,omitempty"` +} + +func NewReportTaskReq() *ReportTaskReq { + return &ReportTaskReq{} +} + + +func (p *ReportTaskReq) GetCode() nebula.ErrorCode { + return p.Code +} + +func (p *ReportTaskReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +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.Stats != nil +} + +func (p *ReportTaskReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ReportTaskReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ReportTaskReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ReportTaskReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *ReportTaskReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *ReportTaskReq) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.Stats = &StatsItem{} + if err := p.Stats.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) + } + return nil +} + +func (p *ReportTaskReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ReportTaskReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ReportTaskReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:space_id: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "job_id", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:job_id: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:job_id: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "task_id", thrift.I32, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:task_id: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:task_id: ", p), err) } + return err +} + +func (p *ReportTaskReq) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetStats() { + if err := oprot.WriteFieldBegin(ctx, "stats", thrift.STRUCT, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:stats: ", p), err) } + if err := p.Stats.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:stats: ", p), err) } + } + return err +} + +func (p *ReportTaskReq) Equals(other *ReportTaskReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if p.SpaceID != other.SpaceID { return false } + if p.JobID != other.JobID { return false } + if p.TaskID != other.TaskID { return false } + if !p.Stats.Equals(other.Stats) { return false } + return true +} + +func (p *ReportTaskReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ReportTaskReq(%+v)", *p) +} + +func (p *ReportTaskReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - HostServices +type ListClusterInfoResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + HostServices map[string][]*ServiceInfo `thrift:"host_services,3" db:"host_services" json:"host_services"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{} +} + + +func (p *ListClusterInfoResp) GetCode() nebula.ErrorCode { + return p.Code +} +var ListClusterInfoResp_Leader_DEFAULT *nebula.HostAddr +func (p *ListClusterInfoResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return ListClusterInfoResp_Leader_DEFAULT + } +return p.Leader +} + +func (p *ListClusterInfoResp) GetHostServices() map[string][]*ServiceInfo { + return p.HostServices +} +func (p *ListClusterInfoResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *ListClusterInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ListClusterInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *ListClusterInfoResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[string][]*ServiceInfo, size) + p.HostServices = tMap + for i := 0; i < size; i ++ { +var _key196 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key196 = v +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*ServiceInfo, 0, size) + _val197 := tSlice + for i := 0; i < size; i ++ { + _elem198 := &ServiceInfo{} + if err := _elem198.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem198), err) + } + _val197 = append(_val197, _elem198) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.HostServices[_key196] = _val197 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListClusterInfoResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "host_services", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host_services: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.STRING, thrift.LIST, len(p.HostServices)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.HostServices { + if err := oprot.WriteString(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:host_services: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) Equals(other *ListClusterInfoResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if len(p.HostServices) != len(other.HostServices) { return false } + for k, _tgt := range p.HostServices { + _src199 := other.HostServices[k] + if len(_tgt) != len(_src199) { return false } + for i, _tgt := range _tgt { + _src200 := _src199[i] + if !_tgt.Equals(_src200) { return false } + } + } + return true +} + +func (p *ListClusterInfoResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListClusterInfoResp(%+v)", *p) +} + +func (p *ListClusterInfoResp) Validate() error { + return nil +} +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoReq) Equals(other *ListClusterInfoReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListClusterInfoReq(%+v)", *p) +} + +func (p *ListClusterInfoReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Dir +type GetMetaDirInfoResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Dir *nebula.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewGetMetaDirInfoResp() *GetMetaDirInfoResp { + return &GetMetaDirInfoResp{} +} + + +func (p *GetMetaDirInfoResp) GetCode() nebula.ErrorCode { + return p.Code +} +var GetMetaDirInfoResp_Dir_DEFAULT *nebula.DirInfo +func (p *GetMetaDirInfoResp) GetDir() *nebula.DirInfo { + if !p.IsSetDir() { + return GetMetaDirInfoResp_Dir_DEFAULT + } +return p.Dir +} +func (p *GetMetaDirInfoResp) IsSetDir() bool { + return p.Dir != nil +} + +func (p *GetMetaDirInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetMetaDirInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetMetaDirInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Dir = &nebula.DirInfo{} + if err := p.Dir.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *GetMetaDirInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetMetaDirInfoResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetMetaDirInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetMetaDirInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *GetMetaDirInfoResp) Equals(other *GetMetaDirInfoResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Dir.Equals(other.Dir) { return false } + return true +} + +func (p *GetMetaDirInfoResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetMetaDirInfoResp(%+v)", *p) +} + +func (p *GetMetaDirInfoResp) Validate() error { + return nil +} +type GetMetaDirInfoReq struct { +} + +func NewGetMetaDirInfoReq() *GetMetaDirInfoReq { + return &GetMetaDirInfoReq{} +} + +func (p *GetMetaDirInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetMetaDirInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetMetaDirInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetMetaDirInfoReq) Equals(other *GetMetaDirInfoReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *GetMetaDirInfoReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetMetaDirInfoReq(%+v)", *p) +} + +func (p *GetMetaDirInfoReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - ErrorMsg +type VerifyClientVersionResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.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{} +} + + +func (p *VerifyClientVersionResp) GetCode() nebula.ErrorCode { + return p.Code +} +var VerifyClientVersionResp_Leader_DEFAULT *nebula.HostAddr +func (p *VerifyClientVersionResp) GetLeader() *nebula.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.Leader != nil +} + +func (p *VerifyClientVersionResp) IsSetErrorMsg() bool { + return p.ErrorMsg != nil +} + +func (p *VerifyClientVersionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *VerifyClientVersionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *VerifyClientVersionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *VerifyClientVersionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *VerifyClientVersionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "VerifyClientVersionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *VerifyClientVersionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *VerifyClientVersionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *VerifyClientVersionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:error_msg: ", p), err) } + } + return err +} + +func (p *VerifyClientVersionResp) Equals(other *VerifyClientVersionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if bytes.Compare(p.ErrorMsg, other.ErrorMsg) != 0 { return false } + return true +} + +func (p *VerifyClientVersionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VerifyClientVersionResp(%+v)", *p) +} + +func (p *VerifyClientVersionResp) Validate() error { + return nil +} +// Attributes: +// - ClientVersion +// - Host +// - BuildVersion +type VerifyClientVersionReq struct { + ClientVersion []byte `thrift:"client_version,1,required" db:"client_version" json:"client_version"` + Host *nebula.HostAddr `thrift:"host,2" db:"host" json:"host"` + BuildVersion []byte `thrift:"build_version,3" db:"build_version" json:"build_version"` +} + +func NewVerifyClientVersionReq() *VerifyClientVersionReq { + return &VerifyClientVersionReq{ +ClientVersion: []byte("3.0.0"), +} +} + + +func (p *VerifyClientVersionReq) GetClientVersion() []byte { + return p.ClientVersion +} +var VerifyClientVersionReq_Host_DEFAULT *nebula.HostAddr +func (p *VerifyClientVersionReq) GetHost() *nebula.HostAddr { + if !p.IsSetHost() { + return VerifyClientVersionReq_Host_DEFAULT + } +return p.Host +} + +func (p *VerifyClientVersionReq) GetBuildVersion() []byte { + return p.BuildVersion +} +func (p *VerifyClientVersionReq) IsSetHost() bool { + return p.Host != nil +} + +func (p *VerifyClientVersionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetClientVersion bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetClientVersion = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetClientVersion{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientVersion is not set")); + } + return nil +} + +func (p *VerifyClientVersionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ClientVersion = v +} + return nil +} + +func (p *VerifyClientVersionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *VerifyClientVersionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.BuildVersion = v +} + return nil +} + +func (p *VerifyClientVersionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "VerifyClientVersionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *VerifyClientVersionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "client_version", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.ClientVersion); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_version (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_version: ", p), err) } + return err +} + +func (p *VerifyClientVersionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *VerifyClientVersionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "build_version", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:build_version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.BuildVersion); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.build_version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:build_version: ", p), err) } + return err +} + +func (p *VerifyClientVersionReq) Equals(other *VerifyClientVersionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ClientVersion, other.ClientVersion) != 0 { return false } + if !p.Host.Equals(other.Host) { return false } + if bytes.Compare(p.BuildVersion, other.BuildVersion) != 0 { return false } + return true +} + +func (p *VerifyClientVersionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VerifyClientVersionReq(%+v)", *p) +} + +func (p *VerifyClientVersionReq) Validate() error { + return nil +} +// Attributes: +// - Code +// - Leader +// - ErrorMsg +type SaveGraphVersionResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Leader *nebula.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` + ErrorMsg []byte `thrift:"error_msg,3" db:"error_msg" json:"error_msg,omitempty"` +} + +func NewSaveGraphVersionResp() *SaveGraphVersionResp { + return &SaveGraphVersionResp{} +} + + +func (p *SaveGraphVersionResp) GetCode() nebula.ErrorCode { + return p.Code +} +var SaveGraphVersionResp_Leader_DEFAULT *nebula.HostAddr +func (p *SaveGraphVersionResp) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return SaveGraphVersionResp_Leader_DEFAULT + } +return p.Leader +} +var SaveGraphVersionResp_ErrorMsg_DEFAULT []byte + +func (p *SaveGraphVersionResp) GetErrorMsg() []byte { + return p.ErrorMsg +} +func (p *SaveGraphVersionResp) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *SaveGraphVersionResp) IsSetErrorMsg() bool { + return p.ErrorMsg != nil +} + +func (p *SaveGraphVersionResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *SaveGraphVersionResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *SaveGraphVersionResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *SaveGraphVersionResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ErrorMsg = v +} + return nil +} + +func (p *SaveGraphVersionResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SaveGraphVersionResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SaveGraphVersionResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *SaveGraphVersionResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } + return err +} + +func (p *SaveGraphVersionResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetErrorMsg() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ErrorMsg); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.error_msg (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:error_msg: ", p), err) } + } + return err +} + +func (p *SaveGraphVersionResp) Equals(other *SaveGraphVersionResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if !p.Leader.Equals(other.Leader) { return false } + if bytes.Compare(p.ErrorMsg, other.ErrorMsg) != 0 { return false } + return true +} + +func (p *SaveGraphVersionResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SaveGraphVersionResp(%+v)", *p) +} + +func (p *SaveGraphVersionResp) Validate() error { + return nil +} +// Attributes: +// - ClientVersion +// - Host +// - BuildVersion +type SaveGraphVersionReq struct { + ClientVersion []byte `thrift:"client_version,1,required" db:"client_version" json:"client_version"` + Host *nebula.HostAddr `thrift:"host,2" db:"host" json:"host"` + BuildVersion []byte `thrift:"build_version,3" db:"build_version" json:"build_version"` +} + +func NewSaveGraphVersionReq() *SaveGraphVersionReq { + return &SaveGraphVersionReq{ +ClientVersion: []byte("3.0.0"), +} +} + + +func (p *SaveGraphVersionReq) GetClientVersion() []byte { + return p.ClientVersion +} +var SaveGraphVersionReq_Host_DEFAULT *nebula.HostAddr +func (p *SaveGraphVersionReq) GetHost() *nebula.HostAddr { + if !p.IsSetHost() { + return SaveGraphVersionReq_Host_DEFAULT + } +return p.Host +} + +func (p *SaveGraphVersionReq) GetBuildVersion() []byte { + return p.BuildVersion +} +func (p *SaveGraphVersionReq) IsSetHost() bool { + return p.Host != nil +} + +func (p *SaveGraphVersionReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetClientVersion bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetClientVersion = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetClientVersion{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientVersion is not set")); + } + return nil +} + +func (p *SaveGraphVersionReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ClientVersion = v +} + return nil +} + +func (p *SaveGraphVersionReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Host = &nebula.HostAddr{} + if err := p.Host.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Host), err) + } + return nil +} + +func (p *SaveGraphVersionReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.BuildVersion = v +} + return nil +} + +func (p *SaveGraphVersionReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "SaveGraphVersionReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *SaveGraphVersionReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "client_version", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.ClientVersion); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.client_version (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_version: ", p), err) } + return err +} + +func (p *SaveGraphVersionReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Host), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:host: ", p), err) } + return err +} + +func (p *SaveGraphVersionReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "build_version", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:build_version: ", p), err) } + if err := oprot.WriteBinary(ctx, p.BuildVersion); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.build_version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:build_version: ", p), err) } + return err +} + +func (p *SaveGraphVersionReq) Equals(other *SaveGraphVersionReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ClientVersion, other.ClientVersion) != 0 { return false } + if !p.Host.Equals(other.Host) { return false } + if bytes.Compare(p.BuildVersion, other.BuildVersion) != 0 { return false } + return true +} + +func (p *SaveGraphVersionReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("SaveGraphVersionReq(%+v)", *p) +} + +func (p *SaveGraphVersionReq) Validate() error { + return nil +} +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 + ClearSpace(ctx context.Context, req *ClearSpaceReq) (_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 + AlterSpace(ctx context.Context, req *AlterSpaceReq) (_r *ExecResp, _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 + AddHosts(ctx context.Context, req *AddHostsReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + AddHostsIntoZone(ctx context.Context, req *AddHostsIntoZoneReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + DropHosts(ctx context.Context, req *DropHostsReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, _err error) + // Parameters: + // - Req + GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, _err error) + // Parameters: + // - Req + ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, _err error) + // Parameters: + // - Req + GetWorkerId(ctx context.Context, req *GetWorkerIdReq) (_r *GetWorkerIdResp, _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 + AgentHeartbeat(ctx context.Context, req *AgentHBReq) (_r *AgentHBResp, _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 + MergeZone(ctx context.Context, req *MergeZoneReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + DivideZone(ctx context.Context, req *DivideZoneReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + RenameZone(ctx context.Context, req *RenameZoneReq) (_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 + 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 + SignInService(ctx context.Context, req *SignInServiceReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + SignOutService(ctx context.Context, req *SignOutServiceReq) (_r *ExecResp, _err error) + // Parameters: + // - Req + ListServiceClients(ctx context.Context, req *ListServiceClientsReq) (_r *ListServiceClientsResp, _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 *RemoveSessionResp, _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 + CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, _err error) + // Parameters: + // - Req + RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *RestoreMetaResp, _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) + // Parameters: + // - Req + SaveGraphVersion(ctx context.Context, req *SaveGraphVersionReq) (_r *SaveGraphVersionResp, _err error) + // Parameters: + // - Req + GetSegmentId(ctx context.Context, req *GetSegmentIdReq) (_r *GetSegmentIdResp, _err error) +} + +type MetaServiceClient struct { + c thrift.TClient + meta thrift.ResponseMeta +} + +func NewMetaServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *MetaServiceClient { + return &MetaServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewMetaServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *MetaServiceClient { + return &MetaServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewMetaServiceClient(c thrift.TClient) *MetaServiceClient { + return &MetaServiceClient{ + c: c, + } +} + +func (p *MetaServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *MetaServiceClient) LastResponseMeta_() thrift.ResponseMeta { + return p.meta +} + +func (p *MetaServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { + p.meta = meta +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSpace(ctx context.Context, req *CreateSpaceReq) (_r *ExecResp, _err error) { + var _args201 MetaServiceCreateSpaceArgs + _args201.Req = req + var _result203 MetaServiceCreateSpaceResult + var _meta202 thrift.ResponseMeta + _meta202, _err = p.Client_().Call(ctx, "createSpace", &_args201, &_result203) + p.SetLastResponseMeta_(_meta202) + if _err != nil { + return + } + if _ret204 := _result203.GetSuccess(); _ret204 != nil { + return _ret204, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createSpace failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSpace(ctx context.Context, req *DropSpaceReq) (_r *ExecResp, _err error) { + var _args205 MetaServiceDropSpaceArgs + _args205.Req = req + var _result207 MetaServiceDropSpaceResult + var _meta206 thrift.ResponseMeta + _meta206, _err = p.Client_().Call(ctx, "dropSpace", &_args205, &_result207) + p.SetLastResponseMeta_(_meta206) + if _err != nil { + return + } + if _ret208 := _result207.GetSuccess(); _ret208 != nil { + return _ret208, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropSpace failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ClearSpace(ctx context.Context, req *ClearSpaceReq) (_r *ExecResp, _err error) { + var _args209 MetaServiceClearSpaceArgs + _args209.Req = req + var _result211 MetaServiceClearSpaceResult + var _meta210 thrift.ResponseMeta + _meta210, _err = p.Client_().Call(ctx, "clearSpace", &_args209, &_result211) + p.SetLastResponseMeta_(_meta210) + if _err != nil { + return + } + if _ret212 := _result211.GetSuccess(); _ret212 != nil { + return _ret212, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "clearSpace failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSpace(ctx context.Context, req *GetSpaceReq) (_r *GetSpaceResp, _err error) { + var _args213 MetaServiceGetSpaceArgs + _args213.Req = req + var _result215 MetaServiceGetSpaceResult + var _meta214 thrift.ResponseMeta + _meta214, _err = p.Client_().Call(ctx, "getSpace", &_args213, &_result215) + p.SetLastResponseMeta_(_meta214) + if _err != nil { + return + } + if _ret216 := _result215.GetSuccess(); _ret216 != nil { + return _ret216, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getSpace failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSpaces(ctx context.Context, req *ListSpacesReq) (_r *ListSpacesResp, _err error) { + var _args217 MetaServiceListSpacesArgs + _args217.Req = req + var _result219 MetaServiceListSpacesResult + var _meta218 thrift.ResponseMeta + _meta218, _err = p.Client_().Call(ctx, "listSpaces", &_args217, &_result219) + p.SetLastResponseMeta_(_meta218) + if _err != nil { + return + } + if _ret220 := _result219.GetSuccess(); _ret220 != nil { + return _ret220, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listSpaces failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterSpace(ctx context.Context, req *AlterSpaceReq) (_r *ExecResp, _err error) { + var _args221 MetaServiceAlterSpaceArgs + _args221.Req = req + var _result223 MetaServiceAlterSpaceResult + var _meta222 thrift.ResponseMeta + _meta222, _err = p.Client_().Call(ctx, "alterSpace", &_args221, &_result223) + p.SetLastResponseMeta_(_meta222) + if _err != nil { + return + } + if _ret224 := _result223.GetSuccess(); _ret224 != nil { + return _ret224, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "alterSpace failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSpaceAs(ctx context.Context, req *CreateSpaceAsReq) (_r *ExecResp, _err error) { + var _args225 MetaServiceCreateSpaceAsArgs + _args225.Req = req + var _result227 MetaServiceCreateSpaceAsResult + var _meta226 thrift.ResponseMeta + _meta226, _err = p.Client_().Call(ctx, "createSpaceAs", &_args225, &_result227) + p.SetLastResponseMeta_(_meta226) + if _err != nil { + return + } + if _ret228 := _result227.GetSuccess(); _ret228 != nil { + return _ret228, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createSpaceAs failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTag(ctx context.Context, req *CreateTagReq) (_r *ExecResp, _err error) { + var _args229 MetaServiceCreateTagArgs + _args229.Req = req + var _result231 MetaServiceCreateTagResult + var _meta230 thrift.ResponseMeta + _meta230, _err = p.Client_().Call(ctx, "createTag", &_args229, &_result231) + p.SetLastResponseMeta_(_meta230) + if _err != nil { + return + } + if _ret232 := _result231.GetSuccess(); _ret232 != nil { + return _ret232, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createTag failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterTag(ctx context.Context, req *AlterTagReq) (_r *ExecResp, _err error) { + var _args233 MetaServiceAlterTagArgs + _args233.Req = req + var _result235 MetaServiceAlterTagResult + var _meta234 thrift.ResponseMeta + _meta234, _err = p.Client_().Call(ctx, "alterTag", &_args233, &_result235) + p.SetLastResponseMeta_(_meta234) + if _err != nil { + return + } + if _ret236 := _result235.GetSuccess(); _ret236 != nil { + return _ret236, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "alterTag failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTag(ctx context.Context, req *DropTagReq) (_r *ExecResp, _err error) { + var _args237 MetaServiceDropTagArgs + _args237.Req = req + var _result239 MetaServiceDropTagResult + var _meta238 thrift.ResponseMeta + _meta238, _err = p.Client_().Call(ctx, "dropTag", &_args237, &_result239) + p.SetLastResponseMeta_(_meta238) + if _err != nil { + return + } + if _ret240 := _result239.GetSuccess(); _ret240 != nil { + return _ret240, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropTag failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTag(ctx context.Context, req *GetTagReq) (_r *GetTagResp, _err error) { + var _args241 MetaServiceGetTagArgs + _args241.Req = req + var _result243 MetaServiceGetTagResult + var _meta242 thrift.ResponseMeta + _meta242, _err = p.Client_().Call(ctx, "getTag", &_args241, &_result243) + p.SetLastResponseMeta_(_meta242) + if _err != nil { + return + } + if _ret244 := _result243.GetSuccess(); _ret244 != nil { + return _ret244, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getTag failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTags(ctx context.Context, req *ListTagsReq) (_r *ListTagsResp, _err error) { + var _args245 MetaServiceListTagsArgs + _args245.Req = req + var _result247 MetaServiceListTagsResult + var _meta246 thrift.ResponseMeta + _meta246, _err = p.Client_().Call(ctx, "listTags", &_args245, &_result247) + p.SetLastResponseMeta_(_meta246) + if _err != nil { + return + } + if _ret248 := _result247.GetSuccess(); _ret248 != nil { + return _ret248, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listTags failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdge(ctx context.Context, req *CreateEdgeReq) (_r *ExecResp, _err error) { + var _args249 MetaServiceCreateEdgeArgs + _args249.Req = req + var _result251 MetaServiceCreateEdgeResult + var _meta250 thrift.ResponseMeta + _meta250, _err = p.Client_().Call(ctx, "createEdge", &_args249, &_result251) + p.SetLastResponseMeta_(_meta250) + if _err != nil { + return + } + if _ret252 := _result251.GetSuccess(); _ret252 != nil { + return _ret252, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterEdge(ctx context.Context, req *AlterEdgeReq) (_r *ExecResp, _err error) { + var _args253 MetaServiceAlterEdgeArgs + _args253.Req = req + var _result255 MetaServiceAlterEdgeResult + var _meta254 thrift.ResponseMeta + _meta254, _err = p.Client_().Call(ctx, "alterEdge", &_args253, &_result255) + p.SetLastResponseMeta_(_meta254) + if _err != nil { + return + } + if _ret256 := _result255.GetSuccess(); _ret256 != nil { + return _ret256, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "alterEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdge(ctx context.Context, req *DropEdgeReq) (_r *ExecResp, _err error) { + var _args257 MetaServiceDropEdgeArgs + _args257.Req = req + var _result259 MetaServiceDropEdgeResult + var _meta258 thrift.ResponseMeta + _meta258, _err = p.Client_().Call(ctx, "dropEdge", &_args257, &_result259) + p.SetLastResponseMeta_(_meta258) + if _err != nil { + return + } + if _ret260 := _result259.GetSuccess(); _ret260 != nil { + return _ret260, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdge(ctx context.Context, req *GetEdgeReq) (_r *GetEdgeResp, _err error) { + var _args261 MetaServiceGetEdgeArgs + _args261.Req = req + var _result263 MetaServiceGetEdgeResult + var _meta262 thrift.ResponseMeta + _meta262, _err = p.Client_().Call(ctx, "getEdge", &_args261, &_result263) + p.SetLastResponseMeta_(_meta262) + if _err != nil { + return + } + if _ret264 := _result263.GetSuccess(); _ret264 != nil { + return _ret264, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdges(ctx context.Context, req *ListEdgesReq) (_r *ListEdgesResp, _err error) { + var _args265 MetaServiceListEdgesArgs + _args265.Req = req + var _result267 MetaServiceListEdgesResult + var _meta266 thrift.ResponseMeta + _meta266, _err = p.Client_().Call(ctx, "listEdges", &_args265, &_result267) + p.SetLastResponseMeta_(_meta266) + if _err != nil { + return + } + if _ret268 := _result267.GetSuccess(); _ret268 != nil { + return _ret268, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listEdges failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddHosts(ctx context.Context, req *AddHostsReq) (_r *ExecResp, _err error) { + var _args269 MetaServiceAddHostsArgs + _args269.Req = req + var _result271 MetaServiceAddHostsResult + var _meta270 thrift.ResponseMeta + _meta270, _err = p.Client_().Call(ctx, "addHosts", &_args269, &_result271) + p.SetLastResponseMeta_(_meta270) + if _err != nil { + return + } + if _ret272 := _result271.GetSuccess(); _ret272 != nil { + return _ret272, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addHosts failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddHostsIntoZone(ctx context.Context, req *AddHostsIntoZoneReq) (_r *ExecResp, _err error) { + var _args273 MetaServiceAddHostsIntoZoneArgs + _args273.Req = req + var _result275 MetaServiceAddHostsIntoZoneResult + var _meta274 thrift.ResponseMeta + _meta274, _err = p.Client_().Call(ctx, "addHostsIntoZone", &_args273, &_result275) + p.SetLastResponseMeta_(_meta274) + if _err != nil { + return + } + if _ret276 := _result275.GetSuccess(); _ret276 != nil { + return _ret276, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addHostsIntoZone failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropHosts(ctx context.Context, req *DropHostsReq) (_r *ExecResp, _err error) { + var _args277 MetaServiceDropHostsArgs + _args277.Req = req + var _result279 MetaServiceDropHostsResult + var _meta278 thrift.ResponseMeta + _meta278, _err = p.Client_().Call(ctx, "dropHosts", &_args277, &_result279) + p.SetLastResponseMeta_(_meta278) + if _err != nil { + return + } + if _ret280 := _result279.GetSuccess(); _ret280 != nil { + return _ret280, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropHosts failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, _err error) { + var _args281 MetaServiceListHostsArgs + _args281.Req = req + var _result283 MetaServiceListHostsResult + var _meta282 thrift.ResponseMeta + _meta282, _err = p.Client_().Call(ctx, "listHosts", &_args281, &_result283) + p.SetLastResponseMeta_(_meta282) + if _err != nil { + return + } + if _ret284 := _result283.GetSuccess(); _ret284 != nil { + return _ret284, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listHosts failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, _err error) { + var _args285 MetaServiceGetPartsAllocArgs + _args285.Req = req + var _result287 MetaServiceGetPartsAllocResult + var _meta286 thrift.ResponseMeta + _meta286, _err = p.Client_().Call(ctx, "getPartsAlloc", &_args285, &_result287) + p.SetLastResponseMeta_(_meta286) + if _err != nil { + return + } + if _ret288 := _result287.GetSuccess(); _ret288 != nil { + return _ret288, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getPartsAlloc failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, _err error) { + var _args289 MetaServiceListPartsArgs + _args289.Req = req + var _result291 MetaServiceListPartsResult + var _meta290 thrift.ResponseMeta + _meta290, _err = p.Client_().Call(ctx, "listParts", &_args289, &_result291) + p.SetLastResponseMeta_(_meta290) + if _err != nil { + return + } + if _ret292 := _result291.GetSuccess(); _ret292 != nil { + return _ret292, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listParts failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetWorkerId(ctx context.Context, req *GetWorkerIdReq) (_r *GetWorkerIdResp, _err error) { + var _args293 MetaServiceGetWorkerIdArgs + _args293.Req = req + var _result295 MetaServiceGetWorkerIdResult + var _meta294 thrift.ResponseMeta + _meta294, _err = p.Client_().Call(ctx, "getWorkerId", &_args293, &_result295) + p.SetLastResponseMeta_(_meta294) + if _err != nil { + return + } + if _ret296 := _result295.GetSuccess(); _ret296 != nil { + return _ret296, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getWorkerId failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateTagIndex(ctx context.Context, req *CreateTagIndexReq) (_r *ExecResp, _err error) { + var _args297 MetaServiceCreateTagIndexArgs + _args297.Req = req + var _result299 MetaServiceCreateTagIndexResult + var _meta298 thrift.ResponseMeta + _meta298, _err = p.Client_().Call(ctx, "createTagIndex", &_args297, &_result299) + p.SetLastResponseMeta_(_meta298) + if _err != nil { + return + } + if _ret300 := _result299.GetSuccess(); _ret300 != nil { + return _ret300, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createTagIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropTagIndex(ctx context.Context, req *DropTagIndexReq) (_r *ExecResp, _err error) { + var _args301 MetaServiceDropTagIndexArgs + _args301.Req = req + var _result303 MetaServiceDropTagIndexResult + var _meta302 thrift.ResponseMeta + _meta302, _err = p.Client_().Call(ctx, "dropTagIndex", &_args301, &_result303) + p.SetLastResponseMeta_(_meta302) + if _err != nil { + return + } + if _ret304 := _result303.GetSuccess(); _ret304 != nil { + return _ret304, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropTagIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetTagIndex(ctx context.Context, req *GetTagIndexReq) (_r *GetTagIndexResp, _err error) { + var _args305 MetaServiceGetTagIndexArgs + _args305.Req = req + var _result307 MetaServiceGetTagIndexResult + var _meta306 thrift.ResponseMeta + _meta306, _err = p.Client_().Call(ctx, "getTagIndex", &_args305, &_result307) + p.SetLastResponseMeta_(_meta306) + if _err != nil { + return + } + if _ret308 := _result307.GetSuccess(); _ret308 != nil { + return _ret308, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getTagIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexes(ctx context.Context, req *ListTagIndexesReq) (_r *ListTagIndexesResp, _err error) { + var _args309 MetaServiceListTagIndexesArgs + _args309.Req = req + var _result311 MetaServiceListTagIndexesResult + var _meta310 thrift.ResponseMeta + _meta310, _err = p.Client_().Call(ctx, "listTagIndexes", &_args309, &_result311) + p.SetLastResponseMeta_(_meta310) + if _err != nil { + return + } + if _ret312 := _result311.GetSuccess(); _ret312 != nil { + return _ret312, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listTagIndexes failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildTagIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, _err error) { + var _args313 MetaServiceRebuildTagIndexArgs + _args313.Req = req + var _result315 MetaServiceRebuildTagIndexResult + var _meta314 thrift.ResponseMeta + _meta314, _err = p.Client_().Call(ctx, "rebuildTagIndex", &_args313, &_result315) + p.SetLastResponseMeta_(_meta314) + if _err != nil { + return + } + if _ret316 := _result315.GetSuccess(); _ret316 != nil { + return _ret316, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "rebuildTagIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListTagIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, _err error) { + var _args317 MetaServiceListTagIndexStatusArgs + _args317.Req = req + var _result319 MetaServiceListTagIndexStatusResult + var _meta318 thrift.ResponseMeta + _meta318, _err = p.Client_().Call(ctx, "listTagIndexStatus", &_args317, &_result319) + p.SetLastResponseMeta_(_meta318) + if _err != nil { + return + } + if _ret320 := _result319.GetSuccess(); _ret320 != nil { + return _ret320, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listTagIndexStatus failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateEdgeIndex(ctx context.Context, req *CreateEdgeIndexReq) (_r *ExecResp, _err error) { + var _args321 MetaServiceCreateEdgeIndexArgs + _args321.Req = req + var _result323 MetaServiceCreateEdgeIndexResult + var _meta322 thrift.ResponseMeta + _meta322, _err = p.Client_().Call(ctx, "createEdgeIndex", &_args321, &_result323) + p.SetLastResponseMeta_(_meta322) + if _err != nil { + return + } + if _ret324 := _result323.GetSuccess(); _ret324 != nil { + return _ret324, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createEdgeIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropEdgeIndex(ctx context.Context, req *DropEdgeIndexReq) (_r *ExecResp, _err error) { + var _args325 MetaServiceDropEdgeIndexArgs + _args325.Req = req + var _result327 MetaServiceDropEdgeIndexResult + var _meta326 thrift.ResponseMeta + _meta326, _err = p.Client_().Call(ctx, "dropEdgeIndex", &_args325, &_result327) + p.SetLastResponseMeta_(_meta326) + if _err != nil { + return + } + if _ret328 := _result327.GetSuccess(); _ret328 != nil { + return _ret328, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropEdgeIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetEdgeIndex(ctx context.Context, req *GetEdgeIndexReq) (_r *GetEdgeIndexResp, _err error) { + var _args329 MetaServiceGetEdgeIndexArgs + _args329.Req = req + var _result331 MetaServiceGetEdgeIndexResult + var _meta330 thrift.ResponseMeta + _meta330, _err = p.Client_().Call(ctx, "getEdgeIndex", &_args329, &_result331) + p.SetLastResponseMeta_(_meta330) + if _err != nil { + return + } + if _ret332 := _result331.GetSuccess(); _ret332 != nil { + return _ret332, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getEdgeIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexes(ctx context.Context, req *ListEdgeIndexesReq) (_r *ListEdgeIndexesResp, _err error) { + var _args333 MetaServiceListEdgeIndexesArgs + _args333.Req = req + var _result335 MetaServiceListEdgeIndexesResult + var _meta334 thrift.ResponseMeta + _meta334, _err = p.Client_().Call(ctx, "listEdgeIndexes", &_args333, &_result335) + p.SetLastResponseMeta_(_meta334) + if _err != nil { + return + } + if _ret336 := _result335.GetSuccess(); _ret336 != nil { + return _ret336, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listEdgeIndexes failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RebuildEdgeIndex(ctx context.Context, req *RebuildIndexReq) (_r *ExecResp, _err error) { + var _args337 MetaServiceRebuildEdgeIndexArgs + _args337.Req = req + var _result339 MetaServiceRebuildEdgeIndexResult + var _meta338 thrift.ResponseMeta + _meta338, _err = p.Client_().Call(ctx, "rebuildEdgeIndex", &_args337, &_result339) + p.SetLastResponseMeta_(_meta338) + if _err != nil { + return + } + if _ret340 := _result339.GetSuccess(); _ret340 != nil { + return _ret340, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "rebuildEdgeIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListEdgeIndexStatus(ctx context.Context, req *ListIndexStatusReq) (_r *ListIndexStatusResp, _err error) { + var _args341 MetaServiceListEdgeIndexStatusArgs + _args341.Req = req + var _result343 MetaServiceListEdgeIndexStatusResult + var _meta342 thrift.ResponseMeta + _meta342, _err = p.Client_().Call(ctx, "listEdgeIndexStatus", &_args341, &_result343) + p.SetLastResponseMeta_(_meta342) + if _err != nil { + return + } + if _ret344 := _result343.GetSuccess(); _ret344 != nil { + return _ret344, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listEdgeIndexStatus failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateUser(ctx context.Context, req *CreateUserReq) (_r *ExecResp, _err error) { + var _args345 MetaServiceCreateUserArgs + _args345.Req = req + var _result347 MetaServiceCreateUserResult + var _meta346 thrift.ResponseMeta + _meta346, _err = p.Client_().Call(ctx, "createUser", &_args345, &_result347) + p.SetLastResponseMeta_(_meta346) + if _err != nil { + return + } + if _ret348 := _result347.GetSuccess(); _ret348 != nil { + return _ret348, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createUser failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropUser(ctx context.Context, req *DropUserReq) (_r *ExecResp, _err error) { + var _args349 MetaServiceDropUserArgs + _args349.Req = req + var _result351 MetaServiceDropUserResult + var _meta350 thrift.ResponseMeta + _meta350, _err = p.Client_().Call(ctx, "dropUser", &_args349, &_result351) + p.SetLastResponseMeta_(_meta350) + if _err != nil { + return + } + if _ret352 := _result351.GetSuccess(); _ret352 != nil { + return _ret352, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropUser failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AlterUser(ctx context.Context, req *AlterUserReq) (_r *ExecResp, _err error) { + var _args353 MetaServiceAlterUserArgs + _args353.Req = req + var _result355 MetaServiceAlterUserResult + var _meta354 thrift.ResponseMeta + _meta354, _err = p.Client_().Call(ctx, "alterUser", &_args353, &_result355) + p.SetLastResponseMeta_(_meta354) + if _err != nil { + return + } + if _ret356 := _result355.GetSuccess(); _ret356 != nil { + return _ret356, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "alterUser failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GrantRole(ctx context.Context, req *GrantRoleReq) (_r *ExecResp, _err error) { + var _args357 MetaServiceGrantRoleArgs + _args357.Req = req + var _result359 MetaServiceGrantRoleResult + var _meta358 thrift.ResponseMeta + _meta358, _err = p.Client_().Call(ctx, "grantRole", &_args357, &_result359) + p.SetLastResponseMeta_(_meta358) + if _err != nil { + return + } + if _ret360 := _result359.GetSuccess(); _ret360 != nil { + return _ret360, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "grantRole failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RevokeRole(ctx context.Context, req *RevokeRoleReq) (_r *ExecResp, _err error) { + var _args361 MetaServiceRevokeRoleArgs + _args361.Req = req + var _result363 MetaServiceRevokeRoleResult + var _meta362 thrift.ResponseMeta + _meta362, _err = p.Client_().Call(ctx, "revokeRole", &_args361, &_result363) + p.SetLastResponseMeta_(_meta362) + if _err != nil { + return + } + if _ret364 := _result363.GetSuccess(); _ret364 != nil { + return _ret364, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "revokeRole failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListUsers(ctx context.Context, req *ListUsersReq) (_r *ListUsersResp, _err error) { + var _args365 MetaServiceListUsersArgs + _args365.Req = req + var _result367 MetaServiceListUsersResult + var _meta366 thrift.ResponseMeta + _meta366, _err = p.Client_().Call(ctx, "listUsers", &_args365, &_result367) + p.SetLastResponseMeta_(_meta366) + if _err != nil { + return + } + if _ret368 := _result367.GetSuccess(); _ret368 != nil { + return _ret368, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listUsers failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListRoles(ctx context.Context, req *ListRolesReq) (_r *ListRolesResp, _err error) { + var _args369 MetaServiceListRolesArgs + _args369.Req = req + var _result371 MetaServiceListRolesResult + var _meta370 thrift.ResponseMeta + _meta370, _err = p.Client_().Call(ctx, "listRoles", &_args369, &_result371) + p.SetLastResponseMeta_(_meta370) + if _err != nil { + return + } + if _ret372 := _result371.GetSuccess(); _ret372 != nil { + return _ret372, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listRoles failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetUserRoles(ctx context.Context, req *GetUserRolesReq) (_r *ListRolesResp, _err error) { + var _args373 MetaServiceGetUserRolesArgs + _args373.Req = req + var _result375 MetaServiceGetUserRolesResult + var _meta374 thrift.ResponseMeta + _meta374, _err = p.Client_().Call(ctx, "getUserRoles", &_args373, &_result375) + p.SetLastResponseMeta_(_meta374) + if _err != nil { + return + } + if _ret376 := _result375.GetSuccess(); _ret376 != nil { + return _ret376, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getUserRoles failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ChangePassword(ctx context.Context, req *ChangePasswordReq) (_r *ExecResp, _err error) { + var _args377 MetaServiceChangePasswordArgs + _args377.Req = req + var _result379 MetaServiceChangePasswordResult + var _meta378 thrift.ResponseMeta + _meta378, _err = p.Client_().Call(ctx, "changePassword", &_args377, &_result379) + p.SetLastResponseMeta_(_meta378) + if _err != nil { + return + } + if _ret380 := _result379.GetSuccess(); _ret380 != nil { + return _ret380, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "changePassword failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) HeartBeat(ctx context.Context, req *HBReq) (_r *HBResp, _err error) { + var _args381 MetaServiceHeartBeatArgs + _args381.Req = req + var _result383 MetaServiceHeartBeatResult + var _meta382 thrift.ResponseMeta + _meta382, _err = p.Client_().Call(ctx, "heartBeat", &_args381, &_result383) + p.SetLastResponseMeta_(_meta382) + if _err != nil { + return + } + if _ret384 := _result383.GetSuccess(); _ret384 != nil { + return _ret384, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "heartBeat failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AgentHeartbeat(ctx context.Context, req *AgentHBReq) (_r *AgentHBResp, _err error) { + var _args385 MetaServiceAgentHeartbeatArgs + _args385.Req = req + var _result387 MetaServiceAgentHeartbeatResult + var _meta386 thrift.ResponseMeta + _meta386, _err = p.Client_().Call(ctx, "agentHeartbeat", &_args385, &_result387) + p.SetLastResponseMeta_(_meta386) + if _err != nil { + return + } + if _ret388 := _result387.GetSuccess(); _ret388 != nil { + return _ret388, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "agentHeartbeat failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RegConfig(ctx context.Context, req *RegConfigReq) (_r *ExecResp, _err error) { + var _args389 MetaServiceRegConfigArgs + _args389.Req = req + var _result391 MetaServiceRegConfigResult + var _meta390 thrift.ResponseMeta + _meta390, _err = p.Client_().Call(ctx, "regConfig", &_args389, &_result391) + p.SetLastResponseMeta_(_meta390) + if _err != nil { + return + } + if _ret392 := _result391.GetSuccess(); _ret392 != nil { + return _ret392, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "regConfig failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetConfig(ctx context.Context, req *GetConfigReq) (_r *GetConfigResp, _err error) { + var _args393 MetaServiceGetConfigArgs + _args393.Req = req + var _result395 MetaServiceGetConfigResult + var _meta394 thrift.ResponseMeta + _meta394, _err = p.Client_().Call(ctx, "getConfig", &_args393, &_result395) + p.SetLastResponseMeta_(_meta394) + if _err != nil { + return + } + if _ret396 := _result395.GetSuccess(); _ret396 != nil { + return _ret396, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getConfig failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SetConfig(ctx context.Context, req *SetConfigReq) (_r *ExecResp, _err error) { + var _args397 MetaServiceSetConfigArgs + _args397.Req = req + var _result399 MetaServiceSetConfigResult + var _meta398 thrift.ResponseMeta + _meta398, _err = p.Client_().Call(ctx, "setConfig", &_args397, &_result399) + p.SetLastResponseMeta_(_meta398) + if _err != nil { + return + } + if _ret400 := _result399.GetSuccess(); _ret400 != nil { + return _ret400, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "setConfig failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListConfigs(ctx context.Context, req *ListConfigsReq) (_r *ListConfigsResp, _err error) { + var _args401 MetaServiceListConfigsArgs + _args401.Req = req + var _result403 MetaServiceListConfigsResult + var _meta402 thrift.ResponseMeta + _meta402, _err = p.Client_().Call(ctx, "listConfigs", &_args401, &_result403) + p.SetLastResponseMeta_(_meta402) + if _err != nil { + return + } + if _ret404 := _result403.GetSuccess(); _ret404 != nil { + return _ret404, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listConfigs failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSnapshot(ctx context.Context, req *CreateSnapshotReq) (_r *ExecResp, _err error) { + var _args405 MetaServiceCreateSnapshotArgs + _args405.Req = req + var _result407 MetaServiceCreateSnapshotResult + var _meta406 thrift.ResponseMeta + _meta406, _err = p.Client_().Call(ctx, "createSnapshot", &_args405, &_result407) + p.SetLastResponseMeta_(_meta406) + if _err != nil { + return + } + if _ret408 := _result407.GetSuccess(); _ret408 != nil { + return _ret408, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createSnapshot failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropSnapshot(ctx context.Context, req *DropSnapshotReq) (_r *ExecResp, _err error) { + var _args409 MetaServiceDropSnapshotArgs + _args409.Req = req + var _result411 MetaServiceDropSnapshotResult + var _meta410 thrift.ResponseMeta + _meta410, _err = p.Client_().Call(ctx, "dropSnapshot", &_args409, &_result411) + p.SetLastResponseMeta_(_meta410) + if _err != nil { + return + } + if _ret412 := _result411.GetSuccess(); _ret412 != nil { + return _ret412, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropSnapshot failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSnapshots(ctx context.Context, req *ListSnapshotsReq) (_r *ListSnapshotsResp, _err error) { + var _args413 MetaServiceListSnapshotsArgs + _args413.Req = req + var _result415 MetaServiceListSnapshotsResult + var _meta414 thrift.ResponseMeta + _meta414, _err = p.Client_().Call(ctx, "listSnapshots", &_args413, &_result415) + p.SetLastResponseMeta_(_meta414) + if _err != nil { + return + } + if _ret416 := _result415.GetSuccess(); _ret416 != nil { + return _ret416, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listSnapshots failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RunAdminJob(ctx context.Context, req *AdminJobReq) (_r *AdminJobResp, _err error) { + var _args417 MetaServiceRunAdminJobArgs + _args417.Req = req + var _result419 MetaServiceRunAdminJobResult + var _meta418 thrift.ResponseMeta + _meta418, _err = p.Client_().Call(ctx, "runAdminJob", &_args417, &_result419) + p.SetLastResponseMeta_(_meta418) + if _err != nil { + return + } + if _ret420 := _result419.GetSuccess(); _ret420 != nil { + return _ret420, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "runAdminJob failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) MergeZone(ctx context.Context, req *MergeZoneReq) (_r *ExecResp, _err error) { + var _args421 MetaServiceMergeZoneArgs + _args421.Req = req + var _result423 MetaServiceMergeZoneResult + var _meta422 thrift.ResponseMeta + _meta422, _err = p.Client_().Call(ctx, "mergeZone", &_args421, &_result423) + p.SetLastResponseMeta_(_meta422) + if _err != nil { + return + } + if _ret424 := _result423.GetSuccess(); _ret424 != nil { + return _ret424, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "mergeZone failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, _err error) { + var _args425 MetaServiceDropZoneArgs + _args425.Req = req + var _result427 MetaServiceDropZoneResult + var _meta426 thrift.ResponseMeta + _meta426, _err = p.Client_().Call(ctx, "dropZone", &_args425, &_result427) + p.SetLastResponseMeta_(_meta426) + if _err != nil { + return + } + if _ret428 := _result427.GetSuccess(); _ret428 != nil { + return _ret428, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropZone failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DivideZone(ctx context.Context, req *DivideZoneReq) (_r *ExecResp, _err error) { + var _args429 MetaServiceDivideZoneArgs + _args429.Req = req + var _result431 MetaServiceDivideZoneResult + var _meta430 thrift.ResponseMeta + _meta430, _err = p.Client_().Call(ctx, "divideZone", &_args429, &_result431) + p.SetLastResponseMeta_(_meta430) + if _err != nil { + return + } + if _ret432 := _result431.GetSuccess(); _ret432 != nil { + return _ret432, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "divideZone failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RenameZone(ctx context.Context, req *RenameZoneReq) (_r *ExecResp, _err error) { + var _args433 MetaServiceRenameZoneArgs + _args433.Req = req + var _result435 MetaServiceRenameZoneResult + var _meta434 thrift.ResponseMeta + _meta434, _err = p.Client_().Call(ctx, "renameZone", &_args433, &_result435) + p.SetLastResponseMeta_(_meta434) + if _err != nil { + return + } + if _ret436 := _result435.GetSuccess(); _ret436 != nil { + return _ret436, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "renameZone failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetZone(ctx context.Context, req *GetZoneReq) (_r *GetZoneResp, _err error) { + var _args437 MetaServiceGetZoneArgs + _args437.Req = req + var _result439 MetaServiceGetZoneResult + var _meta438 thrift.ResponseMeta + _meta438, _err = p.Client_().Call(ctx, "getZone", &_args437, &_result439) + p.SetLastResponseMeta_(_meta438) + if _err != nil { + return + } + if _ret440 := _result439.GetSuccess(); _ret440 != nil { + return _ret440, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getZone failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListZones(ctx context.Context, req *ListZonesReq) (_r *ListZonesResp, _err error) { + var _args441 MetaServiceListZonesArgs + _args441.Req = req + var _result443 MetaServiceListZonesResult + var _meta442 thrift.ResponseMeta + _meta442, _err = p.Client_().Call(ctx, "listZones", &_args441, &_result443) + p.SetLastResponseMeta_(_meta442) + if _err != nil { + return + } + if _ret444 := _result443.GetSuccess(); _ret444 != nil { + return _ret444, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listZones failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) AddListener(ctx context.Context, req *AddListenerReq) (_r *ExecResp, _err error) { + var _args445 MetaServiceAddListenerArgs + _args445.Req = req + var _result447 MetaServiceAddListenerResult + var _meta446 thrift.ResponseMeta + _meta446, _err = p.Client_().Call(ctx, "addListener", &_args445, &_result447) + p.SetLastResponseMeta_(_meta446) + if _err != nil { + return + } + if _ret448 := _result447.GetSuccess(); _ret448 != nil { + return _ret448, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addListener failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveListener(ctx context.Context, req *RemoveListenerReq) (_r *ExecResp, _err error) { + var _args449 MetaServiceRemoveListenerArgs + _args449.Req = req + var _result451 MetaServiceRemoveListenerResult + var _meta450 thrift.ResponseMeta + _meta450, _err = p.Client_().Call(ctx, "removeListener", &_args449, &_result451) + p.SetLastResponseMeta_(_meta450) + if _err != nil { + return + } + if _ret452 := _result451.GetSuccess(); _ret452 != nil { + return _ret452, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "removeListener failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListListener(ctx context.Context, req *ListListenerReq) (_r *ListListenerResp, _err error) { + var _args453 MetaServiceListListenerArgs + _args453.Req = req + var _result455 MetaServiceListListenerResult + var _meta454 thrift.ResponseMeta + _meta454, _err = p.Client_().Call(ctx, "listListener", &_args453, &_result455) + p.SetLastResponseMeta_(_meta454) + if _err != nil { + return + } + if _ret456 := _result455.GetSuccess(); _ret456 != nil { + return _ret456, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listListener failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetStats(ctx context.Context, req *GetStatsReq) (_r *GetStatsResp, _err error) { + var _args457 MetaServiceGetStatsArgs + _args457.Req = req + var _result459 MetaServiceGetStatsResult + var _meta458 thrift.ResponseMeta + _meta458, _err = p.Client_().Call(ctx, "getStats", &_args457, &_result459) + p.SetLastResponseMeta_(_meta458) + if _err != nil { + return + } + if _ret460 := _result459.GetSuccess(); _ret460 != nil { + return _ret460, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getStats failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignInService(ctx context.Context, req *SignInServiceReq) (_r *ExecResp, _err error) { + var _args461 MetaServiceSignInServiceArgs + _args461.Req = req + var _result463 MetaServiceSignInServiceResult + var _meta462 thrift.ResponseMeta + _meta462, _err = p.Client_().Call(ctx, "signInService", &_args461, &_result463) + p.SetLastResponseMeta_(_meta462) + if _err != nil { + return + } + if _ret464 := _result463.GetSuccess(); _ret464 != nil { + return _ret464, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "signInService failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SignOutService(ctx context.Context, req *SignOutServiceReq) (_r *ExecResp, _err error) { + var _args465 MetaServiceSignOutServiceArgs + _args465.Req = req + var _result467 MetaServiceSignOutServiceResult + var _meta466 thrift.ResponseMeta + _meta466, _err = p.Client_().Call(ctx, "signOutService", &_args465, &_result467) + p.SetLastResponseMeta_(_meta466) + if _err != nil { + return + } + if _ret468 := _result467.GetSuccess(); _ret468 != nil { + return _ret468, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "signOutService failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListServiceClients(ctx context.Context, req *ListServiceClientsReq) (_r *ListServiceClientsResp, _err error) { + var _args469 MetaServiceListServiceClientsArgs + _args469.Req = req + var _result471 MetaServiceListServiceClientsResult + var _meta470 thrift.ResponseMeta + _meta470, _err = p.Client_().Call(ctx, "listServiceClients", &_args469, &_result471) + p.SetLastResponseMeta_(_meta470) + if _err != nil { + return + } + if _ret472 := _result471.GetSuccess(); _ret472 != nil { + return _ret472, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listServiceClients failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateFTIndex(ctx context.Context, req *CreateFTIndexReq) (_r *ExecResp, _err error) { + var _args473 MetaServiceCreateFTIndexArgs + _args473.Req = req + var _result475 MetaServiceCreateFTIndexResult + var _meta474 thrift.ResponseMeta + _meta474, _err = p.Client_().Call(ctx, "createFTIndex", &_args473, &_result475) + p.SetLastResponseMeta_(_meta474) + if _err != nil { + return + } + if _ret476 := _result475.GetSuccess(); _ret476 != nil { + return _ret476, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createFTIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) DropFTIndex(ctx context.Context, req *DropFTIndexReq) (_r *ExecResp, _err error) { + var _args477 MetaServiceDropFTIndexArgs + _args477.Req = req + var _result479 MetaServiceDropFTIndexResult + var _meta478 thrift.ResponseMeta + _meta478, _err = p.Client_().Call(ctx, "dropFTIndex", &_args477, &_result479) + p.SetLastResponseMeta_(_meta478) + if _err != nil { + return + } + if _ret480 := _result479.GetSuccess(); _ret480 != nil { + return _ret480, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropFTIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListFTIndexes(ctx context.Context, req *ListFTIndexesReq) (_r *ListFTIndexesResp, _err error) { + var _args481 MetaServiceListFTIndexesArgs + _args481.Req = req + var _result483 MetaServiceListFTIndexesResult + var _meta482 thrift.ResponseMeta + _meta482, _err = p.Client_().Call(ctx, "listFTIndexes", &_args481, &_result483) + p.SetLastResponseMeta_(_meta482) + if _err != nil { + return + } + if _ret484 := _result483.GetSuccess(); _ret484 != nil { + return _ret484, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listFTIndexes failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateSession(ctx context.Context, req *CreateSessionReq) (_r *CreateSessionResp, _err error) { + var _args485 MetaServiceCreateSessionArgs + _args485.Req = req + var _result487 MetaServiceCreateSessionResult + var _meta486 thrift.ResponseMeta + _meta486, _err = p.Client_().Call(ctx, "createSession", &_args485, &_result487) + p.SetLastResponseMeta_(_meta486) + if _err != nil { + return + } + if _ret488 := _result487.GetSuccess(); _ret488 != nil { + return _ret488, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createSession failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) UpdateSessions(ctx context.Context, req *UpdateSessionsReq) (_r *UpdateSessionsResp, _err error) { + var _args489 MetaServiceUpdateSessionsArgs + _args489.Req = req + var _result491 MetaServiceUpdateSessionsResult + var _meta490 thrift.ResponseMeta + _meta490, _err = p.Client_().Call(ctx, "updateSessions", &_args489, &_result491) + p.SetLastResponseMeta_(_meta490) + if _err != nil { + return + } + if _ret492 := _result491.GetSuccess(); _ret492 != nil { + return _ret492, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "updateSessions failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListSessions(ctx context.Context, req *ListSessionsReq) (_r *ListSessionsResp, _err error) { + var _args493 MetaServiceListSessionsArgs + _args493.Req = req + var _result495 MetaServiceListSessionsResult + var _meta494 thrift.ResponseMeta + _meta494, _err = p.Client_().Call(ctx, "listSessions", &_args493, &_result495) + p.SetLastResponseMeta_(_meta494) + if _err != nil { + return + } + if _ret496 := _result495.GetSuccess(); _ret496 != nil { + return _ret496, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listSessions failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSession(ctx context.Context, req *GetSessionReq) (_r *GetSessionResp, _err error) { + var _args497 MetaServiceGetSessionArgs + _args497.Req = req + var _result499 MetaServiceGetSessionResult + var _meta498 thrift.ResponseMeta + _meta498, _err = p.Client_().Call(ctx, "getSession", &_args497, &_result499) + p.SetLastResponseMeta_(_meta498) + if _err != nil { + return + } + if _ret500 := _result499.GetSuccess(); _ret500 != nil { + return _ret500, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getSession failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RemoveSession(ctx context.Context, req *RemoveSessionReq) (_r *RemoveSessionResp, _err error) { + var _args501 MetaServiceRemoveSessionArgs + _args501.Req = req + var _result503 MetaServiceRemoveSessionResult + var _meta502 thrift.ResponseMeta + _meta502, _err = p.Client_().Call(ctx, "removeSession", &_args501, &_result503) + p.SetLastResponseMeta_(_meta502) + if _err != nil { + return + } + if _ret504 := _result503.GetSuccess(); _ret504 != nil { + return _ret504, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "removeSession failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) KillQuery(ctx context.Context, req *KillQueryReq) (_r *ExecResp, _err error) { + var _args505 MetaServiceKillQueryArgs + _args505.Req = req + var _result507 MetaServiceKillQueryResult + var _meta506 thrift.ResponseMeta + _meta506, _err = p.Client_().Call(ctx, "killQuery", &_args505, &_result507) + p.SetLastResponseMeta_(_meta506) + if _err != nil { + return + } + if _ret508 := _result507.GetSuccess(); _ret508 != nil { + return _ret508, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "killQuery failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ReportTaskFinish(ctx context.Context, req *ReportTaskReq) (_r *ExecResp, _err error) { + var _args509 MetaServiceReportTaskFinishArgs + _args509.Req = req + var _result511 MetaServiceReportTaskFinishResult + var _meta510 thrift.ResponseMeta + _meta510, _err = p.Client_().Call(ctx, "reportTaskFinish", &_args509, &_result511) + p.SetLastResponseMeta_(_meta510) + if _err != nil { + return + } + if _ret512 := _result511.GetSuccess(); _ret512 != nil { + return _ret512, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "reportTaskFinish failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, _err error) { + var _args513 MetaServiceCreateBackupArgs + _args513.Req = req + var _result515 MetaServiceCreateBackupResult + var _meta514 thrift.ResponseMeta + _meta514, _err = p.Client_().Call(ctx, "createBackup", &_args513, &_result515) + p.SetLastResponseMeta_(_meta514) + if _err != nil { + return + } + if _ret516 := _result515.GetSuccess(); _ret516 != nil { + return _ret516, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createBackup failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *RestoreMetaResp, _err error) { + var _args517 MetaServiceRestoreMetaArgs + _args517.Req = req + var _result519 MetaServiceRestoreMetaResult + var _meta518 thrift.ResponseMeta + _meta518, _err = p.Client_().Call(ctx, "restoreMeta", &_args517, &_result519) + p.SetLastResponseMeta_(_meta518) + if _err != nil { + return + } + if _ret520 := _result519.GetSuccess(); _ret520 != nil { + return _ret520, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "restoreMeta failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) ListCluster(ctx context.Context, req *ListClusterInfoReq) (_r *ListClusterInfoResp, _err error) { + var _args521 MetaServiceListClusterArgs + _args521.Req = req + var _result523 MetaServiceListClusterResult + var _meta522 thrift.ResponseMeta + _meta522, _err = p.Client_().Call(ctx, "listCluster", &_args521, &_result523) + p.SetLastResponseMeta_(_meta522) + if _err != nil { + return + } + if _ret524 := _result523.GetSuccess(); _ret524 != nil { + return _ret524, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "listCluster failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetMetaDirInfo(ctx context.Context, req *GetMetaDirInfoReq) (_r *GetMetaDirInfoResp, _err error) { + var _args525 MetaServiceGetMetaDirInfoArgs + _args525.Req = req + var _result527 MetaServiceGetMetaDirInfoResult + var _meta526 thrift.ResponseMeta + _meta526, _err = p.Client_().Call(ctx, "getMetaDirInfo", &_args525, &_result527) + p.SetLastResponseMeta_(_meta526) + if _err != nil { + return + } + if _ret528 := _result527.GetSuccess(); _ret528 != nil { + return _ret528, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getMetaDirInfo failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) VerifyClientVersion(ctx context.Context, req *VerifyClientVersionReq) (_r *VerifyClientVersionResp, _err error) { + var _args529 MetaServiceVerifyClientVersionArgs + _args529.Req = req + var _result531 MetaServiceVerifyClientVersionResult + var _meta530 thrift.ResponseMeta + _meta530, _err = p.Client_().Call(ctx, "verifyClientVersion", &_args529, &_result531) + p.SetLastResponseMeta_(_meta530) + if _err != nil { + return + } + if _ret532 := _result531.GetSuccess(); _ret532 != nil { + return _ret532, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "verifyClientVersion failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) SaveGraphVersion(ctx context.Context, req *SaveGraphVersionReq) (_r *SaveGraphVersionResp, _err error) { + var _args533 MetaServiceSaveGraphVersionArgs + _args533.Req = req + var _result535 MetaServiceSaveGraphVersionResult + var _meta534 thrift.ResponseMeta + _meta534, _err = p.Client_().Call(ctx, "saveGraphVersion", &_args533, &_result535) + p.SetLastResponseMeta_(_meta534) + if _err != nil { + return + } + if _ret536 := _result535.GetSuccess(); _ret536 != nil { + return _ret536, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "saveGraphVersion failed: unknown result") +} + +// Parameters: +// - Req +func (p *MetaServiceClient) GetSegmentId(ctx context.Context, req *GetSegmentIdReq) (_r *GetSegmentIdResp, _err error) { + var _args537 MetaServiceGetSegmentIdArgs + _args537.Req = req + var _result539 MetaServiceGetSegmentIdResult + var _meta538 thrift.ResponseMeta + _meta538, _err = p.Client_().Call(ctx, "getSegmentId", &_args537, &_result539) + p.SetLastResponseMeta_(_meta538) + if _err != nil { + return + } + if _ret540 := _result539.GetSuccess(); _ret540 != nil { + return _ret540, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getSegmentId failed: unknown result") +} + +type MetaServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler MetaService +} + +func (p *MetaServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *MetaServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *MetaServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { + + self541 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self541.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} + self541.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} + self541.processorMap["clearSpace"] = &metaServiceProcessorClearSpace{handler:handler} + self541.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} + self541.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} + self541.processorMap["alterSpace"] = &metaServiceProcessorAlterSpace{handler:handler} + self541.processorMap["createSpaceAs"] = &metaServiceProcessorCreateSpaceAs{handler:handler} + self541.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} + self541.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} + self541.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} + self541.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} + self541.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} + self541.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} + self541.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} + self541.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} + self541.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} + self541.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} + self541.processorMap["addHosts"] = &metaServiceProcessorAddHosts{handler:handler} + self541.processorMap["addHostsIntoZone"] = &metaServiceProcessorAddHostsIntoZone{handler:handler} + self541.processorMap["dropHosts"] = &metaServiceProcessorDropHosts{handler:handler} + self541.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} + self541.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} + self541.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} + self541.processorMap["getWorkerId"] = &metaServiceProcessorGetWorkerId{handler:handler} + self541.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} + self541.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} + self541.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} + self541.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} + self541.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} + self541.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} + self541.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} + self541.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} + self541.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} + self541.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} + self541.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} + self541.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} + self541.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} + self541.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} + self541.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} + self541.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} + self541.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} + self541.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} + self541.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} + self541.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} + self541.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} + self541.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} + self541.processorMap["agentHeartbeat"] = &metaServiceProcessorAgentHeartbeat{handler:handler} + self541.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} + self541.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} + self541.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} + self541.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} + self541.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} + self541.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} + self541.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} + self541.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} + self541.processorMap["mergeZone"] = &metaServiceProcessorMergeZone{handler:handler} + self541.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} + self541.processorMap["divideZone"] = &metaServiceProcessorDivideZone{handler:handler} + self541.processorMap["renameZone"] = &metaServiceProcessorRenameZone{handler:handler} + self541.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} + self541.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} + self541.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} + self541.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} + self541.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} + self541.processorMap["getStats"] = &metaServiceProcessorGetStats{handler:handler} + self541.processorMap["signInService"] = &metaServiceProcessorSignInService{handler:handler} + self541.processorMap["signOutService"] = &metaServiceProcessorSignOutService{handler:handler} + self541.processorMap["listServiceClients"] = &metaServiceProcessorListServiceClients{handler:handler} + self541.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} + self541.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} + self541.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} + self541.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} + self541.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} + self541.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} + self541.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} + self541.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} + self541.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} + self541.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} + self541.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} + self541.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} + self541.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} + self541.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} + self541.processorMap["verifyClientVersion"] = &metaServiceProcessorVerifyClientVersion{handler:handler} + self541.processorMap["saveGraphVersion"] = &metaServiceProcessorSaveGraphVersion{handler:handler} + self541.processorMap["getSegmentId"] = &metaServiceProcessorGetSegmentId{handler:handler} +return self541 +} + +func (p *MetaServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { return false, thrift.WrapTException(err2) } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x542 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x542.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x542 + +} + +type metaServiceProcessorCreateSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSpace) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err543 error + args := MetaServiceCreateSpaceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createSpace", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateSpaceResult{} + if retval, err2 := p.handler.CreateSpace(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc544 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSpace: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createSpace", thrift.EXCEPTION, seqId); err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if err2 := _exc544.Write(ctx, oprot); _write_err543 == nil && err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err543 == nil && err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err543 == nil && err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if _write_err543 != nil { + return false, thrift.WrapTException(_write_err543) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createSpace", thrift.REPLY, seqId); err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err543 == nil && err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err543 == nil && err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err543 == nil && err2 != nil { + _write_err543 = thrift.WrapTException(err2) + } + if _write_err543 != nil { + return false, thrift.WrapTException(_write_err543) + } + return true, err +} + +type metaServiceProcessorDropSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSpace) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err545 error + args := MetaServiceDropSpaceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropSpace", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropSpaceResult{} + if retval, err2 := p.handler.DropSpace(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc546 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSpace: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropSpace", thrift.EXCEPTION, seqId); err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if err2 := _exc546.Write(ctx, oprot); _write_err545 == nil && err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err545 == nil && err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err545 == nil && err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if _write_err545 != nil { + return false, thrift.WrapTException(_write_err545) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropSpace", thrift.REPLY, seqId); err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err545 == nil && err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err545 == nil && err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err545 == nil && err2 != nil { + _write_err545 = thrift.WrapTException(err2) + } + if _write_err545 != nil { + return false, thrift.WrapTException(_write_err545) + } + return true, err +} + +type metaServiceProcessorClearSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorClearSpace) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err547 error + args := MetaServiceClearSpaceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "clearSpace", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceClearSpaceResult{} + if retval, err2 := p.handler.ClearSpace(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc548 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing clearSpace: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "clearSpace", thrift.EXCEPTION, seqId); err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if err2 := _exc548.Write(ctx, oprot); _write_err547 == nil && err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err547 == nil && err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err547 == nil && err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if _write_err547 != nil { + return false, thrift.WrapTException(_write_err547) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "clearSpace", thrift.REPLY, seqId); err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err547 == nil && err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err547 == nil && err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err547 == nil && err2 != nil { + _write_err547 = thrift.WrapTException(err2) + } + if _write_err547 != nil { + return false, thrift.WrapTException(_write_err547) + } + return true, err +} + +type metaServiceProcessorGetSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSpace) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err549 error + args := MetaServiceGetSpaceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getSpace", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetSpaceResult{} + if retval, err2 := p.handler.GetSpace(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc550 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSpace: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getSpace", thrift.EXCEPTION, seqId); err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if err2 := _exc550.Write(ctx, oprot); _write_err549 == nil && err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err549 == nil && err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err549 == nil && err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if _write_err549 != nil { + return false, thrift.WrapTException(_write_err549) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getSpace", thrift.REPLY, seqId); err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err549 == nil && err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err549 == nil && err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err549 == nil && err2 != nil { + _write_err549 = thrift.WrapTException(err2) + } + if _write_err549 != nil { + return false, thrift.WrapTException(_write_err549) + } + return true, err +} + +type metaServiceProcessorListSpaces struct { + handler MetaService +} + +func (p *metaServiceProcessorListSpaces) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err551 error + args := MetaServiceListSpacesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listSpaces", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListSpacesResult{} + if retval, err2 := p.handler.ListSpaces(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc552 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSpaces: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listSpaces", thrift.EXCEPTION, seqId); err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if err2 := _exc552.Write(ctx, oprot); _write_err551 == nil && err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err551 == nil && err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err551 == nil && err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if _write_err551 != nil { + return false, thrift.WrapTException(_write_err551) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listSpaces", thrift.REPLY, seqId); err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err551 == nil && err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err551 == nil && err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err551 == nil && err2 != nil { + _write_err551 = thrift.WrapTException(err2) + } + if _write_err551 != nil { + return false, thrift.WrapTException(_write_err551) + } + return true, err +} + +type metaServiceProcessorAlterSpace struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterSpace) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err553 error + args := MetaServiceAlterSpaceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "alterSpace", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAlterSpaceResult{} + if retval, err2 := p.handler.AlterSpace(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc554 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterSpace: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "alterSpace", thrift.EXCEPTION, seqId); err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if err2 := _exc554.Write(ctx, oprot); _write_err553 == nil && err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err553 == nil && err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err553 == nil && err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if _write_err553 != nil { + return false, thrift.WrapTException(_write_err553) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "alterSpace", thrift.REPLY, seqId); err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err553 == nil && err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err553 == nil && err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err553 == nil && err2 != nil { + _write_err553 = thrift.WrapTException(err2) + } + if _write_err553 != nil { + return false, thrift.WrapTException(_write_err553) + } + return true, err +} + +type metaServiceProcessorCreateSpaceAs struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSpaceAs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err555 error + args := MetaServiceCreateSpaceAsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createSpaceAs", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateSpaceAsResult{} + if retval, err2 := p.handler.CreateSpaceAs(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc556 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSpaceAs: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createSpaceAs", thrift.EXCEPTION, seqId); err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if err2 := _exc556.Write(ctx, oprot); _write_err555 == nil && err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err555 == nil && err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err555 == nil && err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if _write_err555 != nil { + return false, thrift.WrapTException(_write_err555) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createSpaceAs", thrift.REPLY, seqId); err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err555 == nil && err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err555 == nil && err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err555 == nil && err2 != nil { + _write_err555 = thrift.WrapTException(err2) + } + if _write_err555 != nil { + return false, thrift.WrapTException(_write_err555) + } + return true, err +} + +type metaServiceProcessorCreateTag struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTag) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err557 error + args := MetaServiceCreateTagArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createTag", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateTagResult{} + if retval, err2 := p.handler.CreateTag(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc558 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTag: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createTag", thrift.EXCEPTION, seqId); err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if err2 := _exc558.Write(ctx, oprot); _write_err557 == nil && err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err557 == nil && err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err557 == nil && err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if _write_err557 != nil { + return false, thrift.WrapTException(_write_err557) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createTag", thrift.REPLY, seqId); err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err557 == nil && err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err557 == nil && err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err557 == nil && err2 != nil { + _write_err557 = thrift.WrapTException(err2) + } + if _write_err557 != nil { + return false, thrift.WrapTException(_write_err557) + } + return true, err +} + +type metaServiceProcessorAlterTag struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterTag) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err559 error + args := MetaServiceAlterTagArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "alterTag", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAlterTagResult{} + if retval, err2 := p.handler.AlterTag(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc560 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterTag: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "alterTag", thrift.EXCEPTION, seqId); err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if err2 := _exc560.Write(ctx, oprot); _write_err559 == nil && err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err559 == nil && err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err559 == nil && err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if _write_err559 != nil { + return false, thrift.WrapTException(_write_err559) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "alterTag", thrift.REPLY, seqId); err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err559 == nil && err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err559 == nil && err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err559 == nil && err2 != nil { + _write_err559 = thrift.WrapTException(err2) + } + if _write_err559 != nil { + return false, thrift.WrapTException(_write_err559) + } + return true, err +} + +type metaServiceProcessorDropTag struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTag) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err561 error + args := MetaServiceDropTagArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropTag", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropTagResult{} + if retval, err2 := p.handler.DropTag(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc562 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTag: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropTag", thrift.EXCEPTION, seqId); err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if err2 := _exc562.Write(ctx, oprot); _write_err561 == nil && err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err561 == nil && err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err561 == nil && err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if _write_err561 != nil { + return false, thrift.WrapTException(_write_err561) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropTag", thrift.REPLY, seqId); err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err561 == nil && err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err561 == nil && err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err561 == nil && err2 != nil { + _write_err561 = thrift.WrapTException(err2) + } + if _write_err561 != nil { + return false, thrift.WrapTException(_write_err561) + } + return true, err +} + +type metaServiceProcessorGetTag struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTag) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err563 error + args := MetaServiceGetTagArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getTag", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetTagResult{} + if retval, err2 := p.handler.GetTag(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc564 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTag: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getTag", thrift.EXCEPTION, seqId); err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if err2 := _exc564.Write(ctx, oprot); _write_err563 == nil && err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err563 == nil && err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err563 == nil && err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if _write_err563 != nil { + return false, thrift.WrapTException(_write_err563) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getTag", thrift.REPLY, seqId); err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err563 == nil && err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err563 == nil && err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err563 == nil && err2 != nil { + _write_err563 = thrift.WrapTException(err2) + } + if _write_err563 != nil { + return false, thrift.WrapTException(_write_err563) + } + return true, err +} + +type metaServiceProcessorListTags struct { + handler MetaService +} + +func (p *metaServiceProcessorListTags) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err565 error + args := MetaServiceListTagsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listTags", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListTagsResult{} + if retval, err2 := p.handler.ListTags(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc566 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTags: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listTags", thrift.EXCEPTION, seqId); err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if err2 := _exc566.Write(ctx, oprot); _write_err565 == nil && err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err565 == nil && err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err565 == nil && err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if _write_err565 != nil { + return false, thrift.WrapTException(_write_err565) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listTags", thrift.REPLY, seqId); err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err565 == nil && err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err565 == nil && err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err565 == nil && err2 != nil { + _write_err565 = thrift.WrapTException(err2) + } + if _write_err565 != nil { + return false, thrift.WrapTException(_write_err565) + } + return true, err +} + +type metaServiceProcessorCreateEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err567 error + args := MetaServiceCreateEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateEdgeResult{} + if retval, err2 := p.handler.CreateEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc568 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if err2 := _exc568.Write(ctx, oprot); _write_err567 == nil && err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err567 == nil && err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err567 == nil && err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if _write_err567 != nil { + return false, thrift.WrapTException(_write_err567) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createEdge", thrift.REPLY, seqId); err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err567 == nil && err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err567 == nil && err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err567 == nil && err2 != nil { + _write_err567 = thrift.WrapTException(err2) + } + if _write_err567 != nil { + return false, thrift.WrapTException(_write_err567) + } + return true, err +} + +type metaServiceProcessorAlterEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err569 error + args := MetaServiceAlterEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "alterEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAlterEdgeResult{} + if retval, err2 := p.handler.AlterEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc570 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "alterEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if err2 := _exc570.Write(ctx, oprot); _write_err569 == nil && err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err569 == nil && err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err569 == nil && err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if _write_err569 != nil { + return false, thrift.WrapTException(_write_err569) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "alterEdge", thrift.REPLY, seqId); err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err569 == nil && err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err569 == nil && err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err569 == nil && err2 != nil { + _write_err569 = thrift.WrapTException(err2) + } + if _write_err569 != nil { + return false, thrift.WrapTException(_write_err569) + } + return true, err +} + +type metaServiceProcessorDropEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err571 error + args := MetaServiceDropEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropEdgeResult{} + if retval, err2 := p.handler.DropEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc572 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if err2 := _exc572.Write(ctx, oprot); _write_err571 == nil && err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err571 == nil && err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err571 == nil && err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if _write_err571 != nil { + return false, thrift.WrapTException(_write_err571) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropEdge", thrift.REPLY, seqId); err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err571 == nil && err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err571 == nil && err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err571 == nil && err2 != nil { + _write_err571 = thrift.WrapTException(err2) + } + if _write_err571 != nil { + return false, thrift.WrapTException(_write_err571) + } + return true, err +} + +type metaServiceProcessorGetEdge struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err573 error + args := MetaServiceGetEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetEdgeResult{} + if retval, err2 := p.handler.GetEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc574 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if err2 := _exc574.Write(ctx, oprot); _write_err573 == nil && err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err573 == nil && err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err573 == nil && err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if _write_err573 != nil { + return false, thrift.WrapTException(_write_err573) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getEdge", thrift.REPLY, seqId); err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err573 == nil && err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err573 == nil && err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err573 == nil && err2 != nil { + _write_err573 = thrift.WrapTException(err2) + } + if _write_err573 != nil { + return false, thrift.WrapTException(_write_err573) + } + return true, err +} + +type metaServiceProcessorListEdges struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err575 error + args := MetaServiceListEdgesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listEdges", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListEdgesResult{} + if retval, err2 := p.handler.ListEdges(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc576 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdges: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listEdges", thrift.EXCEPTION, seqId); err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if err2 := _exc576.Write(ctx, oprot); _write_err575 == nil && err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err575 == nil && err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err575 == nil && err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if _write_err575 != nil { + return false, thrift.WrapTException(_write_err575) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listEdges", thrift.REPLY, seqId); err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err575 == nil && err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err575 == nil && err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err575 == nil && err2 != nil { + _write_err575 = thrift.WrapTException(err2) + } + if _write_err575 != nil { + return false, thrift.WrapTException(_write_err575) + } + return true, err +} + +type metaServiceProcessorAddHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHosts) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err577 error + args := MetaServiceAddHostsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addHosts", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAddHostsResult{} + if retval, err2 := p.handler.AddHosts(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc578 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHosts: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addHosts", thrift.EXCEPTION, seqId); err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if err2 := _exc578.Write(ctx, oprot); _write_err577 == nil && err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err577 == nil && err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err577 == nil && err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if _write_err577 != nil { + return false, thrift.WrapTException(_write_err577) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addHosts", thrift.REPLY, seqId); err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err577 == nil && err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err577 == nil && err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err577 == nil && err2 != nil { + _write_err577 = thrift.WrapTException(err2) + } + if _write_err577 != nil { + return false, thrift.WrapTException(_write_err577) + } + return true, err +} + +type metaServiceProcessorAddHostsIntoZone struct { + handler MetaService +} + +func (p *metaServiceProcessorAddHostsIntoZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err579 error + args := MetaServiceAddHostsIntoZoneArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addHostsIntoZone", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAddHostsIntoZoneResult{} + if retval, err2 := p.handler.AddHostsIntoZone(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc580 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostsIntoZone: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addHostsIntoZone", thrift.EXCEPTION, seqId); err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if err2 := _exc580.Write(ctx, oprot); _write_err579 == nil && err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err579 == nil && err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err579 == nil && err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if _write_err579 != nil { + return false, thrift.WrapTException(_write_err579) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addHostsIntoZone", thrift.REPLY, seqId); err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err579 == nil && err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err579 == nil && err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err579 == nil && err2 != nil { + _write_err579 = thrift.WrapTException(err2) + } + if _write_err579 != nil { + return false, thrift.WrapTException(_write_err579) + } + return true, err +} + +type metaServiceProcessorDropHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorDropHosts) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err581 error + args := MetaServiceDropHostsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropHosts", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropHostsResult{} + if retval, err2 := p.handler.DropHosts(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc582 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHosts: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropHosts", thrift.EXCEPTION, seqId); err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if err2 := _exc582.Write(ctx, oprot); _write_err581 == nil && err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err581 == nil && err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err581 == nil && err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if _write_err581 != nil { + return false, thrift.WrapTException(_write_err581) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropHosts", thrift.REPLY, seqId); err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err581 == nil && err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err581 == nil && err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err581 == nil && err2 != nil { + _write_err581 = thrift.WrapTException(err2) + } + if _write_err581 != nil { + return false, thrift.WrapTException(_write_err581) + } + return true, err +} + +type metaServiceProcessorListHosts struct { + handler MetaService +} + +func (p *metaServiceProcessorListHosts) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err583 error + args := MetaServiceListHostsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listHosts", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListHostsResult{} + if retval, err2 := p.handler.ListHosts(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc584 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listHosts: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listHosts", thrift.EXCEPTION, seqId); err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if err2 := _exc584.Write(ctx, oprot); _write_err583 == nil && err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err583 == nil && err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err583 == nil && err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if _write_err583 != nil { + return false, thrift.WrapTException(_write_err583) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listHosts", thrift.REPLY, seqId); err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err583 == nil && err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err583 == nil && err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err583 == nil && err2 != nil { + _write_err583 = thrift.WrapTException(err2) + } + if _write_err583 != nil { + return false, thrift.WrapTException(_write_err583) + } + return true, err +} + +type metaServiceProcessorGetPartsAlloc struct { + handler MetaService +} + +func (p *metaServiceProcessorGetPartsAlloc) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err585 error + args := MetaServiceGetPartsAllocArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getPartsAlloc", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetPartsAllocResult{} + if retval, err2 := p.handler.GetPartsAlloc(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc586 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getPartsAlloc: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getPartsAlloc", thrift.EXCEPTION, seqId); err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if err2 := _exc586.Write(ctx, oprot); _write_err585 == nil && err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err585 == nil && err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err585 == nil && err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if _write_err585 != nil { + return false, thrift.WrapTException(_write_err585) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getPartsAlloc", thrift.REPLY, seqId); err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err585 == nil && err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err585 == nil && err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err585 == nil && err2 != nil { + _write_err585 = thrift.WrapTException(err2) + } + if _write_err585 != nil { + return false, thrift.WrapTException(_write_err585) + } + return true, err +} + +type metaServiceProcessorListParts struct { + handler MetaService +} + +func (p *metaServiceProcessorListParts) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err587 error + args := MetaServiceListPartsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listParts", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListPartsResult{} + if retval, err2 := p.handler.ListParts(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc588 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listParts: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listParts", thrift.EXCEPTION, seqId); err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if err2 := _exc588.Write(ctx, oprot); _write_err587 == nil && err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err587 == nil && err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err587 == nil && err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if _write_err587 != nil { + return false, thrift.WrapTException(_write_err587) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listParts", thrift.REPLY, seqId); err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err587 == nil && err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err587 == nil && err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err587 == nil && err2 != nil { + _write_err587 = thrift.WrapTException(err2) + } + if _write_err587 != nil { + return false, thrift.WrapTException(_write_err587) + } + return true, err +} + +type metaServiceProcessorGetWorkerId struct { + handler MetaService +} + +func (p *metaServiceProcessorGetWorkerId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err589 error + args := MetaServiceGetWorkerIdArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getWorkerId", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetWorkerIdResult{} + if retval, err2 := p.handler.GetWorkerId(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc590 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getWorkerId: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getWorkerId", thrift.EXCEPTION, seqId); err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if err2 := _exc590.Write(ctx, oprot); _write_err589 == nil && err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err589 == nil && err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err589 == nil && err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if _write_err589 != nil { + return false, thrift.WrapTException(_write_err589) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getWorkerId", thrift.REPLY, seqId); err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err589 == nil && err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err589 == nil && err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err589 == nil && err2 != nil { + _write_err589 = thrift.WrapTException(err2) + } + if _write_err589 != nil { + return false, thrift.WrapTException(_write_err589) + } + return true, err +} + +type metaServiceProcessorCreateTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateTagIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err591 error + args := MetaServiceCreateTagIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createTagIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateTagIndexResult{} + if retval, err2 := p.handler.CreateTagIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc592 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createTagIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createTagIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if err2 := _exc592.Write(ctx, oprot); _write_err591 == nil && err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err591 == nil && err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err591 == nil && err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if _write_err591 != nil { + return false, thrift.WrapTException(_write_err591) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createTagIndex", thrift.REPLY, seqId); err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err591 == nil && err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err591 == nil && err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err591 == nil && err2 != nil { + _write_err591 = thrift.WrapTException(err2) + } + if _write_err591 != nil { + return false, thrift.WrapTException(_write_err591) + } + return true, err +} + +type metaServiceProcessorDropTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropTagIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err593 error + args := MetaServiceDropTagIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropTagIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropTagIndexResult{} + if retval, err2 := p.handler.DropTagIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc594 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropTagIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropTagIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if err2 := _exc594.Write(ctx, oprot); _write_err593 == nil && err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err593 == nil && err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err593 == nil && err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if _write_err593 != nil { + return false, thrift.WrapTException(_write_err593) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropTagIndex", thrift.REPLY, seqId); err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err593 == nil && err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err593 == nil && err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err593 == nil && err2 != nil { + _write_err593 = thrift.WrapTException(err2) + } + if _write_err593 != nil { + return false, thrift.WrapTException(_write_err593) + } + return true, err +} + +type metaServiceProcessorGetTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetTagIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err595 error + args := MetaServiceGetTagIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getTagIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetTagIndexResult{} + if retval, err2 := p.handler.GetTagIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc596 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getTagIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getTagIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if err2 := _exc596.Write(ctx, oprot); _write_err595 == nil && err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err595 == nil && err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err595 == nil && err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if _write_err595 != nil { + return false, thrift.WrapTException(_write_err595) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getTagIndex", thrift.REPLY, seqId); err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err595 == nil && err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err595 == nil && err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err595 == nil && err2 != nil { + _write_err595 = thrift.WrapTException(err2) + } + if _write_err595 != nil { + return false, thrift.WrapTException(_write_err595) + } + return true, err +} + +type metaServiceProcessorListTagIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err597 error + args := MetaServiceListTagIndexesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listTagIndexes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListTagIndexesResult{} + if retval, err2 := p.handler.ListTagIndexes(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc598 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexes: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listTagIndexes", thrift.EXCEPTION, seqId); err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if err2 := _exc598.Write(ctx, oprot); _write_err597 == nil && err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err597 == nil && err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err597 == nil && err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if _write_err597 != nil { + return false, thrift.WrapTException(_write_err597) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listTagIndexes", thrift.REPLY, seqId); err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err597 == nil && err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err597 == nil && err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err597 == nil && err2 != nil { + _write_err597 = thrift.WrapTException(err2) + } + if _write_err597 != nil { + return false, thrift.WrapTException(_write_err597) + } + return true, err +} + +type metaServiceProcessorRebuildTagIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildTagIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err599 error + args := MetaServiceRebuildTagIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "rebuildTagIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRebuildTagIndexResult{} + if retval, err2 := p.handler.RebuildTagIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc600 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildTagIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "rebuildTagIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if err2 := _exc600.Write(ctx, oprot); _write_err599 == nil && err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err599 == nil && err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err599 == nil && err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if _write_err599 != nil { + return false, thrift.WrapTException(_write_err599) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "rebuildTagIndex", thrift.REPLY, seqId); err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err599 == nil && err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err599 == nil && err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err599 == nil && err2 != nil { + _write_err599 = thrift.WrapTException(err2) + } + if _write_err599 != nil { + return false, thrift.WrapTException(_write_err599) + } + return true, err +} + +type metaServiceProcessorListTagIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListTagIndexStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err601 error + args := MetaServiceListTagIndexStatusArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listTagIndexStatus", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListTagIndexStatusResult{} + if retval, err2 := p.handler.ListTagIndexStatus(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc602 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listTagIndexStatus: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listTagIndexStatus", thrift.EXCEPTION, seqId); err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if err2 := _exc602.Write(ctx, oprot); _write_err601 == nil && err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err601 == nil && err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err601 == nil && err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if _write_err601 != nil { + return false, thrift.WrapTException(_write_err601) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listTagIndexStatus", thrift.REPLY, seqId); err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err601 == nil && err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err601 == nil && err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err601 == nil && err2 != nil { + _write_err601 = thrift.WrapTException(err2) + } + if _write_err601 != nil { + return false, thrift.WrapTException(_write_err601) + } + return true, err +} + +type metaServiceProcessorCreateEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateEdgeIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err603 error + args := MetaServiceCreateEdgeIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createEdgeIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateEdgeIndexResult{} + if retval, err2 := p.handler.CreateEdgeIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc604 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createEdgeIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createEdgeIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if err2 := _exc604.Write(ctx, oprot); _write_err603 == nil && err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err603 == nil && err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err603 == nil && err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if _write_err603 != nil { + return false, thrift.WrapTException(_write_err603) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createEdgeIndex", thrift.REPLY, seqId); err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err603 == nil && err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err603 == nil && err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err603 == nil && err2 != nil { + _write_err603 = thrift.WrapTException(err2) + } + if _write_err603 != nil { + return false, thrift.WrapTException(_write_err603) + } + return true, err +} + +type metaServiceProcessorDropEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropEdgeIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err605 error + args := MetaServiceDropEdgeIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropEdgeIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropEdgeIndexResult{} + if retval, err2 := p.handler.DropEdgeIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc606 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropEdgeIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropEdgeIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if err2 := _exc606.Write(ctx, oprot); _write_err605 == nil && err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err605 == nil && err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err605 == nil && err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if _write_err605 != nil { + return false, thrift.WrapTException(_write_err605) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropEdgeIndex", thrift.REPLY, seqId); err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err605 == nil && err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err605 == nil && err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err605 == nil && err2 != nil { + _write_err605 = thrift.WrapTException(err2) + } + if _write_err605 != nil { + return false, thrift.WrapTException(_write_err605) + } + return true, err +} + +type metaServiceProcessorGetEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorGetEdgeIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err607 error + args := MetaServiceGetEdgeIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getEdgeIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetEdgeIndexResult{} + if retval, err2 := p.handler.GetEdgeIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc608 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getEdgeIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getEdgeIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if err2 := _exc608.Write(ctx, oprot); _write_err607 == nil && err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err607 == nil && err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err607 == nil && err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if _write_err607 != nil { + return false, thrift.WrapTException(_write_err607) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getEdgeIndex", thrift.REPLY, seqId); err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err607 == nil && err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err607 == nil && err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err607 == nil && err2 != nil { + _write_err607 = thrift.WrapTException(err2) + } + if _write_err607 != nil { + return false, thrift.WrapTException(_write_err607) + } + return true, err +} + +type metaServiceProcessorListEdgeIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err609 error + args := MetaServiceListEdgeIndexesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listEdgeIndexes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListEdgeIndexesResult{} + if retval, err2 := p.handler.ListEdgeIndexes(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc610 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexes: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listEdgeIndexes", thrift.EXCEPTION, seqId); err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if err2 := _exc610.Write(ctx, oprot); _write_err609 == nil && err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err609 == nil && err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err609 == nil && err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if _write_err609 != nil { + return false, thrift.WrapTException(_write_err609) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listEdgeIndexes", thrift.REPLY, seqId); err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err609 == nil && err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err609 == nil && err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err609 == nil && err2 != nil { + _write_err609 = thrift.WrapTException(err2) + } + if _write_err609 != nil { + return false, thrift.WrapTException(_write_err609) + } + return true, err +} + +type metaServiceProcessorRebuildEdgeIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorRebuildEdgeIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err611 error + args := MetaServiceRebuildEdgeIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "rebuildEdgeIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRebuildEdgeIndexResult{} + if retval, err2 := p.handler.RebuildEdgeIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc612 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing rebuildEdgeIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "rebuildEdgeIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if err2 := _exc612.Write(ctx, oprot); _write_err611 == nil && err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err611 == nil && err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err611 == nil && err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if _write_err611 != nil { + return false, thrift.WrapTException(_write_err611) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "rebuildEdgeIndex", thrift.REPLY, seqId); err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err611 == nil && err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err611 == nil && err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err611 == nil && err2 != nil { + _write_err611 = thrift.WrapTException(err2) + } + if _write_err611 != nil { + return false, thrift.WrapTException(_write_err611) + } + return true, err +} + +type metaServiceProcessorListEdgeIndexStatus struct { + handler MetaService +} + +func (p *metaServiceProcessorListEdgeIndexStatus) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err613 error + args := MetaServiceListEdgeIndexStatusArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listEdgeIndexStatus", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListEdgeIndexStatusResult{} + if retval, err2 := p.handler.ListEdgeIndexStatus(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc614 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listEdgeIndexStatus: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listEdgeIndexStatus", thrift.EXCEPTION, seqId); err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if err2 := _exc614.Write(ctx, oprot); _write_err613 == nil && err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err613 == nil && err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err613 == nil && err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if _write_err613 != nil { + return false, thrift.WrapTException(_write_err613) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listEdgeIndexStatus", thrift.REPLY, seqId); err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err613 == nil && err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err613 == nil && err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err613 == nil && err2 != nil { + _write_err613 = thrift.WrapTException(err2) + } + if _write_err613 != nil { + return false, thrift.WrapTException(_write_err613) + } + return true, err +} + +type metaServiceProcessorCreateUser struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateUser) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err615 error + args := MetaServiceCreateUserArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createUser", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateUserResult{} + if retval, err2 := p.handler.CreateUser(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc616 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createUser: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createUser", thrift.EXCEPTION, seqId); err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if err2 := _exc616.Write(ctx, oprot); _write_err615 == nil && err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err615 == nil && err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err615 == nil && err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if _write_err615 != nil { + return false, thrift.WrapTException(_write_err615) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createUser", thrift.REPLY, seqId); err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err615 == nil && err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err615 == nil && err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err615 == nil && err2 != nil { + _write_err615 = thrift.WrapTException(err2) + } + if _write_err615 != nil { + return false, thrift.WrapTException(_write_err615) + } + return true, err +} + +type metaServiceProcessorDropUser struct { + handler MetaService +} + +func (p *metaServiceProcessorDropUser) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err617 error + args := MetaServiceDropUserArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropUser", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropUserResult{} + if retval, err2 := p.handler.DropUser(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc618 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropUser: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropUser", thrift.EXCEPTION, seqId); err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if err2 := _exc618.Write(ctx, oprot); _write_err617 == nil && err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err617 == nil && err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err617 == nil && err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if _write_err617 != nil { + return false, thrift.WrapTException(_write_err617) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropUser", thrift.REPLY, seqId); err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err617 == nil && err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err617 == nil && err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err617 == nil && err2 != nil { + _write_err617 = thrift.WrapTException(err2) + } + if _write_err617 != nil { + return false, thrift.WrapTException(_write_err617) + } + return true, err +} + +type metaServiceProcessorAlterUser struct { + handler MetaService +} + +func (p *metaServiceProcessorAlterUser) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err619 error + args := MetaServiceAlterUserArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "alterUser", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAlterUserResult{} + if retval, err2 := p.handler.AlterUser(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc620 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterUser: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "alterUser", thrift.EXCEPTION, seqId); err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if err2 := _exc620.Write(ctx, oprot); _write_err619 == nil && err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err619 == nil && err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err619 == nil && err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if _write_err619 != nil { + return false, thrift.WrapTException(_write_err619) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "alterUser", thrift.REPLY, seqId); err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err619 == nil && err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err619 == nil && err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err619 == nil && err2 != nil { + _write_err619 = thrift.WrapTException(err2) + } + if _write_err619 != nil { + return false, thrift.WrapTException(_write_err619) + } + return true, err +} + +type metaServiceProcessorGrantRole struct { + handler MetaService +} + +func (p *metaServiceProcessorGrantRole) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err621 error + args := MetaServiceGrantRoleArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "grantRole", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGrantRoleResult{} + if retval, err2 := p.handler.GrantRole(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc622 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing grantRole: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "grantRole", thrift.EXCEPTION, seqId); err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if err2 := _exc622.Write(ctx, oprot); _write_err621 == nil && err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err621 == nil && err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err621 == nil && err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if _write_err621 != nil { + return false, thrift.WrapTException(_write_err621) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "grantRole", thrift.REPLY, seqId); err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err621 == nil && err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err621 == nil && err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err621 == nil && err2 != nil { + _write_err621 = thrift.WrapTException(err2) + } + if _write_err621 != nil { + return false, thrift.WrapTException(_write_err621) + } + return true, err +} + +type metaServiceProcessorRevokeRole struct { + handler MetaService +} + +func (p *metaServiceProcessorRevokeRole) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err623 error + args := MetaServiceRevokeRoleArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "revokeRole", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRevokeRoleResult{} + if retval, err2 := p.handler.RevokeRole(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc624 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing revokeRole: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "revokeRole", thrift.EXCEPTION, seqId); err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if err2 := _exc624.Write(ctx, oprot); _write_err623 == nil && err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err623 == nil && err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err623 == nil && err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if _write_err623 != nil { + return false, thrift.WrapTException(_write_err623) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "revokeRole", thrift.REPLY, seqId); err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err623 == nil && err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err623 == nil && err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err623 == nil && err2 != nil { + _write_err623 = thrift.WrapTException(err2) + } + if _write_err623 != nil { + return false, thrift.WrapTException(_write_err623) + } + return true, err +} + +type metaServiceProcessorListUsers struct { + handler MetaService +} + +func (p *metaServiceProcessorListUsers) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err625 error + args := MetaServiceListUsersArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listUsers", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListUsersResult{} + if retval, err2 := p.handler.ListUsers(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc626 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listUsers: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listUsers", thrift.EXCEPTION, seqId); err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if err2 := _exc626.Write(ctx, oprot); _write_err625 == nil && err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err625 == nil && err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err625 == nil && err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if _write_err625 != nil { + return false, thrift.WrapTException(_write_err625) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listUsers", thrift.REPLY, seqId); err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err625 == nil && err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err625 == nil && err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err625 == nil && err2 != nil { + _write_err625 = thrift.WrapTException(err2) + } + if _write_err625 != nil { + return false, thrift.WrapTException(_write_err625) + } + return true, err +} + +type metaServiceProcessorListRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorListRoles) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err627 error + args := MetaServiceListRolesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listRoles", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListRolesResult{} + if retval, err2 := p.handler.ListRoles(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc628 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listRoles: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listRoles", thrift.EXCEPTION, seqId); err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if err2 := _exc628.Write(ctx, oprot); _write_err627 == nil && err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err627 == nil && err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err627 == nil && err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if _write_err627 != nil { + return false, thrift.WrapTException(_write_err627) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listRoles", thrift.REPLY, seqId); err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err627 == nil && err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err627 == nil && err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err627 == nil && err2 != nil { + _write_err627 = thrift.WrapTException(err2) + } + if _write_err627 != nil { + return false, thrift.WrapTException(_write_err627) + } + return true, err +} + +type metaServiceProcessorGetUserRoles struct { + handler MetaService +} + +func (p *metaServiceProcessorGetUserRoles) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err629 error + args := MetaServiceGetUserRolesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getUserRoles", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetUserRolesResult{} + if retval, err2 := p.handler.GetUserRoles(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc630 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUserRoles: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getUserRoles", thrift.EXCEPTION, seqId); err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if err2 := _exc630.Write(ctx, oprot); _write_err629 == nil && err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err629 == nil && err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err629 == nil && err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if _write_err629 != nil { + return false, thrift.WrapTException(_write_err629) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getUserRoles", thrift.REPLY, seqId); err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err629 == nil && err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err629 == nil && err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err629 == nil && err2 != nil { + _write_err629 = thrift.WrapTException(err2) + } + if _write_err629 != nil { + return false, thrift.WrapTException(_write_err629) + } + return true, err +} + +type metaServiceProcessorChangePassword struct { + handler MetaService +} + +func (p *metaServiceProcessorChangePassword) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err631 error + args := MetaServiceChangePasswordArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "changePassword", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceChangePasswordResult{} + if retval, err2 := p.handler.ChangePassword(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc632 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing changePassword: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "changePassword", thrift.EXCEPTION, seqId); err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if err2 := _exc632.Write(ctx, oprot); _write_err631 == nil && err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err631 == nil && err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err631 == nil && err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if _write_err631 != nil { + return false, thrift.WrapTException(_write_err631) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "changePassword", thrift.REPLY, seqId); err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err631 == nil && err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err631 == nil && err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err631 == nil && err2 != nil { + _write_err631 = thrift.WrapTException(err2) + } + if _write_err631 != nil { + return false, thrift.WrapTException(_write_err631) + } + return true, err +} + +type metaServiceProcessorHeartBeat struct { + handler MetaService +} + +func (p *metaServiceProcessorHeartBeat) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err633 error + args := MetaServiceHeartBeatArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "heartBeat", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceHeartBeatResult{} + if retval, err2 := p.handler.HeartBeat(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc634 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing heartBeat: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "heartBeat", thrift.EXCEPTION, seqId); err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if err2 := _exc634.Write(ctx, oprot); _write_err633 == nil && err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err633 == nil && err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err633 == nil && err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if _write_err633 != nil { + return false, thrift.WrapTException(_write_err633) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "heartBeat", thrift.REPLY, seqId); err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err633 == nil && err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err633 == nil && err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err633 == nil && err2 != nil { + _write_err633 = thrift.WrapTException(err2) + } + if _write_err633 != nil { + return false, thrift.WrapTException(_write_err633) + } + return true, err +} + +type metaServiceProcessorAgentHeartbeat struct { + handler MetaService +} + +func (p *metaServiceProcessorAgentHeartbeat) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err635 error + args := MetaServiceAgentHeartbeatArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "agentHeartbeat", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAgentHeartbeatResult{} + if retval, err2 := p.handler.AgentHeartbeat(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc636 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing agentHeartbeat: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "agentHeartbeat", thrift.EXCEPTION, seqId); err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if err2 := _exc636.Write(ctx, oprot); _write_err635 == nil && err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err635 == nil && err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err635 == nil && err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if _write_err635 != nil { + return false, thrift.WrapTException(_write_err635) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "agentHeartbeat", thrift.REPLY, seqId); err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err635 == nil && err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err635 == nil && err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err635 == nil && err2 != nil { + _write_err635 = thrift.WrapTException(err2) + } + if _write_err635 != nil { + return false, thrift.WrapTException(_write_err635) + } + return true, err +} + +type metaServiceProcessorRegConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorRegConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err637 error + args := MetaServiceRegConfigArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "regConfig", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRegConfigResult{} + if retval, err2 := p.handler.RegConfig(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc638 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing regConfig: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "regConfig", thrift.EXCEPTION, seqId); err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if err2 := _exc638.Write(ctx, oprot); _write_err637 == nil && err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err637 == nil && err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err637 == nil && err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if _write_err637 != nil { + return false, thrift.WrapTException(_write_err637) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "regConfig", thrift.REPLY, seqId); err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err637 == nil && err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err637 == nil && err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err637 == nil && err2 != nil { + _write_err637 = thrift.WrapTException(err2) + } + if _write_err637 != nil { + return false, thrift.WrapTException(_write_err637) + } + return true, err +} + +type metaServiceProcessorGetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorGetConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err639 error + args := MetaServiceGetConfigArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getConfig", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetConfigResult{} + if retval, err2 := p.handler.GetConfig(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc640 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getConfig: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getConfig", thrift.EXCEPTION, seqId); err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if err2 := _exc640.Write(ctx, oprot); _write_err639 == nil && err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err639 == nil && err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err639 == nil && err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if _write_err639 != nil { + return false, thrift.WrapTException(_write_err639) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getConfig", thrift.REPLY, seqId); err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err639 == nil && err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err639 == nil && err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err639 == nil && err2 != nil { + _write_err639 = thrift.WrapTException(err2) + } + if _write_err639 != nil { + return false, thrift.WrapTException(_write_err639) + } + return true, err +} + +type metaServiceProcessorSetConfig struct { + handler MetaService +} + +func (p *metaServiceProcessorSetConfig) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err641 error + args := MetaServiceSetConfigArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "setConfig", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceSetConfigResult{} + if retval, err2 := p.handler.SetConfig(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc642 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing setConfig: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "setConfig", thrift.EXCEPTION, seqId); err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if err2 := _exc642.Write(ctx, oprot); _write_err641 == nil && err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err641 == nil && err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err641 == nil && err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if _write_err641 != nil { + return false, thrift.WrapTException(_write_err641) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "setConfig", thrift.REPLY, seqId); err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err641 == nil && err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err641 == nil && err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err641 == nil && err2 != nil { + _write_err641 = thrift.WrapTException(err2) + } + if _write_err641 != nil { + return false, thrift.WrapTException(_write_err641) + } + return true, err +} + +type metaServiceProcessorListConfigs struct { + handler MetaService +} + +func (p *metaServiceProcessorListConfigs) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err643 error + args := MetaServiceListConfigsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listConfigs", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListConfigsResult{} + if retval, err2 := p.handler.ListConfigs(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc644 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listConfigs: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listConfigs", thrift.EXCEPTION, seqId); err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if err2 := _exc644.Write(ctx, oprot); _write_err643 == nil && err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err643 == nil && err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err643 == nil && err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if _write_err643 != nil { + return false, thrift.WrapTException(_write_err643) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listConfigs", thrift.REPLY, seqId); err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err643 == nil && err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err643 == nil && err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err643 == nil && err2 != nil { + _write_err643 = thrift.WrapTException(err2) + } + if _write_err643 != nil { + return false, thrift.WrapTException(_write_err643) + } + return true, err +} + +type metaServiceProcessorCreateSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSnapshot) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err645 error + args := MetaServiceCreateSnapshotArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createSnapshot", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateSnapshotResult{} + if retval, err2 := p.handler.CreateSnapshot(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc646 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSnapshot: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createSnapshot", thrift.EXCEPTION, seqId); err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if err2 := _exc646.Write(ctx, oprot); _write_err645 == nil && err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err645 == nil && err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err645 == nil && err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if _write_err645 != nil { + return false, thrift.WrapTException(_write_err645) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createSnapshot", thrift.REPLY, seqId); err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err645 == nil && err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err645 == nil && err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err645 == nil && err2 != nil { + _write_err645 = thrift.WrapTException(err2) + } + if _write_err645 != nil { + return false, thrift.WrapTException(_write_err645) + } + return true, err +} + +type metaServiceProcessorDropSnapshot struct { + handler MetaService +} + +func (p *metaServiceProcessorDropSnapshot) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err647 error + args := MetaServiceDropSnapshotArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropSnapshot", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropSnapshotResult{} + if retval, err2 := p.handler.DropSnapshot(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc648 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropSnapshot: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropSnapshot", thrift.EXCEPTION, seqId); err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if err2 := _exc648.Write(ctx, oprot); _write_err647 == nil && err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err647 == nil && err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err647 == nil && err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if _write_err647 != nil { + return false, thrift.WrapTException(_write_err647) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropSnapshot", thrift.REPLY, seqId); err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err647 == nil && err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err647 == nil && err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err647 == nil && err2 != nil { + _write_err647 = thrift.WrapTException(err2) + } + if _write_err647 != nil { + return false, thrift.WrapTException(_write_err647) + } + return true, err +} + +type metaServiceProcessorListSnapshots struct { + handler MetaService +} + +func (p *metaServiceProcessorListSnapshots) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err649 error + args := MetaServiceListSnapshotsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listSnapshots", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListSnapshotsResult{} + if retval, err2 := p.handler.ListSnapshots(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc650 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSnapshots: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listSnapshots", thrift.EXCEPTION, seqId); err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if err2 := _exc650.Write(ctx, oprot); _write_err649 == nil && err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err649 == nil && err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err649 == nil && err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if _write_err649 != nil { + return false, thrift.WrapTException(_write_err649) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listSnapshots", thrift.REPLY, seqId); err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err649 == nil && err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err649 == nil && err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err649 == nil && err2 != nil { + _write_err649 = thrift.WrapTException(err2) + } + if _write_err649 != nil { + return false, thrift.WrapTException(_write_err649) + } + return true, err +} + +type metaServiceProcessorRunAdminJob struct { + handler MetaService +} + +func (p *metaServiceProcessorRunAdminJob) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err651 error + args := MetaServiceRunAdminJobArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "runAdminJob", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRunAdminJobResult{} + if retval, err2 := p.handler.RunAdminJob(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc652 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing runAdminJob: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "runAdminJob", thrift.EXCEPTION, seqId); err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if err2 := _exc652.Write(ctx, oprot); _write_err651 == nil && err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err651 == nil && err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err651 == nil && err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if _write_err651 != nil { + return false, thrift.WrapTException(_write_err651) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "runAdminJob", thrift.REPLY, seqId); err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err651 == nil && err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err651 == nil && err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err651 == nil && err2 != nil { + _write_err651 = thrift.WrapTException(err2) + } + if _write_err651 != nil { + return false, thrift.WrapTException(_write_err651) + } + return true, err +} + +type metaServiceProcessorMergeZone struct { + handler MetaService +} + +func (p *metaServiceProcessorMergeZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err653 error + args := MetaServiceMergeZoneArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "mergeZone", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceMergeZoneResult{} + if retval, err2 := p.handler.MergeZone(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc654 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing mergeZone: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "mergeZone", thrift.EXCEPTION, seqId); err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if err2 := _exc654.Write(ctx, oprot); _write_err653 == nil && err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err653 == nil && err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err653 == nil && err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if _write_err653 != nil { + return false, thrift.WrapTException(_write_err653) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "mergeZone", thrift.REPLY, seqId); err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err653 == nil && err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err653 == nil && err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err653 == nil && err2 != nil { + _write_err653 = thrift.WrapTException(err2) + } + if _write_err653 != nil { + return false, thrift.WrapTException(_write_err653) + } + return true, err +} + +type metaServiceProcessorDropZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDropZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err655 error + args := MetaServiceDropZoneArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropZone", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropZoneResult{} + if retval, err2 := p.handler.DropZone(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc656 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropZone: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropZone", thrift.EXCEPTION, seqId); err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if err2 := _exc656.Write(ctx, oprot); _write_err655 == nil && err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err655 == nil && err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err655 == nil && err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if _write_err655 != nil { + return false, thrift.WrapTException(_write_err655) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropZone", thrift.REPLY, seqId); err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err655 == nil && err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err655 == nil && err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err655 == nil && err2 != nil { + _write_err655 = thrift.WrapTException(err2) + } + if _write_err655 != nil { + return false, thrift.WrapTException(_write_err655) + } + return true, err +} + +type metaServiceProcessorDivideZone struct { + handler MetaService +} + +func (p *metaServiceProcessorDivideZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err657 error + args := MetaServiceDivideZoneArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "divideZone", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDivideZoneResult{} + if retval, err2 := p.handler.DivideZone(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc658 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing divideZone: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "divideZone", thrift.EXCEPTION, seqId); err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if err2 := _exc658.Write(ctx, oprot); _write_err657 == nil && err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err657 == nil && err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err657 == nil && err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if _write_err657 != nil { + return false, thrift.WrapTException(_write_err657) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "divideZone", thrift.REPLY, seqId); err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err657 == nil && err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err657 == nil && err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err657 == nil && err2 != nil { + _write_err657 = thrift.WrapTException(err2) + } + if _write_err657 != nil { + return false, thrift.WrapTException(_write_err657) + } + return true, err +} + +type metaServiceProcessorRenameZone struct { + handler MetaService +} + +func (p *metaServiceProcessorRenameZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err659 error + args := MetaServiceRenameZoneArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "renameZone", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRenameZoneResult{} + if retval, err2 := p.handler.RenameZone(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc660 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing renameZone: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "renameZone", thrift.EXCEPTION, seqId); err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if err2 := _exc660.Write(ctx, oprot); _write_err659 == nil && err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err659 == nil && err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err659 == nil && err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if _write_err659 != nil { + return false, thrift.WrapTException(_write_err659) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "renameZone", thrift.REPLY, seqId); err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err659 == nil && err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err659 == nil && err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err659 == nil && err2 != nil { + _write_err659 = thrift.WrapTException(err2) + } + if _write_err659 != nil { + return false, thrift.WrapTException(_write_err659) + } + return true, err +} + +type metaServiceProcessorGetZone struct { + handler MetaService +} + +func (p *metaServiceProcessorGetZone) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err661 error + args := MetaServiceGetZoneArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getZone", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetZoneResult{} + if retval, err2 := p.handler.GetZone(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc662 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getZone: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getZone", thrift.EXCEPTION, seqId); err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if err2 := _exc662.Write(ctx, oprot); _write_err661 == nil && err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err661 == nil && err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err661 == nil && err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if _write_err661 != nil { + return false, thrift.WrapTException(_write_err661) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getZone", thrift.REPLY, seqId); err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err661 == nil && err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err661 == nil && err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err661 == nil && err2 != nil { + _write_err661 = thrift.WrapTException(err2) + } + if _write_err661 != nil { + return false, thrift.WrapTException(_write_err661) + } + return true, err +} + +type metaServiceProcessorListZones struct { + handler MetaService +} + +func (p *metaServiceProcessorListZones) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err663 error + args := MetaServiceListZonesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listZones", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListZonesResult{} + if retval, err2 := p.handler.ListZones(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc664 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listZones: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listZones", thrift.EXCEPTION, seqId); err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if err2 := _exc664.Write(ctx, oprot); _write_err663 == nil && err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err663 == nil && err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err663 == nil && err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if _write_err663 != nil { + return false, thrift.WrapTException(_write_err663) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listZones", thrift.REPLY, seqId); err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err663 == nil && err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err663 == nil && err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err663 == nil && err2 != nil { + _write_err663 = thrift.WrapTException(err2) + } + if _write_err663 != nil { + return false, thrift.WrapTException(_write_err663) + } + return true, err +} + +type metaServiceProcessorAddListener struct { + handler MetaService +} + +func (p *metaServiceProcessorAddListener) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err665 error + args := MetaServiceAddListenerArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addListener", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceAddListenerResult{} + if retval, err2 := p.handler.AddListener(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc666 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addListener: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addListener", thrift.EXCEPTION, seqId); err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if err2 := _exc666.Write(ctx, oprot); _write_err665 == nil && err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err665 == nil && err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err665 == nil && err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if _write_err665 != nil { + return false, thrift.WrapTException(_write_err665) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addListener", thrift.REPLY, seqId); err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err665 == nil && err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err665 == nil && err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err665 == nil && err2 != nil { + _write_err665 = thrift.WrapTException(err2) + } + if _write_err665 != nil { + return false, thrift.WrapTException(_write_err665) + } + return true, err +} + +type metaServiceProcessorRemoveListener struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveListener) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err667 error + args := MetaServiceRemoveListenerArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "removeListener", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRemoveListenerResult{} + if retval, err2 := p.handler.RemoveListener(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc668 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeListener: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "removeListener", thrift.EXCEPTION, seqId); err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if err2 := _exc668.Write(ctx, oprot); _write_err667 == nil && err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err667 == nil && err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err667 == nil && err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if _write_err667 != nil { + return false, thrift.WrapTException(_write_err667) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "removeListener", thrift.REPLY, seqId); err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err667 == nil && err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err667 == nil && err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err667 == nil && err2 != nil { + _write_err667 = thrift.WrapTException(err2) + } + if _write_err667 != nil { + return false, thrift.WrapTException(_write_err667) + } + return true, err +} + +type metaServiceProcessorListListener struct { + handler MetaService +} + +func (p *metaServiceProcessorListListener) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err669 error + args := MetaServiceListListenerArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listListener", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListListenerResult{} + if retval, err2 := p.handler.ListListener(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc670 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listListener: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listListener", thrift.EXCEPTION, seqId); err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if err2 := _exc670.Write(ctx, oprot); _write_err669 == nil && err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err669 == nil && err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err669 == nil && err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if _write_err669 != nil { + return false, thrift.WrapTException(_write_err669) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listListener", thrift.REPLY, seqId); err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err669 == nil && err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err669 == nil && err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err669 == nil && err2 != nil { + _write_err669 = thrift.WrapTException(err2) + } + if _write_err669 != nil { + return false, thrift.WrapTException(_write_err669) + } + return true, err +} + +type metaServiceProcessorGetStats struct { + handler MetaService +} + +func (p *metaServiceProcessorGetStats) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err671 error + args := MetaServiceGetStatsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getStats", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetStatsResult{} + if retval, err2 := p.handler.GetStats(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc672 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getStats: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getStats", thrift.EXCEPTION, seqId); err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if err2 := _exc672.Write(ctx, oprot); _write_err671 == nil && err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err671 == nil && err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err671 == nil && err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if _write_err671 != nil { + return false, thrift.WrapTException(_write_err671) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getStats", thrift.REPLY, seqId); err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err671 == nil && err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err671 == nil && err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err671 == nil && err2 != nil { + _write_err671 = thrift.WrapTException(err2) + } + if _write_err671 != nil { + return false, thrift.WrapTException(_write_err671) + } + return true, err +} + +type metaServiceProcessorSignInService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignInService) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err673 error + args := MetaServiceSignInServiceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "signInService", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceSignInServiceResult{} + if retval, err2 := p.handler.SignInService(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc674 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signInService: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "signInService", thrift.EXCEPTION, seqId); err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if err2 := _exc674.Write(ctx, oprot); _write_err673 == nil && err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err673 == nil && err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err673 == nil && err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if _write_err673 != nil { + return false, thrift.WrapTException(_write_err673) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "signInService", thrift.REPLY, seqId); err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err673 == nil && err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err673 == nil && err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err673 == nil && err2 != nil { + _write_err673 = thrift.WrapTException(err2) + } + if _write_err673 != nil { + return false, thrift.WrapTException(_write_err673) + } + return true, err +} + +type metaServiceProcessorSignOutService struct { + handler MetaService +} + +func (p *metaServiceProcessorSignOutService) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err675 error + args := MetaServiceSignOutServiceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "signOutService", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceSignOutServiceResult{} + if retval, err2 := p.handler.SignOutService(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc676 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signOutService: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "signOutService", thrift.EXCEPTION, seqId); err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if err2 := _exc676.Write(ctx, oprot); _write_err675 == nil && err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err675 == nil && err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err675 == nil && err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if _write_err675 != nil { + return false, thrift.WrapTException(_write_err675) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "signOutService", thrift.REPLY, seqId); err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err675 == nil && err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err675 == nil && err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err675 == nil && err2 != nil { + _write_err675 = thrift.WrapTException(err2) + } + if _write_err675 != nil { + return false, thrift.WrapTException(_write_err675) + } + return true, err +} + +type metaServiceProcessorListServiceClients struct { + handler MetaService +} + +func (p *metaServiceProcessorListServiceClients) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err677 error + args := MetaServiceListServiceClientsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listServiceClients", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListServiceClientsResult{} + if retval, err2 := p.handler.ListServiceClients(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc678 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listServiceClients: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listServiceClients", thrift.EXCEPTION, seqId); err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if err2 := _exc678.Write(ctx, oprot); _write_err677 == nil && err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err677 == nil && err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err677 == nil && err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if _write_err677 != nil { + return false, thrift.WrapTException(_write_err677) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listServiceClients", thrift.REPLY, seqId); err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err677 == nil && err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err677 == nil && err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err677 == nil && err2 != nil { + _write_err677 = thrift.WrapTException(err2) + } + if _write_err677 != nil { + return false, thrift.WrapTException(_write_err677) + } + return true, err +} + +type metaServiceProcessorCreateFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateFTIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err679 error + args := MetaServiceCreateFTIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createFTIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateFTIndexResult{} + if retval, err2 := p.handler.CreateFTIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc680 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createFTIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createFTIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if err2 := _exc680.Write(ctx, oprot); _write_err679 == nil && err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err679 == nil && err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err679 == nil && err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if _write_err679 != nil { + return false, thrift.WrapTException(_write_err679) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createFTIndex", thrift.REPLY, seqId); err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err679 == nil && err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err679 == nil && err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err679 == nil && err2 != nil { + _write_err679 = thrift.WrapTException(err2) + } + if _write_err679 != nil { + return false, thrift.WrapTException(_write_err679) + } + return true, err +} + +type metaServiceProcessorDropFTIndex struct { + handler MetaService +} + +func (p *metaServiceProcessorDropFTIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err681 error + args := MetaServiceDropFTIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropFTIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceDropFTIndexResult{} + if retval, err2 := p.handler.DropFTIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc682 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropFTIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropFTIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if err2 := _exc682.Write(ctx, oprot); _write_err681 == nil && err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err681 == nil && err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err681 == nil && err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if _write_err681 != nil { + return false, thrift.WrapTException(_write_err681) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropFTIndex", thrift.REPLY, seqId); err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err681 == nil && err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err681 == nil && err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err681 == nil && err2 != nil { + _write_err681 = thrift.WrapTException(err2) + } + if _write_err681 != nil { + return false, thrift.WrapTException(_write_err681) + } + return true, err +} + +type metaServiceProcessorListFTIndexes struct { + handler MetaService +} + +func (p *metaServiceProcessorListFTIndexes) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err683 error + args := MetaServiceListFTIndexesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listFTIndexes", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListFTIndexesResult{} + if retval, err2 := p.handler.ListFTIndexes(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc684 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listFTIndexes: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listFTIndexes", thrift.EXCEPTION, seqId); err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if err2 := _exc684.Write(ctx, oprot); _write_err683 == nil && err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err683 == nil && err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err683 == nil && err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if _write_err683 != nil { + return false, thrift.WrapTException(_write_err683) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listFTIndexes", thrift.REPLY, seqId); err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err683 == nil && err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err683 == nil && err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err683 == nil && err2 != nil { + _write_err683 = thrift.WrapTException(err2) + } + if _write_err683 != nil { + return false, thrift.WrapTException(_write_err683) + } + return true, err +} + +type metaServiceProcessorCreateSession struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err685 error + args := MetaServiceCreateSessionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateSessionResult{} + if retval, err2 := p.handler.CreateSession(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc686 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createSession: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createSession", thrift.EXCEPTION, seqId); err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if err2 := _exc686.Write(ctx, oprot); _write_err685 == nil && err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err685 == nil && err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err685 == nil && err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if _write_err685 != nil { + return false, thrift.WrapTException(_write_err685) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createSession", thrift.REPLY, seqId); err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err685 == nil && err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err685 == nil && err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err685 == nil && err2 != nil { + _write_err685 = thrift.WrapTException(err2) + } + if _write_err685 != nil { + return false, thrift.WrapTException(_write_err685) + } + return true, err +} + +type metaServiceProcessorUpdateSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorUpdateSessions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err687 error + args := MetaServiceUpdateSessionsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "updateSessions", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceUpdateSessionsResult{} + if retval, err2 := p.handler.UpdateSessions(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc688 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateSessions: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "updateSessions", thrift.EXCEPTION, seqId); err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if err2 := _exc688.Write(ctx, oprot); _write_err687 == nil && err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err687 == nil && err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err687 == nil && err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if _write_err687 != nil { + return false, thrift.WrapTException(_write_err687) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "updateSessions", thrift.REPLY, seqId); err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err687 == nil && err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err687 == nil && err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err687 == nil && err2 != nil { + _write_err687 = thrift.WrapTException(err2) + } + if _write_err687 != nil { + return false, thrift.WrapTException(_write_err687) + } + return true, err +} + +type metaServiceProcessorListSessions struct { + handler MetaService +} + +func (p *metaServiceProcessorListSessions) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err689 error + args := MetaServiceListSessionsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listSessions", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListSessionsResult{} + if retval, err2 := p.handler.ListSessions(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc690 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listSessions: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listSessions", thrift.EXCEPTION, seqId); err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if err2 := _exc690.Write(ctx, oprot); _write_err689 == nil && err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err689 == nil && err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err689 == nil && err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if _write_err689 != nil { + return false, thrift.WrapTException(_write_err689) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listSessions", thrift.REPLY, seqId); err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err689 == nil && err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err689 == nil && err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err689 == nil && err2 != nil { + _write_err689 = thrift.WrapTException(err2) + } + if _write_err689 != nil { + return false, thrift.WrapTException(_write_err689) + } + return true, err +} + +type metaServiceProcessorGetSession struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err691 error + args := MetaServiceGetSessionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetSessionResult{} + if retval, err2 := p.handler.GetSession(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc692 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSession: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getSession", thrift.EXCEPTION, seqId); err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if err2 := _exc692.Write(ctx, oprot); _write_err691 == nil && err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err691 == nil && err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err691 == nil && err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if _write_err691 != nil { + return false, thrift.WrapTException(_write_err691) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getSession", thrift.REPLY, seqId); err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err691 == nil && err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err691 == nil && err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err691 == nil && err2 != nil { + _write_err691 = thrift.WrapTException(err2) + } + if _write_err691 != nil { + return false, thrift.WrapTException(_write_err691) + } + return true, err +} + +type metaServiceProcessorRemoveSession struct { + handler MetaService +} + +func (p *metaServiceProcessorRemoveSession) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err693 error + args := MetaServiceRemoveSessionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "removeSession", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRemoveSessionResult{} + if retval, err2 := p.handler.RemoveSession(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc694 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removeSession: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "removeSession", thrift.EXCEPTION, seqId); err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if err2 := _exc694.Write(ctx, oprot); _write_err693 == nil && err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err693 == nil && err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err693 == nil && err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if _write_err693 != nil { + return false, thrift.WrapTException(_write_err693) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "removeSession", thrift.REPLY, seqId); err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err693 == nil && err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err693 == nil && err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err693 == nil && err2 != nil { + _write_err693 = thrift.WrapTException(err2) + } + if _write_err693 != nil { + return false, thrift.WrapTException(_write_err693) + } + return true, err +} + +type metaServiceProcessorKillQuery struct { + handler MetaService +} + +func (p *metaServiceProcessorKillQuery) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err695 error + args := MetaServiceKillQueryArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "killQuery", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceKillQueryResult{} + if retval, err2 := p.handler.KillQuery(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc696 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing killQuery: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "killQuery", thrift.EXCEPTION, seqId); err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if err2 := _exc696.Write(ctx, oprot); _write_err695 == nil && err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err695 == nil && err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err695 == nil && err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if _write_err695 != nil { + return false, thrift.WrapTException(_write_err695) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "killQuery", thrift.REPLY, seqId); err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err695 == nil && err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err695 == nil && err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err695 == nil && err2 != nil { + _write_err695 = thrift.WrapTException(err2) + } + if _write_err695 != nil { + return false, thrift.WrapTException(_write_err695) + } + return true, err +} + +type metaServiceProcessorReportTaskFinish struct { + handler MetaService +} + +func (p *metaServiceProcessorReportTaskFinish) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err697 error + args := MetaServiceReportTaskFinishArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "reportTaskFinish", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceReportTaskFinishResult{} + if retval, err2 := p.handler.ReportTaskFinish(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc698 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing reportTaskFinish: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "reportTaskFinish", thrift.EXCEPTION, seqId); err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if err2 := _exc698.Write(ctx, oprot); _write_err697 == nil && err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err697 == nil && err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err697 == nil && err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if _write_err697 != nil { + return false, thrift.WrapTException(_write_err697) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "reportTaskFinish", thrift.REPLY, seqId); err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err697 == nil && err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err697 == nil && err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err697 == nil && err2 != nil { + _write_err697 = thrift.WrapTException(err2) + } + if _write_err697 != nil { + return false, thrift.WrapTException(_write_err697) + } + return true, err +} + +type metaServiceProcessorCreateBackup struct { + handler MetaService +} + +func (p *metaServiceProcessorCreateBackup) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err699 error + args := MetaServiceCreateBackupArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createBackup", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceCreateBackupResult{} + if retval, err2 := p.handler.CreateBackup(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc700 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createBackup: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createBackup", thrift.EXCEPTION, seqId); err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if err2 := _exc700.Write(ctx, oprot); _write_err699 == nil && err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err699 == nil && err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err699 == nil && err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if _write_err699 != nil { + return false, thrift.WrapTException(_write_err699) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createBackup", thrift.REPLY, seqId); err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err699 == nil && err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err699 == nil && err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err699 == nil && err2 != nil { + _write_err699 = thrift.WrapTException(err2) + } + if _write_err699 != nil { + return false, thrift.WrapTException(_write_err699) + } + return true, err +} + +type metaServiceProcessorRestoreMeta struct { + handler MetaService +} + +func (p *metaServiceProcessorRestoreMeta) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err701 error + args := MetaServiceRestoreMetaArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "restoreMeta", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceRestoreMetaResult{} + if retval, err2 := p.handler.RestoreMeta(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc702 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing restoreMeta: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "restoreMeta", thrift.EXCEPTION, seqId); err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if err2 := _exc702.Write(ctx, oprot); _write_err701 == nil && err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err701 == nil && err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err701 == nil && err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if _write_err701 != nil { + return false, thrift.WrapTException(_write_err701) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "restoreMeta", thrift.REPLY, seqId); err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err701 == nil && err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err701 == nil && err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err701 == nil && err2 != nil { + _write_err701 = thrift.WrapTException(err2) + } + if _write_err701 != nil { + return false, thrift.WrapTException(_write_err701) + } + return true, err +} + +type metaServiceProcessorListCluster struct { + handler MetaService +} + +func (p *metaServiceProcessorListCluster) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err703 error + args := MetaServiceListClusterArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "listCluster", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceListClusterResult{} + if retval, err2 := p.handler.ListCluster(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc704 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listCluster: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "listCluster", thrift.EXCEPTION, seqId); err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if err2 := _exc704.Write(ctx, oprot); _write_err703 == nil && err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err703 == nil && err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err703 == nil && err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if _write_err703 != nil { + return false, thrift.WrapTException(_write_err703) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "listCluster", thrift.REPLY, seqId); err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err703 == nil && err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err703 == nil && err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err703 == nil && err2 != nil { + _write_err703 = thrift.WrapTException(err2) + } + if _write_err703 != nil { + return false, thrift.WrapTException(_write_err703) + } + return true, err +} + +type metaServiceProcessorGetMetaDirInfo struct { + handler MetaService +} + +func (p *metaServiceProcessorGetMetaDirInfo) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err705 error + args := MetaServiceGetMetaDirInfoArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getMetaDirInfo", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetMetaDirInfoResult{} + if retval, err2 := p.handler.GetMetaDirInfo(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc706 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getMetaDirInfo: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getMetaDirInfo", thrift.EXCEPTION, seqId); err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if err2 := _exc706.Write(ctx, oprot); _write_err705 == nil && err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err705 == nil && err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err705 == nil && err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if _write_err705 != nil { + return false, thrift.WrapTException(_write_err705) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getMetaDirInfo", thrift.REPLY, seqId); err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err705 == nil && err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err705 == nil && err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err705 == nil && err2 != nil { + _write_err705 = thrift.WrapTException(err2) + } + if _write_err705 != nil { + return false, thrift.WrapTException(_write_err705) + } + return true, err +} + +type metaServiceProcessorVerifyClientVersion struct { + handler MetaService +} + +func (p *metaServiceProcessorVerifyClientVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err707 error + args := MetaServiceVerifyClientVersionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "verifyClientVersion", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceVerifyClientVersionResult{} + if retval, err2 := p.handler.VerifyClientVersion(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc708 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing verifyClientVersion: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "verifyClientVersion", thrift.EXCEPTION, seqId); err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if err2 := _exc708.Write(ctx, oprot); _write_err707 == nil && err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err707 == nil && err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err707 == nil && err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if _write_err707 != nil { + return false, thrift.WrapTException(_write_err707) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "verifyClientVersion", thrift.REPLY, seqId); err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err707 == nil && err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err707 == nil && err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err707 == nil && err2 != nil { + _write_err707 = thrift.WrapTException(err2) + } + if _write_err707 != nil { + return false, thrift.WrapTException(_write_err707) + } + return true, err +} + +type metaServiceProcessorSaveGraphVersion struct { + handler MetaService +} + +func (p *metaServiceProcessorSaveGraphVersion) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err709 error + args := MetaServiceSaveGraphVersionArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "saveGraphVersion", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceSaveGraphVersionResult{} + if retval, err2 := p.handler.SaveGraphVersion(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc710 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing saveGraphVersion: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "saveGraphVersion", thrift.EXCEPTION, seqId); err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if err2 := _exc710.Write(ctx, oprot); _write_err709 == nil && err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err709 == nil && err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err709 == nil && err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if _write_err709 != nil { + return false, thrift.WrapTException(_write_err709) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "saveGraphVersion", thrift.REPLY, seqId); err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err709 == nil && err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err709 == nil && err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err709 == nil && err2 != nil { + _write_err709 = thrift.WrapTException(err2) + } + if _write_err709 != nil { + return false, thrift.WrapTException(_write_err709) + } + return true, err +} + +type metaServiceProcessorGetSegmentId struct { + handler MetaService +} + +func (p *metaServiceProcessorGetSegmentId) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err711 error + args := MetaServiceGetSegmentIdArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getSegmentId", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := MetaServiceGetSegmentIdResult{} + if retval, err2 := p.handler.GetSegmentId(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc712 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSegmentId: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getSegmentId", thrift.EXCEPTION, seqId); err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if err2 := _exc712.Write(ctx, oprot); _write_err711 == nil && err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err711 == nil && err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err711 == nil && err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if _write_err711 != nil { + return false, thrift.WrapTException(_write_err711) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getSegmentId", thrift.REPLY, seqId); err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err711 == nil && err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err711 == nil && err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err711 == nil && err2 != nil { + _write_err711 = thrift.WrapTException(err2) + } + if _write_err711 != nil { + return false, thrift.WrapTException(_write_err711) + } + return true, err +} + + +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateSpaceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSpace_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSpaceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSpace_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSpaceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropSpaceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropSpaceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSpaceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropSpace_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropSpaceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropSpaceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSpaceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropSpace_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropSpaceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceClearSpaceArgs struct { + Req *ClearSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceClearSpaceArgs() *MetaServiceClearSpaceArgs { + return &MetaServiceClearSpaceArgs{} +} + +var MetaServiceClearSpaceArgs_Req_DEFAULT *ClearSpaceReq +func (p *MetaServiceClearSpaceArgs) GetReq() *ClearSpaceReq { + if !p.IsSetReq() { + return MetaServiceClearSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceClearSpaceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceClearSpaceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceClearSpaceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ClearSpaceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceClearSpaceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "clearSpace_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceClearSpaceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceClearSpaceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceClearSpaceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceClearSpaceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceClearSpaceResult() *MetaServiceClearSpaceResult { + return &MetaServiceClearSpaceResult{} +} + +var MetaServiceClearSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceClearSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceClearSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceClearSpaceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceClearSpaceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceClearSpaceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceClearSpaceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "clearSpace_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceClearSpaceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceClearSpaceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceClearSpaceResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetSpaceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetSpaceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSpaceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getSpace_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetSpaceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetSpaceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetSpaceResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSpaceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getSpace_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetSpaceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListSpacesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListSpacesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSpacesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listSpaces_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListSpacesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListSpacesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListSpacesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSpacesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listSpaces_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListSpacesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceAlterSpaceArgs struct { + Req *AlterSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAlterSpaceArgs() *MetaServiceAlterSpaceArgs { + return &MetaServiceAlterSpaceArgs{} +} + +var MetaServiceAlterSpaceArgs_Req_DEFAULT *AlterSpaceReq +func (p *MetaServiceAlterSpaceArgs) GetReq() *AlterSpaceReq { + if !p.IsSetReq() { + return MetaServiceAlterSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAlterSpaceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAlterSpaceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterSpaceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AlterSpaceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterSpaceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterSpace_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterSpaceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceAlterSpaceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterSpaceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAlterSpaceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAlterSpaceResult() *MetaServiceAlterSpaceResult { + return &MetaServiceAlterSpaceResult{} +} + +var MetaServiceAlterSpaceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAlterSpaceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAlterSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAlterSpaceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAlterSpaceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterSpaceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterSpaceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterSpace_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterSpaceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceAlterSpaceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAlterSpaceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateSpaceAsArgs struct { + Req *CreateSpaceAsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateSpaceAsArgs() *MetaServiceCreateSpaceAsArgs { + return &MetaServiceCreateSpaceAsArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceCreateSpaceAsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceAsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateSpaceAsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceAsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSpaceAs_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSpaceAsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceCreateSpaceAsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateSpaceAsResult struct { + 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.Success != nil +} + +func (p *MetaServiceCreateSpaceAsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceAsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSpaceAsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSpaceAs_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSpaceAsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceCreateSpaceAsResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateTagArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateTagReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createTag_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateTagArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateTagResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createTag_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateTagResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterTagArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AlterTagReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterTagArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterTag_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterTagArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterTagResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterTagResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterTag_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterTagResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropTagArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropTagReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropTag_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropTagArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropTagResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropTag_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropTagResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetTagArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetTagReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getTag_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetTagArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetTagResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetTagResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getTag_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetTagResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListTagsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListTagsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listTags_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListTagsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListTagsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListTagsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listTags_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListTagsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateEdgeReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AlterEdgeReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropEdgeReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetEdgeReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetEdgeResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListEdgesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListEdgesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listEdges_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListEdgesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListEdgesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListEdgesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listEdges_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListEdgesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceAddHostsArgs struct { + Req *AddHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostsArgs() *MetaServiceAddHostsArgs { + return &MetaServiceAddHostsArgs{} +} + +var MetaServiceAddHostsArgs_Req_DEFAULT *AddHostsReq +func (p *MetaServiceAddHostsArgs) GetReq() *AddHostsReq { + if !p.IsSetReq() { + return MetaServiceAddHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAddHostsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddHostsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddHostsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddHostsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceAddHostsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddHostsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAddHostsResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostsResult() *MetaServiceAddHostsResult { + return &MetaServiceAddHostsResult{} +} + +var MetaServiceAddHostsResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostsResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAddHostsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddHostsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddHostsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceAddHostsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddHostsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceAddHostsIntoZoneArgs struct { + Req *AddHostsIntoZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAddHostsIntoZoneArgs() *MetaServiceAddHostsIntoZoneArgs { + return &MetaServiceAddHostsIntoZoneArgs{} +} + +var MetaServiceAddHostsIntoZoneArgs_Req_DEFAULT *AddHostsIntoZoneReq +func (p *MetaServiceAddHostsIntoZoneArgs) GetReq() *AddHostsIntoZoneReq { + if !p.IsSetReq() { + return MetaServiceAddHostsIntoZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAddHostsIntoZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAddHostsIntoZoneArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddHostsIntoZoneReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addHostsIntoZone_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceAddHostsIntoZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddHostsIntoZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAddHostsIntoZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAddHostsIntoZoneResult() *MetaServiceAddHostsIntoZoneResult { + return &MetaServiceAddHostsIntoZoneResult{} +} + +var MetaServiceAddHostsIntoZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceAddHostsIntoZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceAddHostsIntoZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAddHostsIntoZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAddHostsIntoZoneResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addHostsIntoZone_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddHostsIntoZoneResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceAddHostsIntoZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAddHostsIntoZoneResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropHostsArgs struct { + Req *DropHostsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropHostsArgs() *MetaServiceDropHostsArgs { + return &MetaServiceDropHostsArgs{} +} + +var MetaServiceDropHostsArgs_Req_DEFAULT *DropHostsReq +func (p *MetaServiceDropHostsArgs) GetReq() *DropHostsReq { + if !p.IsSetReq() { + return MetaServiceDropHostsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDropHostsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDropHostsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropHostsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropHostsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropHostsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropHostsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceDropHostsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropHostsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropHostsResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDropHostsResult() *MetaServiceDropHostsResult { + return &MetaServiceDropHostsResult{} +} + +var MetaServiceDropHostsResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDropHostsResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDropHostsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDropHostsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDropHostsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropHostsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropHostsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropHostsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceDropHostsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDropHostsResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListHostsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListHostsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListHostsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listHosts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListHostsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListHostsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListHostsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListHostsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listHosts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListHostsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetPartsAllocReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getPartsAlloc_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetPartsAllocArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetPartsAllocResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetPartsAllocResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getPartsAlloc_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetPartsAllocResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListPartsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListPartsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListPartsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listParts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListPartsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListPartsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListPartsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListPartsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listParts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListPartsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceGetWorkerIdArgs struct { + Req *GetWorkerIdReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetWorkerIdArgs() *MetaServiceGetWorkerIdArgs { + return &MetaServiceGetWorkerIdArgs{} +} + +var MetaServiceGetWorkerIdArgs_Req_DEFAULT *GetWorkerIdReq +func (p *MetaServiceGetWorkerIdArgs) GetReq() *GetWorkerIdReq { + if !p.IsSetReq() { + return MetaServiceGetWorkerIdArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetWorkerIdArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetWorkerIdArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetWorkerIdArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetWorkerIdReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetWorkerIdArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getWorkerId_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetWorkerIdArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceGetWorkerIdArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetWorkerIdArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetWorkerIdResult struct { + Success *GetWorkerIdResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetWorkerIdResult() *MetaServiceGetWorkerIdResult { + return &MetaServiceGetWorkerIdResult{} +} + +var MetaServiceGetWorkerIdResult_Success_DEFAULT *GetWorkerIdResp +func (p *MetaServiceGetWorkerIdResult) GetSuccess() *GetWorkerIdResp { + if !p.IsSetSuccess() { + return MetaServiceGetWorkerIdResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetWorkerIdResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetWorkerIdResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetWorkerIdResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetWorkerIdResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetWorkerIdResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getWorkerId_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetWorkerIdResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceGetWorkerIdResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetWorkerIdResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateTagIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createTagIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateTagIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateTagIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createTagIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateTagIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropTagIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropTagIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropTagIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropTagIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropTagIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropTagIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetTagIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getTagIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetTagIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetTagIndexResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetTagIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getTagIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetTagIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListTagIndexesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listTagIndexes_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListTagIndexesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListTagIndexesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listTagIndexes_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListTagIndexesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RebuildIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "rebuildTagIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRebuildTagIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildTagIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "rebuildTagIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRebuildTagIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListIndexStatusReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listTagIndexStatus_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListTagIndexStatusArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListIndexStatusResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListTagIndexStatusResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listTagIndexStatus_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListTagIndexStatusResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateEdgeIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createEdgeIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateEdgeIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateEdgeIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createEdgeIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateEdgeIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropEdgeIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropEdgeIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropEdgeIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropEdgeIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropEdgeIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropEdgeIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetEdgeIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getEdgeIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetEdgeIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetEdgeIndexResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetEdgeIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getEdgeIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetEdgeIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListEdgeIndexesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listEdgeIndexes_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListEdgeIndexesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListEdgeIndexesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listEdgeIndexes_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListEdgeIndexesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RebuildIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "rebuildEdgeIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "rebuildEdgeIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRebuildEdgeIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListIndexStatusReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listEdgeIndexStatus_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListIndexStatusResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listEdgeIndexStatus_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListEdgeIndexStatusResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateUserArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateUserReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateUserArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createUser_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateUserArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateUserResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateUserResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createUser_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateUserResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropUserArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropUserReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropUserArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropUser_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropUserArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropUserResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropUserResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropUser_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropUserResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterUserArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AlterUserReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAlterUserArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterUser_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterUserArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAlterUserResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAlterUserResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "alterUser_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAlterUserResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGrantRoleArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GrantRoleReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGrantRoleArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "grantRole_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGrantRoleArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGrantRoleResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGrantRoleResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "grantRole_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGrantRoleResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RevokeRoleReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "revokeRole_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRevokeRoleArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRevokeRoleResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "revokeRole_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRevokeRoleResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListUsersArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListUsersReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListUsersArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listUsers_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListUsersArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListUsersResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListUsersResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListUsersResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listUsers_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListUsersResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListRolesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListRolesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListRolesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listRoles_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListRolesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListRolesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListRolesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListRolesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listRoles_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListRolesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetUserRolesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getUserRoles_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetUserRolesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListRolesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetUserRolesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getUserRoles_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetUserRolesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceChangePasswordArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ChangePasswordReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceChangePasswordArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "changePassword_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceChangePasswordArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceChangePasswordResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceChangePasswordResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "changePassword_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceChangePasswordResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceHeartBeatArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &HBReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceHeartBeatArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "heartBeat_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceHeartBeatArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceHeartBeatResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &HBResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceHeartBeatResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "heartBeat_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceHeartBeatResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceAgentHeartbeatArgs struct { + Req *AgentHBReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceAgentHeartbeatArgs() *MetaServiceAgentHeartbeatArgs { + return &MetaServiceAgentHeartbeatArgs{} +} + +var MetaServiceAgentHeartbeatArgs_Req_DEFAULT *AgentHBReq +func (p *MetaServiceAgentHeartbeatArgs) GetReq() *AgentHBReq { + if !p.IsSetReq() { + return MetaServiceAgentHeartbeatArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceAgentHeartbeatArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceAgentHeartbeatArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAgentHeartbeatArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AgentHBReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAgentHeartbeatArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "agentHeartbeat_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAgentHeartbeatArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceAgentHeartbeatArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAgentHeartbeatArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceAgentHeartbeatResult struct { + Success *AgentHBResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceAgentHeartbeatResult() *MetaServiceAgentHeartbeatResult { + return &MetaServiceAgentHeartbeatResult{} +} + +var MetaServiceAgentHeartbeatResult_Success_DEFAULT *AgentHBResp +func (p *MetaServiceAgentHeartbeatResult) GetSuccess() *AgentHBResp { + if !p.IsSetSuccess() { + return MetaServiceAgentHeartbeatResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceAgentHeartbeatResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceAgentHeartbeatResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAgentHeartbeatResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AgentHBResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAgentHeartbeatResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "agentHeartbeat_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAgentHeartbeatResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceAgentHeartbeatResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceAgentHeartbeatResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRegConfigArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RegConfigReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRegConfigArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "regConfig_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRegConfigArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRegConfigResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRegConfigResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "regConfig_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRegConfigResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetConfigArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetConfigReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetConfigArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getConfig_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetConfigArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetConfigResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetConfigResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetConfigResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getConfig_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetConfigResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSetConfigArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &SetConfigReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSetConfigArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "setConfig_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSetConfigArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSetConfigResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSetConfigResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "setConfig_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSetConfigResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListConfigsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListConfigsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListConfigsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listConfigs_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListConfigsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListConfigsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListConfigsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListConfigsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listConfigs_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListConfigsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateSnapshotReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSnapshot_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSnapshotArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSnapshotResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSnapshot_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSnapshotResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropSnapshotReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropSnapshot_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropSnapshotArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropSnapshotResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropSnapshot_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropSnapshotResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListSnapshotsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listSnapshots_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListSnapshotsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListSnapshotsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSnapshotsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listSnapshots_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListSnapshotsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AdminJobReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "runAdminJob_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRunAdminJobArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminJobResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRunAdminJobResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "runAdminJob_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRunAdminJobResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceMergeZoneArgs struct { + Req *MergeZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceMergeZoneArgs() *MetaServiceMergeZoneArgs { + return &MetaServiceMergeZoneArgs{} +} + +var MetaServiceMergeZoneArgs_Req_DEFAULT *MergeZoneReq +func (p *MetaServiceMergeZoneArgs) GetReq() *MergeZoneReq { + if !p.IsSetReq() { + return MetaServiceMergeZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceMergeZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceMergeZoneArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceMergeZoneArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &MergeZoneReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceMergeZoneArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "mergeZone_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceMergeZoneArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceMergeZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceMergeZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceMergeZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceMergeZoneResult() *MetaServiceMergeZoneResult { + return &MetaServiceMergeZoneResult{} +} + +var MetaServiceMergeZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceMergeZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceMergeZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceMergeZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceMergeZoneResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceMergeZoneResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceMergeZoneResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "mergeZone_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceMergeZoneResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceMergeZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceMergeZoneResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropZoneArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropZoneReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropZoneArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropZone_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropZoneArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropZoneResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropZoneResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropZone_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropZoneResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceDivideZoneArgs struct { + Req *DivideZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDivideZoneArgs() *MetaServiceDivideZoneArgs { + return &MetaServiceDivideZoneArgs{} +} + +var MetaServiceDivideZoneArgs_Req_DEFAULT *DivideZoneReq +func (p *MetaServiceDivideZoneArgs) GetReq() *DivideZoneReq { + if !p.IsSetReq() { + return MetaServiceDivideZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceDivideZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceDivideZoneArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDivideZoneArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DivideZoneReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDivideZoneArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "divideZone_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDivideZoneArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceDivideZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDivideZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDivideZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceDivideZoneResult() *MetaServiceDivideZoneResult { + return &MetaServiceDivideZoneResult{} +} + +var MetaServiceDivideZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceDivideZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceDivideZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceDivideZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceDivideZoneResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDivideZoneResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDivideZoneResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "divideZone_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDivideZoneResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceDivideZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceDivideZoneResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceRenameZoneArgs struct { + Req *RenameZoneReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceRenameZoneArgs() *MetaServiceRenameZoneArgs { + return &MetaServiceRenameZoneArgs{} +} + +var MetaServiceRenameZoneArgs_Req_DEFAULT *RenameZoneReq +func (p *MetaServiceRenameZoneArgs) GetReq() *RenameZoneReq { + if !p.IsSetReq() { + return MetaServiceRenameZoneArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceRenameZoneArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceRenameZoneArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRenameZoneArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RenameZoneReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRenameZoneArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "renameZone_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRenameZoneArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceRenameZoneArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRenameZoneArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceRenameZoneResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRenameZoneResult() *MetaServiceRenameZoneResult { + return &MetaServiceRenameZoneResult{} +} + +var MetaServiceRenameZoneResult_Success_DEFAULT *ExecResp +func (p *MetaServiceRenameZoneResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceRenameZoneResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRenameZoneResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRenameZoneResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRenameZoneResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRenameZoneResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "renameZone_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRenameZoneResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceRenameZoneResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceRenameZoneResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetZoneArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetZoneReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetZoneArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getZone_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetZoneArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetZoneResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetZoneResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetZoneResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getZone_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetZoneResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListZonesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListZonesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListZonesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listZones_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListZonesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListZonesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListZonesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListZonesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listZones_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListZonesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddListenerArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddListenerReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceAddListenerArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addListener_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddListenerArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceAddListenerResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceAddListenerResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addListener_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceAddListenerResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RemoveListenerReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "removeListener_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveListenerArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveListenerResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "removeListener_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveListenerResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListListenerArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListListenerReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListListenerArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listListener_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListListenerArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListListenerResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListListenerResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListListenerResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listListener_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListListenerResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceGetStatsArgs struct { + Req *GetStatsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetStatsArgs() *MetaServiceGetStatsArgs { + return &MetaServiceGetStatsArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceGetStatsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetStatsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetStatsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetStatsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getStats_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetStatsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceGetStatsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetStatsResult struct { + 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.Success != nil +} + +func (p *MetaServiceGetStatsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetStatsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetStatsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetStatsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getStats_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetStatsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceGetStatsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceSignInServiceArgs struct { + Req *SignInServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignInServiceArgs() *MetaServiceSignInServiceArgs { + return &MetaServiceSignInServiceArgs{} +} + +var MetaServiceSignInServiceArgs_Req_DEFAULT *SignInServiceReq +func (p *MetaServiceSignInServiceArgs) GetReq() *SignInServiceReq { + if !p.IsSetReq() { + return MetaServiceSignInServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignInServiceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceSignInServiceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSignInServiceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &SignInServiceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignInServiceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "signInService_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSignInServiceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceSignInServiceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignInServiceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceSignInServiceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignInServiceResult() *MetaServiceSignInServiceResult { + return &MetaServiceSignInServiceResult{} +} + +var MetaServiceSignInServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignInServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignInServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignInServiceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceSignInServiceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSignInServiceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignInServiceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "signInService_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSignInServiceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceSignInServiceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignInServiceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceSignOutServiceArgs struct { + Req *SignOutServiceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSignOutServiceArgs() *MetaServiceSignOutServiceArgs { + return &MetaServiceSignOutServiceArgs{} +} + +var MetaServiceSignOutServiceArgs_Req_DEFAULT *SignOutServiceReq +func (p *MetaServiceSignOutServiceArgs) GetReq() *SignOutServiceReq { + if !p.IsSetReq() { + return MetaServiceSignOutServiceArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSignOutServiceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceSignOutServiceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSignOutServiceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &SignOutServiceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSignOutServiceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "signOutService_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSignOutServiceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceSignOutServiceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignOutServiceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceSignOutServiceResult struct { + Success *ExecResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSignOutServiceResult() *MetaServiceSignOutServiceResult { + return &MetaServiceSignOutServiceResult{} +} + +var MetaServiceSignOutServiceResult_Success_DEFAULT *ExecResp +func (p *MetaServiceSignOutServiceResult) GetSuccess() *ExecResp { + if !p.IsSetSuccess() { + return MetaServiceSignOutServiceResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSignOutServiceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceSignOutServiceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSignOutServiceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSignOutServiceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "signOutService_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSignOutServiceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceSignOutServiceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSignOutServiceResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListServiceClientsArgs struct { + Req *ListServiceClientsReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListServiceClientsArgs() *MetaServiceListServiceClientsArgs { + return &MetaServiceListServiceClientsArgs{} +} + +var MetaServiceListServiceClientsArgs_Req_DEFAULT *ListServiceClientsReq +func (p *MetaServiceListServiceClientsArgs) GetReq() *ListServiceClientsReq { + if !p.IsSetReq() { + return MetaServiceListServiceClientsArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceListServiceClientsArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceListServiceClientsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListServiceClientsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListServiceClientsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListServiceClientsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listServiceClients_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListServiceClientsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceListServiceClientsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListServiceClientsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListServiceClientsResult struct { + Success *ListServiceClientsResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceListServiceClientsResult() *MetaServiceListServiceClientsResult { + return &MetaServiceListServiceClientsResult{} +} + +var MetaServiceListServiceClientsResult_Success_DEFAULT *ListServiceClientsResp +func (p *MetaServiceListServiceClientsResult) GetSuccess() *ListServiceClientsResp { + if !p.IsSetSuccess() { + return MetaServiceListServiceClientsResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceListServiceClientsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceListServiceClientsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListServiceClientsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListServiceClientsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListServiceClientsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listServiceClients_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListServiceClientsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceListServiceClientsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceListServiceClientsResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceCreateFTIndexArgs struct { + Req *CreateFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceCreateFTIndexArgs() *MetaServiceCreateFTIndexArgs { + return &MetaServiceCreateFTIndexArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceCreateFTIndexArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateFTIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createFTIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateFTIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceCreateFTIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceCreateFTIndexResult struct { + 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.Success != nil +} + +func (p *MetaServiceCreateFTIndexResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateFTIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createFTIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateFTIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceCreateFTIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceDropFTIndexArgs struct { + Req *DropFTIndexReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceDropFTIndexArgs() *MetaServiceDropFTIndexArgs { + return &MetaServiceDropFTIndexArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceDropFTIndexArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropFTIndexReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropFTIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropFTIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceDropFTIndexArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceDropFTIndexResult struct { + 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.Success != nil +} + +func (p *MetaServiceDropFTIndexResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceDropFTIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropFTIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceDropFTIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceDropFTIndexResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceListFTIndexesArgs struct { + Req *ListFTIndexesReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListFTIndexesArgs() *MetaServiceListFTIndexesArgs { + return &MetaServiceListFTIndexesArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceListFTIndexesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListFTIndexesReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listFTIndexes_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListFTIndexesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceListFTIndexesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListFTIndexesResult struct { + 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.Success != nil +} + +func (p *MetaServiceListFTIndexesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListFTIndexesResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListFTIndexesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listFTIndexes_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListFTIndexesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceListFTIndexesResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateSessionReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSession_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &CreateSessionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createSession_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &UpdateSessionsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "updateSessions_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceUpdateSessionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *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.Success != nil +} + +func (p *MetaServiceUpdateSessionsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &UpdateSessionsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceUpdateSessionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "updateSessions_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceUpdateSessionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListSessionsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListSessionsReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListSessionsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listSessions_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListSessionsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListSessionsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListSessionsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListSessionsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listSessions_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListSessionsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetSessionReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getSession_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetSessionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getSession_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RemoveSessionReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "removeSession_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveSessionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *RemoveSessionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRemoveSessionResult() *MetaServiceRemoveSessionResult { + return &MetaServiceRemoveSessionResult{} +} + +var MetaServiceRemoveSessionResult_Success_DEFAULT *RemoveSessionResp +func (p *MetaServiceRemoveSessionResult) GetSuccess() *RemoveSessionResp { + if !p.IsSetSuccess() { + return MetaServiceRemoveSessionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRemoveSessionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRemoveSessionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &RemoveSessionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRemoveSessionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "removeSession_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRemoveSessionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceKillQueryArgs struct { + Req *KillQueryReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceKillQueryArgs() *MetaServiceKillQueryArgs { + return &MetaServiceKillQueryArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceKillQueryArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceKillQueryArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &KillQueryReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceKillQueryArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "killQuery_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceKillQueryArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceKillQueryArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceKillQueryResult struct { + 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.Success != nil +} + +func (p *MetaServiceKillQueryResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceKillQueryResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceKillQueryResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "killQuery_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceKillQueryResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceKillQueryResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ReportTaskReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "reportTaskFinish_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceReportTaskFinishArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceReportTaskFinishResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "reportTaskFinish_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceReportTaskFinishResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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) +} + +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateBackupArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateBackupReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceCreateBackupArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createBackup_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateBackupArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceCreateBackupResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &CreateBackupResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceCreateBackupResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createBackup_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceCreateBackupResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RestoreMetaReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "restoreMeta_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRestoreMetaArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *RestoreMetaResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceRestoreMetaResult() *MetaServiceRestoreMetaResult { + return &MetaServiceRestoreMetaResult{} +} + +var MetaServiceRestoreMetaResult_Success_DEFAULT *RestoreMetaResp +func (p *MetaServiceRestoreMetaResult) GetSuccess() *RestoreMetaResp { + if !p.IsSetSuccess() { + return MetaServiceRestoreMetaResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceRestoreMetaResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceRestoreMetaResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &RestoreMetaResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceRestoreMetaResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "restoreMeta_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceRestoreMetaResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 MetaServiceListClusterArgs struct { + Req *ListClusterInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceListClusterArgs() *MetaServiceListClusterArgs { + return &MetaServiceListClusterArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceListClusterArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListClusterArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ListClusterInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceListClusterArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listCluster_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListClusterArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceListClusterArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceListClusterResult struct { + 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.Success != nil +} + +func (p *MetaServiceListClusterResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceListClusterResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ListClusterInfoResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceListClusterResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "listCluster_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceListClusterResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceListClusterResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetMetaDirInfoArgs struct { + Req *GetMetaDirInfoReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetMetaDirInfoArgs() *MetaServiceGetMetaDirInfoArgs { + return &MetaServiceGetMetaDirInfoArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetMetaDirInfoReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getMetaDirInfo_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetMetaDirInfoArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetMetaDirInfoResult struct { + 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.Success != nil +} + +func (p *MetaServiceGetMetaDirInfoResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetMetaDirInfoResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetMetaDirInfoResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getMetaDirInfo_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetMetaDirInfoResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceGetMetaDirInfoResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceVerifyClientVersionArgs struct { + Req *VerifyClientVersionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceVerifyClientVersionArgs() *MetaServiceVerifyClientVersionArgs { + return &MetaServiceVerifyClientVersionArgs{} +} + +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.Req != nil +} + +func (p *MetaServiceVerifyClientVersionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceVerifyClientVersionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &VerifyClientVersionReq{ + ClientVersion: []byte("3.0.0"), +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceVerifyClientVersionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "verifyClientVersion_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceVerifyClientVersionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceVerifyClientVersionArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceVerifyClientVersionResult struct { + 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.Success != nil +} + +func (p *MetaServiceVerifyClientVersionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceVerifyClientVersionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &VerifyClientVersionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceVerifyClientVersionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "verifyClientVersion_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceVerifyClientVersionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("MetaServiceVerifyClientVersionResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceSaveGraphVersionArgs struct { + Req *SaveGraphVersionReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceSaveGraphVersionArgs() *MetaServiceSaveGraphVersionArgs { + return &MetaServiceSaveGraphVersionArgs{} +} + +var MetaServiceSaveGraphVersionArgs_Req_DEFAULT *SaveGraphVersionReq +func (p *MetaServiceSaveGraphVersionArgs) GetReq() *SaveGraphVersionReq { + if !p.IsSetReq() { + return MetaServiceSaveGraphVersionArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceSaveGraphVersionArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceSaveGraphVersionArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSaveGraphVersionArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &SaveGraphVersionReq{ + ClientVersion: []byte("3.0.0"), +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceSaveGraphVersionArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "saveGraphVersion_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSaveGraphVersionArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceSaveGraphVersionArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSaveGraphVersionArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceSaveGraphVersionResult struct { + Success *SaveGraphVersionResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceSaveGraphVersionResult() *MetaServiceSaveGraphVersionResult { + return &MetaServiceSaveGraphVersionResult{} +} + +var MetaServiceSaveGraphVersionResult_Success_DEFAULT *SaveGraphVersionResp +func (p *MetaServiceSaveGraphVersionResult) GetSuccess() *SaveGraphVersionResp { + if !p.IsSetSuccess() { + return MetaServiceSaveGraphVersionResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceSaveGraphVersionResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceSaveGraphVersionResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceSaveGraphVersionResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &SaveGraphVersionResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceSaveGraphVersionResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "saveGraphVersion_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceSaveGraphVersionResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceSaveGraphVersionResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceSaveGraphVersionResult(%+v)", *p) +} + +// Attributes: +// - Req +type MetaServiceGetSegmentIdArgs struct { + Req *GetSegmentIdReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewMetaServiceGetSegmentIdArgs() *MetaServiceGetSegmentIdArgs { + return &MetaServiceGetSegmentIdArgs{} +} + +var MetaServiceGetSegmentIdArgs_Req_DEFAULT *GetSegmentIdReq +func (p *MetaServiceGetSegmentIdArgs) GetReq() *GetSegmentIdReq { + if !p.IsSetReq() { + return MetaServiceGetSegmentIdArgs_Req_DEFAULT + } +return p.Req +} +func (p *MetaServiceGetSegmentIdArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *MetaServiceGetSegmentIdArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetSegmentIdArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetSegmentIdReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *MetaServiceGetSegmentIdArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getSegmentId_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetSegmentIdArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *MetaServiceGetSegmentIdArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetSegmentIdArgs(%+v)", *p) +} + +// Attributes: +// - Success +type MetaServiceGetSegmentIdResult struct { + Success *GetSegmentIdResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewMetaServiceGetSegmentIdResult() *MetaServiceGetSegmentIdResult { + return &MetaServiceGetSegmentIdResult{} +} + +var MetaServiceGetSegmentIdResult_Success_DEFAULT *GetSegmentIdResp +func (p *MetaServiceGetSegmentIdResult) GetSuccess() *GetSegmentIdResp { + if !p.IsSetSuccess() { + return MetaServiceGetSegmentIdResult_Success_DEFAULT + } +return p.Success +} +func (p *MetaServiceGetSegmentIdResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *MetaServiceGetSegmentIdResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MetaServiceGetSegmentIdResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetSegmentIdResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *MetaServiceGetSegmentIdResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getSegmentId_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MetaServiceGetSegmentIdResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *MetaServiceGetSegmentIdResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MetaServiceGetSegmentIdResult(%+v)", *p) +} + + diff --git a/nebula/meta/meta_service-remote/meta_service-remote.go b/nebula/meta/meta_service-remote/meta_service-remote.go new file mode 100755 index 00000000..d12a008c --- /dev/null +++ b/nebula/meta/meta_service-remote/meta_service-remote.go @@ -0,0 +1,2365 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package main + +import ( + "context" + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/apache/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-go/v3/nebula" + "github.com/vesoft-inc/nebula-go/v3/nebula/meta" +) + +var _ = nebula.GoUnusedProtection__ +var _ = meta.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " ExecResp createSpace(CreateSpaceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropSpace(DropSpaceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp clearSpace(ClearSpaceReq req)") + fmt.Fprintln(os.Stderr, " GetSpaceResp getSpace(GetSpaceReq req)") + fmt.Fprintln(os.Stderr, " ListSpacesResp listSpaces(ListSpacesReq req)") + fmt.Fprintln(os.Stderr, " ExecResp alterSpace(AlterSpaceReq 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, " ExecResp addHosts(AddHostsReq req)") + fmt.Fprintln(os.Stderr, " ExecResp addHostsIntoZone(AddHostsIntoZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropHosts(DropHostsReq req)") + fmt.Fprintln(os.Stderr, " ListHostsResp listHosts(ListHostsReq req)") + fmt.Fprintln(os.Stderr, " GetPartsAllocResp getPartsAlloc(GetPartsAllocReq req)") + fmt.Fprintln(os.Stderr, " ListPartsResp listParts(ListPartsReq req)") + fmt.Fprintln(os.Stderr, " GetWorkerIdResp getWorkerId(GetWorkerIdReq 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, " AgentHBResp agentHeartbeat(AgentHBReq 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 mergeZone(MergeZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp dropZone(DropZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp divideZone(DivideZoneReq req)") + fmt.Fprintln(os.Stderr, " ExecResp renameZone(RenameZoneReq req)") + fmt.Fprintln(os.Stderr, " GetZoneResp getZone(GetZoneReq req)") + fmt.Fprintln(os.Stderr, " ListZonesResp listZones(ListZonesReq req)") + fmt.Fprintln(os.Stderr, " 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 signInService(SignInServiceReq req)") + fmt.Fprintln(os.Stderr, " ExecResp signOutService(SignOutServiceReq req)") + fmt.Fprintln(os.Stderr, " ListServiceClientsResp listServiceClients(ListServiceClientsReq 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, " RemoveSessionResp removeSession(RemoveSessionReq req)") + fmt.Fprintln(os.Stderr, " ExecResp killQuery(KillQueryReq req)") + fmt.Fprintln(os.Stderr, " ExecResp reportTaskFinish(ReportTaskReq req)") + fmt.Fprintln(os.Stderr, " CreateBackupResp createBackup(CreateBackupReq req)") + fmt.Fprintln(os.Stderr, " RestoreMetaResp restoreMeta(RestoreMetaReq 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, " SaveGraphVersionResp saveGraphVersion(SaveGraphVersionReq req)") + fmt.Fprintln(os.Stderr, " GetSegmentIdResp getSegmentId(GetSegmentIdReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + var cfg *thrift.TConfiguration = nil + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransportConf(trans, cfg) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg) + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg) + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg) + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := meta.NewMetaServiceClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "createSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSpace requires 1 args") + flag.Usage() + } + arg713 := flag.Arg(1) + mbTrans714 := thrift.NewTMemoryBufferLen(len(arg713)) + defer mbTrans714.Close() + _, err715 := mbTrans714.WriteString(arg713) + if err715 != nil { + Usage() + return + } + factory716 := thrift.NewTJSONProtocolFactory() + jsProt717 := factory716.GetProtocol(mbTrans714) + argvalue0 := meta.NewCreateSpaceReq() + err718 := argvalue0.Read(context.Background(), jsProt717) + if err718 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSpace(context.Background(), value0)) + fmt.Print("\n") + break + case "dropSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSpace requires 1 args") + flag.Usage() + } + arg719 := flag.Arg(1) + mbTrans720 := thrift.NewTMemoryBufferLen(len(arg719)) + defer mbTrans720.Close() + _, err721 := mbTrans720.WriteString(arg719) + if err721 != nil { + Usage() + return + } + factory722 := thrift.NewTJSONProtocolFactory() + jsProt723 := factory722.GetProtocol(mbTrans720) + argvalue0 := meta.NewDropSpaceReq() + err724 := argvalue0.Read(context.Background(), jsProt723) + if err724 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSpace(context.Background(), value0)) + fmt.Print("\n") + break + case "clearSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ClearSpace requires 1 args") + flag.Usage() + } + arg725 := flag.Arg(1) + mbTrans726 := thrift.NewTMemoryBufferLen(len(arg725)) + defer mbTrans726.Close() + _, err727 := mbTrans726.WriteString(arg725) + if err727 != nil { + Usage() + return + } + factory728 := thrift.NewTJSONProtocolFactory() + jsProt729 := factory728.GetProtocol(mbTrans726) + argvalue0 := meta.NewClearSpaceReq() + err730 := argvalue0.Read(context.Background(), jsProt729) + if err730 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ClearSpace(context.Background(), value0)) + fmt.Print("\n") + break + case "getSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSpace requires 1 args") + flag.Usage() + } + arg731 := flag.Arg(1) + mbTrans732 := thrift.NewTMemoryBufferLen(len(arg731)) + defer mbTrans732.Close() + _, err733 := mbTrans732.WriteString(arg731) + if err733 != nil { + Usage() + return + } + factory734 := thrift.NewTJSONProtocolFactory() + jsProt735 := factory734.GetProtocol(mbTrans732) + argvalue0 := meta.NewGetSpaceReq() + err736 := argvalue0.Read(context.Background(), jsProt735) + if err736 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSpace(context.Background(), value0)) + fmt.Print("\n") + break + case "listSpaces": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSpaces requires 1 args") + flag.Usage() + } + arg737 := flag.Arg(1) + mbTrans738 := thrift.NewTMemoryBufferLen(len(arg737)) + defer mbTrans738.Close() + _, err739 := mbTrans738.WriteString(arg737) + if err739 != nil { + Usage() + return + } + factory740 := thrift.NewTJSONProtocolFactory() + jsProt741 := factory740.GetProtocol(mbTrans738) + argvalue0 := meta.NewListSpacesReq() + err742 := argvalue0.Read(context.Background(), jsProt741) + if err742 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSpaces(context.Background(), value0)) + fmt.Print("\n") + break + case "alterSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterSpace requires 1 args") + flag.Usage() + } + arg743 := flag.Arg(1) + mbTrans744 := thrift.NewTMemoryBufferLen(len(arg743)) + defer mbTrans744.Close() + _, err745 := mbTrans744.WriteString(arg743) + if err745 != nil { + Usage() + return + } + factory746 := thrift.NewTJSONProtocolFactory() + jsProt747 := factory746.GetProtocol(mbTrans744) + argvalue0 := meta.NewAlterSpaceReq() + err748 := argvalue0.Read(context.Background(), jsProt747) + if err748 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterSpace(context.Background(), value0)) + fmt.Print("\n") + break + case "createSpaceAs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSpaceAs requires 1 args") + flag.Usage() + } + arg749 := flag.Arg(1) + mbTrans750 := thrift.NewTMemoryBufferLen(len(arg749)) + defer mbTrans750.Close() + _, err751 := mbTrans750.WriteString(arg749) + if err751 != nil { + Usage() + return + } + factory752 := thrift.NewTJSONProtocolFactory() + jsProt753 := factory752.GetProtocol(mbTrans750) + argvalue0 := meta.NewCreateSpaceAsReq() + err754 := argvalue0.Read(context.Background(), jsProt753) + if err754 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSpaceAs(context.Background(), value0)) + fmt.Print("\n") + break + case "createTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTag requires 1 args") + flag.Usage() + } + arg755 := flag.Arg(1) + mbTrans756 := thrift.NewTMemoryBufferLen(len(arg755)) + defer mbTrans756.Close() + _, err757 := mbTrans756.WriteString(arg755) + if err757 != nil { + Usage() + return + } + factory758 := thrift.NewTJSONProtocolFactory() + jsProt759 := factory758.GetProtocol(mbTrans756) + argvalue0 := meta.NewCreateTagReq() + err760 := argvalue0.Read(context.Background(), jsProt759) + if err760 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTag(context.Background(), value0)) + fmt.Print("\n") + break + case "alterTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterTag requires 1 args") + flag.Usage() + } + arg761 := flag.Arg(1) + mbTrans762 := thrift.NewTMemoryBufferLen(len(arg761)) + defer mbTrans762.Close() + _, err763 := mbTrans762.WriteString(arg761) + if err763 != nil { + Usage() + return + } + factory764 := thrift.NewTJSONProtocolFactory() + jsProt765 := factory764.GetProtocol(mbTrans762) + argvalue0 := meta.NewAlterTagReq() + err766 := argvalue0.Read(context.Background(), jsProt765) + if err766 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterTag(context.Background(), value0)) + fmt.Print("\n") + break + case "dropTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTag requires 1 args") + flag.Usage() + } + arg767 := flag.Arg(1) + mbTrans768 := thrift.NewTMemoryBufferLen(len(arg767)) + defer mbTrans768.Close() + _, err769 := mbTrans768.WriteString(arg767) + if err769 != nil { + Usage() + return + } + factory770 := thrift.NewTJSONProtocolFactory() + jsProt771 := factory770.GetProtocol(mbTrans768) + argvalue0 := meta.NewDropTagReq() + err772 := argvalue0.Read(context.Background(), jsProt771) + if err772 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTag(context.Background(), value0)) + fmt.Print("\n") + break + case "getTag": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTag requires 1 args") + flag.Usage() + } + arg773 := flag.Arg(1) + mbTrans774 := thrift.NewTMemoryBufferLen(len(arg773)) + defer mbTrans774.Close() + _, err775 := mbTrans774.WriteString(arg773) + if err775 != nil { + Usage() + return + } + factory776 := thrift.NewTJSONProtocolFactory() + jsProt777 := factory776.GetProtocol(mbTrans774) + argvalue0 := meta.NewGetTagReq() + err778 := argvalue0.Read(context.Background(), jsProt777) + if err778 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTag(context.Background(), value0)) + fmt.Print("\n") + break + case "listTags": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTags requires 1 args") + flag.Usage() + } + arg779 := flag.Arg(1) + mbTrans780 := thrift.NewTMemoryBufferLen(len(arg779)) + defer mbTrans780.Close() + _, err781 := mbTrans780.WriteString(arg779) + if err781 != nil { + Usage() + return + } + factory782 := thrift.NewTJSONProtocolFactory() + jsProt783 := factory782.GetProtocol(mbTrans780) + argvalue0 := meta.NewListTagsReq() + err784 := argvalue0.Read(context.Background(), jsProt783) + if err784 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTags(context.Background(), value0)) + fmt.Print("\n") + break + case "createEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdge requires 1 args") + flag.Usage() + } + arg785 := flag.Arg(1) + mbTrans786 := thrift.NewTMemoryBufferLen(len(arg785)) + defer mbTrans786.Close() + _, err787 := mbTrans786.WriteString(arg785) + if err787 != nil { + Usage() + return + } + factory788 := thrift.NewTJSONProtocolFactory() + jsProt789 := factory788.GetProtocol(mbTrans786) + argvalue0 := meta.NewCreateEdgeReq() + err790 := argvalue0.Read(context.Background(), jsProt789) + if err790 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "alterEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterEdge requires 1 args") + flag.Usage() + } + arg791 := flag.Arg(1) + mbTrans792 := thrift.NewTMemoryBufferLen(len(arg791)) + defer mbTrans792.Close() + _, err793 := mbTrans792.WriteString(arg791) + if err793 != nil { + Usage() + return + } + factory794 := thrift.NewTJSONProtocolFactory() + jsProt795 := factory794.GetProtocol(mbTrans792) + argvalue0 := meta.NewAlterEdgeReq() + err796 := argvalue0.Read(context.Background(), jsProt795) + if err796 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "dropEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdge requires 1 args") + flag.Usage() + } + arg797 := flag.Arg(1) + mbTrans798 := thrift.NewTMemoryBufferLen(len(arg797)) + defer mbTrans798.Close() + _, err799 := mbTrans798.WriteString(arg797) + if err799 != nil { + Usage() + return + } + factory800 := thrift.NewTJSONProtocolFactory() + jsProt801 := factory800.GetProtocol(mbTrans798) + argvalue0 := meta.NewDropEdgeReq() + err802 := argvalue0.Read(context.Background(), jsProt801) + if err802 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "getEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdge requires 1 args") + flag.Usage() + } + arg803 := flag.Arg(1) + mbTrans804 := thrift.NewTMemoryBufferLen(len(arg803)) + defer mbTrans804.Close() + _, err805 := mbTrans804.WriteString(arg803) + if err805 != nil { + Usage() + return + } + factory806 := thrift.NewTJSONProtocolFactory() + jsProt807 := factory806.GetProtocol(mbTrans804) + argvalue0 := meta.NewGetEdgeReq() + err808 := argvalue0.Read(context.Background(), jsProt807) + if err808 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "listEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdges requires 1 args") + flag.Usage() + } + arg809 := flag.Arg(1) + mbTrans810 := thrift.NewTMemoryBufferLen(len(arg809)) + defer mbTrans810.Close() + _, err811 := mbTrans810.WriteString(arg809) + if err811 != nil { + Usage() + return + } + factory812 := thrift.NewTJSONProtocolFactory() + jsProt813 := factory812.GetProtocol(mbTrans810) + argvalue0 := meta.NewListEdgesReq() + err814 := argvalue0.Read(context.Background(), jsProt813) + if err814 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdges(context.Background(), value0)) + fmt.Print("\n") + break + case "addHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHosts requires 1 args") + flag.Usage() + } + arg815 := flag.Arg(1) + mbTrans816 := thrift.NewTMemoryBufferLen(len(arg815)) + defer mbTrans816.Close() + _, err817 := mbTrans816.WriteString(arg815) + if err817 != nil { + Usage() + return + } + factory818 := thrift.NewTJSONProtocolFactory() + jsProt819 := factory818.GetProtocol(mbTrans816) + argvalue0 := meta.NewAddHostsReq() + err820 := argvalue0.Read(context.Background(), jsProt819) + if err820 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHosts(context.Background(), value0)) + fmt.Print("\n") + break + case "addHostsIntoZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddHostsIntoZone requires 1 args") + flag.Usage() + } + arg821 := flag.Arg(1) + mbTrans822 := thrift.NewTMemoryBufferLen(len(arg821)) + defer mbTrans822.Close() + _, err823 := mbTrans822.WriteString(arg821) + if err823 != nil { + Usage() + return + } + factory824 := thrift.NewTJSONProtocolFactory() + jsProt825 := factory824.GetProtocol(mbTrans822) + argvalue0 := meta.NewAddHostsIntoZoneReq() + err826 := argvalue0.Read(context.Background(), jsProt825) + if err826 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddHostsIntoZone(context.Background(), value0)) + fmt.Print("\n") + break + case "dropHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropHosts requires 1 args") + flag.Usage() + } + arg827 := flag.Arg(1) + mbTrans828 := thrift.NewTMemoryBufferLen(len(arg827)) + defer mbTrans828.Close() + _, err829 := mbTrans828.WriteString(arg827) + if err829 != nil { + Usage() + return + } + factory830 := thrift.NewTJSONProtocolFactory() + jsProt831 := factory830.GetProtocol(mbTrans828) + argvalue0 := meta.NewDropHostsReq() + err832 := argvalue0.Read(context.Background(), jsProt831) + if err832 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropHosts(context.Background(), value0)) + fmt.Print("\n") + break + case "listHosts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListHosts requires 1 args") + flag.Usage() + } + arg833 := flag.Arg(1) + mbTrans834 := thrift.NewTMemoryBufferLen(len(arg833)) + defer mbTrans834.Close() + _, err835 := mbTrans834.WriteString(arg833) + if err835 != nil { + Usage() + return + } + factory836 := thrift.NewTJSONProtocolFactory() + jsProt837 := factory836.GetProtocol(mbTrans834) + argvalue0 := meta.NewListHostsReq() + err838 := argvalue0.Read(context.Background(), jsProt837) + if err838 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListHosts(context.Background(), value0)) + fmt.Print("\n") + break + case "getPartsAlloc": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetPartsAlloc requires 1 args") + flag.Usage() + } + arg839 := flag.Arg(1) + mbTrans840 := thrift.NewTMemoryBufferLen(len(arg839)) + defer mbTrans840.Close() + _, err841 := mbTrans840.WriteString(arg839) + if err841 != nil { + Usage() + return + } + factory842 := thrift.NewTJSONProtocolFactory() + jsProt843 := factory842.GetProtocol(mbTrans840) + argvalue0 := meta.NewGetPartsAllocReq() + err844 := argvalue0.Read(context.Background(), jsProt843) + if err844 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetPartsAlloc(context.Background(), value0)) + fmt.Print("\n") + break + case "listParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListParts requires 1 args") + flag.Usage() + } + arg845 := flag.Arg(1) + mbTrans846 := thrift.NewTMemoryBufferLen(len(arg845)) + defer mbTrans846.Close() + _, err847 := mbTrans846.WriteString(arg845) + if err847 != nil { + Usage() + return + } + factory848 := thrift.NewTJSONProtocolFactory() + jsProt849 := factory848.GetProtocol(mbTrans846) + argvalue0 := meta.NewListPartsReq() + err850 := argvalue0.Read(context.Background(), jsProt849) + if err850 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListParts(context.Background(), value0)) + fmt.Print("\n") + break + case "getWorkerId": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetWorkerId requires 1 args") + flag.Usage() + } + arg851 := flag.Arg(1) + mbTrans852 := thrift.NewTMemoryBufferLen(len(arg851)) + defer mbTrans852.Close() + _, err853 := mbTrans852.WriteString(arg851) + if err853 != nil { + Usage() + return + } + factory854 := thrift.NewTJSONProtocolFactory() + jsProt855 := factory854.GetProtocol(mbTrans852) + argvalue0 := meta.NewGetWorkerIdReq() + err856 := argvalue0.Read(context.Background(), jsProt855) + if err856 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetWorkerId(context.Background(), value0)) + fmt.Print("\n") + break + case "createTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateTagIndex requires 1 args") + flag.Usage() + } + arg857 := flag.Arg(1) + mbTrans858 := thrift.NewTMemoryBufferLen(len(arg857)) + defer mbTrans858.Close() + _, err859 := mbTrans858.WriteString(arg857) + if err859 != nil { + Usage() + return + } + factory860 := thrift.NewTJSONProtocolFactory() + jsProt861 := factory860.GetProtocol(mbTrans858) + argvalue0 := meta.NewCreateTagIndexReq() + err862 := argvalue0.Read(context.Background(), jsProt861) + if err862 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateTagIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "dropTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropTagIndex requires 1 args") + flag.Usage() + } + arg863 := flag.Arg(1) + mbTrans864 := thrift.NewTMemoryBufferLen(len(arg863)) + defer mbTrans864.Close() + _, err865 := mbTrans864.WriteString(arg863) + if err865 != nil { + Usage() + return + } + factory866 := thrift.NewTJSONProtocolFactory() + jsProt867 := factory866.GetProtocol(mbTrans864) + argvalue0 := meta.NewDropTagIndexReq() + err868 := argvalue0.Read(context.Background(), jsProt867) + if err868 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropTagIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "getTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetTagIndex requires 1 args") + flag.Usage() + } + arg869 := flag.Arg(1) + mbTrans870 := thrift.NewTMemoryBufferLen(len(arg869)) + defer mbTrans870.Close() + _, err871 := mbTrans870.WriteString(arg869) + if err871 != nil { + Usage() + return + } + factory872 := thrift.NewTJSONProtocolFactory() + jsProt873 := factory872.GetProtocol(mbTrans870) + argvalue0 := meta.NewGetTagIndexReq() + err874 := argvalue0.Read(context.Background(), jsProt873) + if err874 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetTagIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "listTagIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexes requires 1 args") + flag.Usage() + } + arg875 := flag.Arg(1) + mbTrans876 := thrift.NewTMemoryBufferLen(len(arg875)) + defer mbTrans876.Close() + _, err877 := mbTrans876.WriteString(arg875) + if err877 != nil { + Usage() + return + } + factory878 := thrift.NewTJSONProtocolFactory() + jsProt879 := factory878.GetProtocol(mbTrans876) + argvalue0 := meta.NewListTagIndexesReq() + err880 := argvalue0.Read(context.Background(), jsProt879) + if err880 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexes(context.Background(), value0)) + fmt.Print("\n") + break + case "rebuildTagIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildTagIndex requires 1 args") + flag.Usage() + } + arg881 := flag.Arg(1) + mbTrans882 := thrift.NewTMemoryBufferLen(len(arg881)) + defer mbTrans882.Close() + _, err883 := mbTrans882.WriteString(arg881) + if err883 != nil { + Usage() + return + } + factory884 := thrift.NewTJSONProtocolFactory() + jsProt885 := factory884.GetProtocol(mbTrans882) + argvalue0 := meta.NewRebuildIndexReq() + err886 := argvalue0.Read(context.Background(), jsProt885) + if err886 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildTagIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "listTagIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListTagIndexStatus requires 1 args") + flag.Usage() + } + arg887 := flag.Arg(1) + mbTrans888 := thrift.NewTMemoryBufferLen(len(arg887)) + defer mbTrans888.Close() + _, err889 := mbTrans888.WriteString(arg887) + if err889 != nil { + Usage() + return + } + factory890 := thrift.NewTJSONProtocolFactory() + jsProt891 := factory890.GetProtocol(mbTrans888) + argvalue0 := meta.NewListIndexStatusReq() + err892 := argvalue0.Read(context.Background(), jsProt891) + if err892 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListTagIndexStatus(context.Background(), value0)) + fmt.Print("\n") + break + case "createEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateEdgeIndex requires 1 args") + flag.Usage() + } + arg893 := flag.Arg(1) + mbTrans894 := thrift.NewTMemoryBufferLen(len(arg893)) + defer mbTrans894.Close() + _, err895 := mbTrans894.WriteString(arg893) + if err895 != nil { + Usage() + return + } + factory896 := thrift.NewTJSONProtocolFactory() + jsProt897 := factory896.GetProtocol(mbTrans894) + argvalue0 := meta.NewCreateEdgeIndexReq() + err898 := argvalue0.Read(context.Background(), jsProt897) + if err898 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateEdgeIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "dropEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropEdgeIndex requires 1 args") + flag.Usage() + } + arg899 := flag.Arg(1) + mbTrans900 := thrift.NewTMemoryBufferLen(len(arg899)) + defer mbTrans900.Close() + _, err901 := mbTrans900.WriteString(arg899) + if err901 != nil { + Usage() + return + } + factory902 := thrift.NewTJSONProtocolFactory() + jsProt903 := factory902.GetProtocol(mbTrans900) + argvalue0 := meta.NewDropEdgeIndexReq() + err904 := argvalue0.Read(context.Background(), jsProt903) + if err904 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropEdgeIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "getEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetEdgeIndex requires 1 args") + flag.Usage() + } + arg905 := flag.Arg(1) + mbTrans906 := thrift.NewTMemoryBufferLen(len(arg905)) + defer mbTrans906.Close() + _, err907 := mbTrans906.WriteString(arg905) + if err907 != nil { + Usage() + return + } + factory908 := thrift.NewTJSONProtocolFactory() + jsProt909 := factory908.GetProtocol(mbTrans906) + argvalue0 := meta.NewGetEdgeIndexReq() + err910 := argvalue0.Read(context.Background(), jsProt909) + if err910 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetEdgeIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "listEdgeIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexes requires 1 args") + flag.Usage() + } + arg911 := flag.Arg(1) + mbTrans912 := thrift.NewTMemoryBufferLen(len(arg911)) + defer mbTrans912.Close() + _, err913 := mbTrans912.WriteString(arg911) + if err913 != nil { + Usage() + return + } + factory914 := thrift.NewTJSONProtocolFactory() + jsProt915 := factory914.GetProtocol(mbTrans912) + argvalue0 := meta.NewListEdgeIndexesReq() + err916 := argvalue0.Read(context.Background(), jsProt915) + if err916 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexes(context.Background(), value0)) + fmt.Print("\n") + break + case "rebuildEdgeIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RebuildEdgeIndex requires 1 args") + flag.Usage() + } + arg917 := flag.Arg(1) + mbTrans918 := thrift.NewTMemoryBufferLen(len(arg917)) + defer mbTrans918.Close() + _, err919 := mbTrans918.WriteString(arg917) + if err919 != nil { + Usage() + return + } + factory920 := thrift.NewTJSONProtocolFactory() + jsProt921 := factory920.GetProtocol(mbTrans918) + argvalue0 := meta.NewRebuildIndexReq() + err922 := argvalue0.Read(context.Background(), jsProt921) + if err922 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RebuildEdgeIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "listEdgeIndexStatus": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListEdgeIndexStatus requires 1 args") + flag.Usage() + } + arg923 := flag.Arg(1) + mbTrans924 := thrift.NewTMemoryBufferLen(len(arg923)) + defer mbTrans924.Close() + _, err925 := mbTrans924.WriteString(arg923) + if err925 != nil { + Usage() + return + } + factory926 := thrift.NewTJSONProtocolFactory() + jsProt927 := factory926.GetProtocol(mbTrans924) + argvalue0 := meta.NewListIndexStatusReq() + err928 := argvalue0.Read(context.Background(), jsProt927) + if err928 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListEdgeIndexStatus(context.Background(), value0)) + fmt.Print("\n") + break + case "createUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateUser requires 1 args") + flag.Usage() + } + arg929 := flag.Arg(1) + mbTrans930 := thrift.NewTMemoryBufferLen(len(arg929)) + defer mbTrans930.Close() + _, err931 := mbTrans930.WriteString(arg929) + if err931 != nil { + Usage() + return + } + factory932 := thrift.NewTJSONProtocolFactory() + jsProt933 := factory932.GetProtocol(mbTrans930) + argvalue0 := meta.NewCreateUserReq() + err934 := argvalue0.Read(context.Background(), jsProt933) + if err934 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateUser(context.Background(), value0)) + fmt.Print("\n") + break + case "dropUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropUser requires 1 args") + flag.Usage() + } + arg935 := flag.Arg(1) + mbTrans936 := thrift.NewTMemoryBufferLen(len(arg935)) + defer mbTrans936.Close() + _, err937 := mbTrans936.WriteString(arg935) + if err937 != nil { + Usage() + return + } + factory938 := thrift.NewTJSONProtocolFactory() + jsProt939 := factory938.GetProtocol(mbTrans936) + argvalue0 := meta.NewDropUserReq() + err940 := argvalue0.Read(context.Background(), jsProt939) + if err940 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropUser(context.Background(), value0)) + fmt.Print("\n") + break + case "alterUser": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AlterUser requires 1 args") + flag.Usage() + } + arg941 := flag.Arg(1) + mbTrans942 := thrift.NewTMemoryBufferLen(len(arg941)) + defer mbTrans942.Close() + _, err943 := mbTrans942.WriteString(arg941) + if err943 != nil { + Usage() + return + } + factory944 := thrift.NewTJSONProtocolFactory() + jsProt945 := factory944.GetProtocol(mbTrans942) + argvalue0 := meta.NewAlterUserReq() + err946 := argvalue0.Read(context.Background(), jsProt945) + if err946 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AlterUser(context.Background(), value0)) + fmt.Print("\n") + break + case "grantRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GrantRole requires 1 args") + flag.Usage() + } + arg947 := flag.Arg(1) + mbTrans948 := thrift.NewTMemoryBufferLen(len(arg947)) + defer mbTrans948.Close() + _, err949 := mbTrans948.WriteString(arg947) + if err949 != nil { + Usage() + return + } + factory950 := thrift.NewTJSONProtocolFactory() + jsProt951 := factory950.GetProtocol(mbTrans948) + argvalue0 := meta.NewGrantRoleReq() + err952 := argvalue0.Read(context.Background(), jsProt951) + if err952 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GrantRole(context.Background(), value0)) + fmt.Print("\n") + break + case "revokeRole": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RevokeRole requires 1 args") + flag.Usage() + } + arg953 := flag.Arg(1) + mbTrans954 := thrift.NewTMemoryBufferLen(len(arg953)) + defer mbTrans954.Close() + _, err955 := mbTrans954.WriteString(arg953) + if err955 != nil { + Usage() + return + } + factory956 := thrift.NewTJSONProtocolFactory() + jsProt957 := factory956.GetProtocol(mbTrans954) + argvalue0 := meta.NewRevokeRoleReq() + err958 := argvalue0.Read(context.Background(), jsProt957) + if err958 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RevokeRole(context.Background(), value0)) + fmt.Print("\n") + break + case "listUsers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListUsers requires 1 args") + flag.Usage() + } + arg959 := flag.Arg(1) + mbTrans960 := thrift.NewTMemoryBufferLen(len(arg959)) + defer mbTrans960.Close() + _, err961 := mbTrans960.WriteString(arg959) + if err961 != nil { + Usage() + return + } + factory962 := thrift.NewTJSONProtocolFactory() + jsProt963 := factory962.GetProtocol(mbTrans960) + argvalue0 := meta.NewListUsersReq() + err964 := argvalue0.Read(context.Background(), jsProt963) + if err964 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListUsers(context.Background(), value0)) + fmt.Print("\n") + break + case "listRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListRoles requires 1 args") + flag.Usage() + } + arg965 := flag.Arg(1) + mbTrans966 := thrift.NewTMemoryBufferLen(len(arg965)) + defer mbTrans966.Close() + _, err967 := mbTrans966.WriteString(arg965) + if err967 != nil { + Usage() + return + } + factory968 := thrift.NewTJSONProtocolFactory() + jsProt969 := factory968.GetProtocol(mbTrans966) + argvalue0 := meta.NewListRolesReq() + err970 := argvalue0.Read(context.Background(), jsProt969) + if err970 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListRoles(context.Background(), value0)) + fmt.Print("\n") + break + case "getUserRoles": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUserRoles requires 1 args") + flag.Usage() + } + arg971 := flag.Arg(1) + mbTrans972 := thrift.NewTMemoryBufferLen(len(arg971)) + defer mbTrans972.Close() + _, err973 := mbTrans972.WriteString(arg971) + if err973 != nil { + Usage() + return + } + factory974 := thrift.NewTJSONProtocolFactory() + jsProt975 := factory974.GetProtocol(mbTrans972) + argvalue0 := meta.NewGetUserRolesReq() + err976 := argvalue0.Read(context.Background(), jsProt975) + if err976 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUserRoles(context.Background(), value0)) + fmt.Print("\n") + break + case "changePassword": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChangePassword requires 1 args") + flag.Usage() + } + arg977 := flag.Arg(1) + mbTrans978 := thrift.NewTMemoryBufferLen(len(arg977)) + defer mbTrans978.Close() + _, err979 := mbTrans978.WriteString(arg977) + if err979 != nil { + Usage() + return + } + factory980 := thrift.NewTJSONProtocolFactory() + jsProt981 := factory980.GetProtocol(mbTrans978) + argvalue0 := meta.NewChangePasswordReq() + err982 := argvalue0.Read(context.Background(), jsProt981) + if err982 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChangePassword(context.Background(), value0)) + fmt.Print("\n") + break + case "heartBeat": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "HeartBeat requires 1 args") + flag.Usage() + } + arg983 := flag.Arg(1) + mbTrans984 := thrift.NewTMemoryBufferLen(len(arg983)) + defer mbTrans984.Close() + _, err985 := mbTrans984.WriteString(arg983) + if err985 != nil { + Usage() + return + } + factory986 := thrift.NewTJSONProtocolFactory() + jsProt987 := factory986.GetProtocol(mbTrans984) + argvalue0 := meta.NewHBReq() + err988 := argvalue0.Read(context.Background(), jsProt987) + if err988 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.HeartBeat(context.Background(), value0)) + fmt.Print("\n") + break + case "agentHeartbeat": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AgentHeartbeat requires 1 args") + flag.Usage() + } + arg989 := flag.Arg(1) + mbTrans990 := thrift.NewTMemoryBufferLen(len(arg989)) + defer mbTrans990.Close() + _, err991 := mbTrans990.WriteString(arg989) + if err991 != nil { + Usage() + return + } + factory992 := thrift.NewTJSONProtocolFactory() + jsProt993 := factory992.GetProtocol(mbTrans990) + argvalue0 := meta.NewAgentHBReq() + err994 := argvalue0.Read(context.Background(), jsProt993) + if err994 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AgentHeartbeat(context.Background(), value0)) + fmt.Print("\n") + break + case "regConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RegConfig requires 1 args") + flag.Usage() + } + arg995 := flag.Arg(1) + mbTrans996 := thrift.NewTMemoryBufferLen(len(arg995)) + defer mbTrans996.Close() + _, err997 := mbTrans996.WriteString(arg995) + if err997 != nil { + Usage() + return + } + factory998 := thrift.NewTJSONProtocolFactory() + jsProt999 := factory998.GetProtocol(mbTrans996) + argvalue0 := meta.NewRegConfigReq() + err1000 := argvalue0.Read(context.Background(), jsProt999) + if err1000 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RegConfig(context.Background(), value0)) + fmt.Print("\n") + break + case "getConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetConfig requires 1 args") + flag.Usage() + } + arg1001 := flag.Arg(1) + mbTrans1002 := thrift.NewTMemoryBufferLen(len(arg1001)) + defer mbTrans1002.Close() + _, err1003 := mbTrans1002.WriteString(arg1001) + if err1003 != nil { + Usage() + return + } + factory1004 := thrift.NewTJSONProtocolFactory() + jsProt1005 := factory1004.GetProtocol(mbTrans1002) + argvalue0 := meta.NewGetConfigReq() + err1006 := argvalue0.Read(context.Background(), jsProt1005) + if err1006 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetConfig(context.Background(), value0)) + fmt.Print("\n") + break + case "setConfig": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SetConfig requires 1 args") + flag.Usage() + } + arg1007 := flag.Arg(1) + mbTrans1008 := thrift.NewTMemoryBufferLen(len(arg1007)) + defer mbTrans1008.Close() + _, err1009 := mbTrans1008.WriteString(arg1007) + if err1009 != nil { + Usage() + return + } + factory1010 := thrift.NewTJSONProtocolFactory() + jsProt1011 := factory1010.GetProtocol(mbTrans1008) + argvalue0 := meta.NewSetConfigReq() + err1012 := argvalue0.Read(context.Background(), jsProt1011) + if err1012 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SetConfig(context.Background(), value0)) + fmt.Print("\n") + break + case "listConfigs": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListConfigs requires 1 args") + flag.Usage() + } + arg1013 := flag.Arg(1) + mbTrans1014 := thrift.NewTMemoryBufferLen(len(arg1013)) + defer mbTrans1014.Close() + _, err1015 := mbTrans1014.WriteString(arg1013) + if err1015 != nil { + Usage() + return + } + factory1016 := thrift.NewTJSONProtocolFactory() + jsProt1017 := factory1016.GetProtocol(mbTrans1014) + argvalue0 := meta.NewListConfigsReq() + err1018 := argvalue0.Read(context.Background(), jsProt1017) + if err1018 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListConfigs(context.Background(), value0)) + fmt.Print("\n") + break + case "createSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSnapshot requires 1 args") + flag.Usage() + } + arg1019 := flag.Arg(1) + mbTrans1020 := thrift.NewTMemoryBufferLen(len(arg1019)) + defer mbTrans1020.Close() + _, err1021 := mbTrans1020.WriteString(arg1019) + if err1021 != nil { + Usage() + return + } + factory1022 := thrift.NewTJSONProtocolFactory() + jsProt1023 := factory1022.GetProtocol(mbTrans1020) + argvalue0 := meta.NewCreateSnapshotReq() + err1024 := argvalue0.Read(context.Background(), jsProt1023) + if err1024 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSnapshot(context.Background(), value0)) + fmt.Print("\n") + break + case "dropSnapshot": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropSnapshot requires 1 args") + flag.Usage() + } + arg1025 := flag.Arg(1) + mbTrans1026 := thrift.NewTMemoryBufferLen(len(arg1025)) + defer mbTrans1026.Close() + _, err1027 := mbTrans1026.WriteString(arg1025) + if err1027 != nil { + Usage() + return + } + factory1028 := thrift.NewTJSONProtocolFactory() + jsProt1029 := factory1028.GetProtocol(mbTrans1026) + argvalue0 := meta.NewDropSnapshotReq() + err1030 := argvalue0.Read(context.Background(), jsProt1029) + if err1030 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropSnapshot(context.Background(), value0)) + fmt.Print("\n") + break + case "listSnapshots": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSnapshots requires 1 args") + flag.Usage() + } + arg1031 := flag.Arg(1) + mbTrans1032 := thrift.NewTMemoryBufferLen(len(arg1031)) + defer mbTrans1032.Close() + _, err1033 := mbTrans1032.WriteString(arg1031) + if err1033 != nil { + Usage() + return + } + factory1034 := thrift.NewTJSONProtocolFactory() + jsProt1035 := factory1034.GetProtocol(mbTrans1032) + argvalue0 := meta.NewListSnapshotsReq() + err1036 := argvalue0.Read(context.Background(), jsProt1035) + if err1036 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSnapshots(context.Background(), value0)) + fmt.Print("\n") + break + case "runAdminJob": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RunAdminJob requires 1 args") + flag.Usage() + } + arg1037 := flag.Arg(1) + mbTrans1038 := thrift.NewTMemoryBufferLen(len(arg1037)) + defer mbTrans1038.Close() + _, err1039 := mbTrans1038.WriteString(arg1037) + if err1039 != nil { + Usage() + return + } + factory1040 := thrift.NewTJSONProtocolFactory() + jsProt1041 := factory1040.GetProtocol(mbTrans1038) + argvalue0 := meta.NewAdminJobReq() + err1042 := argvalue0.Read(context.Background(), jsProt1041) + if err1042 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RunAdminJob(context.Background(), value0)) + fmt.Print("\n") + break + case "mergeZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MergeZone requires 1 args") + flag.Usage() + } + arg1043 := flag.Arg(1) + mbTrans1044 := thrift.NewTMemoryBufferLen(len(arg1043)) + defer mbTrans1044.Close() + _, err1045 := mbTrans1044.WriteString(arg1043) + if err1045 != nil { + Usage() + return + } + factory1046 := thrift.NewTJSONProtocolFactory() + jsProt1047 := factory1046.GetProtocol(mbTrans1044) + argvalue0 := meta.NewMergeZoneReq() + err1048 := argvalue0.Read(context.Background(), jsProt1047) + if err1048 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MergeZone(context.Background(), value0)) + fmt.Print("\n") + break + case "dropZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropZone requires 1 args") + flag.Usage() + } + arg1049 := flag.Arg(1) + mbTrans1050 := thrift.NewTMemoryBufferLen(len(arg1049)) + defer mbTrans1050.Close() + _, err1051 := mbTrans1050.WriteString(arg1049) + if err1051 != nil { + Usage() + return + } + factory1052 := thrift.NewTJSONProtocolFactory() + jsProt1053 := factory1052.GetProtocol(mbTrans1050) + argvalue0 := meta.NewDropZoneReq() + err1054 := argvalue0.Read(context.Background(), jsProt1053) + if err1054 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropZone(context.Background(), value0)) + fmt.Print("\n") + break + case "divideZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DivideZone requires 1 args") + flag.Usage() + } + arg1055 := flag.Arg(1) + mbTrans1056 := thrift.NewTMemoryBufferLen(len(arg1055)) + defer mbTrans1056.Close() + _, err1057 := mbTrans1056.WriteString(arg1055) + if err1057 != nil { + Usage() + return + } + factory1058 := thrift.NewTJSONProtocolFactory() + jsProt1059 := factory1058.GetProtocol(mbTrans1056) + argvalue0 := meta.NewDivideZoneReq() + err1060 := argvalue0.Read(context.Background(), jsProt1059) + if err1060 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DivideZone(context.Background(), value0)) + fmt.Print("\n") + break + case "renameZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RenameZone requires 1 args") + flag.Usage() + } + arg1061 := flag.Arg(1) + mbTrans1062 := thrift.NewTMemoryBufferLen(len(arg1061)) + defer mbTrans1062.Close() + _, err1063 := mbTrans1062.WriteString(arg1061) + if err1063 != nil { + Usage() + return + } + factory1064 := thrift.NewTJSONProtocolFactory() + jsProt1065 := factory1064.GetProtocol(mbTrans1062) + argvalue0 := meta.NewRenameZoneReq() + err1066 := argvalue0.Read(context.Background(), jsProt1065) + if err1066 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RenameZone(context.Background(), value0)) + fmt.Print("\n") + break + case "getZone": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetZone requires 1 args") + flag.Usage() + } + arg1067 := flag.Arg(1) + mbTrans1068 := thrift.NewTMemoryBufferLen(len(arg1067)) + defer mbTrans1068.Close() + _, err1069 := mbTrans1068.WriteString(arg1067) + if err1069 != nil { + Usage() + return + } + factory1070 := thrift.NewTJSONProtocolFactory() + jsProt1071 := factory1070.GetProtocol(mbTrans1068) + argvalue0 := meta.NewGetZoneReq() + err1072 := argvalue0.Read(context.Background(), jsProt1071) + if err1072 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetZone(context.Background(), value0)) + fmt.Print("\n") + break + case "listZones": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListZones requires 1 args") + flag.Usage() + } + arg1073 := flag.Arg(1) + mbTrans1074 := thrift.NewTMemoryBufferLen(len(arg1073)) + defer mbTrans1074.Close() + _, err1075 := mbTrans1074.WriteString(arg1073) + if err1075 != nil { + Usage() + return + } + factory1076 := thrift.NewTJSONProtocolFactory() + jsProt1077 := factory1076.GetProtocol(mbTrans1074) + argvalue0 := meta.NewListZonesReq() + err1078 := argvalue0.Read(context.Background(), jsProt1077) + if err1078 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListZones(context.Background(), value0)) + fmt.Print("\n") + break + case "addListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddListener requires 1 args") + flag.Usage() + } + arg1079 := flag.Arg(1) + mbTrans1080 := thrift.NewTMemoryBufferLen(len(arg1079)) + defer mbTrans1080.Close() + _, err1081 := mbTrans1080.WriteString(arg1079) + if err1081 != nil { + Usage() + return + } + factory1082 := thrift.NewTJSONProtocolFactory() + jsProt1083 := factory1082.GetProtocol(mbTrans1080) + argvalue0 := meta.NewAddListenerReq() + err1084 := argvalue0.Read(context.Background(), jsProt1083) + if err1084 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddListener(context.Background(), value0)) + fmt.Print("\n") + break + case "removeListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveListener requires 1 args") + flag.Usage() + } + arg1085 := flag.Arg(1) + mbTrans1086 := thrift.NewTMemoryBufferLen(len(arg1085)) + defer mbTrans1086.Close() + _, err1087 := mbTrans1086.WriteString(arg1085) + if err1087 != nil { + Usage() + return + } + factory1088 := thrift.NewTJSONProtocolFactory() + jsProt1089 := factory1088.GetProtocol(mbTrans1086) + argvalue0 := meta.NewRemoveListenerReq() + err1090 := argvalue0.Read(context.Background(), jsProt1089) + if err1090 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveListener(context.Background(), value0)) + fmt.Print("\n") + break + case "listListener": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListListener requires 1 args") + flag.Usage() + } + arg1091 := flag.Arg(1) + mbTrans1092 := thrift.NewTMemoryBufferLen(len(arg1091)) + defer mbTrans1092.Close() + _, err1093 := mbTrans1092.WriteString(arg1091) + if err1093 != nil { + Usage() + return + } + factory1094 := thrift.NewTJSONProtocolFactory() + jsProt1095 := factory1094.GetProtocol(mbTrans1092) + argvalue0 := meta.NewListListenerReq() + err1096 := argvalue0.Read(context.Background(), jsProt1095) + if err1096 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListListener(context.Background(), value0)) + fmt.Print("\n") + break + case "getStats": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetStats requires 1 args") + flag.Usage() + } + arg1097 := flag.Arg(1) + mbTrans1098 := thrift.NewTMemoryBufferLen(len(arg1097)) + defer mbTrans1098.Close() + _, err1099 := mbTrans1098.WriteString(arg1097) + if err1099 != nil { + Usage() + return + } + factory1100 := thrift.NewTJSONProtocolFactory() + jsProt1101 := factory1100.GetProtocol(mbTrans1098) + argvalue0 := meta.NewGetStatsReq() + err1102 := argvalue0.Read(context.Background(), jsProt1101) + if err1102 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetStats(context.Background(), value0)) + fmt.Print("\n") + break + case "signInService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignInService requires 1 args") + flag.Usage() + } + arg1103 := flag.Arg(1) + mbTrans1104 := thrift.NewTMemoryBufferLen(len(arg1103)) + defer mbTrans1104.Close() + _, err1105 := mbTrans1104.WriteString(arg1103) + if err1105 != nil { + Usage() + return + } + factory1106 := thrift.NewTJSONProtocolFactory() + jsProt1107 := factory1106.GetProtocol(mbTrans1104) + argvalue0 := meta.NewSignInServiceReq() + err1108 := argvalue0.Read(context.Background(), jsProt1107) + if err1108 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignInService(context.Background(), value0)) + fmt.Print("\n") + break + case "signOutService": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SignOutService requires 1 args") + flag.Usage() + } + arg1109 := flag.Arg(1) + mbTrans1110 := thrift.NewTMemoryBufferLen(len(arg1109)) + defer mbTrans1110.Close() + _, err1111 := mbTrans1110.WriteString(arg1109) + if err1111 != nil { + Usage() + return + } + factory1112 := thrift.NewTJSONProtocolFactory() + jsProt1113 := factory1112.GetProtocol(mbTrans1110) + argvalue0 := meta.NewSignOutServiceReq() + err1114 := argvalue0.Read(context.Background(), jsProt1113) + if err1114 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SignOutService(context.Background(), value0)) + fmt.Print("\n") + break + case "listServiceClients": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListServiceClients requires 1 args") + flag.Usage() + } + arg1115 := flag.Arg(1) + mbTrans1116 := thrift.NewTMemoryBufferLen(len(arg1115)) + defer mbTrans1116.Close() + _, err1117 := mbTrans1116.WriteString(arg1115) + if err1117 != nil { + Usage() + return + } + factory1118 := thrift.NewTJSONProtocolFactory() + jsProt1119 := factory1118.GetProtocol(mbTrans1116) + argvalue0 := meta.NewListServiceClientsReq() + err1120 := argvalue0.Read(context.Background(), jsProt1119) + if err1120 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListServiceClients(context.Background(), value0)) + fmt.Print("\n") + break + case "createFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateFTIndex requires 1 args") + flag.Usage() + } + arg1121 := flag.Arg(1) + mbTrans1122 := thrift.NewTMemoryBufferLen(len(arg1121)) + defer mbTrans1122.Close() + _, err1123 := mbTrans1122.WriteString(arg1121) + if err1123 != nil { + Usage() + return + } + factory1124 := thrift.NewTJSONProtocolFactory() + jsProt1125 := factory1124.GetProtocol(mbTrans1122) + argvalue0 := meta.NewCreateFTIndexReq() + err1126 := argvalue0.Read(context.Background(), jsProt1125) + if err1126 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateFTIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "dropFTIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropFTIndex requires 1 args") + flag.Usage() + } + arg1127 := flag.Arg(1) + mbTrans1128 := thrift.NewTMemoryBufferLen(len(arg1127)) + defer mbTrans1128.Close() + _, err1129 := mbTrans1128.WriteString(arg1127) + if err1129 != nil { + Usage() + return + } + factory1130 := thrift.NewTJSONProtocolFactory() + jsProt1131 := factory1130.GetProtocol(mbTrans1128) + argvalue0 := meta.NewDropFTIndexReq() + err1132 := argvalue0.Read(context.Background(), jsProt1131) + if err1132 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropFTIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "listFTIndexes": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListFTIndexes requires 1 args") + flag.Usage() + } + arg1133 := flag.Arg(1) + mbTrans1134 := thrift.NewTMemoryBufferLen(len(arg1133)) + defer mbTrans1134.Close() + _, err1135 := mbTrans1134.WriteString(arg1133) + if err1135 != nil { + Usage() + return + } + factory1136 := thrift.NewTJSONProtocolFactory() + jsProt1137 := factory1136.GetProtocol(mbTrans1134) + argvalue0 := meta.NewListFTIndexesReq() + err1138 := argvalue0.Read(context.Background(), jsProt1137) + if err1138 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListFTIndexes(context.Background(), value0)) + fmt.Print("\n") + break + case "createSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateSession requires 1 args") + flag.Usage() + } + arg1139 := flag.Arg(1) + mbTrans1140 := thrift.NewTMemoryBufferLen(len(arg1139)) + defer mbTrans1140.Close() + _, err1141 := mbTrans1140.WriteString(arg1139) + if err1141 != nil { + Usage() + return + } + factory1142 := thrift.NewTJSONProtocolFactory() + jsProt1143 := factory1142.GetProtocol(mbTrans1140) + argvalue0 := meta.NewCreateSessionReq() + err1144 := argvalue0.Read(context.Background(), jsProt1143) + if err1144 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateSession(context.Background(), value0)) + fmt.Print("\n") + break + case "updateSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateSessions requires 1 args") + flag.Usage() + } + arg1145 := flag.Arg(1) + mbTrans1146 := thrift.NewTMemoryBufferLen(len(arg1145)) + defer mbTrans1146.Close() + _, err1147 := mbTrans1146.WriteString(arg1145) + if err1147 != nil { + Usage() + return + } + factory1148 := thrift.NewTJSONProtocolFactory() + jsProt1149 := factory1148.GetProtocol(mbTrans1146) + argvalue0 := meta.NewUpdateSessionsReq() + err1150 := argvalue0.Read(context.Background(), jsProt1149) + if err1150 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateSessions(context.Background(), value0)) + fmt.Print("\n") + break + case "listSessions": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListSessions requires 1 args") + flag.Usage() + } + arg1151 := flag.Arg(1) + mbTrans1152 := thrift.NewTMemoryBufferLen(len(arg1151)) + defer mbTrans1152.Close() + _, err1153 := mbTrans1152.WriteString(arg1151) + if err1153 != nil { + Usage() + return + } + factory1154 := thrift.NewTJSONProtocolFactory() + jsProt1155 := factory1154.GetProtocol(mbTrans1152) + argvalue0 := meta.NewListSessionsReq() + err1156 := argvalue0.Read(context.Background(), jsProt1155) + if err1156 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListSessions(context.Background(), value0)) + fmt.Print("\n") + break + case "getSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSession requires 1 args") + flag.Usage() + } + arg1157 := flag.Arg(1) + mbTrans1158 := thrift.NewTMemoryBufferLen(len(arg1157)) + defer mbTrans1158.Close() + _, err1159 := mbTrans1158.WriteString(arg1157) + if err1159 != nil { + Usage() + return + } + factory1160 := thrift.NewTJSONProtocolFactory() + jsProt1161 := factory1160.GetProtocol(mbTrans1158) + argvalue0 := meta.NewGetSessionReq() + err1162 := argvalue0.Read(context.Background(), jsProt1161) + if err1162 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSession(context.Background(), value0)) + fmt.Print("\n") + break + case "removeSession": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemoveSession requires 1 args") + flag.Usage() + } + arg1163 := flag.Arg(1) + mbTrans1164 := thrift.NewTMemoryBufferLen(len(arg1163)) + defer mbTrans1164.Close() + _, err1165 := mbTrans1164.WriteString(arg1163) + if err1165 != nil { + Usage() + return + } + factory1166 := thrift.NewTJSONProtocolFactory() + jsProt1167 := factory1166.GetProtocol(mbTrans1164) + argvalue0 := meta.NewRemoveSessionReq() + err1168 := argvalue0.Read(context.Background(), jsProt1167) + if err1168 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemoveSession(context.Background(), value0)) + fmt.Print("\n") + break + case "killQuery": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "KillQuery requires 1 args") + flag.Usage() + } + arg1169 := flag.Arg(1) + mbTrans1170 := thrift.NewTMemoryBufferLen(len(arg1169)) + defer mbTrans1170.Close() + _, err1171 := mbTrans1170.WriteString(arg1169) + if err1171 != nil { + Usage() + return + } + factory1172 := thrift.NewTJSONProtocolFactory() + jsProt1173 := factory1172.GetProtocol(mbTrans1170) + argvalue0 := meta.NewKillQueryReq() + err1174 := argvalue0.Read(context.Background(), jsProt1173) + if err1174 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.KillQuery(context.Background(), value0)) + fmt.Print("\n") + break + case "reportTaskFinish": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ReportTaskFinish requires 1 args") + flag.Usage() + } + arg1175 := flag.Arg(1) + mbTrans1176 := thrift.NewTMemoryBufferLen(len(arg1175)) + defer mbTrans1176.Close() + _, err1177 := mbTrans1176.WriteString(arg1175) + if err1177 != nil { + Usage() + return + } + factory1178 := thrift.NewTJSONProtocolFactory() + jsProt1179 := factory1178.GetProtocol(mbTrans1176) + argvalue0 := meta.NewReportTaskReq() + err1180 := argvalue0.Read(context.Background(), jsProt1179) + if err1180 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ReportTaskFinish(context.Background(), value0)) + fmt.Print("\n") + break + case "createBackup": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateBackup requires 1 args") + flag.Usage() + } + arg1181 := flag.Arg(1) + mbTrans1182 := thrift.NewTMemoryBufferLen(len(arg1181)) + defer mbTrans1182.Close() + _, err1183 := mbTrans1182.WriteString(arg1181) + if err1183 != nil { + Usage() + return + } + factory1184 := thrift.NewTJSONProtocolFactory() + jsProt1185 := factory1184.GetProtocol(mbTrans1182) + argvalue0 := meta.NewCreateBackupReq() + err1186 := argvalue0.Read(context.Background(), jsProt1185) + if err1186 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateBackup(context.Background(), value0)) + fmt.Print("\n") + break + case "restoreMeta": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RestoreMeta requires 1 args") + flag.Usage() + } + arg1187 := flag.Arg(1) + mbTrans1188 := thrift.NewTMemoryBufferLen(len(arg1187)) + defer mbTrans1188.Close() + _, err1189 := mbTrans1188.WriteString(arg1187) + if err1189 != nil { + Usage() + return + } + factory1190 := thrift.NewTJSONProtocolFactory() + jsProt1191 := factory1190.GetProtocol(mbTrans1188) + argvalue0 := meta.NewRestoreMetaReq() + err1192 := argvalue0.Read(context.Background(), jsProt1191) + if err1192 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RestoreMeta(context.Background(), value0)) + fmt.Print("\n") + break + case "listCluster": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ListCluster requires 1 args") + flag.Usage() + } + arg1193 := flag.Arg(1) + mbTrans1194 := thrift.NewTMemoryBufferLen(len(arg1193)) + defer mbTrans1194.Close() + _, err1195 := mbTrans1194.WriteString(arg1193) + if err1195 != nil { + Usage() + return + } + factory1196 := thrift.NewTJSONProtocolFactory() + jsProt1197 := factory1196.GetProtocol(mbTrans1194) + argvalue0 := meta.NewListClusterInfoReq() + err1198 := argvalue0.Read(context.Background(), jsProt1197) + if err1198 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ListCluster(context.Background(), value0)) + fmt.Print("\n") + break + case "getMetaDirInfo": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetMetaDirInfo requires 1 args") + flag.Usage() + } + arg1199 := flag.Arg(1) + mbTrans1200 := thrift.NewTMemoryBufferLen(len(arg1199)) + defer mbTrans1200.Close() + _, err1201 := mbTrans1200.WriteString(arg1199) + if err1201 != nil { + Usage() + return + } + factory1202 := thrift.NewTJSONProtocolFactory() + jsProt1203 := factory1202.GetProtocol(mbTrans1200) + argvalue0 := meta.NewGetMetaDirInfoReq() + err1204 := argvalue0.Read(context.Background(), jsProt1203) + if err1204 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetMetaDirInfo(context.Background(), value0)) + fmt.Print("\n") + break + case "verifyClientVersion": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "VerifyClientVersion requires 1 args") + flag.Usage() + } + arg1205 := flag.Arg(1) + mbTrans1206 := thrift.NewTMemoryBufferLen(len(arg1205)) + defer mbTrans1206.Close() + _, err1207 := mbTrans1206.WriteString(arg1205) + if err1207 != nil { + Usage() + return + } + factory1208 := thrift.NewTJSONProtocolFactory() + jsProt1209 := factory1208.GetProtocol(mbTrans1206) + argvalue0 := meta.NewVerifyClientVersionReq() + err1210 := argvalue0.Read(context.Background(), jsProt1209) + if err1210 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.VerifyClientVersion(context.Background(), value0)) + fmt.Print("\n") + break + case "saveGraphVersion": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "SaveGraphVersion requires 1 args") + flag.Usage() + } + arg1211 := flag.Arg(1) + mbTrans1212 := thrift.NewTMemoryBufferLen(len(arg1211)) + defer mbTrans1212.Close() + _, err1213 := mbTrans1212.WriteString(arg1211) + if err1213 != nil { + Usage() + return + } + factory1214 := thrift.NewTJSONProtocolFactory() + jsProt1215 := factory1214.GetProtocol(mbTrans1212) + argvalue0 := meta.NewSaveGraphVersionReq() + err1216 := argvalue0.Read(context.Background(), jsProt1215) + if err1216 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.SaveGraphVersion(context.Background(), value0)) + fmt.Print("\n") + break + case "getSegmentId": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetSegmentId requires 1 args") + flag.Usage() + } + arg1217 := flag.Arg(1) + mbTrans1218 := thrift.NewTMemoryBufferLen(len(arg1217)) + defer mbTrans1218.Close() + _, err1219 := mbTrans1218.WriteString(arg1217) + if err1219 != nil { + Usage() + return + } + factory1220 := thrift.NewTJSONProtocolFactory() + jsProt1221 := factory1220.GetProtocol(mbTrans1218) + argvalue0 := meta.NewGetSegmentIdReq() + err1222 := argvalue0.Read(context.Background(), jsProt1221) + if err1222 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetSegmentId(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/nebula/meta/metaservice.go b/nebula/meta/metaservice.go deleted file mode 100644 index daecdeae..00000000 --- a/nebula/meta/metaservice.go +++ /dev/null @@ -1,31607 +0,0 @@ -// 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/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - -) - -// (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 - ClearSpace(ctx context.Context, req *ClearSpaceReq) (_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 - AlterSpace(ctx context.Context, req *AlterSpaceReq) (_r *ExecResp, 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 - AddHosts(ctx context.Context, req *AddHostsReq) (_r *ExecResp, err error) - // Parameters: - // - Req - AddHostsIntoZone(ctx context.Context, req *AddHostsIntoZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - DropHosts(ctx context.Context, req *DropHostsReq) (_r *ExecResp, err error) - // Parameters: - // - Req - ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) - // Parameters: - // - Req - GetPartsAlloc(ctx context.Context, req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) - // Parameters: - // - Req - ListParts(ctx context.Context, req *ListPartsReq) (_r *ListPartsResp, err error) - // Parameters: - // - Req - GetWorkerId(ctx context.Context, req *GetWorkerIdReq) (_r *GetWorkerIdResp, 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 - AgentHeartbeat(ctx context.Context, req *AgentHBReq) (_r *AgentHBResp, 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 - MergeZone(ctx context.Context, req *MergeZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - DropZone(ctx context.Context, req *DropZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - DivideZone(ctx context.Context, req *DivideZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - RenameZone(ctx context.Context, req *RenameZoneReq) (_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 - 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 - SignInService(ctx context.Context, req *SignInServiceReq) (_r *ExecResp, err error) - // Parameters: - // - Req - SignOutService(ctx context.Context, req *SignOutServiceReq) (_r *ExecResp, err error) - // Parameters: - // - Req - ListServiceClients(ctx context.Context, req *ListServiceClientsReq) (_r *ListServiceClientsResp, 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 - CreateBackup(ctx context.Context, req *CreateBackupReq) (_r *CreateBackupResp, err error) - // Parameters: - // - Req - RestoreMeta(ctx context.Context, req *RestoreMetaReq) (_r *RestoreMetaResp, 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) - // Parameters: - // - Req - SaveGraphVersion(ctx context.Context, req *SaveGraphVersionReq) (_r *SaveGraphVersionResp, err error) - // Parameters: - // - Req - GetSegmentId(ctx context.Context, req *GetSegmentIdReq) (_r *GetSegmentIdResp, 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 - ClearSpace(req *ClearSpaceReq) (_r *ExecResp, err error) - // Parameters: - // - Req - GetSpace(req *GetSpaceReq) (_r *GetSpaceResp, err error) - // Parameters: - // - Req - ListSpaces(req *ListSpacesReq) (_r *ListSpacesResp, err error) - // Parameters: - // - Req - AlterSpace(req *AlterSpaceReq) (_r *ExecResp, 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 - AddHosts(req *AddHostsReq) (_r *ExecResp, err error) - // Parameters: - // - Req - AddHostsIntoZone(req *AddHostsIntoZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - DropHosts(req *DropHostsReq) (_r *ExecResp, err error) - // Parameters: - // - Req - ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) - // Parameters: - // - Req - GetPartsAlloc(req *GetPartsAllocReq) (_r *GetPartsAllocResp, err error) - // Parameters: - // - Req - ListParts(req *ListPartsReq) (_r *ListPartsResp, err error) - // Parameters: - // - Req - GetWorkerId(req *GetWorkerIdReq) (_r *GetWorkerIdResp, 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 - AgentHeartbeat(req *AgentHBReq) (_r *AgentHBResp, 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 - MergeZone(req *MergeZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - DropZone(req *DropZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - DivideZone(req *DivideZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - RenameZone(req *RenameZoneReq) (_r *ExecResp, err error) - // Parameters: - // - Req - GetZone(req *GetZoneReq) (_r *GetZoneResp, err error) - // Parameters: - // - Req - ListZones(req *ListZonesReq) (_r *ListZonesResp, 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 - SignInService(req *SignInServiceReq) (_r *ExecResp, err error) - // Parameters: - // - Req - SignOutService(req *SignOutServiceReq) (_r *ExecResp, err error) - // Parameters: - // - Req - ListServiceClients(req *ListServiceClientsReq) (_r *ListServiceClientsResp, 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 - CreateBackup(req *CreateBackupReq) (_r *CreateBackupResp, err error) - // Parameters: - // - Req - RestoreMeta(req *RestoreMetaReq) (_r *RestoreMetaResp, 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) - // Parameters: - // - Req - SaveGraphVersion(req *SaveGraphVersionReq) (_r *SaveGraphVersionResp, err error) - // Parameters: - // - Req - GetSegmentId(req *GetSegmentIdReq) (_r *GetSegmentIdResp, 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) ClearSpace(req *ClearSpaceReq) (_r *ExecResp, err error) { - args := MetaServiceClearSpaceArgs{ - Req : req, - } - err = p.CC.SendMsg("clearSpace", &args, thrift.CALL) - if err != nil { return } - return p.recvClearSpace() -} - - -func (p *MetaServiceClient) recvClearSpace() (value *ExecResp, err error) { - var result MetaServiceClearSpaceResult - err = p.CC.RecvMsg("clearSpace", &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) AlterSpace(req *AlterSpaceReq) (_r *ExecResp, err error) { - args := MetaServiceAlterSpaceArgs{ - Req : req, - } - err = p.CC.SendMsg("alterSpace", &args, thrift.CALL) - if err != nil { return } - return p.recvAlterSpace() -} - - -func (p *MetaServiceClient) recvAlterSpace() (value *ExecResp, err error) { - var result MetaServiceAlterSpaceResult - err = p.CC.RecvMsg("alterSpace", &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) AddHosts(req *AddHostsReq) (_r *ExecResp, err error) { - args := MetaServiceAddHostsArgs{ - Req : req, - } - err = p.CC.SendMsg("addHosts", &args, thrift.CALL) - if err != nil { return } - return p.recvAddHosts() -} - - -func (p *MetaServiceClient) recvAddHosts() (value *ExecResp, err error) { - var result MetaServiceAddHostsResult - err = p.CC.RecvMsg("addHosts", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceClient) AddHostsIntoZone(req *AddHostsIntoZoneReq) (_r *ExecResp, err error) { - args := MetaServiceAddHostsIntoZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("addHostsIntoZone", &args, thrift.CALL) - if err != nil { return } - return p.recvAddHostsIntoZone() -} - - -func (p *MetaServiceClient) recvAddHostsIntoZone() (value *ExecResp, err error) { - var result MetaServiceAddHostsIntoZoneResult - err = p.CC.RecvMsg("addHostsIntoZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceClient) DropHosts(req *DropHostsReq) (_r *ExecResp, err error) { - args := MetaServiceDropHostsArgs{ - Req : req, - } - err = p.CC.SendMsg("dropHosts", &args, thrift.CALL) - if err != nil { return } - return p.recvDropHosts() -} - - -func (p *MetaServiceClient) recvDropHosts() (value *ExecResp, err error) { - var result MetaServiceDropHostsResult - err = p.CC.RecvMsg("dropHosts", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { - 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) GetWorkerId(req *GetWorkerIdReq) (_r *GetWorkerIdResp, err error) { - args := MetaServiceGetWorkerIdArgs{ - Req : req, - } - err = p.CC.SendMsg("getWorkerId", &args, thrift.CALL) - if err != nil { return } - return p.recvGetWorkerId() -} - - -func (p *MetaServiceClient) recvGetWorkerId() (value *GetWorkerIdResp, err error) { - var result MetaServiceGetWorkerIdResult - err = p.CC.RecvMsg("getWorkerId", &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) AgentHeartbeat(req *AgentHBReq) (_r *AgentHBResp, err error) { - args := MetaServiceAgentHeartbeatArgs{ - Req : req, - } - err = p.CC.SendMsg("agentHeartbeat", &args, thrift.CALL) - if err != nil { return } - return p.recvAgentHeartbeat() -} - - -func (p *MetaServiceClient) recvAgentHeartbeat() (value *AgentHBResp, err error) { - var result MetaServiceAgentHeartbeatResult - err = p.CC.RecvMsg("agentHeartbeat", &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) MergeZone(req *MergeZoneReq) (_r *ExecResp, err error) { - args := MetaServiceMergeZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("mergeZone", &args, thrift.CALL) - if err != nil { return } - return p.recvMergeZone() -} - - -func (p *MetaServiceClient) recvMergeZone() (value *ExecResp, err error) { - var result MetaServiceMergeZoneResult - err = p.CC.RecvMsg("mergeZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// 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) DivideZone(req *DivideZoneReq) (_r *ExecResp, err error) { - args := MetaServiceDivideZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("divideZone", &args, thrift.CALL) - if err != nil { return } - return p.recvDivideZone() -} - - -func (p *MetaServiceClient) recvDivideZone() (value *ExecResp, err error) { - var result MetaServiceDivideZoneResult - err = p.CC.RecvMsg("divideZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceClient) RenameZone(req *RenameZoneReq) (_r *ExecResp, err error) { - args := MetaServiceRenameZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("renameZone", &args, thrift.CALL) - if err != nil { return } - return p.recvRenameZone() -} - - -func (p *MetaServiceClient) recvRenameZone() (value *ExecResp, err error) { - var result MetaServiceRenameZoneResult - err = p.CC.RecvMsg("renameZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// 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) 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) SignInService(req *SignInServiceReq) (_r *ExecResp, err error) { - args := MetaServiceSignInServiceArgs{ - Req : req, - } - err = p.CC.SendMsg("signInService", &args, thrift.CALL) - if err != nil { return } - return p.recvSignInService() -} - - -func (p *MetaServiceClient) recvSignInService() (value *ExecResp, err error) { - var result MetaServiceSignInServiceResult - err = p.CC.RecvMsg("signInService", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceClient) SignOutService(req *SignOutServiceReq) (_r *ExecResp, err error) { - args := MetaServiceSignOutServiceArgs{ - Req : req, - } - err = p.CC.SendMsg("signOutService", &args, thrift.CALL) - if err != nil { return } - return p.recvSignOutService() -} - - -func (p *MetaServiceClient) recvSignOutService() (value *ExecResp, err error) { - var result MetaServiceSignOutServiceResult - err = p.CC.RecvMsg("signOutService", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceClient) ListServiceClients(req *ListServiceClientsReq) (_r *ListServiceClientsResp, err error) { - args := MetaServiceListServiceClientsArgs{ - Req : req, - } - err = p.CC.SendMsg("listServiceClients", &args, thrift.CALL) - if err != nil { return } - return p.recvListServiceClients() -} - - -func (p *MetaServiceClient) recvListServiceClients() (value *ListServiceClientsResp, err error) { - var result MetaServiceListServiceClientsResult - err = p.CC.RecvMsg("listServiceClients", &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) 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 *RestoreMetaResp, 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 *RestoreMetaResp, err error) { - var result MetaServiceRestoreMetaResult - err = p.CC.RecvMsg("restoreMeta", &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 -} - -// Parameters: -// - Req -func (p *MetaServiceClient) SaveGraphVersion(req *SaveGraphVersionReq) (_r *SaveGraphVersionResp, err error) { - args := MetaServiceSaveGraphVersionArgs{ - Req : req, - } - err = p.CC.SendMsg("saveGraphVersion", &args, thrift.CALL) - if err != nil { return } - return p.recvSaveGraphVersion() -} - - -func (p *MetaServiceClient) recvSaveGraphVersion() (value *SaveGraphVersionResp, err error) { - var result MetaServiceSaveGraphVersionResult - err = p.CC.RecvMsg("saveGraphVersion", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceClient) GetSegmentId(req *GetSegmentIdReq) (_r *GetSegmentIdResp, err error) { - args := MetaServiceGetSegmentIdArgs{ - Req : req, - } - err = p.CC.SendMsg("getSegmentId", &args, thrift.CALL) - if err != nil { return } - return p.recvGetSegmentId() -} - - -func (p *MetaServiceClient) recvGetSegmentId() (value *GetSegmentIdResp, err error) { - var result MetaServiceGetSegmentIdResult - err = p.CC.RecvMsg("getSegmentId", &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) ClearSpace(req *ClearSpaceReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceClearSpaceArgs{ - Req : req, - } - err = p.CC.SendMsg("clearSpace", &args, thrift.CALL) - if err != nil { return } - return p.recvClearSpace() -} - - -func (p *MetaServiceThreadsafeClient) recvClearSpace() (value *ExecResp, err error) { - var result MetaServiceClearSpaceResult - err = p.CC.RecvMsg("clearSpace", &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) AlterSpace(req *AlterSpaceReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceAlterSpaceArgs{ - Req : req, - } - err = p.CC.SendMsg("alterSpace", &args, thrift.CALL) - if err != nil { return } - return p.recvAlterSpace() -} - - -func (p *MetaServiceThreadsafeClient) recvAlterSpace() (value *ExecResp, err error) { - var result MetaServiceAlterSpaceResult - err = p.CC.RecvMsg("alterSpace", &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) AddHosts(req *AddHostsReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceAddHostsArgs{ - Req : req, - } - err = p.CC.SendMsg("addHosts", &args, thrift.CALL) - if err != nil { return } - return p.recvAddHosts() -} - - -func (p *MetaServiceThreadsafeClient) recvAddHosts() (value *ExecResp, err error) { - var result MetaServiceAddHostsResult - err = p.CC.RecvMsg("addHosts", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) AddHostsIntoZone(req *AddHostsIntoZoneReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceAddHostsIntoZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("addHostsIntoZone", &args, thrift.CALL) - if err != nil { return } - return p.recvAddHostsIntoZone() -} - - -func (p *MetaServiceThreadsafeClient) recvAddHostsIntoZone() (value *ExecResp, err error) { - var result MetaServiceAddHostsIntoZoneResult - err = p.CC.RecvMsg("addHostsIntoZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) DropHosts(req *DropHostsReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceDropHostsArgs{ - Req : req, - } - err = p.CC.SendMsg("dropHosts", &args, thrift.CALL) - if err != nil { return } - return p.recvDropHosts() -} - - -func (p *MetaServiceThreadsafeClient) recvDropHosts() (value *ExecResp, err error) { - var result MetaServiceDropHostsResult - err = p.CC.RecvMsg("dropHosts", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) ListHosts(req *ListHostsReq) (_r *ListHostsResp, err error) { - 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) GetWorkerId(req *GetWorkerIdReq) (_r *GetWorkerIdResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceGetWorkerIdArgs{ - Req : req, - } - err = p.CC.SendMsg("getWorkerId", &args, thrift.CALL) - if err != nil { return } - return p.recvGetWorkerId() -} - - -func (p *MetaServiceThreadsafeClient) recvGetWorkerId() (value *GetWorkerIdResp, err error) { - var result MetaServiceGetWorkerIdResult - err = p.CC.RecvMsg("getWorkerId", &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) AgentHeartbeat(req *AgentHBReq) (_r *AgentHBResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceAgentHeartbeatArgs{ - Req : req, - } - err = p.CC.SendMsg("agentHeartbeat", &args, thrift.CALL) - if err != nil { return } - return p.recvAgentHeartbeat() -} - - -func (p *MetaServiceThreadsafeClient) recvAgentHeartbeat() (value *AgentHBResp, err error) { - var result MetaServiceAgentHeartbeatResult - err = p.CC.RecvMsg("agentHeartbeat", &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) MergeZone(req *MergeZoneReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceMergeZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("mergeZone", &args, thrift.CALL) - if err != nil { return } - return p.recvMergeZone() -} - - -func (p *MetaServiceThreadsafeClient) recvMergeZone() (value *ExecResp, err error) { - var result MetaServiceMergeZoneResult - err = p.CC.RecvMsg("mergeZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// 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) DivideZone(req *DivideZoneReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceDivideZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("divideZone", &args, thrift.CALL) - if err != nil { return } - return p.recvDivideZone() -} - - -func (p *MetaServiceThreadsafeClient) recvDivideZone() (value *ExecResp, err error) { - var result MetaServiceDivideZoneResult - err = p.CC.RecvMsg("divideZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) RenameZone(req *RenameZoneReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceRenameZoneArgs{ - Req : req, - } - err = p.CC.SendMsg("renameZone", &args, thrift.CALL) - if err != nil { return } - return p.recvRenameZone() -} - - -func (p *MetaServiceThreadsafeClient) recvRenameZone() (value *ExecResp, err error) { - var result MetaServiceRenameZoneResult - err = p.CC.RecvMsg("renameZone", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// 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) 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) SignInService(req *SignInServiceReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceSignInServiceArgs{ - Req : req, - } - err = p.CC.SendMsg("signInService", &args, thrift.CALL) - if err != nil { return } - return p.recvSignInService() -} - - -func (p *MetaServiceThreadsafeClient) recvSignInService() (value *ExecResp, err error) { - var result MetaServiceSignInServiceResult - err = p.CC.RecvMsg("signInService", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) SignOutService(req *SignOutServiceReq) (_r *ExecResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceSignOutServiceArgs{ - Req : req, - } - err = p.CC.SendMsg("signOutService", &args, thrift.CALL) - if err != nil { return } - return p.recvSignOutService() -} - - -func (p *MetaServiceThreadsafeClient) recvSignOutService() (value *ExecResp, err error) { - var result MetaServiceSignOutServiceResult - err = p.CC.RecvMsg("signOutService", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) ListServiceClients(req *ListServiceClientsReq) (_r *ListServiceClientsResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceListServiceClientsArgs{ - Req : req, - } - err = p.CC.SendMsg("listServiceClients", &args, thrift.CALL) - if err != nil { return } - return p.recvListServiceClients() -} - - -func (p *MetaServiceThreadsafeClient) recvListServiceClients() (value *ListServiceClientsResp, err error) { - var result MetaServiceListServiceClientsResult - err = p.CC.RecvMsg("listServiceClients", &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) 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 *RestoreMetaResp, 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 *RestoreMetaResp, err error) { - var result MetaServiceRestoreMetaResult - err = p.CC.RecvMsg("restoreMeta", &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 -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) SaveGraphVersion(req *SaveGraphVersionReq) (_r *SaveGraphVersionResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceSaveGraphVersionArgs{ - Req : req, - } - err = p.CC.SendMsg("saveGraphVersion", &args, thrift.CALL) - if err != nil { return } - return p.recvSaveGraphVersion() -} - - -func (p *MetaServiceThreadsafeClient) recvSaveGraphVersion() (value *SaveGraphVersionResp, err error) { - var result MetaServiceSaveGraphVersionResult - err = p.CC.RecvMsg("saveGraphVersion", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceThreadsafeClient) GetSegmentId(req *GetSegmentIdReq) (_r *GetSegmentIdResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := MetaServiceGetSegmentIdArgs{ - Req : req, - } - err = p.CC.SendMsg("getSegmentId", &args, thrift.CALL) - if err != nil { return } - return p.recvGetSegmentId() -} - - -func (p *MetaServiceThreadsafeClient) recvGetSegmentId() (value *GetSegmentIdResp, err error) { - var result MetaServiceGetSegmentIdResult - err = p.CC.RecvMsg("getSegmentId", &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) ClearSpace(ctx context.Context, req *ClearSpaceReq) (_r *ExecResp, err error) { - args := MetaServiceClearSpaceArgs{ - Req : req, - } - var result MetaServiceClearSpaceResult - err = p.RequestChannel.Call(ctx, "clearSpace", &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) AlterSpace(ctx context.Context, req *AlterSpaceReq) (_r *ExecResp, err error) { - args := MetaServiceAlterSpaceArgs{ - Req : req, - } - var result MetaServiceAlterSpaceResult - err = p.RequestChannel.Call(ctx, "alterSpace", &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) AddHosts(ctx context.Context, req *AddHostsReq) (_r *ExecResp, err error) { - args := MetaServiceAddHostsArgs{ - Req : req, - } - var result MetaServiceAddHostsResult - err = p.RequestChannel.Call(ctx, "addHosts", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) AddHostsIntoZone(ctx context.Context, req *AddHostsIntoZoneReq) (_r *ExecResp, err error) { - args := MetaServiceAddHostsIntoZoneArgs{ - Req : req, - } - var result MetaServiceAddHostsIntoZoneResult - err = p.RequestChannel.Call(ctx, "addHostsIntoZone", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) DropHosts(ctx context.Context, req *DropHostsReq) (_r *ExecResp, err error) { - args := MetaServiceDropHostsArgs{ - Req : req, - } - var result MetaServiceDropHostsResult - err = p.RequestChannel.Call(ctx, "dropHosts", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) ListHosts(ctx context.Context, req *ListHostsReq) (_r *ListHostsResp, err error) { - 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) GetWorkerId(ctx context.Context, req *GetWorkerIdReq) (_r *GetWorkerIdResp, err error) { - args := MetaServiceGetWorkerIdArgs{ - Req : req, - } - var result MetaServiceGetWorkerIdResult - err = p.RequestChannel.Call(ctx, "getWorkerId", &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) AgentHeartbeat(ctx context.Context, req *AgentHBReq) (_r *AgentHBResp, err error) { - args := MetaServiceAgentHeartbeatArgs{ - Req : req, - } - var result MetaServiceAgentHeartbeatResult - err = p.RequestChannel.Call(ctx, "agentHeartbeat", &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) MergeZone(ctx context.Context, req *MergeZoneReq) (_r *ExecResp, err error) { - args := MetaServiceMergeZoneArgs{ - Req : req, - } - var result MetaServiceMergeZoneResult - err = p.RequestChannel.Call(ctx, "mergeZone", &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) DivideZone(ctx context.Context, req *DivideZoneReq) (_r *ExecResp, err error) { - args := MetaServiceDivideZoneArgs{ - Req : req, - } - var result MetaServiceDivideZoneResult - err = p.RequestChannel.Call(ctx, "divideZone", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) RenameZone(ctx context.Context, req *RenameZoneReq) (_r *ExecResp, err error) { - args := MetaServiceRenameZoneArgs{ - Req : req, - } - var result MetaServiceRenameZoneResult - err = p.RequestChannel.Call(ctx, "renameZone", &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) 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) SignInService(ctx context.Context, req *SignInServiceReq) (_r *ExecResp, err error) { - args := MetaServiceSignInServiceArgs{ - Req : req, - } - var result MetaServiceSignInServiceResult - err = p.RequestChannel.Call(ctx, "signInService", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) SignOutService(ctx context.Context, req *SignOutServiceReq) (_r *ExecResp, err error) { - args := MetaServiceSignOutServiceArgs{ - Req : req, - } - var result MetaServiceSignOutServiceResult - err = p.RequestChannel.Call(ctx, "signOutService", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) ListServiceClients(ctx context.Context, req *ListServiceClientsReq) (_r *ListServiceClientsResp, err error) { - args := MetaServiceListServiceClientsArgs{ - Req : req, - } - var result MetaServiceListServiceClientsResult - err = p.RequestChannel.Call(ctx, "listServiceClients", &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) 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 *RestoreMetaResp, 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) 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 -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) SaveGraphVersion(ctx context.Context, req *SaveGraphVersionReq) (_r *SaveGraphVersionResp, err error) { - args := MetaServiceSaveGraphVersionArgs{ - Req : req, - } - var result MetaServiceSaveGraphVersionResult - err = p.RequestChannel.Call(ctx, "saveGraphVersion", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *MetaServiceChannelClient) GetSegmentId(ctx context.Context, req *GetSegmentIdReq) (_r *GetSegmentIdResp, err error) { - args := MetaServiceGetSegmentIdArgs{ - Req : req, - } - var result MetaServiceGetSegmentIdResult - err = p.RequestChannel.Call(ctx, "getSegmentId", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - - -type MetaServiceProcessor struct { - processorMap map[string]thrift.ProcessorFunctionContext - functionServiceMap map[string]string - handler MetaService -} - -func (p *MetaServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { - p.processorMap[key] = processor -} - -func (p *MetaServiceProcessor) AddToFunctionServiceMap(key, service string) { - p.functionServiceMap[key] = service -} - -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 (p *MetaServiceProcessor) FunctionServiceMap() map[string]string { - return p.functionServiceMap -} - -func NewMetaServiceProcessor(handler MetaService) *MetaServiceProcessor { - self110 := &MetaServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} - self110.processorMap["createSpace"] = &metaServiceProcessorCreateSpace{handler:handler} - self110.processorMap["dropSpace"] = &metaServiceProcessorDropSpace{handler:handler} - self110.processorMap["clearSpace"] = &metaServiceProcessorClearSpace{handler:handler} - self110.processorMap["getSpace"] = &metaServiceProcessorGetSpace{handler:handler} - self110.processorMap["listSpaces"] = &metaServiceProcessorListSpaces{handler:handler} - self110.processorMap["alterSpace"] = &metaServiceProcessorAlterSpace{handler:handler} - self110.processorMap["createSpaceAs"] = &metaServiceProcessorCreateSpaceAs{handler:handler} - self110.processorMap["createTag"] = &metaServiceProcessorCreateTag{handler:handler} - self110.processorMap["alterTag"] = &metaServiceProcessorAlterTag{handler:handler} - self110.processorMap["dropTag"] = &metaServiceProcessorDropTag{handler:handler} - self110.processorMap["getTag"] = &metaServiceProcessorGetTag{handler:handler} - self110.processorMap["listTags"] = &metaServiceProcessorListTags{handler:handler} - self110.processorMap["createEdge"] = &metaServiceProcessorCreateEdge{handler:handler} - self110.processorMap["alterEdge"] = &metaServiceProcessorAlterEdge{handler:handler} - self110.processorMap["dropEdge"] = &metaServiceProcessorDropEdge{handler:handler} - self110.processorMap["getEdge"] = &metaServiceProcessorGetEdge{handler:handler} - self110.processorMap["listEdges"] = &metaServiceProcessorListEdges{handler:handler} - self110.processorMap["addHosts"] = &metaServiceProcessorAddHosts{handler:handler} - self110.processorMap["addHostsIntoZone"] = &metaServiceProcessorAddHostsIntoZone{handler:handler} - self110.processorMap["dropHosts"] = &metaServiceProcessorDropHosts{handler:handler} - self110.processorMap["listHosts"] = &metaServiceProcessorListHosts{handler:handler} - self110.processorMap["getPartsAlloc"] = &metaServiceProcessorGetPartsAlloc{handler:handler} - self110.processorMap["listParts"] = &metaServiceProcessorListParts{handler:handler} - self110.processorMap["getWorkerId"] = &metaServiceProcessorGetWorkerId{handler:handler} - self110.processorMap["createTagIndex"] = &metaServiceProcessorCreateTagIndex{handler:handler} - self110.processorMap["dropTagIndex"] = &metaServiceProcessorDropTagIndex{handler:handler} - self110.processorMap["getTagIndex"] = &metaServiceProcessorGetTagIndex{handler:handler} - self110.processorMap["listTagIndexes"] = &metaServiceProcessorListTagIndexes{handler:handler} - self110.processorMap["rebuildTagIndex"] = &metaServiceProcessorRebuildTagIndex{handler:handler} - self110.processorMap["listTagIndexStatus"] = &metaServiceProcessorListTagIndexStatus{handler:handler} - self110.processorMap["createEdgeIndex"] = &metaServiceProcessorCreateEdgeIndex{handler:handler} - self110.processorMap["dropEdgeIndex"] = &metaServiceProcessorDropEdgeIndex{handler:handler} - self110.processorMap["getEdgeIndex"] = &metaServiceProcessorGetEdgeIndex{handler:handler} - self110.processorMap["listEdgeIndexes"] = &metaServiceProcessorListEdgeIndexes{handler:handler} - self110.processorMap["rebuildEdgeIndex"] = &metaServiceProcessorRebuildEdgeIndex{handler:handler} - self110.processorMap["listEdgeIndexStatus"] = &metaServiceProcessorListEdgeIndexStatus{handler:handler} - self110.processorMap["createUser"] = &metaServiceProcessorCreateUser{handler:handler} - self110.processorMap["dropUser"] = &metaServiceProcessorDropUser{handler:handler} - self110.processorMap["alterUser"] = &metaServiceProcessorAlterUser{handler:handler} - self110.processorMap["grantRole"] = &metaServiceProcessorGrantRole{handler:handler} - self110.processorMap["revokeRole"] = &metaServiceProcessorRevokeRole{handler:handler} - self110.processorMap["listUsers"] = &metaServiceProcessorListUsers{handler:handler} - self110.processorMap["listRoles"] = &metaServiceProcessorListRoles{handler:handler} - self110.processorMap["getUserRoles"] = &metaServiceProcessorGetUserRoles{handler:handler} - self110.processorMap["changePassword"] = &metaServiceProcessorChangePassword{handler:handler} - self110.processorMap["heartBeat"] = &metaServiceProcessorHeartBeat{handler:handler} - self110.processorMap["agentHeartbeat"] = &metaServiceProcessorAgentHeartbeat{handler:handler} - self110.processorMap["regConfig"] = &metaServiceProcessorRegConfig{handler:handler} - self110.processorMap["getConfig"] = &metaServiceProcessorGetConfig{handler:handler} - self110.processorMap["setConfig"] = &metaServiceProcessorSetConfig{handler:handler} - self110.processorMap["listConfigs"] = &metaServiceProcessorListConfigs{handler:handler} - self110.processorMap["createSnapshot"] = &metaServiceProcessorCreateSnapshot{handler:handler} - self110.processorMap["dropSnapshot"] = &metaServiceProcessorDropSnapshot{handler:handler} - self110.processorMap["listSnapshots"] = &metaServiceProcessorListSnapshots{handler:handler} - self110.processorMap["runAdminJob"] = &metaServiceProcessorRunAdminJob{handler:handler} - self110.processorMap["mergeZone"] = &metaServiceProcessorMergeZone{handler:handler} - self110.processorMap["dropZone"] = &metaServiceProcessorDropZone{handler:handler} - self110.processorMap["divideZone"] = &metaServiceProcessorDivideZone{handler:handler} - self110.processorMap["renameZone"] = &metaServiceProcessorRenameZone{handler:handler} - self110.processorMap["getZone"] = &metaServiceProcessorGetZone{handler:handler} - self110.processorMap["listZones"] = &metaServiceProcessorListZones{handler:handler} - self110.processorMap["addListener"] = &metaServiceProcessorAddListener{handler:handler} - self110.processorMap["removeListener"] = &metaServiceProcessorRemoveListener{handler:handler} - self110.processorMap["listListener"] = &metaServiceProcessorListListener{handler:handler} - self110.processorMap["getStats"] = &metaServiceProcessorGetStats{handler:handler} - self110.processorMap["signInService"] = &metaServiceProcessorSignInService{handler:handler} - self110.processorMap["signOutService"] = &metaServiceProcessorSignOutService{handler:handler} - self110.processorMap["listServiceClients"] = &metaServiceProcessorListServiceClients{handler:handler} - self110.processorMap["createFTIndex"] = &metaServiceProcessorCreateFTIndex{handler:handler} - self110.processorMap["dropFTIndex"] = &metaServiceProcessorDropFTIndex{handler:handler} - self110.processorMap["listFTIndexes"] = &metaServiceProcessorListFTIndexes{handler:handler} - self110.processorMap["createSession"] = &metaServiceProcessorCreateSession{handler:handler} - self110.processorMap["updateSessions"] = &metaServiceProcessorUpdateSessions{handler:handler} - self110.processorMap["listSessions"] = &metaServiceProcessorListSessions{handler:handler} - self110.processorMap["getSession"] = &metaServiceProcessorGetSession{handler:handler} - self110.processorMap["removeSession"] = &metaServiceProcessorRemoveSession{handler:handler} - self110.processorMap["killQuery"] = &metaServiceProcessorKillQuery{handler:handler} - self110.processorMap["reportTaskFinish"] = &metaServiceProcessorReportTaskFinish{handler:handler} - self110.processorMap["createBackup"] = &metaServiceProcessorCreateBackup{handler:handler} - self110.processorMap["restoreMeta"] = &metaServiceProcessorRestoreMeta{handler:handler} - self110.processorMap["listCluster"] = &metaServiceProcessorListCluster{handler:handler} - self110.processorMap["getMetaDirInfo"] = &metaServiceProcessorGetMetaDirInfo{handler:handler} - self110.processorMap["verifyClientVersion"] = &metaServiceProcessorVerifyClientVersion{handler:handler} - self110.processorMap["saveGraphVersion"] = &metaServiceProcessorSaveGraphVersion{handler:handler} - self110.processorMap["getSegmentId"] = &metaServiceProcessorGetSegmentId{handler:handler} - self110.functionServiceMap["createSpace"] = "MetaService" - self110.functionServiceMap["dropSpace"] = "MetaService" - self110.functionServiceMap["clearSpace"] = "MetaService" - self110.functionServiceMap["getSpace"] = "MetaService" - self110.functionServiceMap["listSpaces"] = "MetaService" - self110.functionServiceMap["alterSpace"] = "MetaService" - self110.functionServiceMap["createSpaceAs"] = "MetaService" - self110.functionServiceMap["createTag"] = "MetaService" - self110.functionServiceMap["alterTag"] = "MetaService" - self110.functionServiceMap["dropTag"] = "MetaService" - self110.functionServiceMap["getTag"] = "MetaService" - self110.functionServiceMap["listTags"] = "MetaService" - self110.functionServiceMap["createEdge"] = "MetaService" - self110.functionServiceMap["alterEdge"] = "MetaService" - self110.functionServiceMap["dropEdge"] = "MetaService" - self110.functionServiceMap["getEdge"] = "MetaService" - self110.functionServiceMap["listEdges"] = "MetaService" - self110.functionServiceMap["addHosts"] = "MetaService" - self110.functionServiceMap["addHostsIntoZone"] = "MetaService" - self110.functionServiceMap["dropHosts"] = "MetaService" - self110.functionServiceMap["listHosts"] = "MetaService" - self110.functionServiceMap["getPartsAlloc"] = "MetaService" - self110.functionServiceMap["listParts"] = "MetaService" - self110.functionServiceMap["getWorkerId"] = "MetaService" - self110.functionServiceMap["createTagIndex"] = "MetaService" - self110.functionServiceMap["dropTagIndex"] = "MetaService" - self110.functionServiceMap["getTagIndex"] = "MetaService" - self110.functionServiceMap["listTagIndexes"] = "MetaService" - self110.functionServiceMap["rebuildTagIndex"] = "MetaService" - self110.functionServiceMap["listTagIndexStatus"] = "MetaService" - self110.functionServiceMap["createEdgeIndex"] = "MetaService" - self110.functionServiceMap["dropEdgeIndex"] = "MetaService" - self110.functionServiceMap["getEdgeIndex"] = "MetaService" - self110.functionServiceMap["listEdgeIndexes"] = "MetaService" - self110.functionServiceMap["rebuildEdgeIndex"] = "MetaService" - self110.functionServiceMap["listEdgeIndexStatus"] = "MetaService" - self110.functionServiceMap["createUser"] = "MetaService" - self110.functionServiceMap["dropUser"] = "MetaService" - self110.functionServiceMap["alterUser"] = "MetaService" - self110.functionServiceMap["grantRole"] = "MetaService" - self110.functionServiceMap["revokeRole"] = "MetaService" - self110.functionServiceMap["listUsers"] = "MetaService" - self110.functionServiceMap["listRoles"] = "MetaService" - self110.functionServiceMap["getUserRoles"] = "MetaService" - self110.functionServiceMap["changePassword"] = "MetaService" - self110.functionServiceMap["heartBeat"] = "MetaService" - self110.functionServiceMap["agentHeartbeat"] = "MetaService" - self110.functionServiceMap["regConfig"] = "MetaService" - self110.functionServiceMap["getConfig"] = "MetaService" - self110.functionServiceMap["setConfig"] = "MetaService" - self110.functionServiceMap["listConfigs"] = "MetaService" - self110.functionServiceMap["createSnapshot"] = "MetaService" - self110.functionServiceMap["dropSnapshot"] = "MetaService" - self110.functionServiceMap["listSnapshots"] = "MetaService" - self110.functionServiceMap["runAdminJob"] = "MetaService" - self110.functionServiceMap["mergeZone"] = "MetaService" - self110.functionServiceMap["dropZone"] = "MetaService" - self110.functionServiceMap["divideZone"] = "MetaService" - self110.functionServiceMap["renameZone"] = "MetaService" - self110.functionServiceMap["getZone"] = "MetaService" - self110.functionServiceMap["listZones"] = "MetaService" - self110.functionServiceMap["addListener"] = "MetaService" - self110.functionServiceMap["removeListener"] = "MetaService" - self110.functionServiceMap["listListener"] = "MetaService" - self110.functionServiceMap["getStats"] = "MetaService" - self110.functionServiceMap["signInService"] = "MetaService" - self110.functionServiceMap["signOutService"] = "MetaService" - self110.functionServiceMap["listServiceClients"] = "MetaService" - self110.functionServiceMap["createFTIndex"] = "MetaService" - self110.functionServiceMap["dropFTIndex"] = "MetaService" - self110.functionServiceMap["listFTIndexes"] = "MetaService" - self110.functionServiceMap["createSession"] = "MetaService" - self110.functionServiceMap["updateSessions"] = "MetaService" - self110.functionServiceMap["listSessions"] = "MetaService" - self110.functionServiceMap["getSession"] = "MetaService" - self110.functionServiceMap["removeSession"] = "MetaService" - self110.functionServiceMap["killQuery"] = "MetaService" - self110.functionServiceMap["reportTaskFinish"] = "MetaService" - self110.functionServiceMap["createBackup"] = "MetaService" - self110.functionServiceMap["restoreMeta"] = "MetaService" - self110.functionServiceMap["listCluster"] = "MetaService" - self110.functionServiceMap["getMetaDirInfo"] = "MetaService" - self110.functionServiceMap["verifyClientVersion"] = "MetaService" - self110.functionServiceMap["saveGraphVersion"] = "MetaService" - self110.functionServiceMap["getSegmentId"] = "MetaService" - return self110 -} - -type metaServiceProcessorCreateSpace struct { - handler MetaService -} - -func (p *MetaServiceCreateSpaceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropSpaceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorClearSpace struct { - handler MetaService -} - -func (p *MetaServiceClearSpaceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorClearSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceClearSpaceArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorClearSpace) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("clearSpace", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorClearSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceClearSpaceArgs) - var result MetaServiceClearSpaceResult - if retval, err := p.handler.ClearSpace(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing clearSpace: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorGetSpace struct { - handler MetaService -} - -func (p *MetaServiceGetSpaceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListSpacesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorAlterSpace struct { - handler MetaService -} - -func (p *MetaServiceAlterSpaceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorAlterSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceAlterSpaceArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorAlterSpace) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("alterSpace", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorAlterSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceAlterSpaceArgs) - var result MetaServiceAlterSpaceResult - if retval, err := p.handler.AlterSpace(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing alterSpace: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorCreateSpaceAs struct { - handler MetaService -} - -func (p *MetaServiceCreateSpaceAsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceCreateTagResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceAlterTagResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropTagResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetTagResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListTagsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceCreateEdgeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceAlterEdgeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropEdgeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetEdgeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListEdgesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorAddHosts struct { - handler MetaService -} - -func (p *MetaServiceAddHostsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorAddHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceAddHostsArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorAddHosts) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("addHosts", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorAddHosts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceAddHostsArgs) - var result MetaServiceAddHostsResult - if retval, err := p.handler.AddHosts(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHosts: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorAddHostsIntoZone struct { - handler MetaService -} - -func (p *MetaServiceAddHostsIntoZoneResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorAddHostsIntoZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceAddHostsIntoZoneArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorAddHostsIntoZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("addHostsIntoZone", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorAddHostsIntoZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceAddHostsIntoZoneArgs) - var result MetaServiceAddHostsIntoZoneResult - if retval, err := p.handler.AddHostsIntoZone(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addHostsIntoZone: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorDropHosts struct { - handler MetaService -} - -func (p *MetaServiceDropHostsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorDropHosts) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceDropHostsArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorDropHosts) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("dropHosts", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorDropHosts) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceDropHostsArgs) - var result MetaServiceDropHostsResult - if retval, err := p.handler.DropHosts(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropHosts: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorListHosts struct { - handler MetaService -} - -func (p *MetaServiceListHostsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetPartsAllocResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListPartsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorGetWorkerId struct { - handler MetaService -} - -func (p *MetaServiceGetWorkerIdResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorGetWorkerId) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceGetWorkerIdArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorGetWorkerId) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("getWorkerId", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorGetWorkerId) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceGetWorkerIdArgs) - var result MetaServiceGetWorkerIdResult - if retval, err := p.handler.GetWorkerId(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getWorkerId: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorCreateTagIndex struct { - handler MetaService -} - -func (p *MetaServiceCreateTagIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropTagIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetTagIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListTagIndexesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceRebuildTagIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListTagIndexStatusResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceCreateEdgeIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropEdgeIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetEdgeIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListEdgeIndexesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceRebuildEdgeIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListEdgeIndexStatusResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceCreateUserResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropUserResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceAlterUserResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGrantRoleResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceRevokeRoleResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListUsersResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListRolesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetUserRolesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceChangePasswordResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceHeartBeatResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorAgentHeartbeat struct { - handler MetaService -} - -func (p *MetaServiceAgentHeartbeatResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorAgentHeartbeat) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceAgentHeartbeatArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorAgentHeartbeat) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("agentHeartbeat", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorAgentHeartbeat) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceAgentHeartbeatArgs) - var result MetaServiceAgentHeartbeatResult - if retval, err := p.handler.AgentHeartbeat(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing agentHeartbeat: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorRegConfig struct { - handler MetaService -} - -func (p *MetaServiceRegConfigResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetConfigResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceSetConfigResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListConfigsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceCreateSnapshotResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropSnapshotResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListSnapshotsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceRunAdminJobResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorMergeZone struct { - handler MetaService -} - -func (p *MetaServiceMergeZoneResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorMergeZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceMergeZoneArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorMergeZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("mergeZone", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorMergeZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceMergeZoneArgs) - var result MetaServiceMergeZoneResult - if retval, err := p.handler.MergeZone(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing mergeZone: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorDropZone struct { - handler MetaService -} - -func (p *MetaServiceDropZoneResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorDivideZone struct { - handler MetaService -} - -func (p *MetaServiceDivideZoneResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorDivideZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceDivideZoneArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorDivideZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("divideZone", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorDivideZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceDivideZoneArgs) - var result MetaServiceDivideZoneResult - if retval, err := p.handler.DivideZone(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing divideZone: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorRenameZone struct { - handler MetaService -} - -func (p *MetaServiceRenameZoneResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorRenameZone) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceRenameZoneArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorRenameZone) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("renameZone", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorRenameZone) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceRenameZoneArgs) - var result MetaServiceRenameZoneResult - if retval, err := p.handler.RenameZone(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing renameZone: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorGetZone struct { - handler MetaService -} - -func (p *MetaServiceGetZoneResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListZonesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorAddListener struct { - handler MetaService -} - -func (p *MetaServiceAddListenerResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceRemoveListenerResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListListenerResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetStatsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorSignInService struct { - handler MetaService -} - -func (p *MetaServiceSignInServiceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorSignInService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceSignInServiceArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorSignInService) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("signInService", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorSignInService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceSignInServiceArgs) - var result MetaServiceSignInServiceResult - if retval, err := p.handler.SignInService(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signInService: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorSignOutService struct { - handler MetaService -} - -func (p *MetaServiceSignOutServiceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorSignOutService) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceSignOutServiceArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorSignOutService) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("signOutService", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorSignOutService) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceSignOutServiceArgs) - var result MetaServiceSignOutServiceResult - if retval, err := p.handler.SignOutService(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing signOutService: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorListServiceClients struct { - handler MetaService -} - -func (p *MetaServiceListServiceClientsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorListServiceClients) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceListServiceClientsArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorListServiceClients) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("listServiceClients", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorListServiceClients) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceListServiceClientsArgs) - var result MetaServiceListServiceClientsResult - if retval, err := p.handler.ListServiceClients(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing listServiceClients: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorCreateFTIndex struct { - handler MetaService -} - -func (p *MetaServiceCreateFTIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceDropFTIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListFTIndexesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceCreateSessionResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceUpdateSessionsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceListSessionsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetSessionResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceRemoveSessionResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceKillQueryResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceReportTaskFinishResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorCreateBackup struct { - handler MetaService -} - -func (p *MetaServiceCreateBackupResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceRestoreMetaResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 metaServiceProcessorListCluster struct { - handler MetaService -} - -func (p *MetaServiceListClusterResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceGetMetaDirInfoResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *MetaServiceVerifyClientVersionResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 -} - -type metaServiceProcessorSaveGraphVersion struct { - handler MetaService -} - -func (p *MetaServiceSaveGraphVersionResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorSaveGraphVersion) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceSaveGraphVersionArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorSaveGraphVersion) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("saveGraphVersion", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorSaveGraphVersion) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceSaveGraphVersionArgs) - var result MetaServiceSaveGraphVersionResult - if retval, err := p.handler.SaveGraphVersion(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing saveGraphVersion: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type metaServiceProcessorGetSegmentId struct { - handler MetaService -} - -func (p *MetaServiceGetSegmentIdResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *metaServiceProcessorGetSegmentId) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := MetaServiceGetSegmentIdArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *metaServiceProcessorGetSegmentId) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("getSegmentId", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *metaServiceProcessorGetSegmentId) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*MetaServiceGetSegmentIdArgs) - var result MetaServiceGetSegmentIdResult - if retval, err := p.handler.GetSegmentId(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getSegmentId: " + 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 -} - -type MetaServiceCreateSpaceArgsBuilder struct { - obj *MetaServiceCreateSpaceArgs -} - -func NewMetaServiceCreateSpaceArgsBuilder() *MetaServiceCreateSpaceArgsBuilder{ - return &MetaServiceCreateSpaceArgsBuilder{ - obj: NewMetaServiceCreateSpaceArgs(), - } -} - -func (p MetaServiceCreateSpaceArgsBuilder) Emit() *MetaServiceCreateSpaceArgs{ - return &MetaServiceCreateSpaceArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateSpaceArgsBuilder) Req(req *CreateSpaceReq) *MetaServiceCreateSpaceArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateSpaceArgs) SetReq(req *CreateSpaceReq) *MetaServiceCreateSpaceArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateSpaceResultBuilder struct { - obj *MetaServiceCreateSpaceResult -} - -func NewMetaServiceCreateSpaceResultBuilder() *MetaServiceCreateSpaceResultBuilder{ - return &MetaServiceCreateSpaceResultBuilder{ - obj: NewMetaServiceCreateSpaceResult(), - } -} - -func (p MetaServiceCreateSpaceResultBuilder) Emit() *MetaServiceCreateSpaceResult{ - return &MetaServiceCreateSpaceResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateSpaceResultBuilder) Success(success *ExecResp) *MetaServiceCreateSpaceResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateSpaceResult) SetSuccess(success *ExecResp) *MetaServiceCreateSpaceResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropSpaceArgsBuilder struct { - obj *MetaServiceDropSpaceArgs -} - -func NewMetaServiceDropSpaceArgsBuilder() *MetaServiceDropSpaceArgsBuilder{ - return &MetaServiceDropSpaceArgsBuilder{ - obj: NewMetaServiceDropSpaceArgs(), - } -} - -func (p MetaServiceDropSpaceArgsBuilder) Emit() *MetaServiceDropSpaceArgs{ - return &MetaServiceDropSpaceArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropSpaceArgsBuilder) Req(req *DropSpaceReq) *MetaServiceDropSpaceArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropSpaceArgs) SetReq(req *DropSpaceReq) *MetaServiceDropSpaceArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropSpaceResultBuilder struct { - obj *MetaServiceDropSpaceResult -} - -func NewMetaServiceDropSpaceResultBuilder() *MetaServiceDropSpaceResultBuilder{ - return &MetaServiceDropSpaceResultBuilder{ - obj: NewMetaServiceDropSpaceResult(), - } -} - -func (p MetaServiceDropSpaceResultBuilder) Emit() *MetaServiceDropSpaceResult{ - return &MetaServiceDropSpaceResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropSpaceResultBuilder) Success(success *ExecResp) *MetaServiceDropSpaceResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropSpaceResult) SetSuccess(success *ExecResp) *MetaServiceDropSpaceResult { - m.Success = success - return m -} - -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 MetaServiceClearSpaceArgs struct { - thrift.IRequest - Req *ClearSpaceReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceClearSpaceArgs() *MetaServiceClearSpaceArgs { - return &MetaServiceClearSpaceArgs{ - Req: NewClearSpaceReq(), - } -} - -var MetaServiceClearSpaceArgs_Req_DEFAULT *ClearSpaceReq -func (p *MetaServiceClearSpaceArgs) GetReq() *ClearSpaceReq { - if !p.IsSetReq() { - return MetaServiceClearSpaceArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceClearSpaceArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceClearSpaceArgsBuilder struct { - obj *MetaServiceClearSpaceArgs -} - -func NewMetaServiceClearSpaceArgsBuilder() *MetaServiceClearSpaceArgsBuilder{ - return &MetaServiceClearSpaceArgsBuilder{ - obj: NewMetaServiceClearSpaceArgs(), - } -} - -func (p MetaServiceClearSpaceArgsBuilder) Emit() *MetaServiceClearSpaceArgs{ - return &MetaServiceClearSpaceArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceClearSpaceArgsBuilder) Req(req *ClearSpaceReq) *MetaServiceClearSpaceArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceClearSpaceArgs) SetReq(req *ClearSpaceReq) *MetaServiceClearSpaceArgs { - m.Req = req - return m -} - -func (p *MetaServiceClearSpaceArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceClearSpaceArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewClearSpaceReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceClearSpaceArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("clearSpace_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceClearSpaceArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceClearSpaceArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceClearSpaceArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceClearSpaceResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceClearSpaceResult() *MetaServiceClearSpaceResult { - return &MetaServiceClearSpaceResult{} -} - -var MetaServiceClearSpaceResult_Success_DEFAULT *ExecResp -func (p *MetaServiceClearSpaceResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceClearSpaceResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceClearSpaceResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceClearSpaceResultBuilder struct { - obj *MetaServiceClearSpaceResult -} - -func NewMetaServiceClearSpaceResultBuilder() *MetaServiceClearSpaceResultBuilder{ - return &MetaServiceClearSpaceResultBuilder{ - obj: NewMetaServiceClearSpaceResult(), - } -} - -func (p MetaServiceClearSpaceResultBuilder) Emit() *MetaServiceClearSpaceResult{ - return &MetaServiceClearSpaceResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceClearSpaceResultBuilder) Success(success *ExecResp) *MetaServiceClearSpaceResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceClearSpaceResult) SetSuccess(success *ExecResp) *MetaServiceClearSpaceResult { - m.Success = success - return m -} - -func (p *MetaServiceClearSpaceResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceClearSpaceResult) 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 *MetaServiceClearSpaceResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("clearSpace_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceClearSpaceResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceClearSpaceResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceClearSpaceResult({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 -} - -type MetaServiceGetSpaceArgsBuilder struct { - obj *MetaServiceGetSpaceArgs -} - -func NewMetaServiceGetSpaceArgsBuilder() *MetaServiceGetSpaceArgsBuilder{ - return &MetaServiceGetSpaceArgsBuilder{ - obj: NewMetaServiceGetSpaceArgs(), - } -} - -func (p MetaServiceGetSpaceArgsBuilder) Emit() *MetaServiceGetSpaceArgs{ - return &MetaServiceGetSpaceArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetSpaceArgsBuilder) Req(req *GetSpaceReq) *MetaServiceGetSpaceArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetSpaceArgs) SetReq(req *GetSpaceReq) *MetaServiceGetSpaceArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetSpaceResultBuilder struct { - obj *MetaServiceGetSpaceResult -} - -func NewMetaServiceGetSpaceResultBuilder() *MetaServiceGetSpaceResultBuilder{ - return &MetaServiceGetSpaceResultBuilder{ - obj: NewMetaServiceGetSpaceResult(), - } -} - -func (p MetaServiceGetSpaceResultBuilder) Emit() *MetaServiceGetSpaceResult{ - return &MetaServiceGetSpaceResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetSpaceResultBuilder) Success(success *GetSpaceResp) *MetaServiceGetSpaceResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetSpaceResult) SetSuccess(success *GetSpaceResp) *MetaServiceGetSpaceResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListSpacesArgsBuilder struct { - obj *MetaServiceListSpacesArgs -} - -func NewMetaServiceListSpacesArgsBuilder() *MetaServiceListSpacesArgsBuilder{ - return &MetaServiceListSpacesArgsBuilder{ - obj: NewMetaServiceListSpacesArgs(), - } -} - -func (p MetaServiceListSpacesArgsBuilder) Emit() *MetaServiceListSpacesArgs{ - return &MetaServiceListSpacesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListSpacesArgsBuilder) Req(req *ListSpacesReq) *MetaServiceListSpacesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListSpacesArgs) SetReq(req *ListSpacesReq) *MetaServiceListSpacesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListSpacesResultBuilder struct { - obj *MetaServiceListSpacesResult -} - -func NewMetaServiceListSpacesResultBuilder() *MetaServiceListSpacesResultBuilder{ - return &MetaServiceListSpacesResultBuilder{ - obj: NewMetaServiceListSpacesResult(), - } -} - -func (p MetaServiceListSpacesResultBuilder) Emit() *MetaServiceListSpacesResult{ - return &MetaServiceListSpacesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListSpacesResultBuilder) Success(success *ListSpacesResp) *MetaServiceListSpacesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListSpacesResult) SetSuccess(success *ListSpacesResp) *MetaServiceListSpacesResult { - m.Success = success - return m -} - -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 MetaServiceAlterSpaceArgs struct { - thrift.IRequest - Req *AlterSpaceReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceAlterSpaceArgs() *MetaServiceAlterSpaceArgs { - return &MetaServiceAlterSpaceArgs{ - Req: NewAlterSpaceReq(), - } -} - -var MetaServiceAlterSpaceArgs_Req_DEFAULT *AlterSpaceReq -func (p *MetaServiceAlterSpaceArgs) GetReq() *AlterSpaceReq { - if !p.IsSetReq() { - return MetaServiceAlterSpaceArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceAlterSpaceArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceAlterSpaceArgsBuilder struct { - obj *MetaServiceAlterSpaceArgs -} - -func NewMetaServiceAlterSpaceArgsBuilder() *MetaServiceAlterSpaceArgsBuilder{ - return &MetaServiceAlterSpaceArgsBuilder{ - obj: NewMetaServiceAlterSpaceArgs(), - } -} - -func (p MetaServiceAlterSpaceArgsBuilder) Emit() *MetaServiceAlterSpaceArgs{ - return &MetaServiceAlterSpaceArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAlterSpaceArgsBuilder) Req(req *AlterSpaceReq) *MetaServiceAlterSpaceArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAlterSpaceArgs) SetReq(req *AlterSpaceReq) *MetaServiceAlterSpaceArgs { - m.Req = req - return m -} - -func (p *MetaServiceAlterSpaceArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAlterSpaceArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewAlterSpaceReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceAlterSpaceArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("alterSpace_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAlterSpaceArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceAlterSpaceArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceAlterSpaceArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceAlterSpaceResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceAlterSpaceResult() *MetaServiceAlterSpaceResult { - return &MetaServiceAlterSpaceResult{} -} - -var MetaServiceAlterSpaceResult_Success_DEFAULT *ExecResp -func (p *MetaServiceAlterSpaceResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceAlterSpaceResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceAlterSpaceResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceAlterSpaceResultBuilder struct { - obj *MetaServiceAlterSpaceResult -} - -func NewMetaServiceAlterSpaceResultBuilder() *MetaServiceAlterSpaceResultBuilder{ - return &MetaServiceAlterSpaceResultBuilder{ - obj: NewMetaServiceAlterSpaceResult(), - } -} - -func (p MetaServiceAlterSpaceResultBuilder) Emit() *MetaServiceAlterSpaceResult{ - return &MetaServiceAlterSpaceResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAlterSpaceResultBuilder) Success(success *ExecResp) *MetaServiceAlterSpaceResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAlterSpaceResult) SetSuccess(success *ExecResp) *MetaServiceAlterSpaceResult { - m.Success = success - return m -} - -func (p *MetaServiceAlterSpaceResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAlterSpaceResult) 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 *MetaServiceAlterSpaceResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("alterSpace_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAlterSpaceResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceAlterSpaceResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceAlterSpaceResult({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 -} - -type MetaServiceCreateSpaceAsArgsBuilder struct { - obj *MetaServiceCreateSpaceAsArgs -} - -func NewMetaServiceCreateSpaceAsArgsBuilder() *MetaServiceCreateSpaceAsArgsBuilder{ - return &MetaServiceCreateSpaceAsArgsBuilder{ - obj: NewMetaServiceCreateSpaceAsArgs(), - } -} - -func (p MetaServiceCreateSpaceAsArgsBuilder) Emit() *MetaServiceCreateSpaceAsArgs{ - return &MetaServiceCreateSpaceAsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateSpaceAsArgsBuilder) Req(req *CreateSpaceAsReq) *MetaServiceCreateSpaceAsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateSpaceAsArgs) SetReq(req *CreateSpaceAsReq) *MetaServiceCreateSpaceAsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateSpaceAsResultBuilder struct { - obj *MetaServiceCreateSpaceAsResult -} - -func NewMetaServiceCreateSpaceAsResultBuilder() *MetaServiceCreateSpaceAsResultBuilder{ - return &MetaServiceCreateSpaceAsResultBuilder{ - obj: NewMetaServiceCreateSpaceAsResult(), - } -} - -func (p MetaServiceCreateSpaceAsResultBuilder) Emit() *MetaServiceCreateSpaceAsResult{ - return &MetaServiceCreateSpaceAsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateSpaceAsResultBuilder) Success(success *ExecResp) *MetaServiceCreateSpaceAsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateSpaceAsResult) SetSuccess(success *ExecResp) *MetaServiceCreateSpaceAsResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceCreateTagArgsBuilder struct { - obj *MetaServiceCreateTagArgs -} - -func NewMetaServiceCreateTagArgsBuilder() *MetaServiceCreateTagArgsBuilder{ - return &MetaServiceCreateTagArgsBuilder{ - obj: NewMetaServiceCreateTagArgs(), - } -} - -func (p MetaServiceCreateTagArgsBuilder) Emit() *MetaServiceCreateTagArgs{ - return &MetaServiceCreateTagArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateTagArgsBuilder) Req(req *CreateTagReq) *MetaServiceCreateTagArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateTagArgs) SetReq(req *CreateTagReq) *MetaServiceCreateTagArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateTagResultBuilder struct { - obj *MetaServiceCreateTagResult -} - -func NewMetaServiceCreateTagResultBuilder() *MetaServiceCreateTagResultBuilder{ - return &MetaServiceCreateTagResultBuilder{ - obj: NewMetaServiceCreateTagResult(), - } -} - -func (p MetaServiceCreateTagResultBuilder) Emit() *MetaServiceCreateTagResult{ - return &MetaServiceCreateTagResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateTagResultBuilder) Success(success *ExecResp) *MetaServiceCreateTagResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateTagResult) SetSuccess(success *ExecResp) *MetaServiceCreateTagResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceAlterTagArgsBuilder struct { - obj *MetaServiceAlterTagArgs -} - -func NewMetaServiceAlterTagArgsBuilder() *MetaServiceAlterTagArgsBuilder{ - return &MetaServiceAlterTagArgsBuilder{ - obj: NewMetaServiceAlterTagArgs(), - } -} - -func (p MetaServiceAlterTagArgsBuilder) Emit() *MetaServiceAlterTagArgs{ - return &MetaServiceAlterTagArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAlterTagArgsBuilder) Req(req *AlterTagReq) *MetaServiceAlterTagArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAlterTagArgs) SetReq(req *AlterTagReq) *MetaServiceAlterTagArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceAlterTagResultBuilder struct { - obj *MetaServiceAlterTagResult -} - -func NewMetaServiceAlterTagResultBuilder() *MetaServiceAlterTagResultBuilder{ - return &MetaServiceAlterTagResultBuilder{ - obj: NewMetaServiceAlterTagResult(), - } -} - -func (p MetaServiceAlterTagResultBuilder) Emit() *MetaServiceAlterTagResult{ - return &MetaServiceAlterTagResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAlterTagResultBuilder) Success(success *ExecResp) *MetaServiceAlterTagResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAlterTagResult) SetSuccess(success *ExecResp) *MetaServiceAlterTagResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropTagArgsBuilder struct { - obj *MetaServiceDropTagArgs -} - -func NewMetaServiceDropTagArgsBuilder() *MetaServiceDropTagArgsBuilder{ - return &MetaServiceDropTagArgsBuilder{ - obj: NewMetaServiceDropTagArgs(), - } -} - -func (p MetaServiceDropTagArgsBuilder) Emit() *MetaServiceDropTagArgs{ - return &MetaServiceDropTagArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropTagArgsBuilder) Req(req *DropTagReq) *MetaServiceDropTagArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropTagArgs) SetReq(req *DropTagReq) *MetaServiceDropTagArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropTagResultBuilder struct { - obj *MetaServiceDropTagResult -} - -func NewMetaServiceDropTagResultBuilder() *MetaServiceDropTagResultBuilder{ - return &MetaServiceDropTagResultBuilder{ - obj: NewMetaServiceDropTagResult(), - } -} - -func (p MetaServiceDropTagResultBuilder) Emit() *MetaServiceDropTagResult{ - return &MetaServiceDropTagResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropTagResultBuilder) Success(success *ExecResp) *MetaServiceDropTagResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropTagResult) SetSuccess(success *ExecResp) *MetaServiceDropTagResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetTagArgsBuilder struct { - obj *MetaServiceGetTagArgs -} - -func NewMetaServiceGetTagArgsBuilder() *MetaServiceGetTagArgsBuilder{ - return &MetaServiceGetTagArgsBuilder{ - obj: NewMetaServiceGetTagArgs(), - } -} - -func (p MetaServiceGetTagArgsBuilder) Emit() *MetaServiceGetTagArgs{ - return &MetaServiceGetTagArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetTagArgsBuilder) Req(req *GetTagReq) *MetaServiceGetTagArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetTagArgs) SetReq(req *GetTagReq) *MetaServiceGetTagArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetTagResultBuilder struct { - obj *MetaServiceGetTagResult -} - -func NewMetaServiceGetTagResultBuilder() *MetaServiceGetTagResultBuilder{ - return &MetaServiceGetTagResultBuilder{ - obj: NewMetaServiceGetTagResult(), - } -} - -func (p MetaServiceGetTagResultBuilder) Emit() *MetaServiceGetTagResult{ - return &MetaServiceGetTagResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetTagResultBuilder) Success(success *GetTagResp) *MetaServiceGetTagResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetTagResult) SetSuccess(success *GetTagResp) *MetaServiceGetTagResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListTagsArgsBuilder struct { - obj *MetaServiceListTagsArgs -} - -func NewMetaServiceListTagsArgsBuilder() *MetaServiceListTagsArgsBuilder{ - return &MetaServiceListTagsArgsBuilder{ - obj: NewMetaServiceListTagsArgs(), - } -} - -func (p MetaServiceListTagsArgsBuilder) Emit() *MetaServiceListTagsArgs{ - return &MetaServiceListTagsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListTagsArgsBuilder) Req(req *ListTagsReq) *MetaServiceListTagsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListTagsArgs) SetReq(req *ListTagsReq) *MetaServiceListTagsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListTagsResultBuilder struct { - obj *MetaServiceListTagsResult -} - -func NewMetaServiceListTagsResultBuilder() *MetaServiceListTagsResultBuilder{ - return &MetaServiceListTagsResultBuilder{ - obj: NewMetaServiceListTagsResult(), - } -} - -func (p MetaServiceListTagsResultBuilder) Emit() *MetaServiceListTagsResult{ - return &MetaServiceListTagsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListTagsResultBuilder) Success(success *ListTagsResp) *MetaServiceListTagsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListTagsResult) SetSuccess(success *ListTagsResp) *MetaServiceListTagsResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceCreateEdgeArgsBuilder struct { - obj *MetaServiceCreateEdgeArgs -} - -func NewMetaServiceCreateEdgeArgsBuilder() *MetaServiceCreateEdgeArgsBuilder{ - return &MetaServiceCreateEdgeArgsBuilder{ - obj: NewMetaServiceCreateEdgeArgs(), - } -} - -func (p MetaServiceCreateEdgeArgsBuilder) Emit() *MetaServiceCreateEdgeArgs{ - return &MetaServiceCreateEdgeArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateEdgeArgsBuilder) Req(req *CreateEdgeReq) *MetaServiceCreateEdgeArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateEdgeArgs) SetReq(req *CreateEdgeReq) *MetaServiceCreateEdgeArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateEdgeResultBuilder struct { - obj *MetaServiceCreateEdgeResult -} - -func NewMetaServiceCreateEdgeResultBuilder() *MetaServiceCreateEdgeResultBuilder{ - return &MetaServiceCreateEdgeResultBuilder{ - obj: NewMetaServiceCreateEdgeResult(), - } -} - -func (p MetaServiceCreateEdgeResultBuilder) Emit() *MetaServiceCreateEdgeResult{ - return &MetaServiceCreateEdgeResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateEdgeResultBuilder) Success(success *ExecResp) *MetaServiceCreateEdgeResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateEdgeResult) SetSuccess(success *ExecResp) *MetaServiceCreateEdgeResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceAlterEdgeArgsBuilder struct { - obj *MetaServiceAlterEdgeArgs -} - -func NewMetaServiceAlterEdgeArgsBuilder() *MetaServiceAlterEdgeArgsBuilder{ - return &MetaServiceAlterEdgeArgsBuilder{ - obj: NewMetaServiceAlterEdgeArgs(), - } -} - -func (p MetaServiceAlterEdgeArgsBuilder) Emit() *MetaServiceAlterEdgeArgs{ - return &MetaServiceAlterEdgeArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAlterEdgeArgsBuilder) Req(req *AlterEdgeReq) *MetaServiceAlterEdgeArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAlterEdgeArgs) SetReq(req *AlterEdgeReq) *MetaServiceAlterEdgeArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceAlterEdgeResultBuilder struct { - obj *MetaServiceAlterEdgeResult -} - -func NewMetaServiceAlterEdgeResultBuilder() *MetaServiceAlterEdgeResultBuilder{ - return &MetaServiceAlterEdgeResultBuilder{ - obj: NewMetaServiceAlterEdgeResult(), - } -} - -func (p MetaServiceAlterEdgeResultBuilder) Emit() *MetaServiceAlterEdgeResult{ - return &MetaServiceAlterEdgeResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAlterEdgeResultBuilder) Success(success *ExecResp) *MetaServiceAlterEdgeResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAlterEdgeResult) SetSuccess(success *ExecResp) *MetaServiceAlterEdgeResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropEdgeArgsBuilder struct { - obj *MetaServiceDropEdgeArgs -} - -func NewMetaServiceDropEdgeArgsBuilder() *MetaServiceDropEdgeArgsBuilder{ - return &MetaServiceDropEdgeArgsBuilder{ - obj: NewMetaServiceDropEdgeArgs(), - } -} - -func (p MetaServiceDropEdgeArgsBuilder) Emit() *MetaServiceDropEdgeArgs{ - return &MetaServiceDropEdgeArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropEdgeArgsBuilder) Req(req *DropEdgeReq) *MetaServiceDropEdgeArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropEdgeArgs) SetReq(req *DropEdgeReq) *MetaServiceDropEdgeArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropEdgeResultBuilder struct { - obj *MetaServiceDropEdgeResult -} - -func NewMetaServiceDropEdgeResultBuilder() *MetaServiceDropEdgeResultBuilder{ - return &MetaServiceDropEdgeResultBuilder{ - obj: NewMetaServiceDropEdgeResult(), - } -} - -func (p MetaServiceDropEdgeResultBuilder) Emit() *MetaServiceDropEdgeResult{ - return &MetaServiceDropEdgeResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropEdgeResultBuilder) Success(success *ExecResp) *MetaServiceDropEdgeResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropEdgeResult) SetSuccess(success *ExecResp) *MetaServiceDropEdgeResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetEdgeArgsBuilder struct { - obj *MetaServiceGetEdgeArgs -} - -func NewMetaServiceGetEdgeArgsBuilder() *MetaServiceGetEdgeArgsBuilder{ - return &MetaServiceGetEdgeArgsBuilder{ - obj: NewMetaServiceGetEdgeArgs(), - } -} - -func (p MetaServiceGetEdgeArgsBuilder) Emit() *MetaServiceGetEdgeArgs{ - return &MetaServiceGetEdgeArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetEdgeArgsBuilder) Req(req *GetEdgeReq) *MetaServiceGetEdgeArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetEdgeArgs) SetReq(req *GetEdgeReq) *MetaServiceGetEdgeArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetEdgeResultBuilder struct { - obj *MetaServiceGetEdgeResult -} - -func NewMetaServiceGetEdgeResultBuilder() *MetaServiceGetEdgeResultBuilder{ - return &MetaServiceGetEdgeResultBuilder{ - obj: NewMetaServiceGetEdgeResult(), - } -} - -func (p MetaServiceGetEdgeResultBuilder) Emit() *MetaServiceGetEdgeResult{ - return &MetaServiceGetEdgeResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetEdgeResultBuilder) Success(success *GetEdgeResp) *MetaServiceGetEdgeResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetEdgeResult) SetSuccess(success *GetEdgeResp) *MetaServiceGetEdgeResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListEdgesArgsBuilder struct { - obj *MetaServiceListEdgesArgs -} - -func NewMetaServiceListEdgesArgsBuilder() *MetaServiceListEdgesArgsBuilder{ - return &MetaServiceListEdgesArgsBuilder{ - obj: NewMetaServiceListEdgesArgs(), - } -} - -func (p MetaServiceListEdgesArgsBuilder) Emit() *MetaServiceListEdgesArgs{ - return &MetaServiceListEdgesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListEdgesArgsBuilder) Req(req *ListEdgesReq) *MetaServiceListEdgesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListEdgesArgs) SetReq(req *ListEdgesReq) *MetaServiceListEdgesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListEdgesResultBuilder struct { - obj *MetaServiceListEdgesResult -} - -func NewMetaServiceListEdgesResultBuilder() *MetaServiceListEdgesResultBuilder{ - return &MetaServiceListEdgesResultBuilder{ - obj: NewMetaServiceListEdgesResult(), - } -} - -func (p MetaServiceListEdgesResultBuilder) Emit() *MetaServiceListEdgesResult{ - return &MetaServiceListEdgesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListEdgesResultBuilder) Success(success *ListEdgesResp) *MetaServiceListEdgesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListEdgesResult) SetSuccess(success *ListEdgesResp) *MetaServiceListEdgesResult { - m.Success = success - return m -} - -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 MetaServiceAddHostsArgs struct { - thrift.IRequest - Req *AddHostsReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceAddHostsArgs() *MetaServiceAddHostsArgs { - return &MetaServiceAddHostsArgs{ - Req: NewAddHostsReq(), - } -} - -var MetaServiceAddHostsArgs_Req_DEFAULT *AddHostsReq -func (p *MetaServiceAddHostsArgs) GetReq() *AddHostsReq { - if !p.IsSetReq() { - return MetaServiceAddHostsArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceAddHostsArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceAddHostsArgsBuilder struct { - obj *MetaServiceAddHostsArgs -} - -func NewMetaServiceAddHostsArgsBuilder() *MetaServiceAddHostsArgsBuilder{ - return &MetaServiceAddHostsArgsBuilder{ - obj: NewMetaServiceAddHostsArgs(), - } -} - -func (p MetaServiceAddHostsArgsBuilder) Emit() *MetaServiceAddHostsArgs{ - return &MetaServiceAddHostsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAddHostsArgsBuilder) Req(req *AddHostsReq) *MetaServiceAddHostsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAddHostsArgs) SetReq(req *AddHostsReq) *MetaServiceAddHostsArgs { - m.Req = req - return m -} - -func (p *MetaServiceAddHostsArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAddHostsArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewAddHostsReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceAddHostsArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addHosts_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAddHostsArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceAddHostsArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceAddHostsArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceAddHostsResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceAddHostsResult() *MetaServiceAddHostsResult { - return &MetaServiceAddHostsResult{} -} - -var MetaServiceAddHostsResult_Success_DEFAULT *ExecResp -func (p *MetaServiceAddHostsResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceAddHostsResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceAddHostsResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceAddHostsResultBuilder struct { - obj *MetaServiceAddHostsResult -} - -func NewMetaServiceAddHostsResultBuilder() *MetaServiceAddHostsResultBuilder{ - return &MetaServiceAddHostsResultBuilder{ - obj: NewMetaServiceAddHostsResult(), - } -} - -func (p MetaServiceAddHostsResultBuilder) Emit() *MetaServiceAddHostsResult{ - return &MetaServiceAddHostsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAddHostsResultBuilder) Success(success *ExecResp) *MetaServiceAddHostsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAddHostsResult) SetSuccess(success *ExecResp) *MetaServiceAddHostsResult { - m.Success = success - return m -} - -func (p *MetaServiceAddHostsResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAddHostsResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceAddHostsResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addHosts_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAddHostsResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceAddHostsResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceAddHostsResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type MetaServiceAddHostsIntoZoneArgs struct { - thrift.IRequest - Req *AddHostsIntoZoneReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceAddHostsIntoZoneArgs() *MetaServiceAddHostsIntoZoneArgs { - return &MetaServiceAddHostsIntoZoneArgs{ - Req: NewAddHostsIntoZoneReq(), - } -} - -var MetaServiceAddHostsIntoZoneArgs_Req_DEFAULT *AddHostsIntoZoneReq -func (p *MetaServiceAddHostsIntoZoneArgs) GetReq() *AddHostsIntoZoneReq { - if !p.IsSetReq() { - return MetaServiceAddHostsIntoZoneArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceAddHostsIntoZoneArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceAddHostsIntoZoneArgsBuilder struct { - obj *MetaServiceAddHostsIntoZoneArgs -} - -func NewMetaServiceAddHostsIntoZoneArgsBuilder() *MetaServiceAddHostsIntoZoneArgsBuilder{ - return &MetaServiceAddHostsIntoZoneArgsBuilder{ - obj: NewMetaServiceAddHostsIntoZoneArgs(), - } -} - -func (p MetaServiceAddHostsIntoZoneArgsBuilder) Emit() *MetaServiceAddHostsIntoZoneArgs{ - return &MetaServiceAddHostsIntoZoneArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAddHostsIntoZoneArgsBuilder) Req(req *AddHostsIntoZoneReq) *MetaServiceAddHostsIntoZoneArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAddHostsIntoZoneArgs) SetReq(req *AddHostsIntoZoneReq) *MetaServiceAddHostsIntoZoneArgs { - m.Req = req - return m -} - -func (p *MetaServiceAddHostsIntoZoneArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAddHostsIntoZoneArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewAddHostsIntoZoneReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceAddHostsIntoZoneArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addHostsIntoZone_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAddHostsIntoZoneArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceAddHostsIntoZoneArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceAddHostsIntoZoneArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceAddHostsIntoZoneResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceAddHostsIntoZoneResult() *MetaServiceAddHostsIntoZoneResult { - return &MetaServiceAddHostsIntoZoneResult{} -} - -var MetaServiceAddHostsIntoZoneResult_Success_DEFAULT *ExecResp -func (p *MetaServiceAddHostsIntoZoneResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceAddHostsIntoZoneResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceAddHostsIntoZoneResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceAddHostsIntoZoneResultBuilder struct { - obj *MetaServiceAddHostsIntoZoneResult -} - -func NewMetaServiceAddHostsIntoZoneResultBuilder() *MetaServiceAddHostsIntoZoneResultBuilder{ - return &MetaServiceAddHostsIntoZoneResultBuilder{ - obj: NewMetaServiceAddHostsIntoZoneResult(), - } -} - -func (p MetaServiceAddHostsIntoZoneResultBuilder) Emit() *MetaServiceAddHostsIntoZoneResult{ - return &MetaServiceAddHostsIntoZoneResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAddHostsIntoZoneResultBuilder) Success(success *ExecResp) *MetaServiceAddHostsIntoZoneResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAddHostsIntoZoneResult) SetSuccess(success *ExecResp) *MetaServiceAddHostsIntoZoneResult { - m.Success = success - return m -} - -func (p *MetaServiceAddHostsIntoZoneResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAddHostsIntoZoneResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceAddHostsIntoZoneResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("addHostsIntoZone_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAddHostsIntoZoneResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceAddHostsIntoZoneResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceAddHostsIntoZoneResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type MetaServiceDropHostsArgs struct { - thrift.IRequest - Req *DropHostsReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceDropHostsArgs() *MetaServiceDropHostsArgs { - return &MetaServiceDropHostsArgs{ - Req: NewDropHostsReq(), - } -} - -var MetaServiceDropHostsArgs_Req_DEFAULT *DropHostsReq -func (p *MetaServiceDropHostsArgs) GetReq() *DropHostsReq { - if !p.IsSetReq() { - return MetaServiceDropHostsArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceDropHostsArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceDropHostsArgsBuilder struct { - obj *MetaServiceDropHostsArgs -} - -func NewMetaServiceDropHostsArgsBuilder() *MetaServiceDropHostsArgsBuilder{ - return &MetaServiceDropHostsArgsBuilder{ - obj: NewMetaServiceDropHostsArgs(), - } -} - -func (p MetaServiceDropHostsArgsBuilder) Emit() *MetaServiceDropHostsArgs{ - return &MetaServiceDropHostsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropHostsArgsBuilder) Req(req *DropHostsReq) *MetaServiceDropHostsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropHostsArgs) SetReq(req *DropHostsReq) *MetaServiceDropHostsArgs { - m.Req = req - return m -} - -func (p *MetaServiceDropHostsArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceDropHostsArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewDropHostsReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceDropHostsArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("dropHosts_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceDropHostsArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceDropHostsArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceDropHostsArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceDropHostsResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceDropHostsResult() *MetaServiceDropHostsResult { - return &MetaServiceDropHostsResult{} -} - -var MetaServiceDropHostsResult_Success_DEFAULT *ExecResp -func (p *MetaServiceDropHostsResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceDropHostsResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceDropHostsResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceDropHostsResultBuilder struct { - obj *MetaServiceDropHostsResult -} - -func NewMetaServiceDropHostsResultBuilder() *MetaServiceDropHostsResultBuilder{ - return &MetaServiceDropHostsResultBuilder{ - obj: NewMetaServiceDropHostsResult(), - } -} - -func (p MetaServiceDropHostsResultBuilder) Emit() *MetaServiceDropHostsResult{ - return &MetaServiceDropHostsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropHostsResultBuilder) Success(success *ExecResp) *MetaServiceDropHostsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropHostsResult) SetSuccess(success *ExecResp) *MetaServiceDropHostsResult { - m.Success = success - return m -} - -func (p *MetaServiceDropHostsResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceDropHostsResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceDropHostsResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("dropHosts_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceDropHostsResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceDropHostsResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceDropHostsResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type MetaServiceListHostsArgs struct { - 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 -} - -type MetaServiceListHostsArgsBuilder struct { - obj *MetaServiceListHostsArgs -} - -func NewMetaServiceListHostsArgsBuilder() *MetaServiceListHostsArgsBuilder{ - return &MetaServiceListHostsArgsBuilder{ - obj: NewMetaServiceListHostsArgs(), - } -} - -func (p MetaServiceListHostsArgsBuilder) Emit() *MetaServiceListHostsArgs{ - return &MetaServiceListHostsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListHostsArgsBuilder) Req(req *ListHostsReq) *MetaServiceListHostsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListHostsArgs) SetReq(req *ListHostsReq) *MetaServiceListHostsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListHostsResultBuilder struct { - obj *MetaServiceListHostsResult -} - -func NewMetaServiceListHostsResultBuilder() *MetaServiceListHostsResultBuilder{ - return &MetaServiceListHostsResultBuilder{ - obj: NewMetaServiceListHostsResult(), - } -} - -func (p MetaServiceListHostsResultBuilder) Emit() *MetaServiceListHostsResult{ - return &MetaServiceListHostsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListHostsResultBuilder) Success(success *ListHostsResp) *MetaServiceListHostsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListHostsResult) SetSuccess(success *ListHostsResp) *MetaServiceListHostsResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetPartsAllocArgsBuilder struct { - obj *MetaServiceGetPartsAllocArgs -} - -func NewMetaServiceGetPartsAllocArgsBuilder() *MetaServiceGetPartsAllocArgsBuilder{ - return &MetaServiceGetPartsAllocArgsBuilder{ - obj: NewMetaServiceGetPartsAllocArgs(), - } -} - -func (p MetaServiceGetPartsAllocArgsBuilder) Emit() *MetaServiceGetPartsAllocArgs{ - return &MetaServiceGetPartsAllocArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetPartsAllocArgsBuilder) Req(req *GetPartsAllocReq) *MetaServiceGetPartsAllocArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetPartsAllocArgs) SetReq(req *GetPartsAllocReq) *MetaServiceGetPartsAllocArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetPartsAllocResultBuilder struct { - obj *MetaServiceGetPartsAllocResult -} - -func NewMetaServiceGetPartsAllocResultBuilder() *MetaServiceGetPartsAllocResultBuilder{ - return &MetaServiceGetPartsAllocResultBuilder{ - obj: NewMetaServiceGetPartsAllocResult(), - } -} - -func (p MetaServiceGetPartsAllocResultBuilder) Emit() *MetaServiceGetPartsAllocResult{ - return &MetaServiceGetPartsAllocResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetPartsAllocResultBuilder) Success(success *GetPartsAllocResp) *MetaServiceGetPartsAllocResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetPartsAllocResult) SetSuccess(success *GetPartsAllocResp) *MetaServiceGetPartsAllocResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListPartsArgsBuilder struct { - obj *MetaServiceListPartsArgs -} - -func NewMetaServiceListPartsArgsBuilder() *MetaServiceListPartsArgsBuilder{ - return &MetaServiceListPartsArgsBuilder{ - obj: NewMetaServiceListPartsArgs(), - } -} - -func (p MetaServiceListPartsArgsBuilder) Emit() *MetaServiceListPartsArgs{ - return &MetaServiceListPartsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListPartsArgsBuilder) Req(req *ListPartsReq) *MetaServiceListPartsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListPartsArgs) SetReq(req *ListPartsReq) *MetaServiceListPartsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListPartsResultBuilder struct { - obj *MetaServiceListPartsResult -} - -func NewMetaServiceListPartsResultBuilder() *MetaServiceListPartsResultBuilder{ - return &MetaServiceListPartsResultBuilder{ - obj: NewMetaServiceListPartsResult(), - } -} - -func (p MetaServiceListPartsResultBuilder) Emit() *MetaServiceListPartsResult{ - return &MetaServiceListPartsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListPartsResultBuilder) Success(success *ListPartsResp) *MetaServiceListPartsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListPartsResult) SetSuccess(success *ListPartsResp) *MetaServiceListPartsResult { - m.Success = success - return m -} - -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 MetaServiceGetWorkerIdArgs struct { - thrift.IRequest - Req *GetWorkerIdReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceGetWorkerIdArgs() *MetaServiceGetWorkerIdArgs { - return &MetaServiceGetWorkerIdArgs{ - Req: NewGetWorkerIdReq(), - } -} - -var MetaServiceGetWorkerIdArgs_Req_DEFAULT *GetWorkerIdReq -func (p *MetaServiceGetWorkerIdArgs) GetReq() *GetWorkerIdReq { - if !p.IsSetReq() { - return MetaServiceGetWorkerIdArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceGetWorkerIdArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceGetWorkerIdArgsBuilder struct { - obj *MetaServiceGetWorkerIdArgs -} - -func NewMetaServiceGetWorkerIdArgsBuilder() *MetaServiceGetWorkerIdArgsBuilder{ - return &MetaServiceGetWorkerIdArgsBuilder{ - obj: NewMetaServiceGetWorkerIdArgs(), - } -} - -func (p MetaServiceGetWorkerIdArgsBuilder) Emit() *MetaServiceGetWorkerIdArgs{ - return &MetaServiceGetWorkerIdArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetWorkerIdArgsBuilder) Req(req *GetWorkerIdReq) *MetaServiceGetWorkerIdArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetWorkerIdArgs) SetReq(req *GetWorkerIdReq) *MetaServiceGetWorkerIdArgs { - m.Req = req - return m -} - -func (p *MetaServiceGetWorkerIdArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceGetWorkerIdArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewGetWorkerIdReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceGetWorkerIdArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("getWorkerId_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceGetWorkerIdArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceGetWorkerIdArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceGetWorkerIdArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceGetWorkerIdResult struct { - thrift.IResponse - Success *GetWorkerIdResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceGetWorkerIdResult() *MetaServiceGetWorkerIdResult { - return &MetaServiceGetWorkerIdResult{} -} - -var MetaServiceGetWorkerIdResult_Success_DEFAULT *GetWorkerIdResp -func (p *MetaServiceGetWorkerIdResult) GetSuccess() *GetWorkerIdResp { - if !p.IsSetSuccess() { - return MetaServiceGetWorkerIdResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceGetWorkerIdResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceGetWorkerIdResultBuilder struct { - obj *MetaServiceGetWorkerIdResult -} - -func NewMetaServiceGetWorkerIdResultBuilder() *MetaServiceGetWorkerIdResultBuilder{ - return &MetaServiceGetWorkerIdResultBuilder{ - obj: NewMetaServiceGetWorkerIdResult(), - } -} - -func (p MetaServiceGetWorkerIdResultBuilder) Emit() *MetaServiceGetWorkerIdResult{ - return &MetaServiceGetWorkerIdResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetWorkerIdResultBuilder) Success(success *GetWorkerIdResp) *MetaServiceGetWorkerIdResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetWorkerIdResult) SetSuccess(success *GetWorkerIdResp) *MetaServiceGetWorkerIdResult { - m.Success = success - return m -} - -func (p *MetaServiceGetWorkerIdResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceGetWorkerIdResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewGetWorkerIdResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceGetWorkerIdResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("getWorkerId_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceGetWorkerIdResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceGetWorkerIdResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceGetWorkerIdResult({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 -} - -type MetaServiceCreateTagIndexArgsBuilder struct { - obj *MetaServiceCreateTagIndexArgs -} - -func NewMetaServiceCreateTagIndexArgsBuilder() *MetaServiceCreateTagIndexArgsBuilder{ - return &MetaServiceCreateTagIndexArgsBuilder{ - obj: NewMetaServiceCreateTagIndexArgs(), - } -} - -func (p MetaServiceCreateTagIndexArgsBuilder) Emit() *MetaServiceCreateTagIndexArgs{ - return &MetaServiceCreateTagIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateTagIndexArgsBuilder) Req(req *CreateTagIndexReq) *MetaServiceCreateTagIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateTagIndexArgs) SetReq(req *CreateTagIndexReq) *MetaServiceCreateTagIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateTagIndexResultBuilder struct { - obj *MetaServiceCreateTagIndexResult -} - -func NewMetaServiceCreateTagIndexResultBuilder() *MetaServiceCreateTagIndexResultBuilder{ - return &MetaServiceCreateTagIndexResultBuilder{ - obj: NewMetaServiceCreateTagIndexResult(), - } -} - -func (p MetaServiceCreateTagIndexResultBuilder) Emit() *MetaServiceCreateTagIndexResult{ - return &MetaServiceCreateTagIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateTagIndexResultBuilder) Success(success *ExecResp) *MetaServiceCreateTagIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateTagIndexResult) SetSuccess(success *ExecResp) *MetaServiceCreateTagIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropTagIndexArgsBuilder struct { - obj *MetaServiceDropTagIndexArgs -} - -func NewMetaServiceDropTagIndexArgsBuilder() *MetaServiceDropTagIndexArgsBuilder{ - return &MetaServiceDropTagIndexArgsBuilder{ - obj: NewMetaServiceDropTagIndexArgs(), - } -} - -func (p MetaServiceDropTagIndexArgsBuilder) Emit() *MetaServiceDropTagIndexArgs{ - return &MetaServiceDropTagIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropTagIndexArgsBuilder) Req(req *DropTagIndexReq) *MetaServiceDropTagIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropTagIndexArgs) SetReq(req *DropTagIndexReq) *MetaServiceDropTagIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropTagIndexResultBuilder struct { - obj *MetaServiceDropTagIndexResult -} - -func NewMetaServiceDropTagIndexResultBuilder() *MetaServiceDropTagIndexResultBuilder{ - return &MetaServiceDropTagIndexResultBuilder{ - obj: NewMetaServiceDropTagIndexResult(), - } -} - -func (p MetaServiceDropTagIndexResultBuilder) Emit() *MetaServiceDropTagIndexResult{ - return &MetaServiceDropTagIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropTagIndexResultBuilder) Success(success *ExecResp) *MetaServiceDropTagIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropTagIndexResult) SetSuccess(success *ExecResp) *MetaServiceDropTagIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetTagIndexArgsBuilder struct { - obj *MetaServiceGetTagIndexArgs -} - -func NewMetaServiceGetTagIndexArgsBuilder() *MetaServiceGetTagIndexArgsBuilder{ - return &MetaServiceGetTagIndexArgsBuilder{ - obj: NewMetaServiceGetTagIndexArgs(), - } -} - -func (p MetaServiceGetTagIndexArgsBuilder) Emit() *MetaServiceGetTagIndexArgs{ - return &MetaServiceGetTagIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetTagIndexArgsBuilder) Req(req *GetTagIndexReq) *MetaServiceGetTagIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetTagIndexArgs) SetReq(req *GetTagIndexReq) *MetaServiceGetTagIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetTagIndexResultBuilder struct { - obj *MetaServiceGetTagIndexResult -} - -func NewMetaServiceGetTagIndexResultBuilder() *MetaServiceGetTagIndexResultBuilder{ - return &MetaServiceGetTagIndexResultBuilder{ - obj: NewMetaServiceGetTagIndexResult(), - } -} - -func (p MetaServiceGetTagIndexResultBuilder) Emit() *MetaServiceGetTagIndexResult{ - return &MetaServiceGetTagIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetTagIndexResultBuilder) Success(success *GetTagIndexResp) *MetaServiceGetTagIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetTagIndexResult) SetSuccess(success *GetTagIndexResp) *MetaServiceGetTagIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListTagIndexesArgsBuilder struct { - obj *MetaServiceListTagIndexesArgs -} - -func NewMetaServiceListTagIndexesArgsBuilder() *MetaServiceListTagIndexesArgsBuilder{ - return &MetaServiceListTagIndexesArgsBuilder{ - obj: NewMetaServiceListTagIndexesArgs(), - } -} - -func (p MetaServiceListTagIndexesArgsBuilder) Emit() *MetaServiceListTagIndexesArgs{ - return &MetaServiceListTagIndexesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListTagIndexesArgsBuilder) Req(req *ListTagIndexesReq) *MetaServiceListTagIndexesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListTagIndexesArgs) SetReq(req *ListTagIndexesReq) *MetaServiceListTagIndexesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListTagIndexesResultBuilder struct { - obj *MetaServiceListTagIndexesResult -} - -func NewMetaServiceListTagIndexesResultBuilder() *MetaServiceListTagIndexesResultBuilder{ - return &MetaServiceListTagIndexesResultBuilder{ - obj: NewMetaServiceListTagIndexesResult(), - } -} - -func (p MetaServiceListTagIndexesResultBuilder) Emit() *MetaServiceListTagIndexesResult{ - return &MetaServiceListTagIndexesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListTagIndexesResultBuilder) Success(success *ListTagIndexesResp) *MetaServiceListTagIndexesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListTagIndexesResult) SetSuccess(success *ListTagIndexesResp) *MetaServiceListTagIndexesResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceRebuildTagIndexArgsBuilder struct { - obj *MetaServiceRebuildTagIndexArgs -} - -func NewMetaServiceRebuildTagIndexArgsBuilder() *MetaServiceRebuildTagIndexArgsBuilder{ - return &MetaServiceRebuildTagIndexArgsBuilder{ - obj: NewMetaServiceRebuildTagIndexArgs(), - } -} - -func (p MetaServiceRebuildTagIndexArgsBuilder) Emit() *MetaServiceRebuildTagIndexArgs{ - return &MetaServiceRebuildTagIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRebuildTagIndexArgsBuilder) Req(req *RebuildIndexReq) *MetaServiceRebuildTagIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRebuildTagIndexArgs) SetReq(req *RebuildIndexReq) *MetaServiceRebuildTagIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceRebuildTagIndexResultBuilder struct { - obj *MetaServiceRebuildTagIndexResult -} - -func NewMetaServiceRebuildTagIndexResultBuilder() *MetaServiceRebuildTagIndexResultBuilder{ - return &MetaServiceRebuildTagIndexResultBuilder{ - obj: NewMetaServiceRebuildTagIndexResult(), - } -} - -func (p MetaServiceRebuildTagIndexResultBuilder) Emit() *MetaServiceRebuildTagIndexResult{ - return &MetaServiceRebuildTagIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRebuildTagIndexResultBuilder) Success(success *ExecResp) *MetaServiceRebuildTagIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRebuildTagIndexResult) SetSuccess(success *ExecResp) *MetaServiceRebuildTagIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListTagIndexStatusArgsBuilder struct { - obj *MetaServiceListTagIndexStatusArgs -} - -func NewMetaServiceListTagIndexStatusArgsBuilder() *MetaServiceListTagIndexStatusArgsBuilder{ - return &MetaServiceListTagIndexStatusArgsBuilder{ - obj: NewMetaServiceListTagIndexStatusArgs(), - } -} - -func (p MetaServiceListTagIndexStatusArgsBuilder) Emit() *MetaServiceListTagIndexStatusArgs{ - return &MetaServiceListTagIndexStatusArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListTagIndexStatusArgsBuilder) Req(req *ListIndexStatusReq) *MetaServiceListTagIndexStatusArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListTagIndexStatusArgs) SetReq(req *ListIndexStatusReq) *MetaServiceListTagIndexStatusArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListTagIndexStatusResultBuilder struct { - obj *MetaServiceListTagIndexStatusResult -} - -func NewMetaServiceListTagIndexStatusResultBuilder() *MetaServiceListTagIndexStatusResultBuilder{ - return &MetaServiceListTagIndexStatusResultBuilder{ - obj: NewMetaServiceListTagIndexStatusResult(), - } -} - -func (p MetaServiceListTagIndexStatusResultBuilder) Emit() *MetaServiceListTagIndexStatusResult{ - return &MetaServiceListTagIndexStatusResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListTagIndexStatusResultBuilder) Success(success *ListIndexStatusResp) *MetaServiceListTagIndexStatusResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListTagIndexStatusResult) SetSuccess(success *ListIndexStatusResp) *MetaServiceListTagIndexStatusResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceCreateEdgeIndexArgsBuilder struct { - obj *MetaServiceCreateEdgeIndexArgs -} - -func NewMetaServiceCreateEdgeIndexArgsBuilder() *MetaServiceCreateEdgeIndexArgsBuilder{ - return &MetaServiceCreateEdgeIndexArgsBuilder{ - obj: NewMetaServiceCreateEdgeIndexArgs(), - } -} - -func (p MetaServiceCreateEdgeIndexArgsBuilder) Emit() *MetaServiceCreateEdgeIndexArgs{ - return &MetaServiceCreateEdgeIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateEdgeIndexArgsBuilder) Req(req *CreateEdgeIndexReq) *MetaServiceCreateEdgeIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateEdgeIndexArgs) SetReq(req *CreateEdgeIndexReq) *MetaServiceCreateEdgeIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateEdgeIndexResultBuilder struct { - obj *MetaServiceCreateEdgeIndexResult -} - -func NewMetaServiceCreateEdgeIndexResultBuilder() *MetaServiceCreateEdgeIndexResultBuilder{ - return &MetaServiceCreateEdgeIndexResultBuilder{ - obj: NewMetaServiceCreateEdgeIndexResult(), - } -} - -func (p MetaServiceCreateEdgeIndexResultBuilder) Emit() *MetaServiceCreateEdgeIndexResult{ - return &MetaServiceCreateEdgeIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateEdgeIndexResultBuilder) Success(success *ExecResp) *MetaServiceCreateEdgeIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateEdgeIndexResult) SetSuccess(success *ExecResp) *MetaServiceCreateEdgeIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropEdgeIndexArgsBuilder struct { - obj *MetaServiceDropEdgeIndexArgs -} - -func NewMetaServiceDropEdgeIndexArgsBuilder() *MetaServiceDropEdgeIndexArgsBuilder{ - return &MetaServiceDropEdgeIndexArgsBuilder{ - obj: NewMetaServiceDropEdgeIndexArgs(), - } -} - -func (p MetaServiceDropEdgeIndexArgsBuilder) Emit() *MetaServiceDropEdgeIndexArgs{ - return &MetaServiceDropEdgeIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropEdgeIndexArgsBuilder) Req(req *DropEdgeIndexReq) *MetaServiceDropEdgeIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropEdgeIndexArgs) SetReq(req *DropEdgeIndexReq) *MetaServiceDropEdgeIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropEdgeIndexResultBuilder struct { - obj *MetaServiceDropEdgeIndexResult -} - -func NewMetaServiceDropEdgeIndexResultBuilder() *MetaServiceDropEdgeIndexResultBuilder{ - return &MetaServiceDropEdgeIndexResultBuilder{ - obj: NewMetaServiceDropEdgeIndexResult(), - } -} - -func (p MetaServiceDropEdgeIndexResultBuilder) Emit() *MetaServiceDropEdgeIndexResult{ - return &MetaServiceDropEdgeIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropEdgeIndexResultBuilder) Success(success *ExecResp) *MetaServiceDropEdgeIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropEdgeIndexResult) SetSuccess(success *ExecResp) *MetaServiceDropEdgeIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetEdgeIndexArgsBuilder struct { - obj *MetaServiceGetEdgeIndexArgs -} - -func NewMetaServiceGetEdgeIndexArgsBuilder() *MetaServiceGetEdgeIndexArgsBuilder{ - return &MetaServiceGetEdgeIndexArgsBuilder{ - obj: NewMetaServiceGetEdgeIndexArgs(), - } -} - -func (p MetaServiceGetEdgeIndexArgsBuilder) Emit() *MetaServiceGetEdgeIndexArgs{ - return &MetaServiceGetEdgeIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetEdgeIndexArgsBuilder) Req(req *GetEdgeIndexReq) *MetaServiceGetEdgeIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetEdgeIndexArgs) SetReq(req *GetEdgeIndexReq) *MetaServiceGetEdgeIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetEdgeIndexResultBuilder struct { - obj *MetaServiceGetEdgeIndexResult -} - -func NewMetaServiceGetEdgeIndexResultBuilder() *MetaServiceGetEdgeIndexResultBuilder{ - return &MetaServiceGetEdgeIndexResultBuilder{ - obj: NewMetaServiceGetEdgeIndexResult(), - } -} - -func (p MetaServiceGetEdgeIndexResultBuilder) Emit() *MetaServiceGetEdgeIndexResult{ - return &MetaServiceGetEdgeIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetEdgeIndexResultBuilder) Success(success *GetEdgeIndexResp) *MetaServiceGetEdgeIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetEdgeIndexResult) SetSuccess(success *GetEdgeIndexResp) *MetaServiceGetEdgeIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListEdgeIndexesArgsBuilder struct { - obj *MetaServiceListEdgeIndexesArgs -} - -func NewMetaServiceListEdgeIndexesArgsBuilder() *MetaServiceListEdgeIndexesArgsBuilder{ - return &MetaServiceListEdgeIndexesArgsBuilder{ - obj: NewMetaServiceListEdgeIndexesArgs(), - } -} - -func (p MetaServiceListEdgeIndexesArgsBuilder) Emit() *MetaServiceListEdgeIndexesArgs{ - return &MetaServiceListEdgeIndexesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListEdgeIndexesArgsBuilder) Req(req *ListEdgeIndexesReq) *MetaServiceListEdgeIndexesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListEdgeIndexesArgs) SetReq(req *ListEdgeIndexesReq) *MetaServiceListEdgeIndexesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListEdgeIndexesResultBuilder struct { - obj *MetaServiceListEdgeIndexesResult -} - -func NewMetaServiceListEdgeIndexesResultBuilder() *MetaServiceListEdgeIndexesResultBuilder{ - return &MetaServiceListEdgeIndexesResultBuilder{ - obj: NewMetaServiceListEdgeIndexesResult(), - } -} - -func (p MetaServiceListEdgeIndexesResultBuilder) Emit() *MetaServiceListEdgeIndexesResult{ - return &MetaServiceListEdgeIndexesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListEdgeIndexesResultBuilder) Success(success *ListEdgeIndexesResp) *MetaServiceListEdgeIndexesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListEdgeIndexesResult) SetSuccess(success *ListEdgeIndexesResp) *MetaServiceListEdgeIndexesResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceRebuildEdgeIndexArgsBuilder struct { - obj *MetaServiceRebuildEdgeIndexArgs -} - -func NewMetaServiceRebuildEdgeIndexArgsBuilder() *MetaServiceRebuildEdgeIndexArgsBuilder{ - return &MetaServiceRebuildEdgeIndexArgsBuilder{ - obj: NewMetaServiceRebuildEdgeIndexArgs(), - } -} - -func (p MetaServiceRebuildEdgeIndexArgsBuilder) Emit() *MetaServiceRebuildEdgeIndexArgs{ - return &MetaServiceRebuildEdgeIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRebuildEdgeIndexArgsBuilder) Req(req *RebuildIndexReq) *MetaServiceRebuildEdgeIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRebuildEdgeIndexArgs) SetReq(req *RebuildIndexReq) *MetaServiceRebuildEdgeIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceRebuildEdgeIndexResultBuilder struct { - obj *MetaServiceRebuildEdgeIndexResult -} - -func NewMetaServiceRebuildEdgeIndexResultBuilder() *MetaServiceRebuildEdgeIndexResultBuilder{ - return &MetaServiceRebuildEdgeIndexResultBuilder{ - obj: NewMetaServiceRebuildEdgeIndexResult(), - } -} - -func (p MetaServiceRebuildEdgeIndexResultBuilder) Emit() *MetaServiceRebuildEdgeIndexResult{ - return &MetaServiceRebuildEdgeIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRebuildEdgeIndexResultBuilder) Success(success *ExecResp) *MetaServiceRebuildEdgeIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRebuildEdgeIndexResult) SetSuccess(success *ExecResp) *MetaServiceRebuildEdgeIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListEdgeIndexStatusArgsBuilder struct { - obj *MetaServiceListEdgeIndexStatusArgs -} - -func NewMetaServiceListEdgeIndexStatusArgsBuilder() *MetaServiceListEdgeIndexStatusArgsBuilder{ - return &MetaServiceListEdgeIndexStatusArgsBuilder{ - obj: NewMetaServiceListEdgeIndexStatusArgs(), - } -} - -func (p MetaServiceListEdgeIndexStatusArgsBuilder) Emit() *MetaServiceListEdgeIndexStatusArgs{ - return &MetaServiceListEdgeIndexStatusArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListEdgeIndexStatusArgsBuilder) Req(req *ListIndexStatusReq) *MetaServiceListEdgeIndexStatusArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListEdgeIndexStatusArgs) SetReq(req *ListIndexStatusReq) *MetaServiceListEdgeIndexStatusArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListEdgeIndexStatusResultBuilder struct { - obj *MetaServiceListEdgeIndexStatusResult -} - -func NewMetaServiceListEdgeIndexStatusResultBuilder() *MetaServiceListEdgeIndexStatusResultBuilder{ - return &MetaServiceListEdgeIndexStatusResultBuilder{ - obj: NewMetaServiceListEdgeIndexStatusResult(), - } -} - -func (p MetaServiceListEdgeIndexStatusResultBuilder) Emit() *MetaServiceListEdgeIndexStatusResult{ - return &MetaServiceListEdgeIndexStatusResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListEdgeIndexStatusResultBuilder) Success(success *ListIndexStatusResp) *MetaServiceListEdgeIndexStatusResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListEdgeIndexStatusResult) SetSuccess(success *ListIndexStatusResp) *MetaServiceListEdgeIndexStatusResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceCreateUserArgsBuilder struct { - obj *MetaServiceCreateUserArgs -} - -func NewMetaServiceCreateUserArgsBuilder() *MetaServiceCreateUserArgsBuilder{ - return &MetaServiceCreateUserArgsBuilder{ - obj: NewMetaServiceCreateUserArgs(), - } -} - -func (p MetaServiceCreateUserArgsBuilder) Emit() *MetaServiceCreateUserArgs{ - return &MetaServiceCreateUserArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateUserArgsBuilder) Req(req *CreateUserReq) *MetaServiceCreateUserArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateUserArgs) SetReq(req *CreateUserReq) *MetaServiceCreateUserArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateUserResultBuilder struct { - obj *MetaServiceCreateUserResult -} - -func NewMetaServiceCreateUserResultBuilder() *MetaServiceCreateUserResultBuilder{ - return &MetaServiceCreateUserResultBuilder{ - obj: NewMetaServiceCreateUserResult(), - } -} - -func (p MetaServiceCreateUserResultBuilder) Emit() *MetaServiceCreateUserResult{ - return &MetaServiceCreateUserResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateUserResultBuilder) Success(success *ExecResp) *MetaServiceCreateUserResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateUserResult) SetSuccess(success *ExecResp) *MetaServiceCreateUserResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropUserArgsBuilder struct { - obj *MetaServiceDropUserArgs -} - -func NewMetaServiceDropUserArgsBuilder() *MetaServiceDropUserArgsBuilder{ - return &MetaServiceDropUserArgsBuilder{ - obj: NewMetaServiceDropUserArgs(), - } -} - -func (p MetaServiceDropUserArgsBuilder) Emit() *MetaServiceDropUserArgs{ - return &MetaServiceDropUserArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropUserArgsBuilder) Req(req *DropUserReq) *MetaServiceDropUserArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropUserArgs) SetReq(req *DropUserReq) *MetaServiceDropUserArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropUserResultBuilder struct { - obj *MetaServiceDropUserResult -} - -func NewMetaServiceDropUserResultBuilder() *MetaServiceDropUserResultBuilder{ - return &MetaServiceDropUserResultBuilder{ - obj: NewMetaServiceDropUserResult(), - } -} - -func (p MetaServiceDropUserResultBuilder) Emit() *MetaServiceDropUserResult{ - return &MetaServiceDropUserResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropUserResultBuilder) Success(success *ExecResp) *MetaServiceDropUserResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropUserResult) SetSuccess(success *ExecResp) *MetaServiceDropUserResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceAlterUserArgsBuilder struct { - obj *MetaServiceAlterUserArgs -} - -func NewMetaServiceAlterUserArgsBuilder() *MetaServiceAlterUserArgsBuilder{ - return &MetaServiceAlterUserArgsBuilder{ - obj: NewMetaServiceAlterUserArgs(), - } -} - -func (p MetaServiceAlterUserArgsBuilder) Emit() *MetaServiceAlterUserArgs{ - return &MetaServiceAlterUserArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAlterUserArgsBuilder) Req(req *AlterUserReq) *MetaServiceAlterUserArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAlterUserArgs) SetReq(req *AlterUserReq) *MetaServiceAlterUserArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceAlterUserResultBuilder struct { - obj *MetaServiceAlterUserResult -} - -func NewMetaServiceAlterUserResultBuilder() *MetaServiceAlterUserResultBuilder{ - return &MetaServiceAlterUserResultBuilder{ - obj: NewMetaServiceAlterUserResult(), - } -} - -func (p MetaServiceAlterUserResultBuilder) Emit() *MetaServiceAlterUserResult{ - return &MetaServiceAlterUserResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAlterUserResultBuilder) Success(success *ExecResp) *MetaServiceAlterUserResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAlterUserResult) SetSuccess(success *ExecResp) *MetaServiceAlterUserResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGrantRoleArgsBuilder struct { - obj *MetaServiceGrantRoleArgs -} - -func NewMetaServiceGrantRoleArgsBuilder() *MetaServiceGrantRoleArgsBuilder{ - return &MetaServiceGrantRoleArgsBuilder{ - obj: NewMetaServiceGrantRoleArgs(), - } -} - -func (p MetaServiceGrantRoleArgsBuilder) Emit() *MetaServiceGrantRoleArgs{ - return &MetaServiceGrantRoleArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGrantRoleArgsBuilder) Req(req *GrantRoleReq) *MetaServiceGrantRoleArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGrantRoleArgs) SetReq(req *GrantRoleReq) *MetaServiceGrantRoleArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGrantRoleResultBuilder struct { - obj *MetaServiceGrantRoleResult -} - -func NewMetaServiceGrantRoleResultBuilder() *MetaServiceGrantRoleResultBuilder{ - return &MetaServiceGrantRoleResultBuilder{ - obj: NewMetaServiceGrantRoleResult(), - } -} - -func (p MetaServiceGrantRoleResultBuilder) Emit() *MetaServiceGrantRoleResult{ - return &MetaServiceGrantRoleResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGrantRoleResultBuilder) Success(success *ExecResp) *MetaServiceGrantRoleResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGrantRoleResult) SetSuccess(success *ExecResp) *MetaServiceGrantRoleResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceRevokeRoleArgsBuilder struct { - obj *MetaServiceRevokeRoleArgs -} - -func NewMetaServiceRevokeRoleArgsBuilder() *MetaServiceRevokeRoleArgsBuilder{ - return &MetaServiceRevokeRoleArgsBuilder{ - obj: NewMetaServiceRevokeRoleArgs(), - } -} - -func (p MetaServiceRevokeRoleArgsBuilder) Emit() *MetaServiceRevokeRoleArgs{ - return &MetaServiceRevokeRoleArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRevokeRoleArgsBuilder) Req(req *RevokeRoleReq) *MetaServiceRevokeRoleArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRevokeRoleArgs) SetReq(req *RevokeRoleReq) *MetaServiceRevokeRoleArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceRevokeRoleResultBuilder struct { - obj *MetaServiceRevokeRoleResult -} - -func NewMetaServiceRevokeRoleResultBuilder() *MetaServiceRevokeRoleResultBuilder{ - return &MetaServiceRevokeRoleResultBuilder{ - obj: NewMetaServiceRevokeRoleResult(), - } -} - -func (p MetaServiceRevokeRoleResultBuilder) Emit() *MetaServiceRevokeRoleResult{ - return &MetaServiceRevokeRoleResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRevokeRoleResultBuilder) Success(success *ExecResp) *MetaServiceRevokeRoleResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRevokeRoleResult) SetSuccess(success *ExecResp) *MetaServiceRevokeRoleResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListUsersArgsBuilder struct { - obj *MetaServiceListUsersArgs -} - -func NewMetaServiceListUsersArgsBuilder() *MetaServiceListUsersArgsBuilder{ - return &MetaServiceListUsersArgsBuilder{ - obj: NewMetaServiceListUsersArgs(), - } -} - -func (p MetaServiceListUsersArgsBuilder) Emit() *MetaServiceListUsersArgs{ - return &MetaServiceListUsersArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListUsersArgsBuilder) Req(req *ListUsersReq) *MetaServiceListUsersArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListUsersArgs) SetReq(req *ListUsersReq) *MetaServiceListUsersArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListUsersResultBuilder struct { - obj *MetaServiceListUsersResult -} - -func NewMetaServiceListUsersResultBuilder() *MetaServiceListUsersResultBuilder{ - return &MetaServiceListUsersResultBuilder{ - obj: NewMetaServiceListUsersResult(), - } -} - -func (p MetaServiceListUsersResultBuilder) Emit() *MetaServiceListUsersResult{ - return &MetaServiceListUsersResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListUsersResultBuilder) Success(success *ListUsersResp) *MetaServiceListUsersResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListUsersResult) SetSuccess(success *ListUsersResp) *MetaServiceListUsersResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListRolesArgsBuilder struct { - obj *MetaServiceListRolesArgs -} - -func NewMetaServiceListRolesArgsBuilder() *MetaServiceListRolesArgsBuilder{ - return &MetaServiceListRolesArgsBuilder{ - obj: NewMetaServiceListRolesArgs(), - } -} - -func (p MetaServiceListRolesArgsBuilder) Emit() *MetaServiceListRolesArgs{ - return &MetaServiceListRolesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListRolesArgsBuilder) Req(req *ListRolesReq) *MetaServiceListRolesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListRolesArgs) SetReq(req *ListRolesReq) *MetaServiceListRolesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListRolesResultBuilder struct { - obj *MetaServiceListRolesResult -} - -func NewMetaServiceListRolesResultBuilder() *MetaServiceListRolesResultBuilder{ - return &MetaServiceListRolesResultBuilder{ - obj: NewMetaServiceListRolesResult(), - } -} - -func (p MetaServiceListRolesResultBuilder) Emit() *MetaServiceListRolesResult{ - return &MetaServiceListRolesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListRolesResultBuilder) Success(success *ListRolesResp) *MetaServiceListRolesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListRolesResult) SetSuccess(success *ListRolesResp) *MetaServiceListRolesResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetUserRolesArgsBuilder struct { - obj *MetaServiceGetUserRolesArgs -} - -func NewMetaServiceGetUserRolesArgsBuilder() *MetaServiceGetUserRolesArgsBuilder{ - return &MetaServiceGetUserRolesArgsBuilder{ - obj: NewMetaServiceGetUserRolesArgs(), - } -} - -func (p MetaServiceGetUserRolesArgsBuilder) Emit() *MetaServiceGetUserRolesArgs{ - return &MetaServiceGetUserRolesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetUserRolesArgsBuilder) Req(req *GetUserRolesReq) *MetaServiceGetUserRolesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetUserRolesArgs) SetReq(req *GetUserRolesReq) *MetaServiceGetUserRolesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetUserRolesResultBuilder struct { - obj *MetaServiceGetUserRolesResult -} - -func NewMetaServiceGetUserRolesResultBuilder() *MetaServiceGetUserRolesResultBuilder{ - return &MetaServiceGetUserRolesResultBuilder{ - obj: NewMetaServiceGetUserRolesResult(), - } -} - -func (p MetaServiceGetUserRolesResultBuilder) Emit() *MetaServiceGetUserRolesResult{ - return &MetaServiceGetUserRolesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetUserRolesResultBuilder) Success(success *ListRolesResp) *MetaServiceGetUserRolesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetUserRolesResult) SetSuccess(success *ListRolesResp) *MetaServiceGetUserRolesResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceChangePasswordArgsBuilder struct { - obj *MetaServiceChangePasswordArgs -} - -func NewMetaServiceChangePasswordArgsBuilder() *MetaServiceChangePasswordArgsBuilder{ - return &MetaServiceChangePasswordArgsBuilder{ - obj: NewMetaServiceChangePasswordArgs(), - } -} - -func (p MetaServiceChangePasswordArgsBuilder) Emit() *MetaServiceChangePasswordArgs{ - return &MetaServiceChangePasswordArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceChangePasswordArgsBuilder) Req(req *ChangePasswordReq) *MetaServiceChangePasswordArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceChangePasswordArgs) SetReq(req *ChangePasswordReq) *MetaServiceChangePasswordArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceChangePasswordResultBuilder struct { - obj *MetaServiceChangePasswordResult -} - -func NewMetaServiceChangePasswordResultBuilder() *MetaServiceChangePasswordResultBuilder{ - return &MetaServiceChangePasswordResultBuilder{ - obj: NewMetaServiceChangePasswordResult(), - } -} - -func (p MetaServiceChangePasswordResultBuilder) Emit() *MetaServiceChangePasswordResult{ - return &MetaServiceChangePasswordResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceChangePasswordResultBuilder) Success(success *ExecResp) *MetaServiceChangePasswordResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceChangePasswordResult) SetSuccess(success *ExecResp) *MetaServiceChangePasswordResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceHeartBeatArgsBuilder struct { - obj *MetaServiceHeartBeatArgs -} - -func NewMetaServiceHeartBeatArgsBuilder() *MetaServiceHeartBeatArgsBuilder{ - return &MetaServiceHeartBeatArgsBuilder{ - obj: NewMetaServiceHeartBeatArgs(), - } -} - -func (p MetaServiceHeartBeatArgsBuilder) Emit() *MetaServiceHeartBeatArgs{ - return &MetaServiceHeartBeatArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceHeartBeatArgsBuilder) Req(req *HBReq) *MetaServiceHeartBeatArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceHeartBeatArgs) SetReq(req *HBReq) *MetaServiceHeartBeatArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceHeartBeatResultBuilder struct { - obj *MetaServiceHeartBeatResult -} - -func NewMetaServiceHeartBeatResultBuilder() *MetaServiceHeartBeatResultBuilder{ - return &MetaServiceHeartBeatResultBuilder{ - obj: NewMetaServiceHeartBeatResult(), - } -} - -func (p MetaServiceHeartBeatResultBuilder) Emit() *MetaServiceHeartBeatResult{ - return &MetaServiceHeartBeatResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceHeartBeatResultBuilder) Success(success *HBResp) *MetaServiceHeartBeatResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceHeartBeatResult) SetSuccess(success *HBResp) *MetaServiceHeartBeatResult { - m.Success = success - return m -} - -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 MetaServiceAgentHeartbeatArgs struct { - thrift.IRequest - Req *AgentHBReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceAgentHeartbeatArgs() *MetaServiceAgentHeartbeatArgs { - return &MetaServiceAgentHeartbeatArgs{ - Req: NewAgentHBReq(), - } -} - -var MetaServiceAgentHeartbeatArgs_Req_DEFAULT *AgentHBReq -func (p *MetaServiceAgentHeartbeatArgs) GetReq() *AgentHBReq { - if !p.IsSetReq() { - return MetaServiceAgentHeartbeatArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceAgentHeartbeatArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceAgentHeartbeatArgsBuilder struct { - obj *MetaServiceAgentHeartbeatArgs -} - -func NewMetaServiceAgentHeartbeatArgsBuilder() *MetaServiceAgentHeartbeatArgsBuilder{ - return &MetaServiceAgentHeartbeatArgsBuilder{ - obj: NewMetaServiceAgentHeartbeatArgs(), - } -} - -func (p MetaServiceAgentHeartbeatArgsBuilder) Emit() *MetaServiceAgentHeartbeatArgs{ - return &MetaServiceAgentHeartbeatArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAgentHeartbeatArgsBuilder) Req(req *AgentHBReq) *MetaServiceAgentHeartbeatArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAgentHeartbeatArgs) SetReq(req *AgentHBReq) *MetaServiceAgentHeartbeatArgs { - m.Req = req - return m -} - -func (p *MetaServiceAgentHeartbeatArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAgentHeartbeatArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewAgentHBReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceAgentHeartbeatArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("agentHeartbeat_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAgentHeartbeatArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceAgentHeartbeatArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceAgentHeartbeatArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceAgentHeartbeatResult struct { - thrift.IResponse - Success *AgentHBResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceAgentHeartbeatResult() *MetaServiceAgentHeartbeatResult { - return &MetaServiceAgentHeartbeatResult{} -} - -var MetaServiceAgentHeartbeatResult_Success_DEFAULT *AgentHBResp -func (p *MetaServiceAgentHeartbeatResult) GetSuccess() *AgentHBResp { - if !p.IsSetSuccess() { - return MetaServiceAgentHeartbeatResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceAgentHeartbeatResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceAgentHeartbeatResultBuilder struct { - obj *MetaServiceAgentHeartbeatResult -} - -func NewMetaServiceAgentHeartbeatResultBuilder() *MetaServiceAgentHeartbeatResultBuilder{ - return &MetaServiceAgentHeartbeatResultBuilder{ - obj: NewMetaServiceAgentHeartbeatResult(), - } -} - -func (p MetaServiceAgentHeartbeatResultBuilder) Emit() *MetaServiceAgentHeartbeatResult{ - return &MetaServiceAgentHeartbeatResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAgentHeartbeatResultBuilder) Success(success *AgentHBResp) *MetaServiceAgentHeartbeatResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAgentHeartbeatResult) SetSuccess(success *AgentHBResp) *MetaServiceAgentHeartbeatResult { - m.Success = success - return m -} - -func (p *MetaServiceAgentHeartbeatResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceAgentHeartbeatResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewAgentHBResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceAgentHeartbeatResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("agentHeartbeat_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceAgentHeartbeatResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceAgentHeartbeatResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceAgentHeartbeatResult({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 -} - -type MetaServiceRegConfigArgsBuilder struct { - obj *MetaServiceRegConfigArgs -} - -func NewMetaServiceRegConfigArgsBuilder() *MetaServiceRegConfigArgsBuilder{ - return &MetaServiceRegConfigArgsBuilder{ - obj: NewMetaServiceRegConfigArgs(), - } -} - -func (p MetaServiceRegConfigArgsBuilder) Emit() *MetaServiceRegConfigArgs{ - return &MetaServiceRegConfigArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRegConfigArgsBuilder) Req(req *RegConfigReq) *MetaServiceRegConfigArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRegConfigArgs) SetReq(req *RegConfigReq) *MetaServiceRegConfigArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceRegConfigResultBuilder struct { - obj *MetaServiceRegConfigResult -} - -func NewMetaServiceRegConfigResultBuilder() *MetaServiceRegConfigResultBuilder{ - return &MetaServiceRegConfigResultBuilder{ - obj: NewMetaServiceRegConfigResult(), - } -} - -func (p MetaServiceRegConfigResultBuilder) Emit() *MetaServiceRegConfigResult{ - return &MetaServiceRegConfigResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRegConfigResultBuilder) Success(success *ExecResp) *MetaServiceRegConfigResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRegConfigResult) SetSuccess(success *ExecResp) *MetaServiceRegConfigResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetConfigArgsBuilder struct { - obj *MetaServiceGetConfigArgs -} - -func NewMetaServiceGetConfigArgsBuilder() *MetaServiceGetConfigArgsBuilder{ - return &MetaServiceGetConfigArgsBuilder{ - obj: NewMetaServiceGetConfigArgs(), - } -} - -func (p MetaServiceGetConfigArgsBuilder) Emit() *MetaServiceGetConfigArgs{ - return &MetaServiceGetConfigArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetConfigArgsBuilder) Req(req *GetConfigReq) *MetaServiceGetConfigArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetConfigArgs) SetReq(req *GetConfigReq) *MetaServiceGetConfigArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetConfigResultBuilder struct { - obj *MetaServiceGetConfigResult -} - -func NewMetaServiceGetConfigResultBuilder() *MetaServiceGetConfigResultBuilder{ - return &MetaServiceGetConfigResultBuilder{ - obj: NewMetaServiceGetConfigResult(), - } -} - -func (p MetaServiceGetConfigResultBuilder) Emit() *MetaServiceGetConfigResult{ - return &MetaServiceGetConfigResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetConfigResultBuilder) Success(success *GetConfigResp) *MetaServiceGetConfigResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetConfigResult) SetSuccess(success *GetConfigResp) *MetaServiceGetConfigResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceSetConfigArgsBuilder struct { - obj *MetaServiceSetConfigArgs -} - -func NewMetaServiceSetConfigArgsBuilder() *MetaServiceSetConfigArgsBuilder{ - return &MetaServiceSetConfigArgsBuilder{ - obj: NewMetaServiceSetConfigArgs(), - } -} - -func (p MetaServiceSetConfigArgsBuilder) Emit() *MetaServiceSetConfigArgs{ - return &MetaServiceSetConfigArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceSetConfigArgsBuilder) Req(req *SetConfigReq) *MetaServiceSetConfigArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceSetConfigArgs) SetReq(req *SetConfigReq) *MetaServiceSetConfigArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceSetConfigResultBuilder struct { - obj *MetaServiceSetConfigResult -} - -func NewMetaServiceSetConfigResultBuilder() *MetaServiceSetConfigResultBuilder{ - return &MetaServiceSetConfigResultBuilder{ - obj: NewMetaServiceSetConfigResult(), - } -} - -func (p MetaServiceSetConfigResultBuilder) Emit() *MetaServiceSetConfigResult{ - return &MetaServiceSetConfigResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceSetConfigResultBuilder) Success(success *ExecResp) *MetaServiceSetConfigResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceSetConfigResult) SetSuccess(success *ExecResp) *MetaServiceSetConfigResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListConfigsArgsBuilder struct { - obj *MetaServiceListConfigsArgs -} - -func NewMetaServiceListConfigsArgsBuilder() *MetaServiceListConfigsArgsBuilder{ - return &MetaServiceListConfigsArgsBuilder{ - obj: NewMetaServiceListConfigsArgs(), - } -} - -func (p MetaServiceListConfigsArgsBuilder) Emit() *MetaServiceListConfigsArgs{ - return &MetaServiceListConfigsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListConfigsArgsBuilder) Req(req *ListConfigsReq) *MetaServiceListConfigsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListConfigsArgs) SetReq(req *ListConfigsReq) *MetaServiceListConfigsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListConfigsResultBuilder struct { - obj *MetaServiceListConfigsResult -} - -func NewMetaServiceListConfigsResultBuilder() *MetaServiceListConfigsResultBuilder{ - return &MetaServiceListConfigsResultBuilder{ - obj: NewMetaServiceListConfigsResult(), - } -} - -func (p MetaServiceListConfigsResultBuilder) Emit() *MetaServiceListConfigsResult{ - return &MetaServiceListConfigsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListConfigsResultBuilder) Success(success *ListConfigsResp) *MetaServiceListConfigsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListConfigsResult) SetSuccess(success *ListConfigsResp) *MetaServiceListConfigsResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceCreateSnapshotArgsBuilder struct { - obj *MetaServiceCreateSnapshotArgs -} - -func NewMetaServiceCreateSnapshotArgsBuilder() *MetaServiceCreateSnapshotArgsBuilder{ - return &MetaServiceCreateSnapshotArgsBuilder{ - obj: NewMetaServiceCreateSnapshotArgs(), - } -} - -func (p MetaServiceCreateSnapshotArgsBuilder) Emit() *MetaServiceCreateSnapshotArgs{ - return &MetaServiceCreateSnapshotArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateSnapshotArgsBuilder) Req(req *CreateSnapshotReq) *MetaServiceCreateSnapshotArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateSnapshotArgs) SetReq(req *CreateSnapshotReq) *MetaServiceCreateSnapshotArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateSnapshotResultBuilder struct { - obj *MetaServiceCreateSnapshotResult -} - -func NewMetaServiceCreateSnapshotResultBuilder() *MetaServiceCreateSnapshotResultBuilder{ - return &MetaServiceCreateSnapshotResultBuilder{ - obj: NewMetaServiceCreateSnapshotResult(), - } -} - -func (p MetaServiceCreateSnapshotResultBuilder) Emit() *MetaServiceCreateSnapshotResult{ - return &MetaServiceCreateSnapshotResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateSnapshotResultBuilder) Success(success *ExecResp) *MetaServiceCreateSnapshotResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateSnapshotResult) SetSuccess(success *ExecResp) *MetaServiceCreateSnapshotResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropSnapshotArgsBuilder struct { - obj *MetaServiceDropSnapshotArgs -} - -func NewMetaServiceDropSnapshotArgsBuilder() *MetaServiceDropSnapshotArgsBuilder{ - return &MetaServiceDropSnapshotArgsBuilder{ - obj: NewMetaServiceDropSnapshotArgs(), - } -} - -func (p MetaServiceDropSnapshotArgsBuilder) Emit() *MetaServiceDropSnapshotArgs{ - return &MetaServiceDropSnapshotArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropSnapshotArgsBuilder) Req(req *DropSnapshotReq) *MetaServiceDropSnapshotArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropSnapshotArgs) SetReq(req *DropSnapshotReq) *MetaServiceDropSnapshotArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropSnapshotResultBuilder struct { - obj *MetaServiceDropSnapshotResult -} - -func NewMetaServiceDropSnapshotResultBuilder() *MetaServiceDropSnapshotResultBuilder{ - return &MetaServiceDropSnapshotResultBuilder{ - obj: NewMetaServiceDropSnapshotResult(), - } -} - -func (p MetaServiceDropSnapshotResultBuilder) Emit() *MetaServiceDropSnapshotResult{ - return &MetaServiceDropSnapshotResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropSnapshotResultBuilder) Success(success *ExecResp) *MetaServiceDropSnapshotResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropSnapshotResult) SetSuccess(success *ExecResp) *MetaServiceDropSnapshotResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListSnapshotsArgsBuilder struct { - obj *MetaServiceListSnapshotsArgs -} - -func NewMetaServiceListSnapshotsArgsBuilder() *MetaServiceListSnapshotsArgsBuilder{ - return &MetaServiceListSnapshotsArgsBuilder{ - obj: NewMetaServiceListSnapshotsArgs(), - } -} - -func (p MetaServiceListSnapshotsArgsBuilder) Emit() *MetaServiceListSnapshotsArgs{ - return &MetaServiceListSnapshotsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListSnapshotsArgsBuilder) Req(req *ListSnapshotsReq) *MetaServiceListSnapshotsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListSnapshotsArgs) SetReq(req *ListSnapshotsReq) *MetaServiceListSnapshotsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListSnapshotsResultBuilder struct { - obj *MetaServiceListSnapshotsResult -} - -func NewMetaServiceListSnapshotsResultBuilder() *MetaServiceListSnapshotsResultBuilder{ - return &MetaServiceListSnapshotsResultBuilder{ - obj: NewMetaServiceListSnapshotsResult(), - } -} - -func (p MetaServiceListSnapshotsResultBuilder) Emit() *MetaServiceListSnapshotsResult{ - return &MetaServiceListSnapshotsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListSnapshotsResultBuilder) Success(success *ListSnapshotsResp) *MetaServiceListSnapshotsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListSnapshotsResult) SetSuccess(success *ListSnapshotsResp) *MetaServiceListSnapshotsResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceRunAdminJobArgsBuilder struct { - obj *MetaServiceRunAdminJobArgs -} - -func NewMetaServiceRunAdminJobArgsBuilder() *MetaServiceRunAdminJobArgsBuilder{ - return &MetaServiceRunAdminJobArgsBuilder{ - obj: NewMetaServiceRunAdminJobArgs(), - } -} - -func (p MetaServiceRunAdminJobArgsBuilder) Emit() *MetaServiceRunAdminJobArgs{ - return &MetaServiceRunAdminJobArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRunAdminJobArgsBuilder) Req(req *AdminJobReq) *MetaServiceRunAdminJobArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRunAdminJobArgs) SetReq(req *AdminJobReq) *MetaServiceRunAdminJobArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceRunAdminJobResultBuilder struct { - obj *MetaServiceRunAdminJobResult -} - -func NewMetaServiceRunAdminJobResultBuilder() *MetaServiceRunAdminJobResultBuilder{ - return &MetaServiceRunAdminJobResultBuilder{ - obj: NewMetaServiceRunAdminJobResult(), - } -} - -func (p MetaServiceRunAdminJobResultBuilder) Emit() *MetaServiceRunAdminJobResult{ - return &MetaServiceRunAdminJobResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRunAdminJobResultBuilder) Success(success *AdminJobResp) *MetaServiceRunAdminJobResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRunAdminJobResult) SetSuccess(success *AdminJobResp) *MetaServiceRunAdminJobResult { - m.Success = success - return m -} - -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 MetaServiceMergeZoneArgs struct { - thrift.IRequest - Req *MergeZoneReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceMergeZoneArgs() *MetaServiceMergeZoneArgs { - return &MetaServiceMergeZoneArgs{ - Req: NewMergeZoneReq(), - } -} - -var MetaServiceMergeZoneArgs_Req_DEFAULT *MergeZoneReq -func (p *MetaServiceMergeZoneArgs) GetReq() *MergeZoneReq { - if !p.IsSetReq() { - return MetaServiceMergeZoneArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceMergeZoneArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceMergeZoneArgsBuilder struct { - obj *MetaServiceMergeZoneArgs -} - -func NewMetaServiceMergeZoneArgsBuilder() *MetaServiceMergeZoneArgsBuilder{ - return &MetaServiceMergeZoneArgsBuilder{ - obj: NewMetaServiceMergeZoneArgs(), - } -} - -func (p MetaServiceMergeZoneArgsBuilder) Emit() *MetaServiceMergeZoneArgs{ - return &MetaServiceMergeZoneArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceMergeZoneArgsBuilder) Req(req *MergeZoneReq) *MetaServiceMergeZoneArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceMergeZoneArgs) SetReq(req *MergeZoneReq) *MetaServiceMergeZoneArgs { - m.Req = req - return m -} - -func (p *MetaServiceMergeZoneArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceMergeZoneArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewMergeZoneReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceMergeZoneArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("mergeZone_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceMergeZoneArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceMergeZoneArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceMergeZoneArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceMergeZoneResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceMergeZoneResult() *MetaServiceMergeZoneResult { - return &MetaServiceMergeZoneResult{} -} - -var MetaServiceMergeZoneResult_Success_DEFAULT *ExecResp -func (p *MetaServiceMergeZoneResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceMergeZoneResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceMergeZoneResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceMergeZoneResultBuilder struct { - obj *MetaServiceMergeZoneResult -} - -func NewMetaServiceMergeZoneResultBuilder() *MetaServiceMergeZoneResultBuilder{ - return &MetaServiceMergeZoneResultBuilder{ - obj: NewMetaServiceMergeZoneResult(), - } -} - -func (p MetaServiceMergeZoneResultBuilder) Emit() *MetaServiceMergeZoneResult{ - return &MetaServiceMergeZoneResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceMergeZoneResultBuilder) Success(success *ExecResp) *MetaServiceMergeZoneResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceMergeZoneResult) SetSuccess(success *ExecResp) *MetaServiceMergeZoneResult { - m.Success = success - return m -} - -func (p *MetaServiceMergeZoneResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceMergeZoneResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceMergeZoneResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("mergeZone_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceMergeZoneResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceMergeZoneResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceMergeZoneResult({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 -} - -type MetaServiceDropZoneArgsBuilder struct { - obj *MetaServiceDropZoneArgs -} - -func NewMetaServiceDropZoneArgsBuilder() *MetaServiceDropZoneArgsBuilder{ - return &MetaServiceDropZoneArgsBuilder{ - obj: NewMetaServiceDropZoneArgs(), - } -} - -func (p MetaServiceDropZoneArgsBuilder) Emit() *MetaServiceDropZoneArgs{ - return &MetaServiceDropZoneArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropZoneArgsBuilder) Req(req *DropZoneReq) *MetaServiceDropZoneArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropZoneArgs) SetReq(req *DropZoneReq) *MetaServiceDropZoneArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropZoneResultBuilder struct { - obj *MetaServiceDropZoneResult -} - -func NewMetaServiceDropZoneResultBuilder() *MetaServiceDropZoneResultBuilder{ - return &MetaServiceDropZoneResultBuilder{ - obj: NewMetaServiceDropZoneResult(), - } -} - -func (p MetaServiceDropZoneResultBuilder) Emit() *MetaServiceDropZoneResult{ - return &MetaServiceDropZoneResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropZoneResultBuilder) Success(success *ExecResp) *MetaServiceDropZoneResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropZoneResult) SetSuccess(success *ExecResp) *MetaServiceDropZoneResult { - m.Success = success - return m -} - -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 MetaServiceDivideZoneArgs struct { - thrift.IRequest - Req *DivideZoneReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceDivideZoneArgs() *MetaServiceDivideZoneArgs { - return &MetaServiceDivideZoneArgs{ - Req: NewDivideZoneReq(), - } -} - -var MetaServiceDivideZoneArgs_Req_DEFAULT *DivideZoneReq -func (p *MetaServiceDivideZoneArgs) GetReq() *DivideZoneReq { - if !p.IsSetReq() { - return MetaServiceDivideZoneArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceDivideZoneArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceDivideZoneArgsBuilder struct { - obj *MetaServiceDivideZoneArgs -} - -func NewMetaServiceDivideZoneArgsBuilder() *MetaServiceDivideZoneArgsBuilder{ - return &MetaServiceDivideZoneArgsBuilder{ - obj: NewMetaServiceDivideZoneArgs(), - } -} - -func (p MetaServiceDivideZoneArgsBuilder) Emit() *MetaServiceDivideZoneArgs{ - return &MetaServiceDivideZoneArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDivideZoneArgsBuilder) Req(req *DivideZoneReq) *MetaServiceDivideZoneArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDivideZoneArgs) SetReq(req *DivideZoneReq) *MetaServiceDivideZoneArgs { - m.Req = req - return m -} - -func (p *MetaServiceDivideZoneArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceDivideZoneArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewDivideZoneReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceDivideZoneArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("divideZone_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceDivideZoneArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceDivideZoneArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceDivideZoneArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceDivideZoneResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceDivideZoneResult() *MetaServiceDivideZoneResult { - return &MetaServiceDivideZoneResult{} -} - -var MetaServiceDivideZoneResult_Success_DEFAULT *ExecResp -func (p *MetaServiceDivideZoneResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceDivideZoneResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceDivideZoneResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceDivideZoneResultBuilder struct { - obj *MetaServiceDivideZoneResult -} - -func NewMetaServiceDivideZoneResultBuilder() *MetaServiceDivideZoneResultBuilder{ - return &MetaServiceDivideZoneResultBuilder{ - obj: NewMetaServiceDivideZoneResult(), - } -} - -func (p MetaServiceDivideZoneResultBuilder) Emit() *MetaServiceDivideZoneResult{ - return &MetaServiceDivideZoneResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDivideZoneResultBuilder) Success(success *ExecResp) *MetaServiceDivideZoneResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDivideZoneResult) SetSuccess(success *ExecResp) *MetaServiceDivideZoneResult { - m.Success = success - return m -} - -func (p *MetaServiceDivideZoneResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceDivideZoneResult) 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 *MetaServiceDivideZoneResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("divideZone_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceDivideZoneResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceDivideZoneResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceDivideZoneResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type MetaServiceRenameZoneArgs struct { - thrift.IRequest - Req *RenameZoneReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceRenameZoneArgs() *MetaServiceRenameZoneArgs { - return &MetaServiceRenameZoneArgs{ - Req: NewRenameZoneReq(), - } -} - -var MetaServiceRenameZoneArgs_Req_DEFAULT *RenameZoneReq -func (p *MetaServiceRenameZoneArgs) GetReq() *RenameZoneReq { - if !p.IsSetReq() { - return MetaServiceRenameZoneArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceRenameZoneArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceRenameZoneArgsBuilder struct { - obj *MetaServiceRenameZoneArgs -} - -func NewMetaServiceRenameZoneArgsBuilder() *MetaServiceRenameZoneArgsBuilder{ - return &MetaServiceRenameZoneArgsBuilder{ - obj: NewMetaServiceRenameZoneArgs(), - } -} - -func (p MetaServiceRenameZoneArgsBuilder) Emit() *MetaServiceRenameZoneArgs{ - return &MetaServiceRenameZoneArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRenameZoneArgsBuilder) Req(req *RenameZoneReq) *MetaServiceRenameZoneArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRenameZoneArgs) SetReq(req *RenameZoneReq) *MetaServiceRenameZoneArgs { - m.Req = req - return m -} - -func (p *MetaServiceRenameZoneArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceRenameZoneArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewRenameZoneReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceRenameZoneArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("renameZone_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceRenameZoneArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceRenameZoneArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceRenameZoneArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceRenameZoneResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceRenameZoneResult() *MetaServiceRenameZoneResult { - return &MetaServiceRenameZoneResult{} -} - -var MetaServiceRenameZoneResult_Success_DEFAULT *ExecResp -func (p *MetaServiceRenameZoneResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceRenameZoneResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceRenameZoneResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceRenameZoneResultBuilder struct { - obj *MetaServiceRenameZoneResult -} - -func NewMetaServiceRenameZoneResultBuilder() *MetaServiceRenameZoneResultBuilder{ - return &MetaServiceRenameZoneResultBuilder{ - obj: NewMetaServiceRenameZoneResult(), - } -} - -func (p MetaServiceRenameZoneResultBuilder) Emit() *MetaServiceRenameZoneResult{ - return &MetaServiceRenameZoneResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRenameZoneResultBuilder) Success(success *ExecResp) *MetaServiceRenameZoneResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRenameZoneResult) SetSuccess(success *ExecResp) *MetaServiceRenameZoneResult { - m.Success = success - return m -} - -func (p *MetaServiceRenameZoneResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceRenameZoneResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewExecResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceRenameZoneResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("renameZone_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceRenameZoneResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceRenameZoneResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceRenameZoneResult({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 -} - -type MetaServiceGetZoneArgsBuilder struct { - obj *MetaServiceGetZoneArgs -} - -func NewMetaServiceGetZoneArgsBuilder() *MetaServiceGetZoneArgsBuilder{ - return &MetaServiceGetZoneArgsBuilder{ - obj: NewMetaServiceGetZoneArgs(), - } -} - -func (p MetaServiceGetZoneArgsBuilder) Emit() *MetaServiceGetZoneArgs{ - return &MetaServiceGetZoneArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetZoneArgsBuilder) Req(req *GetZoneReq) *MetaServiceGetZoneArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetZoneArgs) SetReq(req *GetZoneReq) *MetaServiceGetZoneArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetZoneResultBuilder struct { - obj *MetaServiceGetZoneResult -} - -func NewMetaServiceGetZoneResultBuilder() *MetaServiceGetZoneResultBuilder{ - return &MetaServiceGetZoneResultBuilder{ - obj: NewMetaServiceGetZoneResult(), - } -} - -func (p MetaServiceGetZoneResultBuilder) Emit() *MetaServiceGetZoneResult{ - return &MetaServiceGetZoneResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetZoneResultBuilder) Success(success *GetZoneResp) *MetaServiceGetZoneResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetZoneResult) SetSuccess(success *GetZoneResp) *MetaServiceGetZoneResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListZonesArgsBuilder struct { - obj *MetaServiceListZonesArgs -} - -func NewMetaServiceListZonesArgsBuilder() *MetaServiceListZonesArgsBuilder{ - return &MetaServiceListZonesArgsBuilder{ - obj: NewMetaServiceListZonesArgs(), - } -} - -func (p MetaServiceListZonesArgsBuilder) Emit() *MetaServiceListZonesArgs{ - return &MetaServiceListZonesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListZonesArgsBuilder) Req(req *ListZonesReq) *MetaServiceListZonesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListZonesArgs) SetReq(req *ListZonesReq) *MetaServiceListZonesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListZonesResultBuilder struct { - obj *MetaServiceListZonesResult -} - -func NewMetaServiceListZonesResultBuilder() *MetaServiceListZonesResultBuilder{ - return &MetaServiceListZonesResultBuilder{ - obj: NewMetaServiceListZonesResult(), - } -} - -func (p MetaServiceListZonesResultBuilder) Emit() *MetaServiceListZonesResult{ - return &MetaServiceListZonesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListZonesResultBuilder) Success(success *ListZonesResp) *MetaServiceListZonesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListZonesResult) SetSuccess(success *ListZonesResp) *MetaServiceListZonesResult { - m.Success = success - return m -} - -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 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 -} - -type MetaServiceAddListenerArgsBuilder struct { - obj *MetaServiceAddListenerArgs -} - -func NewMetaServiceAddListenerArgsBuilder() *MetaServiceAddListenerArgsBuilder{ - return &MetaServiceAddListenerArgsBuilder{ - obj: NewMetaServiceAddListenerArgs(), - } -} - -func (p MetaServiceAddListenerArgsBuilder) Emit() *MetaServiceAddListenerArgs{ - return &MetaServiceAddListenerArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceAddListenerArgsBuilder) Req(req *AddListenerReq) *MetaServiceAddListenerArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceAddListenerArgs) SetReq(req *AddListenerReq) *MetaServiceAddListenerArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceAddListenerResultBuilder struct { - obj *MetaServiceAddListenerResult -} - -func NewMetaServiceAddListenerResultBuilder() *MetaServiceAddListenerResultBuilder{ - return &MetaServiceAddListenerResultBuilder{ - obj: NewMetaServiceAddListenerResult(), - } -} - -func (p MetaServiceAddListenerResultBuilder) Emit() *MetaServiceAddListenerResult{ - return &MetaServiceAddListenerResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceAddListenerResultBuilder) Success(success *ExecResp) *MetaServiceAddListenerResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceAddListenerResult) SetSuccess(success *ExecResp) *MetaServiceAddListenerResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceRemoveListenerArgsBuilder struct { - obj *MetaServiceRemoveListenerArgs -} - -func NewMetaServiceRemoveListenerArgsBuilder() *MetaServiceRemoveListenerArgsBuilder{ - return &MetaServiceRemoveListenerArgsBuilder{ - obj: NewMetaServiceRemoveListenerArgs(), - } -} - -func (p MetaServiceRemoveListenerArgsBuilder) Emit() *MetaServiceRemoveListenerArgs{ - return &MetaServiceRemoveListenerArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRemoveListenerArgsBuilder) Req(req *RemoveListenerReq) *MetaServiceRemoveListenerArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRemoveListenerArgs) SetReq(req *RemoveListenerReq) *MetaServiceRemoveListenerArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceRemoveListenerResultBuilder struct { - obj *MetaServiceRemoveListenerResult -} - -func NewMetaServiceRemoveListenerResultBuilder() *MetaServiceRemoveListenerResultBuilder{ - return &MetaServiceRemoveListenerResultBuilder{ - obj: NewMetaServiceRemoveListenerResult(), - } -} - -func (p MetaServiceRemoveListenerResultBuilder) Emit() *MetaServiceRemoveListenerResult{ - return &MetaServiceRemoveListenerResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRemoveListenerResultBuilder) Success(success *ExecResp) *MetaServiceRemoveListenerResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRemoveListenerResult) SetSuccess(success *ExecResp) *MetaServiceRemoveListenerResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListListenerArgsBuilder struct { - obj *MetaServiceListListenerArgs -} - -func NewMetaServiceListListenerArgsBuilder() *MetaServiceListListenerArgsBuilder{ - return &MetaServiceListListenerArgsBuilder{ - obj: NewMetaServiceListListenerArgs(), - } -} - -func (p MetaServiceListListenerArgsBuilder) Emit() *MetaServiceListListenerArgs{ - return &MetaServiceListListenerArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListListenerArgsBuilder) Req(req *ListListenerReq) *MetaServiceListListenerArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListListenerArgs) SetReq(req *ListListenerReq) *MetaServiceListListenerArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListListenerResultBuilder struct { - obj *MetaServiceListListenerResult -} - -func NewMetaServiceListListenerResultBuilder() *MetaServiceListListenerResultBuilder{ - return &MetaServiceListListenerResultBuilder{ - obj: NewMetaServiceListListenerResult(), - } -} - -func (p MetaServiceListListenerResultBuilder) Emit() *MetaServiceListListenerResult{ - return &MetaServiceListListenerResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListListenerResultBuilder) Success(success *ListListenerResp) *MetaServiceListListenerResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListListenerResult) SetSuccess(success *ListListenerResp) *MetaServiceListListenerResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetStatsArgsBuilder struct { - obj *MetaServiceGetStatsArgs -} - -func NewMetaServiceGetStatsArgsBuilder() *MetaServiceGetStatsArgsBuilder{ - return &MetaServiceGetStatsArgsBuilder{ - obj: NewMetaServiceGetStatsArgs(), - } -} - -func (p MetaServiceGetStatsArgsBuilder) Emit() *MetaServiceGetStatsArgs{ - return &MetaServiceGetStatsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetStatsArgsBuilder) Req(req *GetStatsReq) *MetaServiceGetStatsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetStatsArgs) SetReq(req *GetStatsReq) *MetaServiceGetStatsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetStatsResultBuilder struct { - obj *MetaServiceGetStatsResult -} - -func NewMetaServiceGetStatsResultBuilder() *MetaServiceGetStatsResultBuilder{ - return &MetaServiceGetStatsResultBuilder{ - obj: NewMetaServiceGetStatsResult(), - } -} - -func (p MetaServiceGetStatsResultBuilder) Emit() *MetaServiceGetStatsResult{ - return &MetaServiceGetStatsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetStatsResultBuilder) Success(success *GetStatsResp) *MetaServiceGetStatsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetStatsResult) SetSuccess(success *GetStatsResp) *MetaServiceGetStatsResult { - m.Success = success - return m -} - -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 MetaServiceSignInServiceArgs struct { - thrift.IRequest - Req *SignInServiceReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceSignInServiceArgs() *MetaServiceSignInServiceArgs { - return &MetaServiceSignInServiceArgs{ - Req: NewSignInServiceReq(), - } -} - -var MetaServiceSignInServiceArgs_Req_DEFAULT *SignInServiceReq -func (p *MetaServiceSignInServiceArgs) GetReq() *SignInServiceReq { - if !p.IsSetReq() { - return MetaServiceSignInServiceArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceSignInServiceArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceSignInServiceArgsBuilder struct { - obj *MetaServiceSignInServiceArgs -} - -func NewMetaServiceSignInServiceArgsBuilder() *MetaServiceSignInServiceArgsBuilder{ - return &MetaServiceSignInServiceArgsBuilder{ - obj: NewMetaServiceSignInServiceArgs(), - } -} - -func (p MetaServiceSignInServiceArgsBuilder) Emit() *MetaServiceSignInServiceArgs{ - return &MetaServiceSignInServiceArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceSignInServiceArgsBuilder) Req(req *SignInServiceReq) *MetaServiceSignInServiceArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceSignInServiceArgs) SetReq(req *SignInServiceReq) *MetaServiceSignInServiceArgs { - m.Req = req - return m -} - -func (p *MetaServiceSignInServiceArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceSignInServiceArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewSignInServiceReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceSignInServiceArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("signInService_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceSignInServiceArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceSignInServiceArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceSignInServiceArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceSignInServiceResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceSignInServiceResult() *MetaServiceSignInServiceResult { - return &MetaServiceSignInServiceResult{} -} - -var MetaServiceSignInServiceResult_Success_DEFAULT *ExecResp -func (p *MetaServiceSignInServiceResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceSignInServiceResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceSignInServiceResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceSignInServiceResultBuilder struct { - obj *MetaServiceSignInServiceResult -} - -func NewMetaServiceSignInServiceResultBuilder() *MetaServiceSignInServiceResultBuilder{ - return &MetaServiceSignInServiceResultBuilder{ - obj: NewMetaServiceSignInServiceResult(), - } -} - -func (p MetaServiceSignInServiceResultBuilder) Emit() *MetaServiceSignInServiceResult{ - return &MetaServiceSignInServiceResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceSignInServiceResultBuilder) Success(success *ExecResp) *MetaServiceSignInServiceResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceSignInServiceResult) SetSuccess(success *ExecResp) *MetaServiceSignInServiceResult { - m.Success = success - return m -} - -func (p *MetaServiceSignInServiceResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceSignInServiceResult) 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 *MetaServiceSignInServiceResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("signInService_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceSignInServiceResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceSignInServiceResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceSignInServiceResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type MetaServiceSignOutServiceArgs struct { - thrift.IRequest - Req *SignOutServiceReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceSignOutServiceArgs() *MetaServiceSignOutServiceArgs { - return &MetaServiceSignOutServiceArgs{ - Req: NewSignOutServiceReq(), - } -} - -var MetaServiceSignOutServiceArgs_Req_DEFAULT *SignOutServiceReq -func (p *MetaServiceSignOutServiceArgs) GetReq() *SignOutServiceReq { - if !p.IsSetReq() { - return MetaServiceSignOutServiceArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceSignOutServiceArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceSignOutServiceArgsBuilder struct { - obj *MetaServiceSignOutServiceArgs -} - -func NewMetaServiceSignOutServiceArgsBuilder() *MetaServiceSignOutServiceArgsBuilder{ - return &MetaServiceSignOutServiceArgsBuilder{ - obj: NewMetaServiceSignOutServiceArgs(), - } -} - -func (p MetaServiceSignOutServiceArgsBuilder) Emit() *MetaServiceSignOutServiceArgs{ - return &MetaServiceSignOutServiceArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceSignOutServiceArgsBuilder) Req(req *SignOutServiceReq) *MetaServiceSignOutServiceArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceSignOutServiceArgs) SetReq(req *SignOutServiceReq) *MetaServiceSignOutServiceArgs { - m.Req = req - return m -} - -func (p *MetaServiceSignOutServiceArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceSignOutServiceArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewSignOutServiceReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceSignOutServiceArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("signOutService_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceSignOutServiceArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceSignOutServiceArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceSignOutServiceArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceSignOutServiceResult struct { - thrift.IResponse - Success *ExecResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceSignOutServiceResult() *MetaServiceSignOutServiceResult { - return &MetaServiceSignOutServiceResult{} -} - -var MetaServiceSignOutServiceResult_Success_DEFAULT *ExecResp -func (p *MetaServiceSignOutServiceResult) GetSuccess() *ExecResp { - if !p.IsSetSuccess() { - return MetaServiceSignOutServiceResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceSignOutServiceResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceSignOutServiceResultBuilder struct { - obj *MetaServiceSignOutServiceResult -} - -func NewMetaServiceSignOutServiceResultBuilder() *MetaServiceSignOutServiceResultBuilder{ - return &MetaServiceSignOutServiceResultBuilder{ - obj: NewMetaServiceSignOutServiceResult(), - } -} - -func (p MetaServiceSignOutServiceResultBuilder) Emit() *MetaServiceSignOutServiceResult{ - return &MetaServiceSignOutServiceResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceSignOutServiceResultBuilder) Success(success *ExecResp) *MetaServiceSignOutServiceResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceSignOutServiceResult) SetSuccess(success *ExecResp) *MetaServiceSignOutServiceResult { - m.Success = success - return m -} - -func (p *MetaServiceSignOutServiceResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceSignOutServiceResult) 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 *MetaServiceSignOutServiceResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("signOutService_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceSignOutServiceResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceSignOutServiceResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceSignOutServiceResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type MetaServiceListServiceClientsArgs struct { - thrift.IRequest - Req *ListServiceClientsReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceListServiceClientsArgs() *MetaServiceListServiceClientsArgs { - return &MetaServiceListServiceClientsArgs{ - Req: NewListServiceClientsReq(), - } -} - -var MetaServiceListServiceClientsArgs_Req_DEFAULT *ListServiceClientsReq -func (p *MetaServiceListServiceClientsArgs) GetReq() *ListServiceClientsReq { - if !p.IsSetReq() { - return MetaServiceListServiceClientsArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceListServiceClientsArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceListServiceClientsArgsBuilder struct { - obj *MetaServiceListServiceClientsArgs -} - -func NewMetaServiceListServiceClientsArgsBuilder() *MetaServiceListServiceClientsArgsBuilder{ - return &MetaServiceListServiceClientsArgsBuilder{ - obj: NewMetaServiceListServiceClientsArgs(), - } -} - -func (p MetaServiceListServiceClientsArgsBuilder) Emit() *MetaServiceListServiceClientsArgs{ - return &MetaServiceListServiceClientsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListServiceClientsArgsBuilder) Req(req *ListServiceClientsReq) *MetaServiceListServiceClientsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListServiceClientsArgs) SetReq(req *ListServiceClientsReq) *MetaServiceListServiceClientsArgs { - m.Req = req - return m -} - -func (p *MetaServiceListServiceClientsArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceListServiceClientsArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewListServiceClientsReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceListServiceClientsArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("listServiceClients_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceListServiceClientsArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceListServiceClientsArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceListServiceClientsArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceListServiceClientsResult struct { - thrift.IResponse - Success *ListServiceClientsResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceListServiceClientsResult() *MetaServiceListServiceClientsResult { - return &MetaServiceListServiceClientsResult{} -} - -var MetaServiceListServiceClientsResult_Success_DEFAULT *ListServiceClientsResp -func (p *MetaServiceListServiceClientsResult) GetSuccess() *ListServiceClientsResp { - if !p.IsSetSuccess() { - return MetaServiceListServiceClientsResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceListServiceClientsResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceListServiceClientsResultBuilder struct { - obj *MetaServiceListServiceClientsResult -} - -func NewMetaServiceListServiceClientsResultBuilder() *MetaServiceListServiceClientsResultBuilder{ - return &MetaServiceListServiceClientsResultBuilder{ - obj: NewMetaServiceListServiceClientsResult(), - } -} - -func (p MetaServiceListServiceClientsResultBuilder) Emit() *MetaServiceListServiceClientsResult{ - return &MetaServiceListServiceClientsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListServiceClientsResultBuilder) Success(success *ListServiceClientsResp) *MetaServiceListServiceClientsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListServiceClientsResult) SetSuccess(success *ListServiceClientsResp) *MetaServiceListServiceClientsResult { - m.Success = success - return m -} - -func (p *MetaServiceListServiceClientsResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceListServiceClientsResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewListServiceClientsResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceListServiceClientsResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("listServiceClients_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceListServiceClientsResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceListServiceClientsResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceListServiceClientsResult({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 -} - -type MetaServiceCreateFTIndexArgsBuilder struct { - obj *MetaServiceCreateFTIndexArgs -} - -func NewMetaServiceCreateFTIndexArgsBuilder() *MetaServiceCreateFTIndexArgsBuilder{ - return &MetaServiceCreateFTIndexArgsBuilder{ - obj: NewMetaServiceCreateFTIndexArgs(), - } -} - -func (p MetaServiceCreateFTIndexArgsBuilder) Emit() *MetaServiceCreateFTIndexArgs{ - return &MetaServiceCreateFTIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateFTIndexArgsBuilder) Req(req *CreateFTIndexReq) *MetaServiceCreateFTIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateFTIndexArgs) SetReq(req *CreateFTIndexReq) *MetaServiceCreateFTIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateFTIndexResultBuilder struct { - obj *MetaServiceCreateFTIndexResult -} - -func NewMetaServiceCreateFTIndexResultBuilder() *MetaServiceCreateFTIndexResultBuilder{ - return &MetaServiceCreateFTIndexResultBuilder{ - obj: NewMetaServiceCreateFTIndexResult(), - } -} - -func (p MetaServiceCreateFTIndexResultBuilder) Emit() *MetaServiceCreateFTIndexResult{ - return &MetaServiceCreateFTIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateFTIndexResultBuilder) Success(success *ExecResp) *MetaServiceCreateFTIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateFTIndexResult) SetSuccess(success *ExecResp) *MetaServiceCreateFTIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceDropFTIndexArgsBuilder struct { - obj *MetaServiceDropFTIndexArgs -} - -func NewMetaServiceDropFTIndexArgsBuilder() *MetaServiceDropFTIndexArgsBuilder{ - return &MetaServiceDropFTIndexArgsBuilder{ - obj: NewMetaServiceDropFTIndexArgs(), - } -} - -func (p MetaServiceDropFTIndexArgsBuilder) Emit() *MetaServiceDropFTIndexArgs{ - return &MetaServiceDropFTIndexArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceDropFTIndexArgsBuilder) Req(req *DropFTIndexReq) *MetaServiceDropFTIndexArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceDropFTIndexArgs) SetReq(req *DropFTIndexReq) *MetaServiceDropFTIndexArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceDropFTIndexResultBuilder struct { - obj *MetaServiceDropFTIndexResult -} - -func NewMetaServiceDropFTIndexResultBuilder() *MetaServiceDropFTIndexResultBuilder{ - return &MetaServiceDropFTIndexResultBuilder{ - obj: NewMetaServiceDropFTIndexResult(), - } -} - -func (p MetaServiceDropFTIndexResultBuilder) Emit() *MetaServiceDropFTIndexResult{ - return &MetaServiceDropFTIndexResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceDropFTIndexResultBuilder) Success(success *ExecResp) *MetaServiceDropFTIndexResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceDropFTIndexResult) SetSuccess(success *ExecResp) *MetaServiceDropFTIndexResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListFTIndexesArgsBuilder struct { - obj *MetaServiceListFTIndexesArgs -} - -func NewMetaServiceListFTIndexesArgsBuilder() *MetaServiceListFTIndexesArgsBuilder{ - return &MetaServiceListFTIndexesArgsBuilder{ - obj: NewMetaServiceListFTIndexesArgs(), - } -} - -func (p MetaServiceListFTIndexesArgsBuilder) Emit() *MetaServiceListFTIndexesArgs{ - return &MetaServiceListFTIndexesArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListFTIndexesArgsBuilder) Req(req *ListFTIndexesReq) *MetaServiceListFTIndexesArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListFTIndexesArgs) SetReq(req *ListFTIndexesReq) *MetaServiceListFTIndexesArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListFTIndexesResultBuilder struct { - obj *MetaServiceListFTIndexesResult -} - -func NewMetaServiceListFTIndexesResultBuilder() *MetaServiceListFTIndexesResultBuilder{ - return &MetaServiceListFTIndexesResultBuilder{ - obj: NewMetaServiceListFTIndexesResult(), - } -} - -func (p MetaServiceListFTIndexesResultBuilder) Emit() *MetaServiceListFTIndexesResult{ - return &MetaServiceListFTIndexesResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListFTIndexesResultBuilder) Success(success *ListFTIndexesResp) *MetaServiceListFTIndexesResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListFTIndexesResult) SetSuccess(success *ListFTIndexesResp) *MetaServiceListFTIndexesResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceCreateSessionArgsBuilder struct { - obj *MetaServiceCreateSessionArgs -} - -func NewMetaServiceCreateSessionArgsBuilder() *MetaServiceCreateSessionArgsBuilder{ - return &MetaServiceCreateSessionArgsBuilder{ - obj: NewMetaServiceCreateSessionArgs(), - } -} - -func (p MetaServiceCreateSessionArgsBuilder) Emit() *MetaServiceCreateSessionArgs{ - return &MetaServiceCreateSessionArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateSessionArgsBuilder) Req(req *CreateSessionReq) *MetaServiceCreateSessionArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateSessionArgs) SetReq(req *CreateSessionReq) *MetaServiceCreateSessionArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateSessionResultBuilder struct { - obj *MetaServiceCreateSessionResult -} - -func NewMetaServiceCreateSessionResultBuilder() *MetaServiceCreateSessionResultBuilder{ - return &MetaServiceCreateSessionResultBuilder{ - obj: NewMetaServiceCreateSessionResult(), - } -} - -func (p MetaServiceCreateSessionResultBuilder) Emit() *MetaServiceCreateSessionResult{ - return &MetaServiceCreateSessionResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateSessionResultBuilder) Success(success *CreateSessionResp) *MetaServiceCreateSessionResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateSessionResult) SetSuccess(success *CreateSessionResp) *MetaServiceCreateSessionResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceUpdateSessionsArgsBuilder struct { - obj *MetaServiceUpdateSessionsArgs -} - -func NewMetaServiceUpdateSessionsArgsBuilder() *MetaServiceUpdateSessionsArgsBuilder{ - return &MetaServiceUpdateSessionsArgsBuilder{ - obj: NewMetaServiceUpdateSessionsArgs(), - } -} - -func (p MetaServiceUpdateSessionsArgsBuilder) Emit() *MetaServiceUpdateSessionsArgs{ - return &MetaServiceUpdateSessionsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceUpdateSessionsArgsBuilder) Req(req *UpdateSessionsReq) *MetaServiceUpdateSessionsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceUpdateSessionsArgs) SetReq(req *UpdateSessionsReq) *MetaServiceUpdateSessionsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceUpdateSessionsResultBuilder struct { - obj *MetaServiceUpdateSessionsResult -} - -func NewMetaServiceUpdateSessionsResultBuilder() *MetaServiceUpdateSessionsResultBuilder{ - return &MetaServiceUpdateSessionsResultBuilder{ - obj: NewMetaServiceUpdateSessionsResult(), - } -} - -func (p MetaServiceUpdateSessionsResultBuilder) Emit() *MetaServiceUpdateSessionsResult{ - return &MetaServiceUpdateSessionsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceUpdateSessionsResultBuilder) Success(success *UpdateSessionsResp) *MetaServiceUpdateSessionsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceUpdateSessionsResult) SetSuccess(success *UpdateSessionsResp) *MetaServiceUpdateSessionsResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceListSessionsArgsBuilder struct { - obj *MetaServiceListSessionsArgs -} - -func NewMetaServiceListSessionsArgsBuilder() *MetaServiceListSessionsArgsBuilder{ - return &MetaServiceListSessionsArgsBuilder{ - obj: NewMetaServiceListSessionsArgs(), - } -} - -func (p MetaServiceListSessionsArgsBuilder) Emit() *MetaServiceListSessionsArgs{ - return &MetaServiceListSessionsArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListSessionsArgsBuilder) Req(req *ListSessionsReq) *MetaServiceListSessionsArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListSessionsArgs) SetReq(req *ListSessionsReq) *MetaServiceListSessionsArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListSessionsResultBuilder struct { - obj *MetaServiceListSessionsResult -} - -func NewMetaServiceListSessionsResultBuilder() *MetaServiceListSessionsResultBuilder{ - return &MetaServiceListSessionsResultBuilder{ - obj: NewMetaServiceListSessionsResult(), - } -} - -func (p MetaServiceListSessionsResultBuilder) Emit() *MetaServiceListSessionsResult{ - return &MetaServiceListSessionsResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListSessionsResultBuilder) Success(success *ListSessionsResp) *MetaServiceListSessionsResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListSessionsResult) SetSuccess(success *ListSessionsResp) *MetaServiceListSessionsResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetSessionArgsBuilder struct { - obj *MetaServiceGetSessionArgs -} - -func NewMetaServiceGetSessionArgsBuilder() *MetaServiceGetSessionArgsBuilder{ - return &MetaServiceGetSessionArgsBuilder{ - obj: NewMetaServiceGetSessionArgs(), - } -} - -func (p MetaServiceGetSessionArgsBuilder) Emit() *MetaServiceGetSessionArgs{ - return &MetaServiceGetSessionArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetSessionArgsBuilder) Req(req *GetSessionReq) *MetaServiceGetSessionArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetSessionArgs) SetReq(req *GetSessionReq) *MetaServiceGetSessionArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetSessionResultBuilder struct { - obj *MetaServiceGetSessionResult -} - -func NewMetaServiceGetSessionResultBuilder() *MetaServiceGetSessionResultBuilder{ - return &MetaServiceGetSessionResultBuilder{ - obj: NewMetaServiceGetSessionResult(), - } -} - -func (p MetaServiceGetSessionResultBuilder) Emit() *MetaServiceGetSessionResult{ - return &MetaServiceGetSessionResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetSessionResultBuilder) Success(success *GetSessionResp) *MetaServiceGetSessionResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetSessionResult) SetSuccess(success *GetSessionResp) *MetaServiceGetSessionResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceRemoveSessionArgsBuilder struct { - obj *MetaServiceRemoveSessionArgs -} - -func NewMetaServiceRemoveSessionArgsBuilder() *MetaServiceRemoveSessionArgsBuilder{ - return &MetaServiceRemoveSessionArgsBuilder{ - obj: NewMetaServiceRemoveSessionArgs(), - } -} - -func (p MetaServiceRemoveSessionArgsBuilder) Emit() *MetaServiceRemoveSessionArgs{ - return &MetaServiceRemoveSessionArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRemoveSessionArgsBuilder) Req(req *RemoveSessionReq) *MetaServiceRemoveSessionArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRemoveSessionArgs) SetReq(req *RemoveSessionReq) *MetaServiceRemoveSessionArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceRemoveSessionResultBuilder struct { - obj *MetaServiceRemoveSessionResult -} - -func NewMetaServiceRemoveSessionResultBuilder() *MetaServiceRemoveSessionResultBuilder{ - return &MetaServiceRemoveSessionResultBuilder{ - obj: NewMetaServiceRemoveSessionResult(), - } -} - -func (p MetaServiceRemoveSessionResultBuilder) Emit() *MetaServiceRemoveSessionResult{ - return &MetaServiceRemoveSessionResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRemoveSessionResultBuilder) Success(success *ExecResp) *MetaServiceRemoveSessionResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRemoveSessionResult) SetSuccess(success *ExecResp) *MetaServiceRemoveSessionResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceKillQueryArgsBuilder struct { - obj *MetaServiceKillQueryArgs -} - -func NewMetaServiceKillQueryArgsBuilder() *MetaServiceKillQueryArgsBuilder{ - return &MetaServiceKillQueryArgsBuilder{ - obj: NewMetaServiceKillQueryArgs(), - } -} - -func (p MetaServiceKillQueryArgsBuilder) Emit() *MetaServiceKillQueryArgs{ - return &MetaServiceKillQueryArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceKillQueryArgsBuilder) Req(req *KillQueryReq) *MetaServiceKillQueryArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceKillQueryArgs) SetReq(req *KillQueryReq) *MetaServiceKillQueryArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceKillQueryResultBuilder struct { - obj *MetaServiceKillQueryResult -} - -func NewMetaServiceKillQueryResultBuilder() *MetaServiceKillQueryResultBuilder{ - return &MetaServiceKillQueryResultBuilder{ - obj: NewMetaServiceKillQueryResult(), - } -} - -func (p MetaServiceKillQueryResultBuilder) Emit() *MetaServiceKillQueryResult{ - return &MetaServiceKillQueryResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceKillQueryResultBuilder) Success(success *ExecResp) *MetaServiceKillQueryResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceKillQueryResult) SetSuccess(success *ExecResp) *MetaServiceKillQueryResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceReportTaskFinishArgsBuilder struct { - obj *MetaServiceReportTaskFinishArgs -} - -func NewMetaServiceReportTaskFinishArgsBuilder() *MetaServiceReportTaskFinishArgsBuilder{ - return &MetaServiceReportTaskFinishArgsBuilder{ - obj: NewMetaServiceReportTaskFinishArgs(), - } -} - -func (p MetaServiceReportTaskFinishArgsBuilder) Emit() *MetaServiceReportTaskFinishArgs{ - return &MetaServiceReportTaskFinishArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceReportTaskFinishArgsBuilder) Req(req *ReportTaskReq) *MetaServiceReportTaskFinishArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceReportTaskFinishArgs) SetReq(req *ReportTaskReq) *MetaServiceReportTaskFinishArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceReportTaskFinishResultBuilder struct { - obj *MetaServiceReportTaskFinishResult -} - -func NewMetaServiceReportTaskFinishResultBuilder() *MetaServiceReportTaskFinishResultBuilder{ - return &MetaServiceReportTaskFinishResultBuilder{ - obj: NewMetaServiceReportTaskFinishResult(), - } -} - -func (p MetaServiceReportTaskFinishResultBuilder) Emit() *MetaServiceReportTaskFinishResult{ - return &MetaServiceReportTaskFinishResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceReportTaskFinishResultBuilder) Success(success *ExecResp) *MetaServiceReportTaskFinishResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceReportTaskFinishResult) SetSuccess(success *ExecResp) *MetaServiceReportTaskFinishResult { - m.Success = success - return m -} - -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 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 -} - -type MetaServiceCreateBackupArgsBuilder struct { - obj *MetaServiceCreateBackupArgs -} - -func NewMetaServiceCreateBackupArgsBuilder() *MetaServiceCreateBackupArgsBuilder{ - return &MetaServiceCreateBackupArgsBuilder{ - obj: NewMetaServiceCreateBackupArgs(), - } -} - -func (p MetaServiceCreateBackupArgsBuilder) Emit() *MetaServiceCreateBackupArgs{ - return &MetaServiceCreateBackupArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceCreateBackupArgsBuilder) Req(req *CreateBackupReq) *MetaServiceCreateBackupArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceCreateBackupArgs) SetReq(req *CreateBackupReq) *MetaServiceCreateBackupArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceCreateBackupResultBuilder struct { - obj *MetaServiceCreateBackupResult -} - -func NewMetaServiceCreateBackupResultBuilder() *MetaServiceCreateBackupResultBuilder{ - return &MetaServiceCreateBackupResultBuilder{ - obj: NewMetaServiceCreateBackupResult(), - } -} - -func (p MetaServiceCreateBackupResultBuilder) Emit() *MetaServiceCreateBackupResult{ - return &MetaServiceCreateBackupResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceCreateBackupResultBuilder) Success(success *CreateBackupResp) *MetaServiceCreateBackupResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceCreateBackupResult) SetSuccess(success *CreateBackupResp) *MetaServiceCreateBackupResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceRestoreMetaArgsBuilder struct { - obj *MetaServiceRestoreMetaArgs -} - -func NewMetaServiceRestoreMetaArgsBuilder() *MetaServiceRestoreMetaArgsBuilder{ - return &MetaServiceRestoreMetaArgsBuilder{ - obj: NewMetaServiceRestoreMetaArgs(), - } -} - -func (p MetaServiceRestoreMetaArgsBuilder) Emit() *MetaServiceRestoreMetaArgs{ - return &MetaServiceRestoreMetaArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceRestoreMetaArgsBuilder) Req(req *RestoreMetaReq) *MetaServiceRestoreMetaArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceRestoreMetaArgs) SetReq(req *RestoreMetaReq) *MetaServiceRestoreMetaArgs { - m.Req = req - return m -} - -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 *RestoreMetaResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceRestoreMetaResult() *MetaServiceRestoreMetaResult { - return &MetaServiceRestoreMetaResult{} -} - -var MetaServiceRestoreMetaResult_Success_DEFAULT *RestoreMetaResp -func (p *MetaServiceRestoreMetaResult) GetSuccess() *RestoreMetaResp { - if !p.IsSetSuccess() { - return MetaServiceRestoreMetaResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceRestoreMetaResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceRestoreMetaResultBuilder struct { - obj *MetaServiceRestoreMetaResult -} - -func NewMetaServiceRestoreMetaResultBuilder() *MetaServiceRestoreMetaResultBuilder{ - return &MetaServiceRestoreMetaResultBuilder{ - obj: NewMetaServiceRestoreMetaResult(), - } -} - -func (p MetaServiceRestoreMetaResultBuilder) Emit() *MetaServiceRestoreMetaResult{ - return &MetaServiceRestoreMetaResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceRestoreMetaResultBuilder) Success(success *RestoreMetaResp) *MetaServiceRestoreMetaResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceRestoreMetaResult) SetSuccess(success *RestoreMetaResp) *MetaServiceRestoreMetaResult { - m.Success = success - return m -} - -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 = NewRestoreMetaResp() - 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 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 -} - -type MetaServiceListClusterArgsBuilder struct { - obj *MetaServiceListClusterArgs -} - -func NewMetaServiceListClusterArgsBuilder() *MetaServiceListClusterArgsBuilder{ - return &MetaServiceListClusterArgsBuilder{ - obj: NewMetaServiceListClusterArgs(), - } -} - -func (p MetaServiceListClusterArgsBuilder) Emit() *MetaServiceListClusterArgs{ - return &MetaServiceListClusterArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceListClusterArgsBuilder) Req(req *ListClusterInfoReq) *MetaServiceListClusterArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceListClusterArgs) SetReq(req *ListClusterInfoReq) *MetaServiceListClusterArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceListClusterResultBuilder struct { - obj *MetaServiceListClusterResult -} - -func NewMetaServiceListClusterResultBuilder() *MetaServiceListClusterResultBuilder{ - return &MetaServiceListClusterResultBuilder{ - obj: NewMetaServiceListClusterResult(), - } -} - -func (p MetaServiceListClusterResultBuilder) Emit() *MetaServiceListClusterResult{ - return &MetaServiceListClusterResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceListClusterResultBuilder) Success(success *ListClusterInfoResp) *MetaServiceListClusterResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceListClusterResult) SetSuccess(success *ListClusterInfoResp) *MetaServiceListClusterResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceGetMetaDirInfoArgsBuilder struct { - obj *MetaServiceGetMetaDirInfoArgs -} - -func NewMetaServiceGetMetaDirInfoArgsBuilder() *MetaServiceGetMetaDirInfoArgsBuilder{ - return &MetaServiceGetMetaDirInfoArgsBuilder{ - obj: NewMetaServiceGetMetaDirInfoArgs(), - } -} - -func (p MetaServiceGetMetaDirInfoArgsBuilder) Emit() *MetaServiceGetMetaDirInfoArgs{ - return &MetaServiceGetMetaDirInfoArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetMetaDirInfoArgsBuilder) Req(req *GetMetaDirInfoReq) *MetaServiceGetMetaDirInfoArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetMetaDirInfoArgs) SetReq(req *GetMetaDirInfoReq) *MetaServiceGetMetaDirInfoArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceGetMetaDirInfoResultBuilder struct { - obj *MetaServiceGetMetaDirInfoResult -} - -func NewMetaServiceGetMetaDirInfoResultBuilder() *MetaServiceGetMetaDirInfoResultBuilder{ - return &MetaServiceGetMetaDirInfoResultBuilder{ - obj: NewMetaServiceGetMetaDirInfoResult(), - } -} - -func (p MetaServiceGetMetaDirInfoResultBuilder) Emit() *MetaServiceGetMetaDirInfoResult{ - return &MetaServiceGetMetaDirInfoResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetMetaDirInfoResultBuilder) Success(success *GetMetaDirInfoResp) *MetaServiceGetMetaDirInfoResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetMetaDirInfoResult) SetSuccess(success *GetMetaDirInfoResp) *MetaServiceGetMetaDirInfoResult { - m.Success = success - return m -} - -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 -} - -type MetaServiceVerifyClientVersionArgsBuilder struct { - obj *MetaServiceVerifyClientVersionArgs -} - -func NewMetaServiceVerifyClientVersionArgsBuilder() *MetaServiceVerifyClientVersionArgsBuilder{ - return &MetaServiceVerifyClientVersionArgsBuilder{ - obj: NewMetaServiceVerifyClientVersionArgs(), - } -} - -func (p MetaServiceVerifyClientVersionArgsBuilder) Emit() *MetaServiceVerifyClientVersionArgs{ - return &MetaServiceVerifyClientVersionArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceVerifyClientVersionArgsBuilder) Req(req *VerifyClientVersionReq) *MetaServiceVerifyClientVersionArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceVerifyClientVersionArgs) SetReq(req *VerifyClientVersionReq) *MetaServiceVerifyClientVersionArgs { - m.Req = req - return m -} - -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,optional" 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 -} - -type MetaServiceVerifyClientVersionResultBuilder struct { - obj *MetaServiceVerifyClientVersionResult -} - -func NewMetaServiceVerifyClientVersionResultBuilder() *MetaServiceVerifyClientVersionResultBuilder{ - return &MetaServiceVerifyClientVersionResultBuilder{ - obj: NewMetaServiceVerifyClientVersionResult(), - } -} - -func (p MetaServiceVerifyClientVersionResultBuilder) Emit() *MetaServiceVerifyClientVersionResult{ - return &MetaServiceVerifyClientVersionResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceVerifyClientVersionResultBuilder) Success(success *VerifyClientVersionResp) *MetaServiceVerifyClientVersionResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceVerifyClientVersionResult) SetSuccess(success *VerifyClientVersionResp) *MetaServiceVerifyClientVersionResult { - m.Success = success - return m -} - -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) -} - -// Attributes: -// - Req -type MetaServiceSaveGraphVersionArgs struct { - thrift.IRequest - Req *SaveGraphVersionReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceSaveGraphVersionArgs() *MetaServiceSaveGraphVersionArgs { - return &MetaServiceSaveGraphVersionArgs{ - Req: NewSaveGraphVersionReq(), - } -} - -var MetaServiceSaveGraphVersionArgs_Req_DEFAULT *SaveGraphVersionReq -func (p *MetaServiceSaveGraphVersionArgs) GetReq() *SaveGraphVersionReq { - if !p.IsSetReq() { - return MetaServiceSaveGraphVersionArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceSaveGraphVersionArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceSaveGraphVersionArgsBuilder struct { - obj *MetaServiceSaveGraphVersionArgs -} - -func NewMetaServiceSaveGraphVersionArgsBuilder() *MetaServiceSaveGraphVersionArgsBuilder{ - return &MetaServiceSaveGraphVersionArgsBuilder{ - obj: NewMetaServiceSaveGraphVersionArgs(), - } -} - -func (p MetaServiceSaveGraphVersionArgsBuilder) Emit() *MetaServiceSaveGraphVersionArgs{ - return &MetaServiceSaveGraphVersionArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceSaveGraphVersionArgsBuilder) Req(req *SaveGraphVersionReq) *MetaServiceSaveGraphVersionArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceSaveGraphVersionArgs) SetReq(req *SaveGraphVersionReq) *MetaServiceSaveGraphVersionArgs { - m.Req = req - return m -} - -func (p *MetaServiceSaveGraphVersionArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceSaveGraphVersionArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewSaveGraphVersionReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceSaveGraphVersionArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("saveGraphVersion_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceSaveGraphVersionArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceSaveGraphVersionArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceSaveGraphVersionArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceSaveGraphVersionResult struct { - thrift.IResponse - Success *SaveGraphVersionResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceSaveGraphVersionResult() *MetaServiceSaveGraphVersionResult { - return &MetaServiceSaveGraphVersionResult{} -} - -var MetaServiceSaveGraphVersionResult_Success_DEFAULT *SaveGraphVersionResp -func (p *MetaServiceSaveGraphVersionResult) GetSuccess() *SaveGraphVersionResp { - if !p.IsSetSuccess() { - return MetaServiceSaveGraphVersionResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceSaveGraphVersionResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceSaveGraphVersionResultBuilder struct { - obj *MetaServiceSaveGraphVersionResult -} - -func NewMetaServiceSaveGraphVersionResultBuilder() *MetaServiceSaveGraphVersionResultBuilder{ - return &MetaServiceSaveGraphVersionResultBuilder{ - obj: NewMetaServiceSaveGraphVersionResult(), - } -} - -func (p MetaServiceSaveGraphVersionResultBuilder) Emit() *MetaServiceSaveGraphVersionResult{ - return &MetaServiceSaveGraphVersionResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceSaveGraphVersionResultBuilder) Success(success *SaveGraphVersionResp) *MetaServiceSaveGraphVersionResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceSaveGraphVersionResult) SetSuccess(success *SaveGraphVersionResp) *MetaServiceSaveGraphVersionResult { - m.Success = success - return m -} - -func (p *MetaServiceSaveGraphVersionResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceSaveGraphVersionResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewSaveGraphVersionResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceSaveGraphVersionResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("saveGraphVersion_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceSaveGraphVersionResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceSaveGraphVersionResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceSaveGraphVersionResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type MetaServiceGetSegmentIdArgs struct { - thrift.IRequest - Req *GetSegmentIdReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewMetaServiceGetSegmentIdArgs() *MetaServiceGetSegmentIdArgs { - return &MetaServiceGetSegmentIdArgs{ - Req: NewGetSegmentIdReq(), - } -} - -var MetaServiceGetSegmentIdArgs_Req_DEFAULT *GetSegmentIdReq -func (p *MetaServiceGetSegmentIdArgs) GetReq() *GetSegmentIdReq { - if !p.IsSetReq() { - return MetaServiceGetSegmentIdArgs_Req_DEFAULT - } -return p.Req -} -func (p *MetaServiceGetSegmentIdArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type MetaServiceGetSegmentIdArgsBuilder struct { - obj *MetaServiceGetSegmentIdArgs -} - -func NewMetaServiceGetSegmentIdArgsBuilder() *MetaServiceGetSegmentIdArgsBuilder{ - return &MetaServiceGetSegmentIdArgsBuilder{ - obj: NewMetaServiceGetSegmentIdArgs(), - } -} - -func (p MetaServiceGetSegmentIdArgsBuilder) Emit() *MetaServiceGetSegmentIdArgs{ - return &MetaServiceGetSegmentIdArgs{ - Req: p.obj.Req, - } -} - -func (m *MetaServiceGetSegmentIdArgsBuilder) Req(req *GetSegmentIdReq) *MetaServiceGetSegmentIdArgsBuilder { - m.obj.Req = req - return m -} - -func (m *MetaServiceGetSegmentIdArgs) SetReq(req *GetSegmentIdReq) *MetaServiceGetSegmentIdArgs { - m.Req = req - return m -} - -func (p *MetaServiceGetSegmentIdArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceGetSegmentIdArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewGetSegmentIdReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *MetaServiceGetSegmentIdArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("getSegmentId_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceGetSegmentIdArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *MetaServiceGetSegmentIdArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("MetaServiceGetSegmentIdArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type MetaServiceGetSegmentIdResult struct { - thrift.IResponse - Success *GetSegmentIdResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewMetaServiceGetSegmentIdResult() *MetaServiceGetSegmentIdResult { - return &MetaServiceGetSegmentIdResult{} -} - -var MetaServiceGetSegmentIdResult_Success_DEFAULT *GetSegmentIdResp -func (p *MetaServiceGetSegmentIdResult) GetSuccess() *GetSegmentIdResp { - if !p.IsSetSuccess() { - return MetaServiceGetSegmentIdResult_Success_DEFAULT - } -return p.Success -} -func (p *MetaServiceGetSegmentIdResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type MetaServiceGetSegmentIdResultBuilder struct { - obj *MetaServiceGetSegmentIdResult -} - -func NewMetaServiceGetSegmentIdResultBuilder() *MetaServiceGetSegmentIdResultBuilder{ - return &MetaServiceGetSegmentIdResultBuilder{ - obj: NewMetaServiceGetSegmentIdResult(), - } -} - -func (p MetaServiceGetSegmentIdResultBuilder) Emit() *MetaServiceGetSegmentIdResult{ - return &MetaServiceGetSegmentIdResult{ - Success: p.obj.Success, - } -} - -func (m *MetaServiceGetSegmentIdResultBuilder) Success(success *GetSegmentIdResp) *MetaServiceGetSegmentIdResultBuilder { - m.obj.Success = success - return m -} - -func (m *MetaServiceGetSegmentIdResult) SetSuccess(success *GetSegmentIdResp) *MetaServiceGetSegmentIdResult { - m.Success = success - return m -} - -func (p *MetaServiceGetSegmentIdResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MetaServiceGetSegmentIdResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewGetSegmentIdResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *MetaServiceGetSegmentIdResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("getSegmentId_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MetaServiceGetSegmentIdResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *MetaServiceGetSegmentIdResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("MetaServiceGetSegmentIdResult({Success:%s})", successVal) -} - - diff --git a/nebula/meta/ttypes.go b/nebula/meta/ttypes.go deleted file mode 100644 index d842210a..00000000 --- a/nebula/meta/ttypes.go +++ /dev/null @@ -1,35297 +0,0 @@ -// 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/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - -) - -// (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 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 AlterSpaceOp int64 -const ( - AlterSpaceOp_ADD_ZONE AlterSpaceOp = 1 -) - -var AlterSpaceOpToName = map[AlterSpaceOp]string { - AlterSpaceOp_ADD_ZONE: "ADD_ZONE", -} - -var AlterSpaceOpToValue = map[string]AlterSpaceOp { - "ADD_ZONE": AlterSpaceOp_ADD_ZONE, -} - -var AlterSpaceOpNames = []string { - "ADD_ZONE", -} - -var AlterSpaceOpValues = []AlterSpaceOp { - AlterSpaceOp_ADD_ZONE, -} - -func (p AlterSpaceOp) String() string { - if v, ok := AlterSpaceOpToName[p]; ok { - return v - } - return "" -} - -func AlterSpaceOpFromString(s string) (AlterSpaceOp, error) { - if v, ok := AlterSpaceOpToValue[s]; ok { - return v, nil - } - return AlterSpaceOp(0), fmt.Errorf("not a valid AlterSpaceOp string") -} - -func AlterSpaceOpPtr(v AlterSpaceOp) *AlterSpaceOp { return &v } - -type JobOp int64 -const ( - JobOp_ADD JobOp = 1 - JobOp_SHOW_All JobOp = 2 - JobOp_SHOW JobOp = 3 - JobOp_STOP JobOp = 4 - JobOp_RECOVER JobOp = 5 -) - -var JobOpToName = map[JobOp]string { - JobOp_ADD: "ADD", - JobOp_SHOW_All: "SHOW_All", - JobOp_SHOW: "SHOW", - JobOp_STOP: "STOP", - JobOp_RECOVER: "RECOVER", -} - -var JobOpToValue = map[string]JobOp { - "ADD": JobOp_ADD, - "SHOW_All": JobOp_SHOW_All, - "SHOW": JobOp_SHOW, - "STOP": JobOp_STOP, - "RECOVER": JobOp_RECOVER, -} - -var JobOpNames = []string { - "ADD", - "SHOW_All", - "SHOW", - "STOP", - "RECOVER", -} - -var JobOpValues = []JobOp { - JobOp_ADD, - JobOp_SHOW_All, - JobOp_SHOW, - JobOp_STOP, - JobOp_RECOVER, -} - -func (p JobOp) String() string { - if v, ok := JobOpToName[p]; ok { - return v - } - return "" -} - -func JobOpFromString(s string) (JobOp, error) { - if v, ok := JobOpToValue[s]; ok { - return v, nil - } - return JobOp(0), fmt.Errorf("not a valid JobOp string") -} - -func JobOpPtr(v JobOp) *JobOp { return &v } - -type JobType int64 -const ( - JobType_COMPACT JobType = 0 - JobType_FLUSH JobType = 1 - JobType_REBUILD_TAG_INDEX JobType = 2 - JobType_REBUILD_EDGE_INDEX JobType = 3 - JobType_REBUILD_FULLTEXT_INDEX JobType = 4 - JobType_STATS JobType = 5 - JobType_DATA_BALANCE JobType = 6 - JobType_DOWNLOAD JobType = 7 - JobType_INGEST JobType = 8 - JobType_LEADER_BALANCE JobType = 9 - JobType_ZONE_BALANCE JobType = 10 - JobType_UNKNOWN JobType = 99 -) - -var JobTypeToName = map[JobType]string { - JobType_COMPACT: "COMPACT", - JobType_FLUSH: "FLUSH", - JobType_REBUILD_TAG_INDEX: "REBUILD_TAG_INDEX", - JobType_REBUILD_EDGE_INDEX: "REBUILD_EDGE_INDEX", - JobType_REBUILD_FULLTEXT_INDEX: "REBUILD_FULLTEXT_INDEX", - JobType_STATS: "STATS", - JobType_DATA_BALANCE: "DATA_BALANCE", - JobType_DOWNLOAD: "DOWNLOAD", - JobType_INGEST: "INGEST", - JobType_LEADER_BALANCE: "LEADER_BALANCE", - JobType_ZONE_BALANCE: "ZONE_BALANCE", - JobType_UNKNOWN: "UNKNOWN", -} - -var JobTypeToValue = map[string]JobType { - "COMPACT": JobType_COMPACT, - "FLUSH": JobType_FLUSH, - "REBUILD_TAG_INDEX": JobType_REBUILD_TAG_INDEX, - "REBUILD_EDGE_INDEX": JobType_REBUILD_EDGE_INDEX, - "REBUILD_FULLTEXT_INDEX": JobType_REBUILD_FULLTEXT_INDEX, - "STATS": JobType_STATS, - "DATA_BALANCE": JobType_DATA_BALANCE, - "DOWNLOAD": JobType_DOWNLOAD, - "INGEST": JobType_INGEST, - "LEADER_BALANCE": JobType_LEADER_BALANCE, - "ZONE_BALANCE": JobType_ZONE_BALANCE, - "UNKNOWN": JobType_UNKNOWN, -} - -var JobTypeNames = []string { - "COMPACT", - "FLUSH", - "REBUILD_TAG_INDEX", - "REBUILD_EDGE_INDEX", - "REBUILD_FULLTEXT_INDEX", - "STATS", - "DATA_BALANCE", - "DOWNLOAD", - "INGEST", - "LEADER_BALANCE", - "ZONE_BALANCE", - "UNKNOWN", -} - -var JobTypeValues = []JobType { - JobType_COMPACT, - JobType_FLUSH, - JobType_REBUILD_TAG_INDEX, - JobType_REBUILD_EDGE_INDEX, - JobType_REBUILD_FULLTEXT_INDEX, - JobType_STATS, - JobType_DATA_BALANCE, - JobType_DOWNLOAD, - JobType_INGEST, - JobType_LEADER_BALANCE, - JobType_ZONE_BALANCE, - JobType_UNKNOWN, -} - -func (p JobType) String() string { - if v, ok := JobTypeToName[p]; ok { - return v - } - return "" -} - -func JobTypeFromString(s string) (JobType, error) { - if v, ok := JobTypeToValue[s]; ok { - return v, nil - } - return JobType(0), fmt.Errorf("not a valid JobType string") -} - -func JobTypePtr(v JobType) *JobType { 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 - ListHostType_AGENT ListHostType = 4 -) - -var ListHostTypeToName = map[ListHostType]string { - ListHostType_ALLOC: "ALLOC", - ListHostType_GRAPH: "GRAPH", - ListHostType_META: "META", - ListHostType_STORAGE: "STORAGE", - ListHostType_AGENT: "AGENT", -} - -var ListHostTypeToValue = map[string]ListHostType { - "ALLOC": ListHostType_ALLOC, - "GRAPH": ListHostType_GRAPH, - "META": ListHostType_META, - "STORAGE": ListHostType_STORAGE, - "AGENT": ListHostType_AGENT, -} - -var ListHostTypeNames = []string { - "ALLOC", - "GRAPH", - "META", - "STORAGE", - "AGENT", -} - -var ListHostTypeValues = []ListHostType { - ListHostType_ALLOC, - ListHostType_GRAPH, - ListHostType_META, - ListHostType_STORAGE, - ListHostType_AGENT, -} - -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_AGENT HostRole = 4 - HostRole_UNKNOWN HostRole = 5 -) - -var HostRoleToName = map[HostRole]string { - HostRole_GRAPH: "GRAPH", - HostRole_META: "META", - HostRole_STORAGE: "STORAGE", - HostRole_LISTENER: "LISTENER", - HostRole_AGENT: "AGENT", - HostRole_UNKNOWN: "UNKNOWN", -} - -var HostRoleToValue = map[string]HostRole { - "GRAPH": HostRole_GRAPH, - "META": HostRole_META, - "STORAGE": HostRole_STORAGE, - "LISTENER": HostRole_LISTENER, - "AGENT": HostRole_AGENT, - "UNKNOWN": HostRole_UNKNOWN, -} - -var HostRoleNames = []string { - "GRAPH", - "META", - "STORAGE", - "LISTENER", - "AGENT", - "UNKNOWN", -} - -var HostRoleValues = []HostRole { - HostRole_GRAPH, - HostRole_META, - HostRole_STORAGE, - HostRole_LISTENER, - HostRole_AGENT, - 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 ExternalServiceType int64 -const ( - ExternalServiceType_ELASTICSEARCH ExternalServiceType = 1 -) - -var ExternalServiceTypeToName = map[ExternalServiceType]string { - ExternalServiceType_ELASTICSEARCH: "ELASTICSEARCH", -} - -var ExternalServiceTypeToValue = map[string]ExternalServiceType { - "ELASTICSEARCH": ExternalServiceType_ELASTICSEARCH, -} - -var ExternalServiceTypeNames = []string { - "ELASTICSEARCH", -} - -var ExternalServiceTypeValues = []ExternalServiceType { - ExternalServiceType_ELASTICSEARCH, -} - -func (p ExternalServiceType) String() string { - if v, ok := ExternalServiceTypeToName[p]; ok { - return v - } - return "" -} - -func ExternalServiceTypeFromString(s string) (ExternalServiceType, error) { - if v, ok := ExternalServiceTypeToValue[s]; ok { - return v, nil - } - return ExternalServiceType(0), fmt.Errorf("not a valid ExternalServiceType string") -} - -func ExternalServiceTypePtr(v ExternalServiceType) *ExternalServiceType { 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,optional" db:"space_id" json:"space_id,omitempty"` - TagID *nebula0.TagID `thrift:"tag_id,2,optional" db:"tag_id" json:"tag_id,omitempty"` - EdgeType *nebula0.EdgeType `thrift:"edge_type,3,optional" db:"edge_type" json:"edge_type,omitempty"` - IndexID *nebula0.IndexID `thrift:"index_id,4,optional" db:"index_id" json:"index_id,omitempty"` - ClusterID *ClusterID `thrift:"cluster_id,5,optional" 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 -} - -type IDBuilder struct { - obj *ID -} - -func NewIDBuilder() *IDBuilder{ - return &IDBuilder{ - obj: NewID(), - } -} - -func (p IDBuilder) Emit() *ID{ - return &ID{ - SpaceID: p.obj.SpaceID, - TagID: p.obj.TagID, - EdgeType: p.obj.EdgeType, - IndexID: p.obj.IndexID, - ClusterID: p.obj.ClusterID, - } -} - -func (i *IDBuilder) SpaceID(spaceID *nebula0.GraphSpaceID) *IDBuilder { - i.obj.SpaceID = spaceID - return i -} - -func (i *IDBuilder) TagID(tagID *nebula0.TagID) *IDBuilder { - i.obj.TagID = tagID - return i -} - -func (i *IDBuilder) EdgeType(edgeType *nebula0.EdgeType) *IDBuilder { - i.obj.EdgeType = edgeType - return i -} - -func (i *IDBuilder) IndexID(indexID *nebula0.IndexID) *IDBuilder { - i.obj.IndexID = indexID - return i -} - -func (i *IDBuilder) ClusterID(clusterID *ClusterID) *IDBuilder { - i.obj.ClusterID = clusterID - return i -} - -func (i *ID) SetSpaceID(spaceID *nebula0.GraphSpaceID) *ID { - i.SpaceID = spaceID - return i -} - -func (i *ID) SetTagID(tagID *nebula0.TagID) *ID { - i.TagID = tagID - return i -} - -func (i *ID) SetEdgeType(edgeType *nebula0.EdgeType) *ID { - i.EdgeType = edgeType - return i -} - -func (i *ID) SetIndexID(indexID *nebula0.IndexID) *ID { - i.IndexID = indexID - return i -} - -func (i *ID) SetClusterID(clusterID *ClusterID) *ID { - i.ClusterID = clusterID - return i -} - -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 nebula0.PropertyType `thrift:"type,1,required" db:"type" json:"type"` - TypeLength int16 `thrift:"type_length,2,optional" db:"type_length" json:"type_length,omitempty"` - GeoShape *GeoShape `thrift:"geo_shape,3,optional" db:"geo_shape" json:"geo_shape,omitempty"` -} - -func NewColumnTypeDef() *ColumnTypeDef { - return &ColumnTypeDef{} -} - - -func (p *ColumnTypeDef) GetType() nebula0.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 -} - -type ColumnTypeDefBuilder struct { - obj *ColumnTypeDef -} - -func NewColumnTypeDefBuilder() *ColumnTypeDefBuilder{ - return &ColumnTypeDefBuilder{ - obj: NewColumnTypeDef(), - } -} - -func (p ColumnTypeDefBuilder) Emit() *ColumnTypeDef{ - return &ColumnTypeDef{ - Type: p.obj.Type, - TypeLength: p.obj.TypeLength, - GeoShape: p.obj.GeoShape, - } -} - -func (c *ColumnTypeDefBuilder) Type(type_a1 nebula0.PropertyType) *ColumnTypeDefBuilder { - c.obj.Type = type_a1 - return c -} - -func (c *ColumnTypeDefBuilder) TypeLength(typeLength int16) *ColumnTypeDefBuilder { - c.obj.TypeLength = typeLength - return c -} - -func (c *ColumnTypeDefBuilder) GeoShape(geoShape *GeoShape) *ColumnTypeDefBuilder { - c.obj.GeoShape = geoShape - return c -} - -func (c *ColumnTypeDef) SetType(type_a1 nebula0.PropertyType) *ColumnTypeDef { - c.Type = type_a1 - return c -} - -func (c *ColumnTypeDef) SetTypeLength(typeLength int16) *ColumnTypeDef { - c.TypeLength = typeLength - return c -} - -func (c *ColumnTypeDef) SetGeoShape(geoShape *GeoShape) *ColumnTypeDef { - c.GeoShape = geoShape - return c -} - -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 := nebula0.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,optional" db:"default_value" json:"default_value,omitempty"` - Nullable bool `thrift:"nullable,4,optional" db:"nullable" json:"nullable,omitempty"` - Comment []byte `thrift:"comment,5,optional" 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 -} - -type ColumnDefBuilder struct { - obj *ColumnDef -} - -func NewColumnDefBuilder() *ColumnDefBuilder{ - return &ColumnDefBuilder{ - obj: NewColumnDef(), - } -} - -func (p ColumnDefBuilder) Emit() *ColumnDef{ - return &ColumnDef{ - Name: p.obj.Name, - Type: p.obj.Type, - DefaultValue: p.obj.DefaultValue, - Nullable: p.obj.Nullable, - Comment: p.obj.Comment, - } -} - -func (c *ColumnDefBuilder) Name(name []byte) *ColumnDefBuilder { - c.obj.Name = name - return c -} - -func (c *ColumnDefBuilder) Type(type_a1 *ColumnTypeDef) *ColumnDefBuilder { - c.obj.Type = type_a1 - return c -} - -func (c *ColumnDefBuilder) DefaultValue(defaultValue []byte) *ColumnDefBuilder { - c.obj.DefaultValue = defaultValue - return c -} - -func (c *ColumnDefBuilder) Nullable(nullable bool) *ColumnDefBuilder { - c.obj.Nullable = nullable - return c -} - -func (c *ColumnDefBuilder) Comment(comment []byte) *ColumnDefBuilder { - c.obj.Comment = comment - return c -} - -func (c *ColumnDef) SetName(name []byte) *ColumnDef { - c.Name = name - return c -} - -func (c *ColumnDef) SetType(type_a1 *ColumnTypeDef) *ColumnDef { - c.Type = type_a1 - return c -} - -func (c *ColumnDef) SetDefaultValue(defaultValue []byte) *ColumnDef { - c.DefaultValue = defaultValue - return c -} - -func (c *ColumnDef) SetNullable(nullable bool) *ColumnDef { - c.Nullable = nullable - return c -} - -func (c *ColumnDef) SetComment(comment []byte) *ColumnDef { - c.Comment = comment - return c -} - -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,optional" db:"ttl_duration" json:"ttl_duration,omitempty"` - TtlCol []byte `thrift:"ttl_col,2,optional" db:"ttl_col" json:"ttl_col,omitempty"` - Comment []byte `thrift:"comment,3,optional" 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 -} - -type SchemaPropBuilder struct { - obj *SchemaProp -} - -func NewSchemaPropBuilder() *SchemaPropBuilder{ - return &SchemaPropBuilder{ - obj: NewSchemaProp(), - } -} - -func (p SchemaPropBuilder) Emit() *SchemaProp{ - return &SchemaProp{ - TtlDuration: p.obj.TtlDuration, - TtlCol: p.obj.TtlCol, - Comment: p.obj.Comment, - } -} - -func (s *SchemaPropBuilder) TtlDuration(ttlDuration *int64) *SchemaPropBuilder { - s.obj.TtlDuration = ttlDuration - return s -} - -func (s *SchemaPropBuilder) TtlCol(ttlCol []byte) *SchemaPropBuilder { - s.obj.TtlCol = ttlCol - return s -} - -func (s *SchemaPropBuilder) Comment(comment []byte) *SchemaPropBuilder { - s.obj.Comment = comment - return s -} - -func (s *SchemaProp) SetTtlDuration(ttlDuration *int64) *SchemaProp { - s.TtlDuration = ttlDuration - return s -} - -func (s *SchemaProp) SetTtlCol(ttlCol []byte) *SchemaProp { - s.TtlCol = ttlCol - return s -} - -func (s *SchemaProp) SetComment(comment []byte) *SchemaProp { - s.Comment = comment - return s -} - -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 -} - -type SchemaBuilder struct { - obj *Schema -} - -func NewSchemaBuilder() *SchemaBuilder{ - return &SchemaBuilder{ - obj: NewSchema(), - } -} - -func (p SchemaBuilder) Emit() *Schema{ - return &Schema{ - Columns: p.obj.Columns, - SchemaProp: p.obj.SchemaProp, - } -} - -func (s *SchemaBuilder) Columns(columns []*ColumnDef) *SchemaBuilder { - s.obj.Columns = columns - return s -} - -func (s *SchemaBuilder) SchemaProp(schemaProp *SchemaProp) *SchemaBuilder { - s.obj.SchemaProp = schemaProp - return s -} - -func (s *Schema) SetColumns(columns []*ColumnDef) *Schema { - s.Columns = columns - return s -} - -func (s *Schema) SetSchemaProp(schemaProp *SchemaProp) *Schema { - s.SchemaProp = schemaProp - return s -} - -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 -} - -type IdNameBuilder struct { - obj *IdName -} - -func NewIdNameBuilder() *IdNameBuilder{ - return &IdNameBuilder{ - obj: NewIdName(), - } -} - -func (p IdNameBuilder) Emit() *IdName{ - return &IdName{ - Id: p.obj.Id, - Name: p.obj.Name, - } -} - -func (i *IdNameBuilder) Id(id *ID) *IdNameBuilder { - i.obj.Id = id - return i -} - -func (i *IdNameBuilder) Name(name []byte) *IdNameBuilder { - i.obj.Name = name - return i -} - -func (i *IdName) SetId(id *ID) *IdName { - i.Id = id - return i -} - -func (i *IdName) SetName(name []byte) *IdName { - i.Name = name - return i -} - -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 -// - ZoneNames -// - 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"` - ZoneNames [][]byte `thrift:"zone_names,7" db:"zone_names" json:"zone_names"` - IsolationLevel *IsolationLevel `thrift:"isolation_level,8,optional" db:"isolation_level" json:"isolation_level,omitempty"` - Comment []byte `thrift:"comment,9,optional" 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 -} - -func (p *SpaceDesc) GetZoneNames() [][]byte { - return p.ZoneNames -} -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) IsSetIsolationLevel() bool { - return p != nil && p.IsolationLevel != nil -} - -func (p *SpaceDesc) IsSetComment() bool { - return p != nil && p.Comment != nil -} - -type SpaceDescBuilder struct { - obj *SpaceDesc -} - -func NewSpaceDescBuilder() *SpaceDescBuilder{ - return &SpaceDescBuilder{ - obj: NewSpaceDesc(), - } -} - -func (p SpaceDescBuilder) Emit() *SpaceDesc{ - return &SpaceDesc{ - SpaceName: p.obj.SpaceName, - PartitionNum: p.obj.PartitionNum, - ReplicaFactor: p.obj.ReplicaFactor, - CharsetName: p.obj.CharsetName, - CollateName: p.obj.CollateName, - VidType: p.obj.VidType, - ZoneNames: p.obj.ZoneNames, - IsolationLevel: p.obj.IsolationLevel, - Comment: p.obj.Comment, - } -} - -func (s *SpaceDescBuilder) SpaceName(spaceName []byte) *SpaceDescBuilder { - s.obj.SpaceName = spaceName - return s -} - -func (s *SpaceDescBuilder) PartitionNum(partitionNum int32) *SpaceDescBuilder { - s.obj.PartitionNum = partitionNum - return s -} - -func (s *SpaceDescBuilder) ReplicaFactor(replicaFactor int32) *SpaceDescBuilder { - s.obj.ReplicaFactor = replicaFactor - return s -} - -func (s *SpaceDescBuilder) CharsetName(charsetName []byte) *SpaceDescBuilder { - s.obj.CharsetName = charsetName - return s -} - -func (s *SpaceDescBuilder) CollateName(collateName []byte) *SpaceDescBuilder { - s.obj.CollateName = collateName - return s -} - -func (s *SpaceDescBuilder) VidType(vidType *ColumnTypeDef) *SpaceDescBuilder { - s.obj.VidType = vidType - return s -} - -func (s *SpaceDescBuilder) ZoneNames(zoneNames [][]byte) *SpaceDescBuilder { - s.obj.ZoneNames = zoneNames - return s -} - -func (s *SpaceDescBuilder) IsolationLevel(isolationLevel *IsolationLevel) *SpaceDescBuilder { - s.obj.IsolationLevel = isolationLevel - return s -} - -func (s *SpaceDescBuilder) Comment(comment []byte) *SpaceDescBuilder { - s.obj.Comment = comment - return s -} - -func (s *SpaceDesc) SetSpaceName(spaceName []byte) *SpaceDesc { - s.SpaceName = spaceName - return s -} - -func (s *SpaceDesc) SetPartitionNum(partitionNum int32) *SpaceDesc { - s.PartitionNum = partitionNum - return s -} - -func (s *SpaceDesc) SetReplicaFactor(replicaFactor int32) *SpaceDesc { - s.ReplicaFactor = replicaFactor - return s -} - -func (s *SpaceDesc) SetCharsetName(charsetName []byte) *SpaceDesc { - s.CharsetName = charsetName - return s -} - -func (s *SpaceDesc) SetCollateName(collateName []byte) *SpaceDesc { - s.CollateName = collateName - return s -} - -func (s *SpaceDesc) SetVidType(vidType *ColumnTypeDef) *SpaceDesc { - s.VidType = vidType - return s -} - -func (s *SpaceDesc) SetZoneNames(zoneNames [][]byte) *SpaceDesc { - s.ZoneNames = zoneNames - return s -} - -func (s *SpaceDesc) SetIsolationLevel(isolationLevel *IsolationLevel) *SpaceDesc { - s.IsolationLevel = isolationLevel - return s -} - -func (s *SpaceDesc) SetComment(comment []byte) *SpaceDesc { - s.Comment = comment - return s -} - -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 { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - p.ZoneNames = tSlice - for i := 0; i < size; i ++ { - var _elem2 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem2 = v - } - p.ZoneNames = append(p.ZoneNames, _elem2) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - 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 err := oprot.WriteFieldBegin("zone_names", thrift.LIST, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:zone_names: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.ZoneNames)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ZoneNames { - if err := oprot.WriteBinary(v); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:zone_names: ", p), err) } - return err -} - -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) - } - zoneNamesVal := fmt.Sprintf("%v", p.ZoneNames) - 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 ZoneNames:%s IsolationLevel:%s Comment:%s})", spaceNameVal, partitionNumVal, replicaFactorVal, charsetNameVal, collateNameVal, vidTypeVal, zoneNamesVal, 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 -} - -type SpaceItemBuilder struct { - obj *SpaceItem -} - -func NewSpaceItemBuilder() *SpaceItemBuilder{ - return &SpaceItemBuilder{ - obj: NewSpaceItem(), - } -} - -func (p SpaceItemBuilder) Emit() *SpaceItem{ - return &SpaceItem{ - SpaceID: p.obj.SpaceID, - Properties: p.obj.Properties, - } -} - -func (s *SpaceItemBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *SpaceItemBuilder { - s.obj.SpaceID = spaceID - return s -} - -func (s *SpaceItemBuilder) Properties(properties *SpaceDesc) *SpaceItemBuilder { - s.obj.Properties = properties - return s -} - -func (s *SpaceItem) SetSpaceID(spaceID nebula0.GraphSpaceID) *SpaceItem { - s.SpaceID = spaceID - return s -} - -func (s *SpaceItem) SetProperties(properties *SpaceDesc) *SpaceItem { - s.Properties = properties - return s -} - -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 -} - -type TagItemBuilder struct { - obj *TagItem -} - -func NewTagItemBuilder() *TagItemBuilder{ - return &TagItemBuilder{ - obj: NewTagItem(), - } -} - -func (p TagItemBuilder) Emit() *TagItem{ - return &TagItem{ - TagID: p.obj.TagID, - TagName: p.obj.TagName, - Version: p.obj.Version, - Schema: p.obj.Schema, - } -} - -func (t *TagItemBuilder) TagID(tagID nebula0.TagID) *TagItemBuilder { - t.obj.TagID = tagID - return t -} - -func (t *TagItemBuilder) TagName(tagName []byte) *TagItemBuilder { - t.obj.TagName = tagName - return t -} - -func (t *TagItemBuilder) Version(version SchemaVer) *TagItemBuilder { - t.obj.Version = version - return t -} - -func (t *TagItemBuilder) Schema(schema *Schema) *TagItemBuilder { - t.obj.Schema = schema - return t -} - -func (t *TagItem) SetTagID(tagID nebula0.TagID) *TagItem { - t.TagID = tagID - return t -} - -func (t *TagItem) SetTagName(tagName []byte) *TagItem { - t.TagName = tagName - return t -} - -func (t *TagItem) SetVersion(version SchemaVer) *TagItem { - t.Version = version - return t -} - -func (t *TagItem) SetSchema(schema *Schema) *TagItem { - t.Schema = schema - return t -} - -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 -} - -type AlterSchemaItemBuilder struct { - obj *AlterSchemaItem -} - -func NewAlterSchemaItemBuilder() *AlterSchemaItemBuilder{ - return &AlterSchemaItemBuilder{ - obj: NewAlterSchemaItem(), - } -} - -func (p AlterSchemaItemBuilder) Emit() *AlterSchemaItem{ - return &AlterSchemaItem{ - Op: p.obj.Op, - Schema: p.obj.Schema, - } -} - -func (a *AlterSchemaItemBuilder) Op(op AlterSchemaOp) *AlterSchemaItemBuilder { - a.obj.Op = op - return a -} - -func (a *AlterSchemaItemBuilder) Schema(schema *Schema) *AlterSchemaItemBuilder { - a.obj.Schema = schema - return a -} - -func (a *AlterSchemaItem) SetOp(op AlterSchemaOp) *AlterSchemaItem { - a.Op = op - return a -} - -func (a *AlterSchemaItem) SetSchema(schema *Schema) *AlterSchemaItem { - a.Schema = schema - return a -} - -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 -} - -type EdgeItemBuilder struct { - obj *EdgeItem -} - -func NewEdgeItemBuilder() *EdgeItemBuilder{ - return &EdgeItemBuilder{ - obj: NewEdgeItem(), - } -} - -func (p EdgeItemBuilder) Emit() *EdgeItem{ - return &EdgeItem{ - EdgeType: p.obj.EdgeType, - EdgeName: p.obj.EdgeName, - Version: p.obj.Version, - Schema: p.obj.Schema, - } -} - -func (e *EdgeItemBuilder) EdgeType(edgeType nebula0.EdgeType) *EdgeItemBuilder { - e.obj.EdgeType = edgeType - return e -} - -func (e *EdgeItemBuilder) EdgeName(edgeName []byte) *EdgeItemBuilder { - e.obj.EdgeName = edgeName - return e -} - -func (e *EdgeItemBuilder) Version(version SchemaVer) *EdgeItemBuilder { - e.obj.Version = version - return e -} - -func (e *EdgeItemBuilder) Schema(schema *Schema) *EdgeItemBuilder { - e.obj.Schema = schema - return e -} - -func (e *EdgeItem) SetEdgeType(edgeType nebula0.EdgeType) *EdgeItem { - e.EdgeType = edgeType - return e -} - -func (e *EdgeItem) SetEdgeName(edgeName []byte) *EdgeItem { - e.EdgeName = edgeName - return e -} - -func (e *EdgeItem) SetVersion(version SchemaVer) *EdgeItem { - e.Version = version - return e -} - -func (e *EdgeItem) SetSchema(schema *Schema) *EdgeItem { - e.Schema = schema - return e -} - -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: -// - S2MaxLevel -// - S2MaxCells -type IndexParams struct { - S2MaxLevel *int32 `thrift:"s2_max_level,1,optional" db:"s2_max_level" json:"s2_max_level,omitempty"` - S2MaxCells *int32 `thrift:"s2_max_cells,2,optional" db:"s2_max_cells" json:"s2_max_cells,omitempty"` -} - -func NewIndexParams() *IndexParams { - return &IndexParams{} -} - -var IndexParams_S2MaxLevel_DEFAULT int32 -func (p *IndexParams) GetS2MaxLevel() int32 { - if !p.IsSetS2MaxLevel() { - return IndexParams_S2MaxLevel_DEFAULT - } -return *p.S2MaxLevel -} -var IndexParams_S2MaxCells_DEFAULT int32 -func (p *IndexParams) GetS2MaxCells() int32 { - if !p.IsSetS2MaxCells() { - return IndexParams_S2MaxCells_DEFAULT - } -return *p.S2MaxCells -} -func (p *IndexParams) IsSetS2MaxLevel() bool { - return p != nil && p.S2MaxLevel != nil -} - -func (p *IndexParams) IsSetS2MaxCells() bool { - return p != nil && p.S2MaxCells != nil -} - -type IndexParamsBuilder struct { - obj *IndexParams -} - -func NewIndexParamsBuilder() *IndexParamsBuilder{ - return &IndexParamsBuilder{ - obj: NewIndexParams(), - } -} - -func (p IndexParamsBuilder) Emit() *IndexParams{ - return &IndexParams{ - S2MaxLevel: p.obj.S2MaxLevel, - S2MaxCells: p.obj.S2MaxCells, - } -} - -func (i *IndexParamsBuilder) S2MaxLevel(s2MaxLevel *int32) *IndexParamsBuilder { - i.obj.S2MaxLevel = s2MaxLevel - return i -} - -func (i *IndexParamsBuilder) S2MaxCells(s2MaxCells *int32) *IndexParamsBuilder { - i.obj.S2MaxCells = s2MaxCells - return i -} - -func (i *IndexParams) SetS2MaxLevel(s2MaxLevel *int32) *IndexParams { - i.S2MaxLevel = s2MaxLevel - return i -} - -func (i *IndexParams) SetS2MaxCells(s2MaxCells *int32) *IndexParams { - i.S2MaxCells = s2MaxCells - return i -} - -func (p *IndexParams) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *IndexParams) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.S2MaxLevel = &v - } - return nil -} - -func (p *IndexParams) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.S2MaxCells = &v - } - return nil -} - -func (p *IndexParams) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("IndexParams"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *IndexParams) writeField1(oprot thrift.Protocol) (err error) { - if p.IsSetS2MaxLevel() { - if err := oprot.WriteFieldBegin("s2_max_level", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:s2_max_level: ", p), err) } - if err := oprot.WriteI32(int32(*p.S2MaxLevel)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.s2_max_level (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:s2_max_level: ", p), err) } - } - return err -} - -func (p *IndexParams) writeField2(oprot thrift.Protocol) (err error) { - if p.IsSetS2MaxCells() { - if err := oprot.WriteFieldBegin("s2_max_cells", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:s2_max_cells: ", p), err) } - if err := oprot.WriteI32(int32(*p.S2MaxCells)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.s2_max_cells (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:s2_max_cells: ", p), err) } - } - return err -} - -func (p *IndexParams) String() string { - if p == nil { - return "" - } - - var s2MaxLevelVal string - if p.S2MaxLevel == nil { - s2MaxLevelVal = "" - } else { - s2MaxLevelVal = fmt.Sprintf("%v", *p.S2MaxLevel) - } - var s2MaxCellsVal string - if p.S2MaxCells == nil { - s2MaxCellsVal = "" - } else { - s2MaxCellsVal = fmt.Sprintf("%v", *p.S2MaxCells) - } - return fmt.Sprintf("IndexParams({S2MaxLevel:%s S2MaxCells:%s})", s2MaxLevelVal, s2MaxCellsVal) -} - -// Attributes: -// - IndexID -// - IndexName -// - SchemaID -// - SchemaName -// - Fields -// - Comment -// - IndexParams -type IndexItem struct { - IndexID nebula0.IndexID `thrift:"index_id,1" db:"index_id" json:"index_id"` - IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` - 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,optional" db:"comment" json:"comment,omitempty"` - IndexParams *IndexParams `thrift:"index_params,7,optional" db:"index_params" json:"index_params,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 -} -var IndexItem_IndexParams_DEFAULT *IndexParams -func (p *IndexItem) GetIndexParams() *IndexParams { - if !p.IsSetIndexParams() { - return IndexItem_IndexParams_DEFAULT - } -return p.IndexParams -} -func (p *IndexItem) IsSetSchemaID() bool { - return p != nil && p.SchemaID != nil -} - -func (p *IndexItem) IsSetComment() bool { - return p != nil && p.Comment != nil -} - -func (p *IndexItem) IsSetIndexParams() bool { - return p != nil && p.IndexParams != nil -} - -type IndexItemBuilder struct { - obj *IndexItem -} - -func NewIndexItemBuilder() *IndexItemBuilder{ - return &IndexItemBuilder{ - obj: NewIndexItem(), - } -} - -func (p IndexItemBuilder) Emit() *IndexItem{ - return &IndexItem{ - IndexID: p.obj.IndexID, - IndexName: p.obj.IndexName, - SchemaID: p.obj.SchemaID, - SchemaName: p.obj.SchemaName, - Fields: p.obj.Fields, - Comment: p.obj.Comment, - IndexParams: p.obj.IndexParams, - } -} - -func (i *IndexItemBuilder) IndexID(indexID nebula0.IndexID) *IndexItemBuilder { - i.obj.IndexID = indexID - return i -} - -func (i *IndexItemBuilder) IndexName(indexName []byte) *IndexItemBuilder { - i.obj.IndexName = indexName - return i -} - -func (i *IndexItemBuilder) SchemaID(schemaID *nebula0.SchemaID) *IndexItemBuilder { - i.obj.SchemaID = schemaID - return i -} - -func (i *IndexItemBuilder) SchemaName(schemaName []byte) *IndexItemBuilder { - i.obj.SchemaName = schemaName - return i -} - -func (i *IndexItemBuilder) Fields(fields []*ColumnDef) *IndexItemBuilder { - i.obj.Fields = fields - return i -} - -func (i *IndexItemBuilder) Comment(comment []byte) *IndexItemBuilder { - i.obj.Comment = comment - return i -} - -func (i *IndexItemBuilder) IndexParams(indexParams *IndexParams) *IndexItemBuilder { - i.obj.IndexParams = indexParams - return i -} - -func (i *IndexItem) SetIndexID(indexID nebula0.IndexID) *IndexItem { - i.IndexID = indexID - return i -} - -func (i *IndexItem) SetIndexName(indexName []byte) *IndexItem { - i.IndexName = indexName - return i -} - -func (i *IndexItem) SetSchemaID(schemaID *nebula0.SchemaID) *IndexItem { - i.SchemaID = schemaID - return i -} - -func (i *IndexItem) SetSchemaName(schemaName []byte) *IndexItem { - i.SchemaName = schemaName - return i -} - -func (i *IndexItem) SetFields(fields []*ColumnDef) *IndexItem { - i.Fields = fields - return i -} - -func (i *IndexItem) SetComment(comment []byte) *IndexItem { - i.Comment = comment - return i -} - -func (i *IndexItem) SetIndexParams(indexParams *IndexParams) *IndexItem { - i.IndexParams = indexParams - return i -} - -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 - } - 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 *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 ++ { - _elem3 := NewColumnDef() - if err := _elem3.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem3), err) - } - p.Fields = append(p.Fields, _elem3) - } - 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) ReadField7(iprot thrift.Protocol) error { - p.IndexParams = NewIndexParams() - if err := p.IndexParams.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) - } - return nil -} - -func (p *IndexItem) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("IndexItem"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *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) writeField7(oprot thrift.Protocol) (err error) { - if p.IsSetIndexParams() { - if err := oprot.WriteFieldBegin("index_params", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } - if err := p.IndexParams.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } - } - return err -} - -func (p *IndexItem) String() string { - if p == nil { - return "" - } - - 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) - var indexParamsVal string - if p.IndexParams == nil { - indexParamsVal = "" - } else { - indexParamsVal = fmt.Sprintf("%v", p.IndexParams) - } - return fmt.Sprintf("IndexItem({IndexID:%s IndexName:%s SchemaID:%s SchemaName:%s Fields:%s Comment:%s IndexParams:%s})", indexIDVal, indexNameVal, schemaIDVal, schemaNameVal, fieldsVal, commentVal, indexParamsVal) -} - -// Attributes: -// - 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,optional" db:"zone_name" json:"zone_name,omitempty"` - Version []byte `thrift:"version,8,optional" 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 -} - -type HostItemBuilder struct { - obj *HostItem -} - -func NewHostItemBuilder() *HostItemBuilder{ - return &HostItemBuilder{ - obj: NewHostItem(), - } -} - -func (p HostItemBuilder) Emit() *HostItem{ - return &HostItem{ - HostAddr: p.obj.HostAddr, - Status: p.obj.Status, - LeaderParts: p.obj.LeaderParts, - AllParts: p.obj.AllParts, - Role: p.obj.Role, - GitInfoSha: p.obj.GitInfoSha, - ZoneName: p.obj.ZoneName, - Version: p.obj.Version, - } -} - -func (h *HostItemBuilder) HostAddr(hostAddr *nebula0.HostAddr) *HostItemBuilder { - h.obj.HostAddr = hostAddr - return h -} - -func (h *HostItemBuilder) Status(status HostStatus) *HostItemBuilder { - h.obj.Status = status - return h -} - -func (h *HostItemBuilder) LeaderParts(leaderParts map[string][]nebula0.PartitionID) *HostItemBuilder { - h.obj.LeaderParts = leaderParts - return h -} - -func (h *HostItemBuilder) AllParts(allParts map[string][]nebula0.PartitionID) *HostItemBuilder { - h.obj.AllParts = allParts - return h -} - -func (h *HostItemBuilder) Role(role HostRole) *HostItemBuilder { - h.obj.Role = role - return h -} - -func (h *HostItemBuilder) GitInfoSha(gitInfoSha []byte) *HostItemBuilder { - h.obj.GitInfoSha = gitInfoSha - return h -} - -func (h *HostItemBuilder) ZoneName(zoneName []byte) *HostItemBuilder { - h.obj.ZoneName = zoneName - return h -} - -func (h *HostItemBuilder) Version(version []byte) *HostItemBuilder { - h.obj.Version = version - return h -} - -func (h *HostItem) SetHostAddr(hostAddr *nebula0.HostAddr) *HostItem { - h.HostAddr = hostAddr - return h -} - -func (h *HostItem) SetStatus(status HostStatus) *HostItem { - h.Status = status - return h -} - -func (h *HostItem) SetLeaderParts(leaderParts map[string][]nebula0.PartitionID) *HostItem { - h.LeaderParts = leaderParts - return h -} - -func (h *HostItem) SetAllParts(allParts map[string][]nebula0.PartitionID) *HostItem { - h.AllParts = allParts - return h -} - -func (h *HostItem) SetRole(role HostRole) *HostItem { - h.Role = role - return h -} - -func (h *HostItem) SetGitInfoSha(gitInfoSha []byte) *HostItem { - h.GitInfoSha = gitInfoSha - return h -} - -func (h *HostItem) SetZoneName(zoneName []byte) *HostItem { - h.ZoneName = zoneName - return h -} - -func (h *HostItem) SetVersion(version []byte) *HostItem { - h.Version = version - return h -} - -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 _key4 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key4 = v - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]nebula0.PartitionID, 0, size) - _val5 := tSlice - for i := 0; i < size; i ++ { - var _elem6 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem6 = temp - } - _val5 = append(_val5, _elem6) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.LeaderParts[_key4] = _val5 - } - 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 _key7 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key7 = v - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]nebula0.PartitionID, 0, size) - _val8 := tSlice - for i := 0; i < size; i ++ { - var _elem9 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem9 = temp - } - _val8 = append(_val8, _elem9) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.AllParts[_key7] = _val8 - } - 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 -} -type UserItemBuilder struct { - obj *UserItem -} - -func NewUserItemBuilder() *UserItemBuilder{ - return &UserItemBuilder{ - obj: NewUserItem(), - } -} - -func (p UserItemBuilder) Emit() *UserItem{ - return &UserItem{ - Account: p.obj.Account, - IsLock: p.obj.IsLock, - MaxQueriesPerHour: p.obj.MaxQueriesPerHour, - MaxUpdatesPerHour: p.obj.MaxUpdatesPerHour, - MaxConnectionsPerHour: p.obj.MaxConnectionsPerHour, - MaxUserConnections: p.obj.MaxUserConnections, - } -} - -func (u *UserItemBuilder) Account(account []byte) *UserItemBuilder { - u.obj.Account = account - return u -} - -func (u *UserItemBuilder) IsLock(isLock bool) *UserItemBuilder { - u.obj.IsLock = isLock - return u -} - -func (u *UserItemBuilder) MaxQueriesPerHour(maxQueriesPerHour int32) *UserItemBuilder { - u.obj.MaxQueriesPerHour = maxQueriesPerHour - return u -} - -func (u *UserItemBuilder) MaxUpdatesPerHour(maxUpdatesPerHour int32) *UserItemBuilder { - u.obj.MaxUpdatesPerHour = maxUpdatesPerHour - return u -} - -func (u *UserItemBuilder) MaxConnectionsPerHour(maxConnectionsPerHour int32) *UserItemBuilder { - u.obj.MaxConnectionsPerHour = maxConnectionsPerHour - return u -} - -func (u *UserItemBuilder) MaxUserConnections(maxUserConnections int32) *UserItemBuilder { - u.obj.MaxUserConnections = maxUserConnections - return u -} - -func (u *UserItem) SetAccount(account []byte) *UserItem { - u.Account = account - return u -} - -func (u *UserItem) SetIsLock(isLock bool) *UserItem { - u.IsLock = isLock - return u -} - -func (u *UserItem) SetMaxQueriesPerHour(maxQueriesPerHour int32) *UserItem { - u.MaxQueriesPerHour = maxQueriesPerHour - return u -} - -func (u *UserItem) SetMaxUpdatesPerHour(maxUpdatesPerHour int32) *UserItem { - u.MaxUpdatesPerHour = maxUpdatesPerHour - return u -} - -func (u *UserItem) SetMaxConnectionsPerHour(maxConnectionsPerHour int32) *UserItem { - u.MaxConnectionsPerHour = maxConnectionsPerHour - return u -} - -func (u *UserItem) SetMaxUserConnections(maxUserConnections int32) *UserItem { - u.MaxUserConnections = maxUserConnections - return u -} - -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 -} -type RoleItemBuilder struct { - obj *RoleItem -} - -func NewRoleItemBuilder() *RoleItemBuilder{ - return &RoleItemBuilder{ - obj: NewRoleItem(), - } -} - -func (p RoleItemBuilder) Emit() *RoleItem{ - return &RoleItem{ - UserID: p.obj.UserID, - SpaceID: p.obj.SpaceID, - RoleType: p.obj.RoleType, - } -} - -func (r *RoleItemBuilder) UserID(userID []byte) *RoleItemBuilder { - r.obj.UserID = userID - return r -} - -func (r *RoleItemBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *RoleItemBuilder { - r.obj.SpaceID = spaceID - return r -} - -func (r *RoleItemBuilder) RoleType(roleType RoleType) *RoleItemBuilder { - r.obj.RoleType = roleType - return r -} - -func (r *RoleItem) SetUserID(userID []byte) *RoleItem { - r.UserID = userID - return r -} - -func (r *RoleItem) SetSpaceID(spaceID nebula0.GraphSpaceID) *RoleItem { - r.SpaceID = spaceID - return r -} - -func (r *RoleItem) SetRoleType(roleType RoleType) *RoleItem { - r.RoleType = roleType - return r -} - -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 -} - -type ExecRespBuilder struct { - obj *ExecResp -} - -func NewExecRespBuilder() *ExecRespBuilder{ - return &ExecRespBuilder{ - obj: NewExecResp(), - } -} - -func (p ExecRespBuilder) Emit() *ExecResp{ - return &ExecResp{ - Code: p.obj.Code, - Id: p.obj.Id, - Leader: p.obj.Leader, - } -} - -func (e *ExecRespBuilder) Code(code nebula0.ErrorCode) *ExecRespBuilder { - e.obj.Code = code - return e -} - -func (e *ExecRespBuilder) Id(id *ID) *ExecRespBuilder { - e.obj.Id = id - return e -} - -func (e *ExecRespBuilder) Leader(leader *nebula0.HostAddr) *ExecRespBuilder { - e.obj.Leader = leader - return e -} - -func (e *ExecResp) SetCode(code nebula0.ErrorCode) *ExecResp { - e.Code = code - return e -} - -func (e *ExecResp) SetId(id *ID) *ExecResp { - e.Id = id - return e -} - -func (e *ExecResp) SetLeader(leader *nebula0.HostAddr) *ExecResp { - e.Leader = leader - return e -} - -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: -// - SpaceName -// - Op -// - Paras -type AlterSpaceReq struct { - SpaceName []byte `thrift:"space_name,1" db:"space_name" json:"space_name"` - Op AlterSpaceOp `thrift:"op,2" db:"op" json:"op"` - Paras [][]byte `thrift:"paras,3" db:"paras" json:"paras"` -} - -func NewAlterSpaceReq() *AlterSpaceReq { - return &AlterSpaceReq{} -} - - -func (p *AlterSpaceReq) GetSpaceName() []byte { - return p.SpaceName -} - -func (p *AlterSpaceReq) GetOp() AlterSpaceOp { - return p.Op -} - -func (p *AlterSpaceReq) GetParas() [][]byte { - return p.Paras -} -type AlterSpaceReqBuilder struct { - obj *AlterSpaceReq -} - -func NewAlterSpaceReqBuilder() *AlterSpaceReqBuilder{ - return &AlterSpaceReqBuilder{ - obj: NewAlterSpaceReq(), - } -} - -func (p AlterSpaceReqBuilder) Emit() *AlterSpaceReq{ - return &AlterSpaceReq{ - SpaceName: p.obj.SpaceName, - Op: p.obj.Op, - Paras: p.obj.Paras, - } -} - -func (a *AlterSpaceReqBuilder) SpaceName(spaceName []byte) *AlterSpaceReqBuilder { - a.obj.SpaceName = spaceName - return a -} - -func (a *AlterSpaceReqBuilder) Op(op AlterSpaceOp) *AlterSpaceReqBuilder { - a.obj.Op = op - return a -} - -func (a *AlterSpaceReqBuilder) Paras(paras [][]byte) *AlterSpaceReqBuilder { - a.obj.Paras = paras - return a -} - -func (a *AlterSpaceReq) SetSpaceName(spaceName []byte) *AlterSpaceReq { - a.SpaceName = spaceName - return a -} - -func (a *AlterSpaceReq) SetOp(op AlterSpaceOp) *AlterSpaceReq { - a.Op = op - return a -} - -func (a *AlterSpaceReq) SetParas(paras [][]byte) *AlterSpaceReq { - a.Paras = paras - return a -} - -func (p *AlterSpaceReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AlterSpaceReq) 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 *AlterSpaceReq) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := AlterSpaceOp(v) - p.Op = temp - } - return nil -} - -func (p *AlterSpaceReq) 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 _elem10 []byte - if v, err := iprot.ReadBinary(); 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 *AlterSpaceReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AlterSpaceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *AlterSpaceReq) 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 *AlterSpaceReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("op", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:op: ", p), err) } - if err := oprot.WriteI32(int32(p.Op)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.op (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:op: ", p), err) } - return err -} - -func (p *AlterSpaceReq) 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 *AlterSpaceReq) String() string { - if p == nil { - return "" - } - - spaceNameVal := fmt.Sprintf("%v", p.SpaceName) - opVal := fmt.Sprintf("%v", p.Op) - parasVal := fmt.Sprintf("%v", p.Paras) - return fmt.Sprintf("AlterSpaceReq({SpaceName:%s Op:%s Paras:%s})", spaceNameVal, opVal, parasVal) -} - -// Attributes: -// - SpaceID -// - Op -// - Type -// - Paras -type AdminJobReq struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Op JobOp `thrift:"op,2" db:"op" json:"op"` - Type JobType `thrift:"type,3" db:"type" json:"type"` - Paras [][]byte `thrift:"paras,4" db:"paras" json:"paras"` -} - -func NewAdminJobReq() *AdminJobReq { - return &AdminJobReq{} -} - - -func (p *AdminJobReq) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -func (p *AdminJobReq) GetOp() JobOp { - return p.Op -} - -func (p *AdminJobReq) GetType() JobType { - return p.Type -} - -func (p *AdminJobReq) GetParas() [][]byte { - return p.Paras -} -type AdminJobReqBuilder struct { - obj *AdminJobReq -} - -func NewAdminJobReqBuilder() *AdminJobReqBuilder{ - return &AdminJobReqBuilder{ - obj: NewAdminJobReq(), - } -} - -func (p AdminJobReqBuilder) Emit() *AdminJobReq{ - return &AdminJobReq{ - SpaceID: p.obj.SpaceID, - Op: p.obj.Op, - Type: p.obj.Type, - Paras: p.obj.Paras, - } -} - -func (a *AdminJobReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AdminJobReqBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AdminJobReqBuilder) Op(op JobOp) *AdminJobReqBuilder { - a.obj.Op = op - return a -} - -func (a *AdminJobReqBuilder) Type(type_a1 JobType) *AdminJobReqBuilder { - a.obj.Type = type_a1 - return a -} - -func (a *AdminJobReqBuilder) Paras(paras [][]byte) *AdminJobReqBuilder { - a.obj.Paras = paras - return a -} - -func (a *AdminJobReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *AdminJobReq { - a.SpaceID = spaceID - return a -} - -func (a *AdminJobReq) SetOp(op JobOp) *AdminJobReq { - a.Op = op - return a -} - -func (a *AdminJobReq) SetType(type_a1 JobType) *AdminJobReq { - a.Type = type_a1 - return a -} - -func (a *AdminJobReq) SetParas(paras [][]byte) *AdminJobReq { - a.Paras = paras - return a -} - -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 - } - 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 *AdminJobReq) 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 *AdminJobReq) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - temp := JobOp(v) - p.Op = temp - } - return nil -} - -func (p *AdminJobReq) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := JobType(v) - p.Type = temp - } - return nil -} - -func (p *AdminJobReq) 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.Paras = 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.Paras = append(p.Paras, _elem11) - } - 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 := 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 *AdminJobReq) 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 *AdminJobReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("op", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:op: ", p), err) } - if err := oprot.WriteI32(int32(p.Op)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.op (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:op: ", p), err) } - return err -} - -func (p *AdminJobReq) 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 *AdminJobReq) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("paras", thrift.LIST, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:paras: ", p), err) } - return err -} - -func (p *AdminJobReq) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - opVal := fmt.Sprintf("%v", p.Op) - typeVal := fmt.Sprintf("%v", p.Type) - parasVal := fmt.Sprintf("%v", p.Paras) - return fmt.Sprintf("AdminJobReq({SpaceID:%s Op:%s Type:%s Paras:%s})", spaceIDVal, opVal, typeVal, parasVal) -} - -// Attributes: -// - SpaceID -// - JobID -// - Type -// - Paras -// - Status -// - StartTime -// - StopTime -// - Code -type JobDesc struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` - Type JobType `thrift:"type,3" db:"type" json:"type"` - Paras []string `thrift:"paras,4" db:"paras" json:"paras"` - Status JobStatus `thrift:"status,5" db:"status" json:"status"` - StartTime int64 `thrift:"start_time,6" db:"start_time" json:"start_time"` - StopTime int64 `thrift:"stop_time,7" db:"stop_time" json:"stop_time"` - Code nebula0.ErrorCode `thrift:"code,8" db:"code" json:"code"` -} - -func NewJobDesc() *JobDesc { - return &JobDesc{} -} - - -func (p *JobDesc) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -func (p *JobDesc) GetJobID() int32 { - return p.JobID -} - -func (p *JobDesc) GetType() JobType { - return p.Type -} - -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) GetCode() nebula0.ErrorCode { - return p.Code -} -type JobDescBuilder struct { - obj *JobDesc -} - -func NewJobDescBuilder() *JobDescBuilder{ - return &JobDescBuilder{ - obj: NewJobDesc(), - } -} - -func (p JobDescBuilder) Emit() *JobDesc{ - return &JobDesc{ - SpaceID: p.obj.SpaceID, - JobID: p.obj.JobID, - Type: p.obj.Type, - Paras: p.obj.Paras, - Status: p.obj.Status, - StartTime: p.obj.StartTime, - StopTime: p.obj.StopTime, - Code: p.obj.Code, - } -} - -func (j *JobDescBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *JobDescBuilder { - j.obj.SpaceID = spaceID - return j -} - -func (j *JobDescBuilder) JobID(jobID int32) *JobDescBuilder { - j.obj.JobID = jobID - return j -} - -func (j *JobDescBuilder) Type(type_a1 JobType) *JobDescBuilder { - j.obj.Type = type_a1 - return j -} - -func (j *JobDescBuilder) Paras(paras []string) *JobDescBuilder { - j.obj.Paras = paras - return j -} - -func (j *JobDescBuilder) Status(status JobStatus) *JobDescBuilder { - j.obj.Status = status - return j -} - -func (j *JobDescBuilder) StartTime(startTime int64) *JobDescBuilder { - j.obj.StartTime = startTime - return j -} - -func (j *JobDescBuilder) StopTime(stopTime int64) *JobDescBuilder { - j.obj.StopTime = stopTime - return j -} - -func (j *JobDescBuilder) Code(code nebula0.ErrorCode) *JobDescBuilder { - j.obj.Code = code - return j -} - -func (j *JobDesc) SetSpaceID(spaceID nebula0.GraphSpaceID) *JobDesc { - j.SpaceID = spaceID - return j -} - -func (j *JobDesc) SetJobID(jobID int32) *JobDesc { - j.JobID = jobID - return j -} - -func (j *JobDesc) SetType(type_a1 JobType) *JobDesc { - j.Type = type_a1 - return j -} - -func (j *JobDesc) SetParas(paras []string) *JobDesc { - j.Paras = paras - return j -} - -func (j *JobDesc) SetStatus(status JobStatus) *JobDesc { - j.Status = status - return j -} - -func (j *JobDesc) SetStartTime(startTime int64) *JobDesc { - j.StartTime = startTime - return j -} - -func (j *JobDesc) SetStopTime(stopTime int64) *JobDesc { - j.StopTime = stopTime - return j -} - -func (j *JobDesc) SetCode(code nebula0.ErrorCode) *JobDesc { - j.Code = code - return j -} - -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 - } - 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 *JobDesc) 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 *JobDesc) 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 *JobDesc) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := JobType(v) - p.Type = temp - } - return nil -} - -func (p *JobDesc) ReadField4(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 _elem12 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem12 = v - } - p.Paras = append(p.Paras, _elem12) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *JobDesc) ReadField5(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - temp := JobStatus(v) - p.Status = temp - } - 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.StartTime = v - } - return nil -} - -func (p *JobDesc) ReadField7(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 7: ", err) - } else { - p.StopTime = v - } - return nil -} - -func (p *JobDesc) ReadField8(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 8: ", err) - } else { - temp := nebula0.ErrorCode(v) - p.Code = temp - } - 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 := 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 *JobDesc) 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 *JobDesc) 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 *JobDesc) 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 *JobDesc) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("paras", thrift.LIST, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:paras: ", p), err) } - return err -} - -func (p *JobDesc) writeField5(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:status: ", p), err) } - if err := oprot.WriteI32(int32(p.Status)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.status (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:status: ", p), err) } - return err -} - -func (p *JobDesc) writeField6(oprot thrift.Protocol) (err error) { - 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 *JobDesc) writeField7(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stop_time: ", p), err) } - if err := oprot.WriteI64(int64(p.StopTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stop_time (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stop_time: ", p), err) } - return err -} - -func (p *JobDesc) writeField8(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("code", thrift.I32, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:code: ", p), err) } - if err := oprot.WriteI32(int32(p.Code)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.code (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:code: ", p), err) } - return err -} - -func (p *JobDesc) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - jobIDVal := fmt.Sprintf("%v", p.JobID) - typeVal := fmt.Sprintf("%v", p.Type) - parasVal := fmt.Sprintf("%v", p.Paras) - statusVal := fmt.Sprintf("%v", p.Status) - startTimeVal := fmt.Sprintf("%v", p.StartTime) - stopTimeVal := fmt.Sprintf("%v", p.StopTime) - codeVal := fmt.Sprintf("%v", p.Code) - return fmt.Sprintf("JobDesc({SpaceID:%s JobID:%s Type:%s Paras:%s Status:%s StartTime:%s StopTime:%s Code:%s})", spaceIDVal, jobIDVal, typeVal, parasVal, statusVal, startTimeVal, stopTimeVal, codeVal) -} - -// Attributes: -// - SpaceID -// - JobID -// - TaskID -// - Host -// - Status -// - StartTime -// - StopTime -// - Code -type TaskDesc struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - JobID int32 `thrift:"job_id,2" db:"job_id" json:"job_id"` - TaskID int32 `thrift:"task_id,3" db:"task_id" json:"task_id"` - Host *nebula0.HostAddr `thrift:"host,4" db:"host" json:"host"` - Status JobStatus `thrift:"status,5" db:"status" json:"status"` - StartTime int64 `thrift:"start_time,6" db:"start_time" json:"start_time"` - StopTime int64 `thrift:"stop_time,7" db:"stop_time" json:"stop_time"` - Code nebula0.ErrorCode `thrift:"code,8" db:"code" json:"code"` -} - -func NewTaskDesc() *TaskDesc { - return &TaskDesc{ - Host: nebula0.NewHostAddr(), - } -} - - -func (p *TaskDesc) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -func (p *TaskDesc) GetJobID() int32 { - return p.JobID -} - -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) GetCode() nebula0.ErrorCode { - return p.Code -} -func (p *TaskDesc) IsSetHost() bool { - return p != nil && p.Host != nil -} - -type TaskDescBuilder struct { - obj *TaskDesc -} - -func NewTaskDescBuilder() *TaskDescBuilder{ - return &TaskDescBuilder{ - obj: NewTaskDesc(), - } -} - -func (p TaskDescBuilder) Emit() *TaskDesc{ - return &TaskDesc{ - SpaceID: p.obj.SpaceID, - JobID: p.obj.JobID, - TaskID: p.obj.TaskID, - Host: p.obj.Host, - Status: p.obj.Status, - StartTime: p.obj.StartTime, - StopTime: p.obj.StopTime, - Code: p.obj.Code, - } -} - -func (t *TaskDescBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *TaskDescBuilder { - t.obj.SpaceID = spaceID - return t -} - -func (t *TaskDescBuilder) JobID(jobID int32) *TaskDescBuilder { - t.obj.JobID = jobID - return t -} - -func (t *TaskDescBuilder) TaskID(taskID int32) *TaskDescBuilder { - t.obj.TaskID = taskID - return t -} - -func (t *TaskDescBuilder) Host(host *nebula0.HostAddr) *TaskDescBuilder { - t.obj.Host = host - return t -} - -func (t *TaskDescBuilder) Status(status JobStatus) *TaskDescBuilder { - t.obj.Status = status - return t -} - -func (t *TaskDescBuilder) StartTime(startTime int64) *TaskDescBuilder { - t.obj.StartTime = startTime - return t -} - -func (t *TaskDescBuilder) StopTime(stopTime int64) *TaskDescBuilder { - t.obj.StopTime = stopTime - return t -} - -func (t *TaskDescBuilder) Code(code nebula0.ErrorCode) *TaskDescBuilder { - t.obj.Code = code - return t -} - -func (t *TaskDesc) SetSpaceID(spaceID nebula0.GraphSpaceID) *TaskDesc { - t.SpaceID = spaceID - return t -} - -func (t *TaskDesc) SetJobID(jobID int32) *TaskDesc { - t.JobID = jobID - return t -} - -func (t *TaskDesc) SetTaskID(taskID int32) *TaskDesc { - t.TaskID = taskID - return t -} - -func (t *TaskDesc) SetHost(host *nebula0.HostAddr) *TaskDesc { - t.Host = host - return t -} - -func (t *TaskDesc) SetStatus(status JobStatus) *TaskDesc { - t.Status = status - return t -} - -func (t *TaskDesc) SetStartTime(startTime int64) *TaskDesc { - t.StartTime = startTime - return t -} - -func (t *TaskDesc) SetStopTime(stopTime int64) *TaskDesc { - t.StopTime = stopTime - return t -} - -func (t *TaskDesc) SetCode(code nebula0.ErrorCode) *TaskDesc { - t.Code = code - return t -} - -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 - } - 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 *TaskDesc) 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 *TaskDesc) 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 *TaskDesc) 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 *TaskDesc) ReadField4(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) ReadField5(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - temp := JobStatus(v) - p.Status = temp - } - return nil -} - -func (p *TaskDesc) 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 *TaskDesc) ReadField7(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 7: ", err) - } else { - p.StopTime = v - } - return nil -} - -func (p *TaskDesc) ReadField8(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 8: ", err) - } else { - temp := nebula0.ErrorCode(v) - p.Code = temp - } - 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 := 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 *TaskDesc) 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 *TaskDesc) 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 *TaskDesc) 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 *TaskDesc) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("host", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4: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 4:host: ", p), err) } - return err -} - -func (p *TaskDesc) writeField5(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("status", thrift.I32, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:status: ", p), err) } - if err := oprot.WriteI32(int32(p.Status)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.status (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:status: ", p), err) } - return err -} - -func (p *TaskDesc) writeField6(oprot thrift.Protocol) (err error) { - 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 *TaskDesc) writeField7(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("stop_time", thrift.I64, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:stop_time: ", p), err) } - if err := oprot.WriteI64(int64(p.StopTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.stop_time (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:stop_time: ", p), err) } - return err -} - -func (p *TaskDesc) writeField8(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("code", thrift.I32, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:code: ", p), err) } - if err := oprot.WriteI32(int32(p.Code)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.code (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:code: ", p), err) } - return err -} - -func (p *TaskDesc) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - jobIDVal := fmt.Sprintf("%v", p.JobID) - 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) - codeVal := fmt.Sprintf("%v", p.Code) - return fmt.Sprintf("TaskDesc({SpaceID:%s JobID:%s TaskID:%s Host:%s Status:%s StartTime:%s StopTime:%s Code:%s})", spaceIDVal, jobIDVal, taskIDVal, hostVal, statusVal, startTimeVal, stopTimeVal, codeVal) -} - -// Attributes: -// - JobID -// - JobDesc -// - TaskDesc -// - RecoveredJobNum -type AdminJobResult_ struct { - JobID *int32 `thrift:"job_id,1,optional" db:"job_id" json:"job_id,omitempty"` - JobDesc []*JobDesc `thrift:"job_desc,2,optional" db:"job_desc" json:"job_desc,omitempty"` - TaskDesc []*TaskDesc `thrift:"task_desc,3,optional" db:"task_desc" json:"task_desc,omitempty"` - RecoveredJobNum *int32 `thrift:"recovered_job_num,4,optional" 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 -} - -type AdminJobResult_Builder struct { - obj *AdminJobResult_ -} - -func NewAdminJobResult_Builder() *AdminJobResult_Builder{ - return &AdminJobResult_Builder{ - obj: NewAdminJobResult_(), - } -} - -func (p AdminJobResult_Builder) Emit() *AdminJobResult_{ - return &AdminJobResult_{ - JobID: p.obj.JobID, - JobDesc: p.obj.JobDesc, - TaskDesc: p.obj.TaskDesc, - RecoveredJobNum: p.obj.RecoveredJobNum, - } -} - -func (a *AdminJobResult_Builder) JobID(jobID *int32) *AdminJobResult_Builder { - a.obj.JobID = jobID - return a -} - -func (a *AdminJobResult_Builder) JobDesc(jobDesc []*JobDesc) *AdminJobResult_Builder { - a.obj.JobDesc = jobDesc - return a -} - -func (a *AdminJobResult_Builder) TaskDesc(taskDesc []*TaskDesc) *AdminJobResult_Builder { - a.obj.TaskDesc = taskDesc - return a -} - -func (a *AdminJobResult_Builder) RecoveredJobNum(recoveredJobNum *int32) *AdminJobResult_Builder { - a.obj.RecoveredJobNum = recoveredJobNum - return a -} - -func (a *AdminJobResult_) SetJobID(jobID *int32) *AdminJobResult_ { - a.JobID = jobID - return a -} - -func (a *AdminJobResult_) SetJobDesc(jobDesc []*JobDesc) *AdminJobResult_ { - a.JobDesc = jobDesc - return a -} - -func (a *AdminJobResult_) SetTaskDesc(taskDesc []*TaskDesc) *AdminJobResult_ { - a.TaskDesc = taskDesc - return a -} - -func (a *AdminJobResult_) SetRecoveredJobNum(recoveredJobNum *int32) *AdminJobResult_ { - a.RecoveredJobNum = recoveredJobNum - return a -} - -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 ++ { - _elem13 := NewJobDesc() - if err := _elem13.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) - } - p.JobDesc = append(p.JobDesc, _elem13) - } - 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 ++ { - _elem14 := NewTaskDesc() - if err := _elem14.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) - } - p.TaskDesc = append(p.TaskDesc, _elem14) - } - 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 -} - -type AdminJobRespBuilder struct { - obj *AdminJobResp -} - -func NewAdminJobRespBuilder() *AdminJobRespBuilder{ - return &AdminJobRespBuilder{ - obj: NewAdminJobResp(), - } -} - -func (p AdminJobRespBuilder) Emit() *AdminJobResp{ - return &AdminJobResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Result_: p.obj.Result_, - } -} - -func (a *AdminJobRespBuilder) Code(code nebula0.ErrorCode) *AdminJobRespBuilder { - a.obj.Code = code - return a -} - -func (a *AdminJobRespBuilder) Leader(leader *nebula0.HostAddr) *AdminJobRespBuilder { - a.obj.Leader = leader - return a -} - -func (a *AdminJobRespBuilder) Result_(result *AdminJobResult_) *AdminJobRespBuilder { - a.obj.Result_ = result - return a -} - -func (a *AdminJobResp) SetCode(code nebula0.ErrorCode) *AdminJobResp { - a.Code = code - return a -} - -func (a *AdminJobResp) SetLeader(leader *nebula0.HostAddr) *AdminJobResp { - a.Leader = leader - return a -} - -func (a *AdminJobResp) SetResult_(result *AdminJobResult_) *AdminJobResp { - a.Result_ = result - return a -} - -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 -} -type CorrelativityBuilder struct { - obj *Correlativity -} - -func NewCorrelativityBuilder() *CorrelativityBuilder{ - return &CorrelativityBuilder{ - obj: NewCorrelativity(), - } -} - -func (p CorrelativityBuilder) Emit() *Correlativity{ - return &Correlativity{ - PartID: p.obj.PartID, - Proportion: p.obj.Proportion, - } -} - -func (c *CorrelativityBuilder) PartID(partID nebula0.PartitionID) *CorrelativityBuilder { - c.obj.PartID = partID - return c -} - -func (c *CorrelativityBuilder) Proportion(proportion float64) *CorrelativityBuilder { - c.obj.Proportion = proportion - return c -} - -func (c *Correlativity) SetPartID(partID nebula0.PartitionID) *Correlativity { - c.PartID = partID - return c -} - -func (c *Correlativity) SetProportion(proportion float64) *Correlativity { - c.Proportion = proportion - return c -} - -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 -} -type StatsItemBuilder struct { - obj *StatsItem -} - -func NewStatsItemBuilder() *StatsItemBuilder{ - return &StatsItemBuilder{ - obj: NewStatsItem(), - } -} - -func (p StatsItemBuilder) Emit() *StatsItem{ - return &StatsItem{ - TagVertices: p.obj.TagVertices, - Edges: p.obj.Edges, - SpaceVertices: p.obj.SpaceVertices, - SpaceEdges: p.obj.SpaceEdges, - PositivePartCorrelativity: p.obj.PositivePartCorrelativity, - NegativePartCorrelativity: p.obj.NegativePartCorrelativity, - Status: p.obj.Status, - } -} - -func (s *StatsItemBuilder) TagVertices(tagVertices map[string]int64) *StatsItemBuilder { - s.obj.TagVertices = tagVertices - return s -} - -func (s *StatsItemBuilder) Edges(edges map[string]int64) *StatsItemBuilder { - s.obj.Edges = edges - return s -} - -func (s *StatsItemBuilder) SpaceVertices(spaceVertices int64) *StatsItemBuilder { - s.obj.SpaceVertices = spaceVertices - return s -} - -func (s *StatsItemBuilder) SpaceEdges(spaceEdges int64) *StatsItemBuilder { - s.obj.SpaceEdges = spaceEdges - return s -} - -func (s *StatsItemBuilder) PositivePartCorrelativity(positivePartCorrelativity map[nebula0.PartitionID][]*Correlativity) *StatsItemBuilder { - s.obj.PositivePartCorrelativity = positivePartCorrelativity - return s -} - -func (s *StatsItemBuilder) NegativePartCorrelativity(negativePartCorrelativity map[nebula0.PartitionID][]*Correlativity) *StatsItemBuilder { - s.obj.NegativePartCorrelativity = negativePartCorrelativity - return s -} - -func (s *StatsItemBuilder) Status(status JobStatus) *StatsItemBuilder { - s.obj.Status = status - return s -} - -func (s *StatsItem) SetTagVertices(tagVertices map[string]int64) *StatsItem { - s.TagVertices = tagVertices - return s -} - -func (s *StatsItem) SetEdges(edges map[string]int64) *StatsItem { - s.Edges = edges - return s -} - -func (s *StatsItem) SetSpaceVertices(spaceVertices int64) *StatsItem { - s.SpaceVertices = spaceVertices - return s -} - -func (s *StatsItem) SetSpaceEdges(spaceEdges int64) *StatsItem { - s.SpaceEdges = spaceEdges - return s -} - -func (s *StatsItem) SetPositivePartCorrelativity(positivePartCorrelativity map[nebula0.PartitionID][]*Correlativity) *StatsItem { - s.PositivePartCorrelativity = positivePartCorrelativity - return s -} - -func (s *StatsItem) SetNegativePartCorrelativity(negativePartCorrelativity map[nebula0.PartitionID][]*Correlativity) *StatsItem { - s.NegativePartCorrelativity = negativePartCorrelativity - return s -} - -func (s *StatsItem) SetStatus(status JobStatus) *StatsItem { - s.Status = status - return s -} - -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 _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.TagVertices[_key15] = _val16 - } - 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 _key17 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key17 = v - } - var _val18 int64 - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val18 = v - } - p.Edges[_key17] = _val18 - } - 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 _key19 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key19 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Correlativity, 0, size) - _val20 := tSlice - for i := 0; i < size; i ++ { - _elem21 := NewCorrelativity() - if err := _elem21.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem21), err) - } - _val20 = append(_val20, _elem21) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.PositivePartCorrelativity[_key19] = _val20 - } - 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 _key22 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key22 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*Correlativity, 0, size) - _val23 := tSlice - for i := 0; i < size; i ++ { - _elem24 := NewCorrelativity() - if err := _elem24.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) - } - _val23 = append(_val23, _elem24) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.NegativePartCorrelativity[_key22] = _val23 - } - 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 -} - -type CreateSpaceReqBuilder struct { - obj *CreateSpaceReq -} - -func NewCreateSpaceReqBuilder() *CreateSpaceReqBuilder{ - return &CreateSpaceReqBuilder{ - obj: NewCreateSpaceReq(), - } -} - -func (p CreateSpaceReqBuilder) Emit() *CreateSpaceReq{ - return &CreateSpaceReq{ - Properties: p.obj.Properties, - IfNotExists: p.obj.IfNotExists, - } -} - -func (c *CreateSpaceReqBuilder) Properties(properties *SpaceDesc) *CreateSpaceReqBuilder { - c.obj.Properties = properties - return c -} - -func (c *CreateSpaceReqBuilder) IfNotExists(ifNotExists bool) *CreateSpaceReqBuilder { - c.obj.IfNotExists = ifNotExists - return c -} - -func (c *CreateSpaceReq) SetProperties(properties *SpaceDesc) *CreateSpaceReq { - c.Properties = properties - return c -} - -func (c *CreateSpaceReq) SetIfNotExists(ifNotExists bool) *CreateSpaceReq { - c.IfNotExists = ifNotExists - return c -} - -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_ -} -type CreateSpaceAsReqBuilder struct { - obj *CreateSpaceAsReq -} - -func NewCreateSpaceAsReqBuilder() *CreateSpaceAsReqBuilder{ - return &CreateSpaceAsReqBuilder{ - obj: NewCreateSpaceAsReq(), - } -} - -func (p CreateSpaceAsReqBuilder) Emit() *CreateSpaceAsReq{ - return &CreateSpaceAsReq{ - OldSpaceName: p.obj.OldSpaceName, - NewSpaceName_: p.obj.NewSpaceName_, - } -} - -func (c *CreateSpaceAsReqBuilder) OldSpaceName(oldSpaceName []byte) *CreateSpaceAsReqBuilder { - c.obj.OldSpaceName = oldSpaceName - return c -} - -func (c *CreateSpaceAsReqBuilder) NewSpaceName_(newSpaceName []byte) *CreateSpaceAsReqBuilder { - c.obj.NewSpaceName_ = newSpaceName - return c -} - -func (c *CreateSpaceAsReq) SetOldSpaceName(oldSpaceName []byte) *CreateSpaceAsReq { - c.OldSpaceName = oldSpaceName - return c -} - -func (c *CreateSpaceAsReq) SetNewSpaceName_(newSpaceName []byte) *CreateSpaceAsReq { - c.NewSpaceName_ = newSpaceName - return c -} - -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 -} -type DropSpaceReqBuilder struct { - obj *DropSpaceReq -} - -func NewDropSpaceReqBuilder() *DropSpaceReqBuilder{ - return &DropSpaceReqBuilder{ - obj: NewDropSpaceReq(), - } -} - -func (p DropSpaceReqBuilder) Emit() *DropSpaceReq{ - return &DropSpaceReq{ - SpaceName: p.obj.SpaceName, - IfExists: p.obj.IfExists, - } -} - -func (d *DropSpaceReqBuilder) SpaceName(spaceName []byte) *DropSpaceReqBuilder { - d.obj.SpaceName = spaceName - return d -} - -func (d *DropSpaceReqBuilder) IfExists(ifExists bool) *DropSpaceReqBuilder { - d.obj.IfExists = ifExists - return d -} - -func (d *DropSpaceReq) SetSpaceName(spaceName []byte) *DropSpaceReq { - d.SpaceName = spaceName - return d -} - -func (d *DropSpaceReq) SetIfExists(ifExists bool) *DropSpaceReq { - d.IfExists = ifExists - return d -} - -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) -} - -// Attributes: -// - SpaceName -// - IfExists -type ClearSpaceReq 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 NewClearSpaceReq() *ClearSpaceReq { - return &ClearSpaceReq{} -} - - -func (p *ClearSpaceReq) GetSpaceName() []byte { - return p.SpaceName -} - -func (p *ClearSpaceReq) GetIfExists() bool { - return p.IfExists -} -type ClearSpaceReqBuilder struct { - obj *ClearSpaceReq -} - -func NewClearSpaceReqBuilder() *ClearSpaceReqBuilder{ - return &ClearSpaceReqBuilder{ - obj: NewClearSpaceReq(), - } -} - -func (p ClearSpaceReqBuilder) Emit() *ClearSpaceReq{ - return &ClearSpaceReq{ - SpaceName: p.obj.SpaceName, - IfExists: p.obj.IfExists, - } -} - -func (c *ClearSpaceReqBuilder) SpaceName(spaceName []byte) *ClearSpaceReqBuilder { - c.obj.SpaceName = spaceName - return c -} - -func (c *ClearSpaceReqBuilder) IfExists(ifExists bool) *ClearSpaceReqBuilder { - c.obj.IfExists = ifExists - return c -} - -func (c *ClearSpaceReq) SetSpaceName(spaceName []byte) *ClearSpaceReq { - c.SpaceName = spaceName - return c -} - -func (c *ClearSpaceReq) SetIfExists(ifExists bool) *ClearSpaceReq { - c.IfExists = ifExists - return c -} - -func (p *ClearSpaceReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ClearSpaceReq) 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 *ClearSpaceReq) 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 *ClearSpaceReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ClearSpaceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ClearSpaceReq) 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 *ClearSpaceReq) 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 *ClearSpaceReq) String() string { - if p == nil { - return "" - } - - spaceNameVal := fmt.Sprintf("%v", p.SpaceName) - ifExistsVal := fmt.Sprintf("%v", p.IfExists) - return fmt.Sprintf("ClearSpaceReq({SpaceName:%s IfExists:%s})", spaceNameVal, ifExistsVal) -} - -type ListSpacesReq struct { -} - -func NewListSpacesReq() *ListSpacesReq { - return &ListSpacesReq{} -} - -type ListSpacesReqBuilder struct { - obj *ListSpacesReq -} - -func NewListSpacesReqBuilder() *ListSpacesReqBuilder{ - return &ListSpacesReqBuilder{ - obj: NewListSpacesReq(), - } -} - -func (p ListSpacesReqBuilder) Emit() *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 -} - -type ListSpacesRespBuilder struct { - obj *ListSpacesResp -} - -func NewListSpacesRespBuilder() *ListSpacesRespBuilder{ - return &ListSpacesRespBuilder{ - obj: NewListSpacesResp(), - } -} - -func (p ListSpacesRespBuilder) Emit() *ListSpacesResp{ - return &ListSpacesResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Spaces: p.obj.Spaces, - } -} - -func (l *ListSpacesRespBuilder) Code(code nebula0.ErrorCode) *ListSpacesRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListSpacesRespBuilder) Leader(leader *nebula0.HostAddr) *ListSpacesRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListSpacesRespBuilder) Spaces(spaces []*IdName) *ListSpacesRespBuilder { - l.obj.Spaces = spaces - return l -} - -func (l *ListSpacesResp) SetCode(code nebula0.ErrorCode) *ListSpacesResp { - l.Code = code - return l -} - -func (l *ListSpacesResp) SetLeader(leader *nebula0.HostAddr) *ListSpacesResp { - l.Leader = leader - return l -} - -func (l *ListSpacesResp) SetSpaces(spaces []*IdName) *ListSpacesResp { - l.Spaces = spaces - return l -} - -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 ++ { - _elem25 := NewIdName() - if err := _elem25.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) - } - p.Spaces = append(p.Spaces, _elem25) - } - 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 -} -type GetSpaceReqBuilder struct { - obj *GetSpaceReq -} - -func NewGetSpaceReqBuilder() *GetSpaceReqBuilder{ - return &GetSpaceReqBuilder{ - obj: NewGetSpaceReq(), - } -} - -func (p GetSpaceReqBuilder) Emit() *GetSpaceReq{ - return &GetSpaceReq{ - SpaceName: p.obj.SpaceName, - } -} - -func (g *GetSpaceReqBuilder) SpaceName(spaceName []byte) *GetSpaceReqBuilder { - g.obj.SpaceName = spaceName - return g -} - -func (g *GetSpaceReq) SetSpaceName(spaceName []byte) *GetSpaceReq { - g.SpaceName = spaceName - return g -} - -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 -} - -type GetSpaceRespBuilder struct { - obj *GetSpaceResp -} - -func NewGetSpaceRespBuilder() *GetSpaceRespBuilder{ - return &GetSpaceRespBuilder{ - obj: NewGetSpaceResp(), - } -} - -func (p GetSpaceRespBuilder) Emit() *GetSpaceResp{ - return &GetSpaceResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Item: p.obj.Item, - } -} - -func (g *GetSpaceRespBuilder) Code(code nebula0.ErrorCode) *GetSpaceRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetSpaceRespBuilder) Leader(leader *nebula0.HostAddr) *GetSpaceRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetSpaceRespBuilder) Item(item *SpaceItem) *GetSpaceRespBuilder { - g.obj.Item = item - return g -} - -func (g *GetSpaceResp) SetCode(code nebula0.ErrorCode) *GetSpaceResp { - g.Code = code - return g -} - -func (g *GetSpaceResp) SetLeader(leader *nebula0.HostAddr) *GetSpaceResp { - g.Leader = leader - return g -} - -func (g *GetSpaceResp) SetItem(item *SpaceItem) *GetSpaceResp { - g.Item = item - return g -} - -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 -} - -type CreateTagReqBuilder struct { - obj *CreateTagReq -} - -func NewCreateTagReqBuilder() *CreateTagReqBuilder{ - return &CreateTagReqBuilder{ - obj: NewCreateTagReq(), - } -} - -func (p CreateTagReqBuilder) Emit() *CreateTagReq{ - return &CreateTagReq{ - SpaceID: p.obj.SpaceID, - TagName: p.obj.TagName, - Schema: p.obj.Schema, - IfNotExists: p.obj.IfNotExists, - } -} - -func (c *CreateTagReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *CreateTagReqBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *CreateTagReqBuilder) TagName(tagName []byte) *CreateTagReqBuilder { - c.obj.TagName = tagName - return c -} - -func (c *CreateTagReqBuilder) Schema(schema *Schema) *CreateTagReqBuilder { - c.obj.Schema = schema - return c -} - -func (c *CreateTagReqBuilder) IfNotExists(ifNotExists bool) *CreateTagReqBuilder { - c.obj.IfNotExists = ifNotExists - return c -} - -func (c *CreateTagReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *CreateTagReq { - c.SpaceID = spaceID - return c -} - -func (c *CreateTagReq) SetTagName(tagName []byte) *CreateTagReq { - c.TagName = tagName - return c -} - -func (c *CreateTagReq) SetSchema(schema *Schema) *CreateTagReq { - c.Schema = schema - return c -} - -func (c *CreateTagReq) SetIfNotExists(ifNotExists bool) *CreateTagReq { - c.IfNotExists = ifNotExists - return c -} - -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 -} - -type AlterTagReqBuilder struct { - obj *AlterTagReq -} - -func NewAlterTagReqBuilder() *AlterTagReqBuilder{ - return &AlterTagReqBuilder{ - obj: NewAlterTagReq(), - } -} - -func (p AlterTagReqBuilder) Emit() *AlterTagReq{ - return &AlterTagReq{ - SpaceID: p.obj.SpaceID, - TagName: p.obj.TagName, - TagItems: p.obj.TagItems, - SchemaProp: p.obj.SchemaProp, - } -} - -func (a *AlterTagReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AlterTagReqBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AlterTagReqBuilder) TagName(tagName []byte) *AlterTagReqBuilder { - a.obj.TagName = tagName - return a -} - -func (a *AlterTagReqBuilder) TagItems(tagItems []*AlterSchemaItem) *AlterTagReqBuilder { - a.obj.TagItems = tagItems - return a -} - -func (a *AlterTagReqBuilder) SchemaProp(schemaProp *SchemaProp) *AlterTagReqBuilder { - a.obj.SchemaProp = schemaProp - return a -} - -func (a *AlterTagReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *AlterTagReq { - a.SpaceID = spaceID - return a -} - -func (a *AlterTagReq) SetTagName(tagName []byte) *AlterTagReq { - a.TagName = tagName - return a -} - -func (a *AlterTagReq) SetTagItems(tagItems []*AlterSchemaItem) *AlterTagReq { - a.TagItems = tagItems - return a -} - -func (a *AlterTagReq) SetSchemaProp(schemaProp *SchemaProp) *AlterTagReq { - a.SchemaProp = schemaProp - return a -} - -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 ++ { - _elem26 := NewAlterSchemaItem() - if err := _elem26.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) - } - p.TagItems = append(p.TagItems, _elem26) - } - 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 -} -type DropTagReqBuilder struct { - obj *DropTagReq -} - -func NewDropTagReqBuilder() *DropTagReqBuilder{ - return &DropTagReqBuilder{ - obj: NewDropTagReq(), - } -} - -func (p DropTagReqBuilder) Emit() *DropTagReq{ - return &DropTagReq{ - SpaceID: p.obj.SpaceID, - TagName: p.obj.TagName, - IfExists: p.obj.IfExists, - } -} - -func (d *DropTagReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DropTagReqBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DropTagReqBuilder) TagName(tagName []byte) *DropTagReqBuilder { - d.obj.TagName = tagName - return d -} - -func (d *DropTagReqBuilder) IfExists(ifExists bool) *DropTagReqBuilder { - d.obj.IfExists = ifExists - return d -} - -func (d *DropTagReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *DropTagReq { - d.SpaceID = spaceID - return d -} - -func (d *DropTagReq) SetTagName(tagName []byte) *DropTagReq { - d.TagName = tagName - return d -} - -func (d *DropTagReq) SetIfExists(ifExists bool) *DropTagReq { - d.IfExists = ifExists - return d -} - -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 -} -type ListTagsReqBuilder struct { - obj *ListTagsReq -} - -func NewListTagsReqBuilder() *ListTagsReqBuilder{ - return &ListTagsReqBuilder{ - obj: NewListTagsReq(), - } -} - -func (p ListTagsReqBuilder) Emit() *ListTagsReq{ - return &ListTagsReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (l *ListTagsReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListTagsReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListTagsReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListTagsReq { - l.SpaceID = spaceID - return l -} - -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 -} - -type ListTagsRespBuilder struct { - obj *ListTagsResp -} - -func NewListTagsRespBuilder() *ListTagsRespBuilder{ - return &ListTagsRespBuilder{ - obj: NewListTagsResp(), - } -} - -func (p ListTagsRespBuilder) Emit() *ListTagsResp{ - return &ListTagsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Tags: p.obj.Tags, - } -} - -func (l *ListTagsRespBuilder) Code(code nebula0.ErrorCode) *ListTagsRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListTagsRespBuilder) Leader(leader *nebula0.HostAddr) *ListTagsRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListTagsRespBuilder) Tags(tags []*TagItem) *ListTagsRespBuilder { - l.obj.Tags = tags - return l -} - -func (l *ListTagsResp) SetCode(code nebula0.ErrorCode) *ListTagsResp { - l.Code = code - return l -} - -func (l *ListTagsResp) SetLeader(leader *nebula0.HostAddr) *ListTagsResp { - l.Leader = leader - return l -} - -func (l *ListTagsResp) SetTags(tags []*TagItem) *ListTagsResp { - l.Tags = tags - return l -} - -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 ++ { - _elem27 := NewTagItem() - if err := _elem27.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) - } - p.Tags = append(p.Tags, _elem27) - } - 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 -} -type GetTagReqBuilder struct { - obj *GetTagReq -} - -func NewGetTagReqBuilder() *GetTagReqBuilder{ - return &GetTagReqBuilder{ - obj: NewGetTagReq(), - } -} - -func (p GetTagReqBuilder) Emit() *GetTagReq{ - return &GetTagReq{ - SpaceID: p.obj.SpaceID, - TagName: p.obj.TagName, - Version: p.obj.Version, - } -} - -func (g *GetTagReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetTagReqBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetTagReqBuilder) TagName(tagName []byte) *GetTagReqBuilder { - g.obj.TagName = tagName - return g -} - -func (g *GetTagReqBuilder) Version(version SchemaVer) *GetTagReqBuilder { - g.obj.Version = version - return g -} - -func (g *GetTagReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetTagReq { - g.SpaceID = spaceID - return g -} - -func (g *GetTagReq) SetTagName(tagName []byte) *GetTagReq { - g.TagName = tagName - return g -} - -func (g *GetTagReq) SetVersion(version SchemaVer) *GetTagReq { - g.Version = version - return g -} - -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 -} - -type GetTagRespBuilder struct { - obj *GetTagResp -} - -func NewGetTagRespBuilder() *GetTagRespBuilder{ - return &GetTagRespBuilder{ - obj: NewGetTagResp(), - } -} - -func (p GetTagRespBuilder) Emit() *GetTagResp{ - return &GetTagResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Schema: p.obj.Schema, - } -} - -func (g *GetTagRespBuilder) Code(code nebula0.ErrorCode) *GetTagRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetTagRespBuilder) Leader(leader *nebula0.HostAddr) *GetTagRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetTagRespBuilder) Schema(schema *Schema) *GetTagRespBuilder { - g.obj.Schema = schema - return g -} - -func (g *GetTagResp) SetCode(code nebula0.ErrorCode) *GetTagResp { - g.Code = code - return g -} - -func (g *GetTagResp) SetLeader(leader *nebula0.HostAddr) *GetTagResp { - g.Leader = leader - return g -} - -func (g *GetTagResp) SetSchema(schema *Schema) *GetTagResp { - g.Schema = schema - return g -} - -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 -} - -type CreateEdgeReqBuilder struct { - obj *CreateEdgeReq -} - -func NewCreateEdgeReqBuilder() *CreateEdgeReqBuilder{ - return &CreateEdgeReqBuilder{ - obj: NewCreateEdgeReq(), - } -} - -func (p CreateEdgeReqBuilder) Emit() *CreateEdgeReq{ - return &CreateEdgeReq{ - SpaceID: p.obj.SpaceID, - EdgeName: p.obj.EdgeName, - Schema: p.obj.Schema, - IfNotExists: p.obj.IfNotExists, - } -} - -func (c *CreateEdgeReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *CreateEdgeReqBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *CreateEdgeReqBuilder) EdgeName(edgeName []byte) *CreateEdgeReqBuilder { - c.obj.EdgeName = edgeName - return c -} - -func (c *CreateEdgeReqBuilder) Schema(schema *Schema) *CreateEdgeReqBuilder { - c.obj.Schema = schema - return c -} - -func (c *CreateEdgeReqBuilder) IfNotExists(ifNotExists bool) *CreateEdgeReqBuilder { - c.obj.IfNotExists = ifNotExists - return c -} - -func (c *CreateEdgeReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *CreateEdgeReq { - c.SpaceID = spaceID - return c -} - -func (c *CreateEdgeReq) SetEdgeName(edgeName []byte) *CreateEdgeReq { - c.EdgeName = edgeName - return c -} - -func (c *CreateEdgeReq) SetSchema(schema *Schema) *CreateEdgeReq { - c.Schema = schema - return c -} - -func (c *CreateEdgeReq) SetIfNotExists(ifNotExists bool) *CreateEdgeReq { - c.IfNotExists = ifNotExists - return c -} - -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 -} - -type AlterEdgeReqBuilder struct { - obj *AlterEdgeReq -} - -func NewAlterEdgeReqBuilder() *AlterEdgeReqBuilder{ - return &AlterEdgeReqBuilder{ - obj: NewAlterEdgeReq(), - } -} - -func (p AlterEdgeReqBuilder) Emit() *AlterEdgeReq{ - return &AlterEdgeReq{ - SpaceID: p.obj.SpaceID, - EdgeName: p.obj.EdgeName, - EdgeItems: p.obj.EdgeItems, - SchemaProp: p.obj.SchemaProp, - } -} - -func (a *AlterEdgeReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AlterEdgeReqBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AlterEdgeReqBuilder) EdgeName(edgeName []byte) *AlterEdgeReqBuilder { - a.obj.EdgeName = edgeName - return a -} - -func (a *AlterEdgeReqBuilder) EdgeItems(edgeItems []*AlterSchemaItem) *AlterEdgeReqBuilder { - a.obj.EdgeItems = edgeItems - return a -} - -func (a *AlterEdgeReqBuilder) SchemaProp(schemaProp *SchemaProp) *AlterEdgeReqBuilder { - a.obj.SchemaProp = schemaProp - return a -} - -func (a *AlterEdgeReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *AlterEdgeReq { - a.SpaceID = spaceID - return a -} - -func (a *AlterEdgeReq) SetEdgeName(edgeName []byte) *AlterEdgeReq { - a.EdgeName = edgeName - return a -} - -func (a *AlterEdgeReq) SetEdgeItems(edgeItems []*AlterSchemaItem) *AlterEdgeReq { - a.EdgeItems = edgeItems - return a -} - -func (a *AlterEdgeReq) SetSchemaProp(schemaProp *SchemaProp) *AlterEdgeReq { - a.SchemaProp = schemaProp - return a -} - -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 ++ { - _elem28 := NewAlterSchemaItem() - if err := _elem28.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) - } - p.EdgeItems = append(p.EdgeItems, _elem28) - } - 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 -} -type GetEdgeReqBuilder struct { - obj *GetEdgeReq -} - -func NewGetEdgeReqBuilder() *GetEdgeReqBuilder{ - return &GetEdgeReqBuilder{ - obj: NewGetEdgeReq(), - } -} - -func (p GetEdgeReqBuilder) Emit() *GetEdgeReq{ - return &GetEdgeReq{ - SpaceID: p.obj.SpaceID, - EdgeName: p.obj.EdgeName, - Version: p.obj.Version, - } -} - -func (g *GetEdgeReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetEdgeReqBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetEdgeReqBuilder) EdgeName(edgeName []byte) *GetEdgeReqBuilder { - g.obj.EdgeName = edgeName - return g -} - -func (g *GetEdgeReqBuilder) Version(version SchemaVer) *GetEdgeReqBuilder { - g.obj.Version = version - return g -} - -func (g *GetEdgeReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetEdgeReq { - g.SpaceID = spaceID - return g -} - -func (g *GetEdgeReq) SetEdgeName(edgeName []byte) *GetEdgeReq { - g.EdgeName = edgeName - return g -} - -func (g *GetEdgeReq) SetVersion(version SchemaVer) *GetEdgeReq { - g.Version = version - return g -} - -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 -} - -type GetEdgeRespBuilder struct { - obj *GetEdgeResp -} - -func NewGetEdgeRespBuilder() *GetEdgeRespBuilder{ - return &GetEdgeRespBuilder{ - obj: NewGetEdgeResp(), - } -} - -func (p GetEdgeRespBuilder) Emit() *GetEdgeResp{ - return &GetEdgeResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Schema: p.obj.Schema, - } -} - -func (g *GetEdgeRespBuilder) Code(code nebula0.ErrorCode) *GetEdgeRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetEdgeRespBuilder) Leader(leader *nebula0.HostAddr) *GetEdgeRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetEdgeRespBuilder) Schema(schema *Schema) *GetEdgeRespBuilder { - g.obj.Schema = schema - return g -} - -func (g *GetEdgeResp) SetCode(code nebula0.ErrorCode) *GetEdgeResp { - g.Code = code - return g -} - -func (g *GetEdgeResp) SetLeader(leader *nebula0.HostAddr) *GetEdgeResp { - g.Leader = leader - return g -} - -func (g *GetEdgeResp) SetSchema(schema *Schema) *GetEdgeResp { - g.Schema = schema - return g -} - -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 -} -type DropEdgeReqBuilder struct { - obj *DropEdgeReq -} - -func NewDropEdgeReqBuilder() *DropEdgeReqBuilder{ - return &DropEdgeReqBuilder{ - obj: NewDropEdgeReq(), - } -} - -func (p DropEdgeReqBuilder) Emit() *DropEdgeReq{ - return &DropEdgeReq{ - SpaceID: p.obj.SpaceID, - EdgeName: p.obj.EdgeName, - IfExists: p.obj.IfExists, - } -} - -func (d *DropEdgeReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DropEdgeReqBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DropEdgeReqBuilder) EdgeName(edgeName []byte) *DropEdgeReqBuilder { - d.obj.EdgeName = edgeName - return d -} - -func (d *DropEdgeReqBuilder) IfExists(ifExists bool) *DropEdgeReqBuilder { - d.obj.IfExists = ifExists - return d -} - -func (d *DropEdgeReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *DropEdgeReq { - d.SpaceID = spaceID - return d -} - -func (d *DropEdgeReq) SetEdgeName(edgeName []byte) *DropEdgeReq { - d.EdgeName = edgeName - return d -} - -func (d *DropEdgeReq) SetIfExists(ifExists bool) *DropEdgeReq { - d.IfExists = ifExists - return d -} - -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 -} -type ListEdgesReqBuilder struct { - obj *ListEdgesReq -} - -func NewListEdgesReqBuilder() *ListEdgesReqBuilder{ - return &ListEdgesReqBuilder{ - obj: NewListEdgesReq(), - } -} - -func (p ListEdgesReqBuilder) Emit() *ListEdgesReq{ - return &ListEdgesReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (l *ListEdgesReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListEdgesReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListEdgesReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListEdgesReq { - l.SpaceID = spaceID - return l -} - -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 -} - -type ListEdgesRespBuilder struct { - obj *ListEdgesResp -} - -func NewListEdgesRespBuilder() *ListEdgesRespBuilder{ - return &ListEdgesRespBuilder{ - obj: NewListEdgesResp(), - } -} - -func (p ListEdgesRespBuilder) Emit() *ListEdgesResp{ - return &ListEdgesResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Edges: p.obj.Edges, - } -} - -func (l *ListEdgesRespBuilder) Code(code nebula0.ErrorCode) *ListEdgesRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListEdgesRespBuilder) Leader(leader *nebula0.HostAddr) *ListEdgesRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListEdgesRespBuilder) Edges(edges []*EdgeItem) *ListEdgesRespBuilder { - l.obj.Edges = edges - return l -} - -func (l *ListEdgesResp) SetCode(code nebula0.ErrorCode) *ListEdgesResp { - l.Code = code - return l -} - -func (l *ListEdgesResp) SetLeader(leader *nebula0.HostAddr) *ListEdgesResp { - l.Leader = leader - return l -} - -func (l *ListEdgesResp) SetEdges(edges []*EdgeItem) *ListEdgesResp { - l.Edges = edges - return l -} - -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 ++ { - _elem29 := NewEdgeItem() - if err := _elem29.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) - } - p.Edges = append(p.Edges, _elem29) - } - 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: -// - Hosts -type AddHostsReq struct { - Hosts []*nebula0.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` -} - -func NewAddHostsReq() *AddHostsReq { - return &AddHostsReq{} -} - - -func (p *AddHostsReq) GetHosts() []*nebula0.HostAddr { - return p.Hosts -} -type AddHostsReqBuilder struct { - obj *AddHostsReq -} - -func NewAddHostsReqBuilder() *AddHostsReqBuilder{ - return &AddHostsReqBuilder{ - obj: NewAddHostsReq(), - } -} - -func (p AddHostsReqBuilder) Emit() *AddHostsReq{ - return &AddHostsReq{ - Hosts: p.obj.Hosts, - } -} - -func (a *AddHostsReqBuilder) Hosts(hosts []*nebula0.HostAddr) *AddHostsReqBuilder { - a.obj.Hosts = hosts - return a -} - -func (a *AddHostsReq) SetHosts(hosts []*nebula0.HostAddr) *AddHostsReq { - a.Hosts = hosts - return a -} - -func (p *AddHostsReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AddHostsReq) ReadField1(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.HostAddr, 0, size) - p.Hosts = tSlice - for i := 0; i < size; i ++ { - _elem30 := nebula0.NewHostAddr() - if err := _elem30.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) - } - p.Hosts = append(p.Hosts, _elem30) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *AddHostsReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AddHostsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *AddHostsReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Hosts)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Hosts { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } - return err -} - -func (p *AddHostsReq) String() string { - if p == nil { - return "" - } - - hostsVal := fmt.Sprintf("%v", p.Hosts) - return fmt.Sprintf("AddHostsReq({Hosts:%s})", hostsVal) -} - -// Attributes: -// - Hosts -type DropHostsReq struct { - Hosts []*nebula0.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` -} - -func NewDropHostsReq() *DropHostsReq { - return &DropHostsReq{} -} - - -func (p *DropHostsReq) GetHosts() []*nebula0.HostAddr { - return p.Hosts -} -type DropHostsReqBuilder struct { - obj *DropHostsReq -} - -func NewDropHostsReqBuilder() *DropHostsReqBuilder{ - return &DropHostsReqBuilder{ - obj: NewDropHostsReq(), - } -} - -func (p DropHostsReqBuilder) Emit() *DropHostsReq{ - return &DropHostsReq{ - Hosts: p.obj.Hosts, - } -} - -func (d *DropHostsReqBuilder) Hosts(hosts []*nebula0.HostAddr) *DropHostsReqBuilder { - d.obj.Hosts = hosts - return d -} - -func (d *DropHostsReq) SetHosts(hosts []*nebula0.HostAddr) *DropHostsReq { - d.Hosts = hosts - return d -} - -func (p *DropHostsReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *DropHostsReq) ReadField1(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.HostAddr, 0, size) - p.Hosts = tSlice - for i := 0; i < size; i ++ { - _elem31 := nebula0.NewHostAddr() - if err := _elem31.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem31), err) - } - p.Hosts = append(p.Hosts, _elem31) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *DropHostsReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("DropHostsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *DropHostsReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Hosts)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Hosts { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } - return err -} - -func (p *DropHostsReq) String() string { - if p == nil { - return "" - } - - hostsVal := fmt.Sprintf("%v", p.Hosts) - return fmt.Sprintf("DropHostsReq({Hosts:%s})", hostsVal) -} - -// 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 -} -type ListHostsReqBuilder struct { - obj *ListHostsReq -} - -func NewListHostsReqBuilder() *ListHostsReqBuilder{ - return &ListHostsReqBuilder{ - obj: NewListHostsReq(), - } -} - -func (p ListHostsReqBuilder) Emit() *ListHostsReq{ - return &ListHostsReq{ - Type: p.obj.Type, - } -} - -func (l *ListHostsReqBuilder) Type(type_a1 ListHostType) *ListHostsReqBuilder { - l.obj.Type = type_a1 - return l -} - -func (l *ListHostsReq) SetType(type_a1 ListHostType) *ListHostsReq { - l.Type = type_a1 - return l -} - -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 -} - -type ListHostsRespBuilder struct { - obj *ListHostsResp -} - -func NewListHostsRespBuilder() *ListHostsRespBuilder{ - return &ListHostsRespBuilder{ - obj: NewListHostsResp(), - } -} - -func (p ListHostsRespBuilder) Emit() *ListHostsResp{ - return &ListHostsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Hosts: p.obj.Hosts, - } -} - -func (l *ListHostsRespBuilder) Code(code nebula0.ErrorCode) *ListHostsRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListHostsRespBuilder) Leader(leader *nebula0.HostAddr) *ListHostsRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListHostsRespBuilder) Hosts(hosts []*HostItem) *ListHostsRespBuilder { - l.obj.Hosts = hosts - return l -} - -func (l *ListHostsResp) SetCode(code nebula0.ErrorCode) *ListHostsResp { - l.Code = code - return l -} - -func (l *ListHostsResp) SetLeader(leader *nebula0.HostAddr) *ListHostsResp { - l.Leader = leader - return l -} - -func (l *ListHostsResp) SetHosts(hosts []*HostItem) *ListHostsResp { - l.Hosts = hosts - return l -} - -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 ++ { - _elem32 := NewHostItem() - if err := _elem32.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem32), err) - } - p.Hosts = append(p.Hosts, _elem32) - } - 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,optional" 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 -} - -type PartItemBuilder struct { - obj *PartItem -} - -func NewPartItemBuilder() *PartItemBuilder{ - return &PartItemBuilder{ - obj: NewPartItem(), - } -} - -func (p PartItemBuilder) Emit() *PartItem{ - return &PartItem{ - PartID: p.obj.PartID, - Leader: p.obj.Leader, - Peers: p.obj.Peers, - Losts: p.obj.Losts, - } -} - -func (p *PartItemBuilder) PartID(partID nebula0.PartitionID) *PartItemBuilder { - p.obj.PartID = partID - return p -} - -func (p *PartItemBuilder) Leader(leader *nebula0.HostAddr) *PartItemBuilder { - p.obj.Leader = leader - return p -} - -func (p *PartItemBuilder) Peers(peers []*nebula0.HostAddr) *PartItemBuilder { - p.obj.Peers = peers - return p -} - -func (p *PartItemBuilder) Losts(losts []*nebula0.HostAddr) *PartItemBuilder { - p.obj.Losts = losts - return p -} - -func (p *PartItem) SetPartID(partID nebula0.PartitionID) *PartItem { - p.PartID = partID - return p -} - -func (p *PartItem) SetLeader(leader *nebula0.HostAddr) *PartItem { - p.Leader = leader - return p -} - -func (p *PartItem) SetPeers(peers []*nebula0.HostAddr) *PartItem { - p.Peers = peers - return p -} - -func (p *PartItem) SetLosts(losts []*nebula0.HostAddr) *PartItem { - p.Losts = losts - return p -} - -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 ++ { - _elem33 := nebula0.NewHostAddr() - if err := _elem33.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem33), err) - } - p.Peers = append(p.Peers, _elem33) - } - 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 ++ { - _elem34 := nebula0.NewHostAddr() - if err := _elem34.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem34), err) - } - p.Losts = append(p.Losts, _elem34) - } - 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 -} -type ListPartsReqBuilder struct { - obj *ListPartsReq -} - -func NewListPartsReqBuilder() *ListPartsReqBuilder{ - return &ListPartsReqBuilder{ - obj: NewListPartsReq(), - } -} - -func (p ListPartsReqBuilder) Emit() *ListPartsReq{ - return &ListPartsReq{ - SpaceID: p.obj.SpaceID, - PartIds: p.obj.PartIds, - } -} - -func (l *ListPartsReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListPartsReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListPartsReqBuilder) PartIds(partIds []nebula0.PartitionID) *ListPartsReqBuilder { - l.obj.PartIds = partIds - return l -} - -func (l *ListPartsReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListPartsReq { - l.SpaceID = spaceID - return l -} - -func (l *ListPartsReq) SetPartIds(partIds []nebula0.PartitionID) *ListPartsReq { - l.PartIds = partIds - return l -} - -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 _elem35 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem35 = temp - } - p.PartIds = append(p.PartIds, _elem35) - } - 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 -} - -type ListPartsRespBuilder struct { - obj *ListPartsResp -} - -func NewListPartsRespBuilder() *ListPartsRespBuilder{ - return &ListPartsRespBuilder{ - obj: NewListPartsResp(), - } -} - -func (p ListPartsRespBuilder) Emit() *ListPartsResp{ - return &ListPartsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Parts: p.obj.Parts, - } -} - -func (l *ListPartsRespBuilder) Code(code nebula0.ErrorCode) *ListPartsRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListPartsRespBuilder) Leader(leader *nebula0.HostAddr) *ListPartsRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListPartsRespBuilder) Parts(parts []*PartItem) *ListPartsRespBuilder { - l.obj.Parts = parts - return l -} - -func (l *ListPartsResp) SetCode(code nebula0.ErrorCode) *ListPartsResp { - l.Code = code - return l -} - -func (l *ListPartsResp) SetLeader(leader *nebula0.HostAddr) *ListPartsResp { - l.Leader = leader - return l -} - -func (l *ListPartsResp) SetParts(parts []*PartItem) *ListPartsResp { - l.Parts = parts - return l -} - -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 ++ { - _elem36 := NewPartItem() - if err := _elem36.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem36), err) - } - p.Parts = append(p.Parts, _elem36) - } - 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 -} -type GetPartsAllocReqBuilder struct { - obj *GetPartsAllocReq -} - -func NewGetPartsAllocReqBuilder() *GetPartsAllocReqBuilder{ - return &GetPartsAllocReqBuilder{ - obj: NewGetPartsAllocReq(), - } -} - -func (p GetPartsAllocReqBuilder) Emit() *GetPartsAllocReq{ - return &GetPartsAllocReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (g *GetPartsAllocReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetPartsAllocReqBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetPartsAllocReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetPartsAllocReq { - g.SpaceID = spaceID - return g -} - -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,optional" 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 -} - -type GetPartsAllocRespBuilder struct { - obj *GetPartsAllocResp -} - -func NewGetPartsAllocRespBuilder() *GetPartsAllocRespBuilder{ - return &GetPartsAllocRespBuilder{ - obj: NewGetPartsAllocResp(), - } -} - -func (p GetPartsAllocRespBuilder) Emit() *GetPartsAllocResp{ - return &GetPartsAllocResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Parts: p.obj.Parts, - Terms: p.obj.Terms, - } -} - -func (g *GetPartsAllocRespBuilder) Code(code nebula0.ErrorCode) *GetPartsAllocRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetPartsAllocRespBuilder) Leader(leader *nebula0.HostAddr) *GetPartsAllocRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetPartsAllocRespBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.HostAddr) *GetPartsAllocRespBuilder { - g.obj.Parts = parts - return g -} - -func (g *GetPartsAllocRespBuilder) Terms(terms map[nebula0.PartitionID]int64) *GetPartsAllocRespBuilder { - g.obj.Terms = terms - return g -} - -func (g *GetPartsAllocResp) SetCode(code nebula0.ErrorCode) *GetPartsAllocResp { - g.Code = code - return g -} - -func (g *GetPartsAllocResp) SetLeader(leader *nebula0.HostAddr) *GetPartsAllocResp { - g.Leader = leader - return g -} - -func (g *GetPartsAllocResp) SetParts(parts map[nebula0.PartitionID][]*nebula0.HostAddr) *GetPartsAllocResp { - g.Parts = parts - return g -} - -func (g *GetPartsAllocResp) SetTerms(terms map[nebula0.PartitionID]int64) *GetPartsAllocResp { - g.Terms = terms - return g -} - -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 _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.HostAddr, 0, size) - _val38 := tSlice - for i := 0; i < size; i ++ { - _elem39 := nebula0.NewHostAddr() - 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 *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 _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 - } - var _val41 int64 - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val41 = v - } - p.Terms[_key40] = _val41 - } - 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: -// - Host -type GetWorkerIdReq struct { - Host []byte `thrift:"host,1" db:"host" json:"host"` -} - -func NewGetWorkerIdReq() *GetWorkerIdReq { - return &GetWorkerIdReq{} -} - - -func (p *GetWorkerIdReq) GetHost() []byte { - return p.Host -} -type GetWorkerIdReqBuilder struct { - obj *GetWorkerIdReq -} - -func NewGetWorkerIdReqBuilder() *GetWorkerIdReqBuilder{ - return &GetWorkerIdReqBuilder{ - obj: NewGetWorkerIdReq(), - } -} - -func (p GetWorkerIdReqBuilder) Emit() *GetWorkerIdReq{ - return &GetWorkerIdReq{ - Host: p.obj.Host, - } -} - -func (g *GetWorkerIdReqBuilder) Host(host []byte) *GetWorkerIdReqBuilder { - g.obj.Host = host - return g -} - -func (g *GetWorkerIdReq) SetHost(host []byte) *GetWorkerIdReq { - g.Host = host - return g -} - -func (p *GetWorkerIdReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GetWorkerIdReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Host = v - } - return nil -} - -func (p *GetWorkerIdReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetWorkerIdReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetWorkerIdReq) 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.WriteBinary(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 *GetWorkerIdReq) String() string { - if p == nil { - return "" - } - - hostVal := fmt.Sprintf("%v", p.Host) - return fmt.Sprintf("GetWorkerIdReq({Host:%s})", hostVal) -} - -// Attributes: -// - Code -// - Leader -// - Workerid -type GetWorkerIdResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` - Workerid int64 `thrift:"workerid,3" db:"workerid" json:"workerid"` -} - -func NewGetWorkerIdResp() *GetWorkerIdResp { - return &GetWorkerIdResp{ - Leader: nebula0.NewHostAddr(), - } -} - - -func (p *GetWorkerIdResp) GetCode() nebula0.ErrorCode { - return p.Code -} -var GetWorkerIdResp_Leader_DEFAULT *nebula0.HostAddr -func (p *GetWorkerIdResp) GetLeader() *nebula0.HostAddr { - if !p.IsSetLeader() { - return GetWorkerIdResp_Leader_DEFAULT - } -return p.Leader -} - -func (p *GetWorkerIdResp) GetWorkerid() int64 { - return p.Workerid -} -func (p *GetWorkerIdResp) IsSetLeader() bool { - return p != nil && p.Leader != nil -} - -type GetWorkerIdRespBuilder struct { - obj *GetWorkerIdResp -} - -func NewGetWorkerIdRespBuilder() *GetWorkerIdRespBuilder{ - return &GetWorkerIdRespBuilder{ - obj: NewGetWorkerIdResp(), - } -} - -func (p GetWorkerIdRespBuilder) Emit() *GetWorkerIdResp{ - return &GetWorkerIdResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Workerid: p.obj.Workerid, - } -} - -func (g *GetWorkerIdRespBuilder) Code(code nebula0.ErrorCode) *GetWorkerIdRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetWorkerIdRespBuilder) Leader(leader *nebula0.HostAddr) *GetWorkerIdRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetWorkerIdRespBuilder) Workerid(workerid int64) *GetWorkerIdRespBuilder { - g.obj.Workerid = workerid - return g -} - -func (g *GetWorkerIdResp) SetCode(code nebula0.ErrorCode) *GetWorkerIdResp { - g.Code = code - return g -} - -func (g *GetWorkerIdResp) SetLeader(leader *nebula0.HostAddr) *GetWorkerIdResp { - g.Leader = leader - return g -} - -func (g *GetWorkerIdResp) SetWorkerid(workerid int64) *GetWorkerIdResp { - g.Workerid = workerid - return g -} - -func (p *GetWorkerIdResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GetWorkerIdResp) 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 *GetWorkerIdResp) 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 *GetWorkerIdResp) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.Workerid = v - } - return nil -} - -func (p *GetWorkerIdResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetWorkerIdResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetWorkerIdResp) 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 *GetWorkerIdResp) 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 *GetWorkerIdResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("workerid", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:workerid: ", p), err) } - if err := oprot.WriteI64(int64(p.Workerid)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.workerid (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:workerid: ", p), err) } - return err -} - -func (p *GetWorkerIdResp) 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) - } - workeridVal := fmt.Sprintf("%v", p.Workerid) - return fmt.Sprintf("GetWorkerIdResp({Code:%s Leader:%s Workerid:%s})", codeVal, leaderVal, workeridVal) -} - -// Attributes: -// - Length -type GetSegmentIdReq struct { - Length int64 `thrift:"length,1" db:"length" json:"length"` -} - -func NewGetSegmentIdReq() *GetSegmentIdReq { - return &GetSegmentIdReq{} -} - - -func (p *GetSegmentIdReq) GetLength() int64 { - return p.Length -} -type GetSegmentIdReqBuilder struct { - obj *GetSegmentIdReq -} - -func NewGetSegmentIdReqBuilder() *GetSegmentIdReqBuilder{ - return &GetSegmentIdReqBuilder{ - obj: NewGetSegmentIdReq(), - } -} - -func (p GetSegmentIdReqBuilder) Emit() *GetSegmentIdReq{ - return &GetSegmentIdReq{ - Length: p.obj.Length, - } -} - -func (g *GetSegmentIdReqBuilder) Length(length int64) *GetSegmentIdReqBuilder { - g.obj.Length = length - return g -} - -func (g *GetSegmentIdReq) SetLength(length int64) *GetSegmentIdReq { - g.Length = length - return g -} - -func (p *GetSegmentIdReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GetSegmentIdReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Length = v - } - return nil -} - -func (p *GetSegmentIdReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetSegmentIdReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetSegmentIdReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("length", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:length: ", p), err) } - if err := oprot.WriteI64(int64(p.Length)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.length (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:length: ", p), err) } - return err -} - -func (p *GetSegmentIdReq) String() string { - if p == nil { - return "" - } - - lengthVal := fmt.Sprintf("%v", p.Length) - return fmt.Sprintf("GetSegmentIdReq({Length:%s})", lengthVal) -} - -// Attributes: -// - Code -// - Leader -// - SegmentID -type GetSegmentIdResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` - SegmentID int64 `thrift:"segment_id,3" db:"segment_id" json:"segment_id"` -} - -func NewGetSegmentIdResp() *GetSegmentIdResp { - return &GetSegmentIdResp{ - Leader: nebula0.NewHostAddr(), - } -} - - -func (p *GetSegmentIdResp) GetCode() nebula0.ErrorCode { - return p.Code -} -var GetSegmentIdResp_Leader_DEFAULT *nebula0.HostAddr -func (p *GetSegmentIdResp) GetLeader() *nebula0.HostAddr { - if !p.IsSetLeader() { - return GetSegmentIdResp_Leader_DEFAULT - } -return p.Leader -} - -func (p *GetSegmentIdResp) GetSegmentID() int64 { - return p.SegmentID -} -func (p *GetSegmentIdResp) IsSetLeader() bool { - return p != nil && p.Leader != nil -} - -type GetSegmentIdRespBuilder struct { - obj *GetSegmentIdResp -} - -func NewGetSegmentIdRespBuilder() *GetSegmentIdRespBuilder{ - return &GetSegmentIdRespBuilder{ - obj: NewGetSegmentIdResp(), - } -} - -func (p GetSegmentIdRespBuilder) Emit() *GetSegmentIdResp{ - return &GetSegmentIdResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - SegmentID: p.obj.SegmentID, - } -} - -func (g *GetSegmentIdRespBuilder) Code(code nebula0.ErrorCode) *GetSegmentIdRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetSegmentIdRespBuilder) Leader(leader *nebula0.HostAddr) *GetSegmentIdRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetSegmentIdRespBuilder) SegmentID(segmentID int64) *GetSegmentIdRespBuilder { - g.obj.SegmentID = segmentID - return g -} - -func (g *GetSegmentIdResp) SetCode(code nebula0.ErrorCode) *GetSegmentIdResp { - g.Code = code - return g -} - -func (g *GetSegmentIdResp) SetLeader(leader *nebula0.HostAddr) *GetSegmentIdResp { - g.Leader = leader - return g -} - -func (g *GetSegmentIdResp) SetSegmentID(segmentID int64) *GetSegmentIdResp { - g.SegmentID = segmentID - return g -} - -func (p *GetSegmentIdResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GetSegmentIdResp) 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 *GetSegmentIdResp) 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 *GetSegmentIdResp) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.SegmentID = v - } - return nil -} - -func (p *GetSegmentIdResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetSegmentIdResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetSegmentIdResp) 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 *GetSegmentIdResp) 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 *GetSegmentIdResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("segment_id", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:segment_id: ", p), err) } - if err := oprot.WriteI64(int64(p.SegmentID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.segment_id (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:segment_id: ", p), err) } - return err -} - -func (p *GetSegmentIdResp) 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) - } - segmentIDVal := fmt.Sprintf("%v", p.SegmentID) - return fmt.Sprintf("GetSegmentIdResp({Code:%s Leader:%s SegmentID:%s})", codeVal, leaderVal, segmentIDVal) -} - -// 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 -} - -type HBRespBuilder struct { - obj *HBResp -} - -func NewHBRespBuilder() *HBRespBuilder{ - return &HBRespBuilder{ - obj: NewHBResp(), - } -} - -func (p HBRespBuilder) Emit() *HBResp{ - return &HBResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - ClusterID: p.obj.ClusterID, - LastUpdateTimeInMs: p.obj.LastUpdateTimeInMs, - MetaVersion: p.obj.MetaVersion, - } -} - -func (h *HBRespBuilder) Code(code nebula0.ErrorCode) *HBRespBuilder { - h.obj.Code = code - return h -} - -func (h *HBRespBuilder) Leader(leader *nebula0.HostAddr) *HBRespBuilder { - h.obj.Leader = leader - return h -} - -func (h *HBRespBuilder) ClusterID(clusterID ClusterID) *HBRespBuilder { - h.obj.ClusterID = clusterID - return h -} - -func (h *HBRespBuilder) LastUpdateTimeInMs(lastUpdateTimeInMs int64) *HBRespBuilder { - h.obj.LastUpdateTimeInMs = lastUpdateTimeInMs - return h -} - -func (h *HBRespBuilder) MetaVersion(metaVersion int32) *HBRespBuilder { - h.obj.MetaVersion = metaVersion - return h -} - -func (h *HBResp) SetCode(code nebula0.ErrorCode) *HBResp { - h.Code = code - return h -} - -func (h *HBResp) SetLeader(leader *nebula0.HostAddr) *HBResp { - h.Leader = leader - return h -} - -func (h *HBResp) SetClusterID(clusterID ClusterID) *HBResp { - h.ClusterID = clusterID - return h -} - -func (h *HBResp) SetLastUpdateTimeInMs(lastUpdateTimeInMs int64) *HBResp { - h.LastUpdateTimeInMs = lastUpdateTimeInMs - return h -} - -func (h *HBResp) SetMetaVersion(metaVersion int32) *HBResp { - h.MetaVersion = metaVersion - return h -} - -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 -} -type LeaderInfoBuilder struct { - obj *LeaderInfo -} - -func NewLeaderInfoBuilder() *LeaderInfoBuilder{ - return &LeaderInfoBuilder{ - obj: NewLeaderInfo(), - } -} - -func (p LeaderInfoBuilder) Emit() *LeaderInfo{ - return &LeaderInfo{ - PartID: p.obj.PartID, - Term: p.obj.Term, - } -} - -func (l *LeaderInfoBuilder) PartID(partID nebula0.PartitionID) *LeaderInfoBuilder { - l.obj.PartID = partID - return l -} - -func (l *LeaderInfoBuilder) Term(term int64) *LeaderInfoBuilder { - l.obj.Term = term - return l -} - -func (l *LeaderInfo) SetPartID(partID nebula0.PartitionID) *LeaderInfo { - l.PartID = partID - return l -} - -func (l *LeaderInfo) SetTerm(term int64) *LeaderInfo { - l.Term = term - return l -} - -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: -// - PartList -type PartitionList struct { - PartList []nebula0.PartitionID `thrift:"part_list,1" db:"part_list" json:"part_list"` -} - -func NewPartitionList() *PartitionList { - return &PartitionList{} -} - - -func (p *PartitionList) GetPartList() []nebula0.PartitionID { - return p.PartList -} -type PartitionListBuilder struct { - obj *PartitionList -} - -func NewPartitionListBuilder() *PartitionListBuilder{ - return &PartitionListBuilder{ - obj: NewPartitionList(), - } -} - -func (p PartitionListBuilder) Emit() *PartitionList{ - return &PartitionList{ - PartList: p.obj.PartList, - } -} - -func (p *PartitionListBuilder) PartList(partList []nebula0.PartitionID) *PartitionListBuilder { - p.obj.PartList = partList - return p -} - -func (p *PartitionList) SetPartList(partList []nebula0.PartitionID) *PartitionList { - p.PartList = partList - return p -} - -func (p *PartitionList) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *PartitionList) ReadField1(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.PartList = tSlice - for i := 0; i < size; i ++ { - var _elem42 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem42 = temp - } - p.PartList = append(p.PartList, _elem42) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *PartitionList) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("PartitionList"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *PartitionList) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("part_list", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:part_list: ", p), err) } - if err := oprot.WriteListBegin(thrift.I32, len(p.PartList)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.PartList { - 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:part_list: ", p), err) } - return err -} - -func (p *PartitionList) String() string { - if p == nil { - return "" - } - - partListVal := fmt.Sprintf("%v", p.PartList) - return fmt.Sprintf("PartitionList({PartList:%s})", partListVal) -} - -// Attributes: -// - Role -// - Host -// - ClusterID -// - LeaderPartIds -// - GitInfoSha -// - DiskParts -// - Dir -// - 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,optional" db:"leader_partIds" json:"leader_partIds,omitempty"` - GitInfoSha []byte `thrift:"git_info_sha,5" db:"git_info_sha" json:"git_info_sha"` - DiskParts map[nebula0.GraphSpaceID]map[string]*PartitionList `thrift:"disk_parts,6,optional" db:"disk_parts" json:"disk_parts,omitempty"` - Dir *nebula0.DirInfo `thrift:"dir,7,optional" db:"dir" json:"dir,omitempty"` - Version []byte `thrift:"version,8,optional" 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_DiskParts_DEFAULT map[nebula0.GraphSpaceID]map[string]*PartitionList - -func (p *HBReq) GetDiskParts() map[nebula0.GraphSpaceID]map[string]*PartitionList { - return p.DiskParts -} -var HBReq_Dir_DEFAULT *nebula0.DirInfo -func (p *HBReq) GetDir() *nebula0.DirInfo { - if !p.IsSetDir() { - return HBReq_Dir_DEFAULT - } -return p.Dir -} -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) IsSetDiskParts() bool { - return p != nil && p.DiskParts != nil -} - -func (p *HBReq) IsSetDir() bool { - return p != nil && p.Dir != nil -} - -func (p *HBReq) IsSetVersion() bool { - return p != nil && p.Version != nil -} - -type HBReqBuilder struct { - obj *HBReq -} - -func NewHBReqBuilder() *HBReqBuilder{ - return &HBReqBuilder{ - obj: NewHBReq(), - } -} - -func (p HBReqBuilder) Emit() *HBReq{ - return &HBReq{ - Role: p.obj.Role, - Host: p.obj.Host, - ClusterID: p.obj.ClusterID, - LeaderPartIds: p.obj.LeaderPartIds, - GitInfoSha: p.obj.GitInfoSha, - DiskParts: p.obj.DiskParts, - Dir: p.obj.Dir, - Version: p.obj.Version, - } -} - -func (h *HBReqBuilder) Role(role HostRole) *HBReqBuilder { - h.obj.Role = role - return h -} - -func (h *HBReqBuilder) Host(host *nebula0.HostAddr) *HBReqBuilder { - h.obj.Host = host - return h -} - -func (h *HBReqBuilder) ClusterID(clusterID ClusterID) *HBReqBuilder { - h.obj.ClusterID = clusterID - return h -} - -func (h *HBReqBuilder) LeaderPartIds(leaderPartIds map[nebula0.GraphSpaceID][]*LeaderInfo) *HBReqBuilder { - h.obj.LeaderPartIds = leaderPartIds - return h -} - -func (h *HBReqBuilder) GitInfoSha(gitInfoSha []byte) *HBReqBuilder { - h.obj.GitInfoSha = gitInfoSha - return h -} - -func (h *HBReqBuilder) DiskParts(diskParts map[nebula0.GraphSpaceID]map[string]*PartitionList) *HBReqBuilder { - h.obj.DiskParts = diskParts - return h -} - -func (h *HBReqBuilder) Dir(dir *nebula0.DirInfo) *HBReqBuilder { - h.obj.Dir = dir - return h -} - -func (h *HBReqBuilder) Version(version []byte) *HBReqBuilder { - h.obj.Version = version - return h -} - -func (h *HBReq) SetRole(role HostRole) *HBReq { - h.Role = role - return h -} - -func (h *HBReq) SetHost(host *nebula0.HostAddr) *HBReq { - h.Host = host - return h -} - -func (h *HBReq) SetClusterID(clusterID ClusterID) *HBReq { - h.ClusterID = clusterID - return h -} - -func (h *HBReq) SetLeaderPartIds(leaderPartIds map[nebula0.GraphSpaceID][]*LeaderInfo) *HBReq { - h.LeaderPartIds = leaderPartIds - return h -} - -func (h *HBReq) SetGitInfoSha(gitInfoSha []byte) *HBReq { - h.GitInfoSha = gitInfoSha - return h -} - -func (h *HBReq) SetDiskParts(diskParts map[nebula0.GraphSpaceID]map[string]*PartitionList) *HBReq { - h.DiskParts = diskParts - return h -} - -func (h *HBReq) SetDir(dir *nebula0.DirInfo) *HBReq { - h.Dir = dir - return h -} - -func (h *HBReq) SetVersion(version []byte) *HBReq { - h.Version = version - return h -} - -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 - } - 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 *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 _key43 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _key43 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*LeaderInfo, 0, size) - _val44 := tSlice - for i := 0; i < size; i ++ { - _elem45 := NewLeaderInfo() - if err := _elem45.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem45), err) - } - _val44 = append(_val44, _elem45) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.LeaderPartIds[_key43] = _val44 - } - 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 { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.GraphSpaceID]map[string]*PartitionList, size) - p.DiskParts = tMap - for i := 0; i < size; i ++ { - var _key46 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _key46 = temp - } - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string]*PartitionList, size) - _val47 := tMap - for i := 0; i < size; i ++ { - var _key48 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key48 = v - } - _val49 := NewPartitionList() - if err := _val49.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val49), err) - } - _val47[_key48] = _val49 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - p.DiskParts[_key46] = _val47 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *HBReq) ReadField7(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 *HBReq) 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 *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 := 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 *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.IsSetDiskParts() { - if err := oprot.WriteFieldBegin("disk_parts", thrift.MAP, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:disk_parts: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.MAP, len(p.DiskParts)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.DiskParts { - if err := oprot.WriteI32(int32(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(v)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range v { - 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.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:disk_parts: ", p), err) } - } - return err -} - -func (p *HBReq) writeField7(oprot thrift.Protocol) (err error) { - if p.IsSetDir() { - if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7: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 7:dir: ", p), err) } - } - return err -} - -func (p *HBReq) 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 *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) - diskPartsVal := fmt.Sprintf("%v", p.DiskParts) - var dirVal string - if p.Dir == nil { - dirVal = "" - } else { - dirVal = fmt.Sprintf("%v", p.Dir) - } - versionVal := fmt.Sprintf("%v", p.Version) - return fmt.Sprintf("HBReq({Role:%s Host:%s ClusterID:%s LeaderPartIds:%s GitInfoSha:%s DiskParts:%s Dir:%s Version:%s})", roleVal, hostVal, clusterIDVal, leaderPartIdsVal, gitInfoShaVal, diskPartsVal, dirVal, versionVal) -} - -// Attributes: -// - Dir -// - Addr -// - Role -type ServiceInfo struct { - Dir *nebula0.DirInfo `thrift:"dir,1" db:"dir" json:"dir"` - Addr *nebula0.HostAddr `thrift:"addr,2" db:"addr" json:"addr"` - Role HostRole `thrift:"role,3" db:"role" json:"role"` -} - -func NewServiceInfo() *ServiceInfo { - return &ServiceInfo{ - Dir: nebula0.NewDirInfo(), - Addr: nebula0.NewHostAddr(), - } -} - -var ServiceInfo_Dir_DEFAULT *nebula0.DirInfo -func (p *ServiceInfo) GetDir() *nebula0.DirInfo { - if !p.IsSetDir() { - return ServiceInfo_Dir_DEFAULT - } -return p.Dir -} -var ServiceInfo_Addr_DEFAULT *nebula0.HostAddr -func (p *ServiceInfo) GetAddr() *nebula0.HostAddr { - if !p.IsSetAddr() { - return ServiceInfo_Addr_DEFAULT - } -return p.Addr -} - -func (p *ServiceInfo) GetRole() HostRole { - return p.Role -} -func (p *ServiceInfo) IsSetDir() bool { - return p != nil && p.Dir != nil -} - -func (p *ServiceInfo) IsSetAddr() bool { - return p != nil && p.Addr != nil -} - -type ServiceInfoBuilder struct { - obj *ServiceInfo -} - -func NewServiceInfoBuilder() *ServiceInfoBuilder{ - return &ServiceInfoBuilder{ - obj: NewServiceInfo(), - } -} - -func (p ServiceInfoBuilder) Emit() *ServiceInfo{ - return &ServiceInfo{ - Dir: p.obj.Dir, - Addr: p.obj.Addr, - Role: p.obj.Role, - } -} - -func (s *ServiceInfoBuilder) Dir(dir *nebula0.DirInfo) *ServiceInfoBuilder { - s.obj.Dir = dir - return s -} - -func (s *ServiceInfoBuilder) Addr(addr *nebula0.HostAddr) *ServiceInfoBuilder { - s.obj.Addr = addr - return s -} - -func (s *ServiceInfoBuilder) Role(role HostRole) *ServiceInfoBuilder { - s.obj.Role = role - return s -} - -func (s *ServiceInfo) SetDir(dir *nebula0.DirInfo) *ServiceInfo { - s.Dir = dir - return s -} - -func (s *ServiceInfo) SetAddr(addr *nebula0.HostAddr) *ServiceInfo { - s.Addr = addr - return s -} - -func (s *ServiceInfo) SetRole(role HostRole) *ServiceInfo { - s.Role = role - return s -} - -func (p *ServiceInfo) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ServiceInfo) ReadField1(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 *ServiceInfo) ReadField2(iprot thrift.Protocol) error { - p.Addr = nebula0.NewHostAddr() - if err := p.Addr.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Addr), err) - } - return nil -} - -func (p *ServiceInfo) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := HostRole(v) - p.Role = temp - } - return nil -} - -func (p *ServiceInfo) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ServiceInfo"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ServiceInfo) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("dir", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1: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 1:dir: ", p), err) } - return err -} - -func (p *ServiceInfo) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("addr", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:addr: ", p), err) } - if err := p.Addr.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Addr), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:addr: ", p), err) } - return err -} - -func (p *ServiceInfo) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("role", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:role: ", p), err) } - if err := oprot.WriteI32(int32(p.Role)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.role (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:role: ", p), err) } - return err -} - -func (p *ServiceInfo) String() string { - if p == nil { - return "" - } - - var dirVal string - if p.Dir == nil { - dirVal = "" - } else { - dirVal = fmt.Sprintf("%v", p.Dir) - } - var addrVal string - if p.Addr == nil { - addrVal = "" - } else { - addrVal = fmt.Sprintf("%v", p.Addr) - } - roleVal := fmt.Sprintf("%v", p.Role) - return fmt.Sprintf("ServiceInfo({Dir:%s Addr:%s Role:%s})", dirVal, addrVal, roleVal) -} - -// Attributes: -// - Host -// - GitInfoSha -// - Version -type AgentHBReq struct { - Host *nebula0.HostAddr `thrift:"host,1" db:"host" json:"host"` - GitInfoSha []byte `thrift:"git_info_sha,2" db:"git_info_sha" json:"git_info_sha"` - Version []byte `thrift:"version,3,optional" db:"version" json:"version,omitempty"` -} - -func NewAgentHBReq() *AgentHBReq { - return &AgentHBReq{ - Host: nebula0.NewHostAddr(), - } -} - -var AgentHBReq_Host_DEFAULT *nebula0.HostAddr -func (p *AgentHBReq) GetHost() *nebula0.HostAddr { - if !p.IsSetHost() { - return AgentHBReq_Host_DEFAULT - } -return p.Host -} - -func (p *AgentHBReq) GetGitInfoSha() []byte { - return p.GitInfoSha -} -var AgentHBReq_Version_DEFAULT []byte - -func (p *AgentHBReq) GetVersion() []byte { - return p.Version -} -func (p *AgentHBReq) IsSetHost() bool { - return p != nil && p.Host != nil -} - -func (p *AgentHBReq) IsSetVersion() bool { - return p != nil && p.Version != nil -} - -type AgentHBReqBuilder struct { - obj *AgentHBReq -} - -func NewAgentHBReqBuilder() *AgentHBReqBuilder{ - return &AgentHBReqBuilder{ - obj: NewAgentHBReq(), - } -} - -func (p AgentHBReqBuilder) Emit() *AgentHBReq{ - return &AgentHBReq{ - Host: p.obj.Host, - GitInfoSha: p.obj.GitInfoSha, - Version: p.obj.Version, - } -} - -func (a *AgentHBReqBuilder) Host(host *nebula0.HostAddr) *AgentHBReqBuilder { - a.obj.Host = host - return a -} - -func (a *AgentHBReqBuilder) GitInfoSha(gitInfoSha []byte) *AgentHBReqBuilder { - a.obj.GitInfoSha = gitInfoSha - return a -} - -func (a *AgentHBReqBuilder) Version(version []byte) *AgentHBReqBuilder { - a.obj.Version = version - return a -} - -func (a *AgentHBReq) SetHost(host *nebula0.HostAddr) *AgentHBReq { - a.Host = host - return a -} - -func (a *AgentHBReq) SetGitInfoSha(gitInfoSha []byte) *AgentHBReq { - a.GitInfoSha = gitInfoSha - return a -} - -func (a *AgentHBReq) SetVersion(version []byte) *AgentHBReq { - a.Version = version - return a -} - -func (p *AgentHBReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AgentHBReq) 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 *AgentHBReq) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.GitInfoSha = v - } - return nil -} - -func (p *AgentHBReq) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.Version = v - } - return nil -} - -func (p *AgentHBReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AgentHBReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *AgentHBReq) 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 *AgentHBReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("git_info_sha", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:git_info_sha: ", p), err) } - if err := oprot.WriteBinary(p.GitInfoSha); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.git_info_sha (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:git_info_sha: ", p), err) } - return err -} - -func (p *AgentHBReq) writeField3(oprot thrift.Protocol) (err error) { - if p.IsSetVersion() { - if err := oprot.WriteFieldBegin("version", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:version: ", p), err) } - if err := oprot.WriteBinary(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 *AgentHBReq) String() string { - if p == nil { - return "" - } - - var hostVal string - if p.Host == nil { - hostVal = "" - } else { - hostVal = fmt.Sprintf("%v", p.Host) - } - gitInfoShaVal := fmt.Sprintf("%v", p.GitInfoSha) - versionVal := fmt.Sprintf("%v", p.Version) - return fmt.Sprintf("AgentHBReq({Host:%s GitInfoSha:%s Version:%s})", hostVal, gitInfoShaVal, versionVal) -} - -// Attributes: -// - Code -// - Leader -// - ServiceList -type AgentHBResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` - ServiceList []*ServiceInfo `thrift:"service_list,3" db:"service_list" json:"service_list"` -} - -func NewAgentHBResp() *AgentHBResp { - return &AgentHBResp{ - Leader: nebula0.NewHostAddr(), - } -} - - -func (p *AgentHBResp) GetCode() nebula0.ErrorCode { - return p.Code -} -var AgentHBResp_Leader_DEFAULT *nebula0.HostAddr -func (p *AgentHBResp) GetLeader() *nebula0.HostAddr { - if !p.IsSetLeader() { - return AgentHBResp_Leader_DEFAULT - } -return p.Leader -} - -func (p *AgentHBResp) GetServiceList() []*ServiceInfo { - return p.ServiceList -} -func (p *AgentHBResp) IsSetLeader() bool { - return p != nil && p.Leader != nil -} - -type AgentHBRespBuilder struct { - obj *AgentHBResp -} - -func NewAgentHBRespBuilder() *AgentHBRespBuilder{ - return &AgentHBRespBuilder{ - obj: NewAgentHBResp(), - } -} - -func (p AgentHBRespBuilder) Emit() *AgentHBResp{ - return &AgentHBResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - ServiceList: p.obj.ServiceList, - } -} - -func (a *AgentHBRespBuilder) Code(code nebula0.ErrorCode) *AgentHBRespBuilder { - a.obj.Code = code - return a -} - -func (a *AgentHBRespBuilder) Leader(leader *nebula0.HostAddr) *AgentHBRespBuilder { - a.obj.Leader = leader - return a -} - -func (a *AgentHBRespBuilder) ServiceList(serviceList []*ServiceInfo) *AgentHBRespBuilder { - a.obj.ServiceList = serviceList - return a -} - -func (a *AgentHBResp) SetCode(code nebula0.ErrorCode) *AgentHBResp { - a.Code = code - return a -} - -func (a *AgentHBResp) SetLeader(leader *nebula0.HostAddr) *AgentHBResp { - a.Leader = leader - return a -} - -func (a *AgentHBResp) SetServiceList(serviceList []*ServiceInfo) *AgentHBResp { - a.ServiceList = serviceList - return a -} - -func (p *AgentHBResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AgentHBResp) 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 *AgentHBResp) 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 *AgentHBResp) ReadField3(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*ServiceInfo, 0, size) - p.ServiceList = tSlice - for i := 0; i < size; i ++ { - _elem50 := NewServiceInfo() - if err := _elem50.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) - } - p.ServiceList = append(p.ServiceList, _elem50) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *AgentHBResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AgentHBResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *AgentHBResp) 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 *AgentHBResp) 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 *AgentHBResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("service_list", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:service_list: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ServiceList)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ServiceList { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - 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:service_list: ", p), err) } - return err -} - -func (p *AgentHBResp) 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) - } - serviceListVal := fmt.Sprintf("%v", p.ServiceList) - return fmt.Sprintf("AgentHBResp({Code:%s Leader:%s ServiceList:%s})", codeVal, leaderVal, serviceListVal) -} - -// Attributes: -// - Name -// - TypeLength -type IndexFieldDef struct { - Name []byte `thrift:"name,1,required" db:"name" json:"name"` - TypeLength *int16 `thrift:"type_length,2,optional" 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 -} - -type IndexFieldDefBuilder struct { - obj *IndexFieldDef -} - -func NewIndexFieldDefBuilder() *IndexFieldDefBuilder{ - return &IndexFieldDefBuilder{ - obj: NewIndexFieldDef(), - } -} - -func (p IndexFieldDefBuilder) Emit() *IndexFieldDef{ - return &IndexFieldDef{ - Name: p.obj.Name, - TypeLength: p.obj.TypeLength, - } -} - -func (i *IndexFieldDefBuilder) Name(name []byte) *IndexFieldDefBuilder { - i.obj.Name = name - return i -} - -func (i *IndexFieldDefBuilder) TypeLength(typeLength *int16) *IndexFieldDefBuilder { - i.obj.TypeLength = typeLength - return i -} - -func (i *IndexFieldDef) SetName(name []byte) *IndexFieldDef { - i.Name = name - return i -} - -func (i *IndexFieldDef) SetTypeLength(typeLength *int16) *IndexFieldDef { - i.TypeLength = typeLength - return i -} - -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 -// - IndexParams -type CreateTagIndexReq struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` - 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,optional" db:"comment" json:"comment,omitempty"` - IndexParams *IndexParams `thrift:"index_params,7,optional" db:"index_params" json:"index_params,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 -} -var CreateTagIndexReq_IndexParams_DEFAULT *IndexParams -func (p *CreateTagIndexReq) GetIndexParams() *IndexParams { - if !p.IsSetIndexParams() { - return CreateTagIndexReq_IndexParams_DEFAULT - } -return p.IndexParams -} -func (p *CreateTagIndexReq) IsSetComment() bool { - return p != nil && p.Comment != nil -} - -func (p *CreateTagIndexReq) IsSetIndexParams() bool { - return p != nil && p.IndexParams != nil -} - -type CreateTagIndexReqBuilder struct { - obj *CreateTagIndexReq -} - -func NewCreateTagIndexReqBuilder() *CreateTagIndexReqBuilder{ - return &CreateTagIndexReqBuilder{ - obj: NewCreateTagIndexReq(), - } -} - -func (p CreateTagIndexReqBuilder) Emit() *CreateTagIndexReq{ - return &CreateTagIndexReq{ - SpaceID: p.obj.SpaceID, - IndexName: p.obj.IndexName, - TagName: p.obj.TagName, - Fields: p.obj.Fields, - IfNotExists: p.obj.IfNotExists, - Comment: p.obj.Comment, - IndexParams: p.obj.IndexParams, - } -} - -func (c *CreateTagIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *CreateTagIndexReqBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *CreateTagIndexReqBuilder) IndexName(indexName []byte) *CreateTagIndexReqBuilder { - c.obj.IndexName = indexName - return c -} - -func (c *CreateTagIndexReqBuilder) TagName(tagName []byte) *CreateTagIndexReqBuilder { - c.obj.TagName = tagName - return c -} - -func (c *CreateTagIndexReqBuilder) Fields(fields []*IndexFieldDef) *CreateTagIndexReqBuilder { - c.obj.Fields = fields - return c -} - -func (c *CreateTagIndexReqBuilder) IfNotExists(ifNotExists bool) *CreateTagIndexReqBuilder { - c.obj.IfNotExists = ifNotExists - return c -} - -func (c *CreateTagIndexReqBuilder) Comment(comment []byte) *CreateTagIndexReqBuilder { - c.obj.Comment = comment - return c -} - -func (c *CreateTagIndexReqBuilder) IndexParams(indexParams *IndexParams) *CreateTagIndexReqBuilder { - c.obj.IndexParams = indexParams - return c -} - -func (c *CreateTagIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *CreateTagIndexReq { - c.SpaceID = spaceID - return c -} - -func (c *CreateTagIndexReq) SetIndexName(indexName []byte) *CreateTagIndexReq { - c.IndexName = indexName - return c -} - -func (c *CreateTagIndexReq) SetTagName(tagName []byte) *CreateTagIndexReq { - c.TagName = tagName - return c -} - -func (c *CreateTagIndexReq) SetFields(fields []*IndexFieldDef) *CreateTagIndexReq { - c.Fields = fields - return c -} - -func (c *CreateTagIndexReq) SetIfNotExists(ifNotExists bool) *CreateTagIndexReq { - c.IfNotExists = ifNotExists - return c -} - -func (c *CreateTagIndexReq) SetComment(comment []byte) *CreateTagIndexReq { - c.Comment = comment - return c -} - -func (c *CreateTagIndexReq) SetIndexParams(indexParams *IndexParams) *CreateTagIndexReq { - c.IndexParams = indexParams - return c -} - -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 - } - 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 *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 ++ { - _elem51 := NewIndexFieldDef() - if err := _elem51.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) - } - p.Fields = append(p.Fields, _elem51) - } - 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) ReadField7(iprot thrift.Protocol) error { - p.IndexParams = NewIndexParams() - if err := p.IndexParams.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) - } - return nil -} - -func (p *CreateTagIndexReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("CreateTagIndexReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *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) writeField7(oprot thrift.Protocol) (err error) { - if p.IsSetIndexParams() { - if err := oprot.WriteFieldBegin("index_params", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } - if err := p.IndexParams.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } - } - return err -} - -func (p *CreateTagIndexReq) String() string { - if p == nil { - return "" - } - - 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) - var indexParamsVal string - if p.IndexParams == nil { - indexParamsVal = "" - } else { - indexParamsVal = fmt.Sprintf("%v", p.IndexParams) - } - return fmt.Sprintf("CreateTagIndexReq({SpaceID:%s IndexName:%s TagName:%s Fields:%s IfNotExists:%s Comment:%s IndexParams:%s})", spaceIDVal, indexNameVal, tagNameVal, fieldsVal, ifNotExistsVal, commentVal, indexParamsVal) -} - -// Attributes: -// - 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 -} -type DropTagIndexReqBuilder struct { - obj *DropTagIndexReq -} - -func NewDropTagIndexReqBuilder() *DropTagIndexReqBuilder{ - return &DropTagIndexReqBuilder{ - obj: NewDropTagIndexReq(), - } -} - -func (p DropTagIndexReqBuilder) Emit() *DropTagIndexReq{ - return &DropTagIndexReq{ - SpaceID: p.obj.SpaceID, - IndexName: p.obj.IndexName, - IfExists: p.obj.IfExists, - } -} - -func (d *DropTagIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DropTagIndexReqBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DropTagIndexReqBuilder) IndexName(indexName []byte) *DropTagIndexReqBuilder { - d.obj.IndexName = indexName - return d -} - -func (d *DropTagIndexReqBuilder) IfExists(ifExists bool) *DropTagIndexReqBuilder { - d.obj.IfExists = ifExists - return d -} - -func (d *DropTagIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *DropTagIndexReq { - d.SpaceID = spaceID - return d -} - -func (d *DropTagIndexReq) SetIndexName(indexName []byte) *DropTagIndexReq { - d.IndexName = indexName - return d -} - -func (d *DropTagIndexReq) SetIfExists(ifExists bool) *DropTagIndexReq { - d.IfExists = ifExists - return d -} - -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 -} -type GetTagIndexReqBuilder struct { - obj *GetTagIndexReq -} - -func NewGetTagIndexReqBuilder() *GetTagIndexReqBuilder{ - return &GetTagIndexReqBuilder{ - obj: NewGetTagIndexReq(), - } -} - -func (p GetTagIndexReqBuilder) Emit() *GetTagIndexReq{ - return &GetTagIndexReq{ - SpaceID: p.obj.SpaceID, - IndexName: p.obj.IndexName, - } -} - -func (g *GetTagIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetTagIndexReqBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetTagIndexReqBuilder) IndexName(indexName []byte) *GetTagIndexReqBuilder { - g.obj.IndexName = indexName - return g -} - -func (g *GetTagIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetTagIndexReq { - g.SpaceID = spaceID - return g -} - -func (g *GetTagIndexReq) SetIndexName(indexName []byte) *GetTagIndexReq { - g.IndexName = indexName - return g -} - -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 -} - -type GetTagIndexRespBuilder struct { - obj *GetTagIndexResp -} - -func NewGetTagIndexRespBuilder() *GetTagIndexRespBuilder{ - return &GetTagIndexRespBuilder{ - obj: NewGetTagIndexResp(), - } -} - -func (p GetTagIndexRespBuilder) Emit() *GetTagIndexResp{ - return &GetTagIndexResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Item: p.obj.Item, - } -} - -func (g *GetTagIndexRespBuilder) Code(code nebula0.ErrorCode) *GetTagIndexRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetTagIndexRespBuilder) Leader(leader *nebula0.HostAddr) *GetTagIndexRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetTagIndexRespBuilder) Item(item *IndexItem) *GetTagIndexRespBuilder { - g.obj.Item = item - return g -} - -func (g *GetTagIndexResp) SetCode(code nebula0.ErrorCode) *GetTagIndexResp { - g.Code = code - return g -} - -func (g *GetTagIndexResp) SetLeader(leader *nebula0.HostAddr) *GetTagIndexResp { - g.Leader = leader - return g -} - -func (g *GetTagIndexResp) SetItem(item *IndexItem) *GetTagIndexResp { - g.Item = item - return g -} - -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 -} -type ListTagIndexesReqBuilder struct { - obj *ListTagIndexesReq -} - -func NewListTagIndexesReqBuilder() *ListTagIndexesReqBuilder{ - return &ListTagIndexesReqBuilder{ - obj: NewListTagIndexesReq(), - } -} - -func (p ListTagIndexesReqBuilder) Emit() *ListTagIndexesReq{ - return &ListTagIndexesReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (l *ListTagIndexesReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListTagIndexesReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListTagIndexesReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListTagIndexesReq { - l.SpaceID = spaceID - return l -} - -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 -} - -type ListTagIndexesRespBuilder struct { - obj *ListTagIndexesResp -} - -func NewListTagIndexesRespBuilder() *ListTagIndexesRespBuilder{ - return &ListTagIndexesRespBuilder{ - obj: NewListTagIndexesResp(), - } -} - -func (p ListTagIndexesRespBuilder) Emit() *ListTagIndexesResp{ - return &ListTagIndexesResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Items: p.obj.Items, - } -} - -func (l *ListTagIndexesRespBuilder) Code(code nebula0.ErrorCode) *ListTagIndexesRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListTagIndexesRespBuilder) Leader(leader *nebula0.HostAddr) *ListTagIndexesRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListTagIndexesRespBuilder) Items(items []*IndexItem) *ListTagIndexesRespBuilder { - l.obj.Items = items - return l -} - -func (l *ListTagIndexesResp) SetCode(code nebula0.ErrorCode) *ListTagIndexesResp { - l.Code = code - return l -} - -func (l *ListTagIndexesResp) SetLeader(leader *nebula0.HostAddr) *ListTagIndexesResp { - l.Leader = leader - return l -} - -func (l *ListTagIndexesResp) SetItems(items []*IndexItem) *ListTagIndexesResp { - l.Items = items - return l -} - -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 ++ { - _elem52 := NewIndexItem() - if err := _elem52.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) - } - p.Items = append(p.Items, _elem52) - } - 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 -// - IndexParams -type CreateEdgeIndexReq struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - IndexName []byte `thrift:"index_name,2" db:"index_name" json:"index_name"` - 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,optional" db:"comment" json:"comment,omitempty"` - IndexParams *IndexParams `thrift:"index_params,7,optional" db:"index_params" json:"index_params,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 -} -var CreateEdgeIndexReq_IndexParams_DEFAULT *IndexParams -func (p *CreateEdgeIndexReq) GetIndexParams() *IndexParams { - if !p.IsSetIndexParams() { - return CreateEdgeIndexReq_IndexParams_DEFAULT - } -return p.IndexParams -} -func (p *CreateEdgeIndexReq) IsSetComment() bool { - return p != nil && p.Comment != nil -} - -func (p *CreateEdgeIndexReq) IsSetIndexParams() bool { - return p != nil && p.IndexParams != nil -} - -type CreateEdgeIndexReqBuilder struct { - obj *CreateEdgeIndexReq -} - -func NewCreateEdgeIndexReqBuilder() *CreateEdgeIndexReqBuilder{ - return &CreateEdgeIndexReqBuilder{ - obj: NewCreateEdgeIndexReq(), - } -} - -func (p CreateEdgeIndexReqBuilder) Emit() *CreateEdgeIndexReq{ - return &CreateEdgeIndexReq{ - SpaceID: p.obj.SpaceID, - IndexName: p.obj.IndexName, - EdgeName: p.obj.EdgeName, - Fields: p.obj.Fields, - IfNotExists: p.obj.IfNotExists, - Comment: p.obj.Comment, - IndexParams: p.obj.IndexParams, - } -} - -func (c *CreateEdgeIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *CreateEdgeIndexReqBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *CreateEdgeIndexReqBuilder) IndexName(indexName []byte) *CreateEdgeIndexReqBuilder { - c.obj.IndexName = indexName - return c -} - -func (c *CreateEdgeIndexReqBuilder) EdgeName(edgeName []byte) *CreateEdgeIndexReqBuilder { - c.obj.EdgeName = edgeName - return c -} - -func (c *CreateEdgeIndexReqBuilder) Fields(fields []*IndexFieldDef) *CreateEdgeIndexReqBuilder { - c.obj.Fields = fields - return c -} - -func (c *CreateEdgeIndexReqBuilder) IfNotExists(ifNotExists bool) *CreateEdgeIndexReqBuilder { - c.obj.IfNotExists = ifNotExists - return c -} - -func (c *CreateEdgeIndexReqBuilder) Comment(comment []byte) *CreateEdgeIndexReqBuilder { - c.obj.Comment = comment - return c -} - -func (c *CreateEdgeIndexReqBuilder) IndexParams(indexParams *IndexParams) *CreateEdgeIndexReqBuilder { - c.obj.IndexParams = indexParams - return c -} - -func (c *CreateEdgeIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *CreateEdgeIndexReq { - c.SpaceID = spaceID - return c -} - -func (c *CreateEdgeIndexReq) SetIndexName(indexName []byte) *CreateEdgeIndexReq { - c.IndexName = indexName - return c -} - -func (c *CreateEdgeIndexReq) SetEdgeName(edgeName []byte) *CreateEdgeIndexReq { - c.EdgeName = edgeName - return c -} - -func (c *CreateEdgeIndexReq) SetFields(fields []*IndexFieldDef) *CreateEdgeIndexReq { - c.Fields = fields - return c -} - -func (c *CreateEdgeIndexReq) SetIfNotExists(ifNotExists bool) *CreateEdgeIndexReq { - c.IfNotExists = ifNotExists - return c -} - -func (c *CreateEdgeIndexReq) SetComment(comment []byte) *CreateEdgeIndexReq { - c.Comment = comment - return c -} - -func (c *CreateEdgeIndexReq) SetIndexParams(indexParams *IndexParams) *CreateEdgeIndexReq { - c.IndexParams = indexParams - return c -} - -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 - } - 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 *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 ++ { - _elem53 := NewIndexFieldDef() - if err := _elem53.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) - } - p.Fields = append(p.Fields, _elem53) - } - 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) ReadField7(iprot thrift.Protocol) error { - p.IndexParams = NewIndexParams() - if err := p.IndexParams.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.IndexParams), err) - } - return nil -} - -func (p *CreateEdgeIndexReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("CreateEdgeIndexReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *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) writeField7(oprot thrift.Protocol) (err error) { - if p.IsSetIndexParams() { - if err := oprot.WriteFieldBegin("index_params", thrift.STRUCT, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:index_params: ", p), err) } - if err := p.IndexParams.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.IndexParams), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:index_params: ", p), err) } - } - return err -} - -func (p *CreateEdgeIndexReq) String() string { - if p == nil { - return "" - } - - 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) - var indexParamsVal string - if p.IndexParams == nil { - indexParamsVal = "" - } else { - indexParamsVal = fmt.Sprintf("%v", p.IndexParams) - } - return fmt.Sprintf("CreateEdgeIndexReq({SpaceID:%s IndexName:%s EdgeName:%s Fields:%s IfNotExists:%s Comment:%s IndexParams:%s})", spaceIDVal, indexNameVal, edgeNameVal, fieldsVal, ifNotExistsVal, commentVal, indexParamsVal) -} - -// Attributes: -// - 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 -} -type DropEdgeIndexReqBuilder struct { - obj *DropEdgeIndexReq -} - -func NewDropEdgeIndexReqBuilder() *DropEdgeIndexReqBuilder{ - return &DropEdgeIndexReqBuilder{ - obj: NewDropEdgeIndexReq(), - } -} - -func (p DropEdgeIndexReqBuilder) Emit() *DropEdgeIndexReq{ - return &DropEdgeIndexReq{ - SpaceID: p.obj.SpaceID, - IndexName: p.obj.IndexName, - IfExists: p.obj.IfExists, - } -} - -func (d *DropEdgeIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DropEdgeIndexReqBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DropEdgeIndexReqBuilder) IndexName(indexName []byte) *DropEdgeIndexReqBuilder { - d.obj.IndexName = indexName - return d -} - -func (d *DropEdgeIndexReqBuilder) IfExists(ifExists bool) *DropEdgeIndexReqBuilder { - d.obj.IfExists = ifExists - return d -} - -func (d *DropEdgeIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *DropEdgeIndexReq { - d.SpaceID = spaceID - return d -} - -func (d *DropEdgeIndexReq) SetIndexName(indexName []byte) *DropEdgeIndexReq { - d.IndexName = indexName - return d -} - -func (d *DropEdgeIndexReq) SetIfExists(ifExists bool) *DropEdgeIndexReq { - d.IfExists = ifExists - return d -} - -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 -} -type GetEdgeIndexReqBuilder struct { - obj *GetEdgeIndexReq -} - -func NewGetEdgeIndexReqBuilder() *GetEdgeIndexReqBuilder{ - return &GetEdgeIndexReqBuilder{ - obj: NewGetEdgeIndexReq(), - } -} - -func (p GetEdgeIndexReqBuilder) Emit() *GetEdgeIndexReq{ - return &GetEdgeIndexReq{ - SpaceID: p.obj.SpaceID, - IndexName: p.obj.IndexName, - } -} - -func (g *GetEdgeIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetEdgeIndexReqBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetEdgeIndexReqBuilder) IndexName(indexName []byte) *GetEdgeIndexReqBuilder { - g.obj.IndexName = indexName - return g -} - -func (g *GetEdgeIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetEdgeIndexReq { - g.SpaceID = spaceID - return g -} - -func (g *GetEdgeIndexReq) SetIndexName(indexName []byte) *GetEdgeIndexReq { - g.IndexName = indexName - return g -} - -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 -} - -type GetEdgeIndexRespBuilder struct { - obj *GetEdgeIndexResp -} - -func NewGetEdgeIndexRespBuilder() *GetEdgeIndexRespBuilder{ - return &GetEdgeIndexRespBuilder{ - obj: NewGetEdgeIndexResp(), - } -} - -func (p GetEdgeIndexRespBuilder) Emit() *GetEdgeIndexResp{ - return &GetEdgeIndexResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Item: p.obj.Item, - } -} - -func (g *GetEdgeIndexRespBuilder) Code(code nebula0.ErrorCode) *GetEdgeIndexRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetEdgeIndexRespBuilder) Leader(leader *nebula0.HostAddr) *GetEdgeIndexRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetEdgeIndexRespBuilder) Item(item *IndexItem) *GetEdgeIndexRespBuilder { - g.obj.Item = item - return g -} - -func (g *GetEdgeIndexResp) SetCode(code nebula0.ErrorCode) *GetEdgeIndexResp { - g.Code = code - return g -} - -func (g *GetEdgeIndexResp) SetLeader(leader *nebula0.HostAddr) *GetEdgeIndexResp { - g.Leader = leader - return g -} - -func (g *GetEdgeIndexResp) SetItem(item *IndexItem) *GetEdgeIndexResp { - g.Item = item - return g -} - -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 -} -type ListEdgeIndexesReqBuilder struct { - obj *ListEdgeIndexesReq -} - -func NewListEdgeIndexesReqBuilder() *ListEdgeIndexesReqBuilder{ - return &ListEdgeIndexesReqBuilder{ - obj: NewListEdgeIndexesReq(), - } -} - -func (p ListEdgeIndexesReqBuilder) Emit() *ListEdgeIndexesReq{ - return &ListEdgeIndexesReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (l *ListEdgeIndexesReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListEdgeIndexesReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListEdgeIndexesReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListEdgeIndexesReq { - l.SpaceID = spaceID - return l -} - -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 -} - -type ListEdgeIndexesRespBuilder struct { - obj *ListEdgeIndexesResp -} - -func NewListEdgeIndexesRespBuilder() *ListEdgeIndexesRespBuilder{ - return &ListEdgeIndexesRespBuilder{ - obj: NewListEdgeIndexesResp(), - } -} - -func (p ListEdgeIndexesRespBuilder) Emit() *ListEdgeIndexesResp{ - return &ListEdgeIndexesResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Items: p.obj.Items, - } -} - -func (l *ListEdgeIndexesRespBuilder) Code(code nebula0.ErrorCode) *ListEdgeIndexesRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListEdgeIndexesRespBuilder) Leader(leader *nebula0.HostAddr) *ListEdgeIndexesRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListEdgeIndexesRespBuilder) Items(items []*IndexItem) *ListEdgeIndexesRespBuilder { - l.obj.Items = items - return l -} - -func (l *ListEdgeIndexesResp) SetCode(code nebula0.ErrorCode) *ListEdgeIndexesResp { - l.Code = code - return l -} - -func (l *ListEdgeIndexesResp) SetLeader(leader *nebula0.HostAddr) *ListEdgeIndexesResp { - l.Leader = leader - return l -} - -func (l *ListEdgeIndexesResp) SetItems(items []*IndexItem) *ListEdgeIndexesResp { - l.Items = items - return l -} - -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 ++ { - _elem54 := NewIndexItem() - if err := _elem54.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem54), err) - } - p.Items = append(p.Items, _elem54) - } - 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 -} -type RebuildIndexReqBuilder struct { - obj *RebuildIndexReq -} - -func NewRebuildIndexReqBuilder() *RebuildIndexReqBuilder{ - return &RebuildIndexReqBuilder{ - obj: NewRebuildIndexReq(), - } -} - -func (p RebuildIndexReqBuilder) Emit() *RebuildIndexReq{ - return &RebuildIndexReq{ - SpaceID: p.obj.SpaceID, - IndexName: p.obj.IndexName, - } -} - -func (r *RebuildIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *RebuildIndexReqBuilder { - r.obj.SpaceID = spaceID - return r -} - -func (r *RebuildIndexReqBuilder) IndexName(indexName []byte) *RebuildIndexReqBuilder { - r.obj.IndexName = indexName - return r -} - -func (r *RebuildIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *RebuildIndexReq { - r.SpaceID = spaceID - return r -} - -func (r *RebuildIndexReq) SetIndexName(indexName []byte) *RebuildIndexReq { - r.IndexName = indexName - return r -} - -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 -} -type CreateUserReqBuilder struct { - obj *CreateUserReq -} - -func NewCreateUserReqBuilder() *CreateUserReqBuilder{ - return &CreateUserReqBuilder{ - obj: NewCreateUserReq(), - } -} - -func (p CreateUserReqBuilder) Emit() *CreateUserReq{ - return &CreateUserReq{ - Account: p.obj.Account, - EncodedPwd: p.obj.EncodedPwd, - IfNotExists: p.obj.IfNotExists, - } -} - -func (c *CreateUserReqBuilder) Account(account []byte) *CreateUserReqBuilder { - c.obj.Account = account - return c -} - -func (c *CreateUserReqBuilder) EncodedPwd(encodedPwd []byte) *CreateUserReqBuilder { - c.obj.EncodedPwd = encodedPwd - return c -} - -func (c *CreateUserReqBuilder) IfNotExists(ifNotExists bool) *CreateUserReqBuilder { - c.obj.IfNotExists = ifNotExists - return c -} - -func (c *CreateUserReq) SetAccount(account []byte) *CreateUserReq { - c.Account = account - return c -} - -func (c *CreateUserReq) SetEncodedPwd(encodedPwd []byte) *CreateUserReq { - c.EncodedPwd = encodedPwd - return c -} - -func (c *CreateUserReq) SetIfNotExists(ifNotExists bool) *CreateUserReq { - c.IfNotExists = ifNotExists - return c -} - -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 -} -type DropUserReqBuilder struct { - obj *DropUserReq -} - -func NewDropUserReqBuilder() *DropUserReqBuilder{ - return &DropUserReqBuilder{ - obj: NewDropUserReq(), - } -} - -func (p DropUserReqBuilder) Emit() *DropUserReq{ - return &DropUserReq{ - Account: p.obj.Account, - IfExists: p.obj.IfExists, - } -} - -func (d *DropUserReqBuilder) Account(account []byte) *DropUserReqBuilder { - d.obj.Account = account - return d -} - -func (d *DropUserReqBuilder) IfExists(ifExists bool) *DropUserReqBuilder { - d.obj.IfExists = ifExists - return d -} - -func (d *DropUserReq) SetAccount(account []byte) *DropUserReq { - d.Account = account - return d -} - -func (d *DropUserReq) SetIfExists(ifExists bool) *DropUserReq { - d.IfExists = ifExists - return d -} - -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 -} -type AlterUserReqBuilder struct { - obj *AlterUserReq -} - -func NewAlterUserReqBuilder() *AlterUserReqBuilder{ - return &AlterUserReqBuilder{ - obj: NewAlterUserReq(), - } -} - -func (p AlterUserReqBuilder) Emit() *AlterUserReq{ - return &AlterUserReq{ - Account: p.obj.Account, - EncodedPwd: p.obj.EncodedPwd, - } -} - -func (a *AlterUserReqBuilder) Account(account []byte) *AlterUserReqBuilder { - a.obj.Account = account - return a -} - -func (a *AlterUserReqBuilder) EncodedPwd(encodedPwd []byte) *AlterUserReqBuilder { - a.obj.EncodedPwd = encodedPwd - return a -} - -func (a *AlterUserReq) SetAccount(account []byte) *AlterUserReq { - a.Account = account - return a -} - -func (a *AlterUserReq) SetEncodedPwd(encodedPwd []byte) *AlterUserReq { - a.EncodedPwd = encodedPwd - return a -} - -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 -} - -type GrantRoleReqBuilder struct { - obj *GrantRoleReq -} - -func NewGrantRoleReqBuilder() *GrantRoleReqBuilder{ - return &GrantRoleReqBuilder{ - obj: NewGrantRoleReq(), - } -} - -func (p GrantRoleReqBuilder) Emit() *GrantRoleReq{ - return &GrantRoleReq{ - RoleItem: p.obj.RoleItem, - } -} - -func (g *GrantRoleReqBuilder) RoleItem(roleItem *RoleItem) *GrantRoleReqBuilder { - g.obj.RoleItem = roleItem - return g -} - -func (g *GrantRoleReq) SetRoleItem(roleItem *RoleItem) *GrantRoleReq { - g.RoleItem = roleItem - return g -} - -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 -} - -type RevokeRoleReqBuilder struct { - obj *RevokeRoleReq -} - -func NewRevokeRoleReqBuilder() *RevokeRoleReqBuilder{ - return &RevokeRoleReqBuilder{ - obj: NewRevokeRoleReq(), - } -} - -func (p RevokeRoleReqBuilder) Emit() *RevokeRoleReq{ - return &RevokeRoleReq{ - RoleItem: p.obj.RoleItem, - } -} - -func (r *RevokeRoleReqBuilder) RoleItem(roleItem *RoleItem) *RevokeRoleReqBuilder { - r.obj.RoleItem = roleItem - return r -} - -func (r *RevokeRoleReq) SetRoleItem(roleItem *RoleItem) *RevokeRoleReq { - r.RoleItem = roleItem - return r -} - -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{} -} - -type ListUsersReqBuilder struct { - obj *ListUsersReq -} - -func NewListUsersReqBuilder() *ListUsersReqBuilder{ - return &ListUsersReqBuilder{ - obj: NewListUsersReq(), - } -} - -func (p ListUsersReqBuilder) Emit() *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 -} - -type ListUsersRespBuilder struct { - obj *ListUsersResp -} - -func NewListUsersRespBuilder() *ListUsersRespBuilder{ - return &ListUsersRespBuilder{ - obj: NewListUsersResp(), - } -} - -func (p ListUsersRespBuilder) Emit() *ListUsersResp{ - return &ListUsersResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Users: p.obj.Users, - } -} - -func (l *ListUsersRespBuilder) Code(code nebula0.ErrorCode) *ListUsersRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListUsersRespBuilder) Leader(leader *nebula0.HostAddr) *ListUsersRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListUsersRespBuilder) Users(users map[string][]byte) *ListUsersRespBuilder { - l.obj.Users = users - return l -} - -func (l *ListUsersResp) SetCode(code nebula0.ErrorCode) *ListUsersResp { - l.Code = code - return l -} - -func (l *ListUsersResp) SetLeader(leader *nebula0.HostAddr) *ListUsersResp { - l.Leader = leader - return l -} - -func (l *ListUsersResp) SetUsers(users map[string][]byte) *ListUsersResp { - l.Users = users - return l -} - -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 _key55 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key55 = v - } - var _val56 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val56 = v - } - p.Users[_key55] = _val56 - } - 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 -} -type ListRolesReqBuilder struct { - obj *ListRolesReq -} - -func NewListRolesReqBuilder() *ListRolesReqBuilder{ - return &ListRolesReqBuilder{ - obj: NewListRolesReq(), - } -} - -func (p ListRolesReqBuilder) Emit() *ListRolesReq{ - return &ListRolesReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (l *ListRolesReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListRolesReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListRolesReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListRolesReq { - l.SpaceID = spaceID - return l -} - -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 -} - -type ListRolesRespBuilder struct { - obj *ListRolesResp -} - -func NewListRolesRespBuilder() *ListRolesRespBuilder{ - return &ListRolesRespBuilder{ - obj: NewListRolesResp(), - } -} - -func (p ListRolesRespBuilder) Emit() *ListRolesResp{ - return &ListRolesResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Roles: p.obj.Roles, - } -} - -func (l *ListRolesRespBuilder) Code(code nebula0.ErrorCode) *ListRolesRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListRolesRespBuilder) Leader(leader *nebula0.HostAddr) *ListRolesRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListRolesRespBuilder) Roles(roles []*RoleItem) *ListRolesRespBuilder { - l.obj.Roles = roles - return l -} - -func (l *ListRolesResp) SetCode(code nebula0.ErrorCode) *ListRolesResp { - l.Code = code - return l -} - -func (l *ListRolesResp) SetLeader(leader *nebula0.HostAddr) *ListRolesResp { - l.Leader = leader - return l -} - -func (l *ListRolesResp) SetRoles(roles []*RoleItem) *ListRolesResp { - l.Roles = roles - return l -} - -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 ++ { - _elem57 := NewRoleItem() - if err := _elem57.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem57), err) - } - p.Roles = append(p.Roles, _elem57) - } - 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 -} -type GetUserRolesReqBuilder struct { - obj *GetUserRolesReq -} - -func NewGetUserRolesReqBuilder() *GetUserRolesReqBuilder{ - return &GetUserRolesReqBuilder{ - obj: NewGetUserRolesReq(), - } -} - -func (p GetUserRolesReqBuilder) Emit() *GetUserRolesReq{ - return &GetUserRolesReq{ - Account: p.obj.Account, - } -} - -func (g *GetUserRolesReqBuilder) Account(account []byte) *GetUserRolesReqBuilder { - g.obj.Account = account - return g -} - -func (g *GetUserRolesReq) SetAccount(account []byte) *GetUserRolesReq { - g.Account = account - return g -} - -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 -} -type ChangePasswordReqBuilder struct { - obj *ChangePasswordReq -} - -func NewChangePasswordReqBuilder() *ChangePasswordReqBuilder{ - return &ChangePasswordReqBuilder{ - obj: NewChangePasswordReq(), - } -} - -func (p ChangePasswordReqBuilder) Emit() *ChangePasswordReq{ - return &ChangePasswordReq{ - Account: p.obj.Account, - NewEncodedPwd_: p.obj.NewEncodedPwd_, - OldEncodedPwd: p.obj.OldEncodedPwd, - } -} - -func (c *ChangePasswordReqBuilder) Account(account []byte) *ChangePasswordReqBuilder { - c.obj.Account = account - return c -} - -func (c *ChangePasswordReqBuilder) NewEncodedPwd_(newEncodedPwd []byte) *ChangePasswordReqBuilder { - c.obj.NewEncodedPwd_ = newEncodedPwd - return c -} - -func (c *ChangePasswordReqBuilder) OldEncodedPwd(oldEncodedPwd []byte) *ChangePasswordReqBuilder { - c.obj.OldEncodedPwd = oldEncodedPwd - return c -} - -func (c *ChangePasswordReq) SetAccount(account []byte) *ChangePasswordReq { - c.Account = account - return c -} - -func (c *ChangePasswordReq) SetNewEncodedPwd_(newEncodedPwd []byte) *ChangePasswordReq { - c.NewEncodedPwd_ = newEncodedPwd - return c -} - -func (c *ChangePasswordReq) SetOldEncodedPwd(oldEncodedPwd []byte) *ChangePasswordReq { - c.OldEncodedPwd = oldEncodedPwd - return c -} - -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: -// - Id -// - Command -// - Result_ -// - StartTime -// - StopTime -type BalanceTask struct { - Id []byte `thrift:"id,1" db:"id" json:"id"` - Command []byte `thrift:"command,2" db:"command" json:"command"` - Result_ TaskResult_ `thrift:"result,3" db:"result" json:"result"` - StartTime int64 `thrift:"start_time,4" db:"start_time" json:"start_time"` - StopTime int64 `thrift:"stop_time,5" db:"stop_time" json:"stop_time"` -} - -func NewBalanceTask() *BalanceTask { - return &BalanceTask{} -} - - -func (p *BalanceTask) GetId() []byte { - return p.Id -} - -func (p *BalanceTask) GetCommand() []byte { - return p.Command -} - -func (p *BalanceTask) GetResult_() TaskResult_ { - return p.Result_ -} - -func (p *BalanceTask) GetStartTime() int64 { - return p.StartTime -} - -func (p *BalanceTask) GetStopTime() int64 { - return p.StopTime -} -type BalanceTaskBuilder struct { - obj *BalanceTask -} - -func NewBalanceTaskBuilder() *BalanceTaskBuilder{ - return &BalanceTaskBuilder{ - obj: NewBalanceTask(), - } -} - -func (p BalanceTaskBuilder) Emit() *BalanceTask{ - return &BalanceTask{ - Id: p.obj.Id, - Command: p.obj.Command, - Result_: p.obj.Result_, - StartTime: p.obj.StartTime, - StopTime: p.obj.StopTime, - } -} - -func (b *BalanceTaskBuilder) Id(id []byte) *BalanceTaskBuilder { - b.obj.Id = id - return b -} - -func (b *BalanceTaskBuilder) Command(command []byte) *BalanceTaskBuilder { - b.obj.Command = command - return b -} - -func (b *BalanceTaskBuilder) Result_(result TaskResult_) *BalanceTaskBuilder { - b.obj.Result_ = result - return b -} - -func (b *BalanceTaskBuilder) StartTime(startTime int64) *BalanceTaskBuilder { - b.obj.StartTime = startTime - return b -} - -func (b *BalanceTaskBuilder) StopTime(stopTime int64) *BalanceTaskBuilder { - b.obj.StopTime = stopTime - return b -} - -func (b *BalanceTask) SetId(id []byte) *BalanceTask { - b.Id = id - return b -} - -func (b *BalanceTask) SetCommand(command []byte) *BalanceTask { - b.Command = command - return b -} - -func (b *BalanceTask) SetResult_(result TaskResult_) *BalanceTask { - b.Result_ = result - return b -} - -func (b *BalanceTask) SetStartTime(startTime int64) *BalanceTask { - b.StartTime = startTime - return b -} - -func (b *BalanceTask) SetStopTime(stopTime int64) *BalanceTask { - b.StopTime = stopTime - return b -} - -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 - } - 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 *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.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Command = v - } - return nil -} - -func (p *BalanceTask) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := TaskResult_(v) - p.Result_ = temp - } - return nil -} - -func (p *BalanceTask) 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 *BalanceTask) 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 *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 := 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 *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("command", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:command: ", p), err) } - if err := oprot.WriteBinary(p.Command); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.command (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:command: ", p), err) } - return err -} - -func (p *BalanceTask) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("result", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:result: ", p), err) } - if err := oprot.WriteI32(int32(p.Result_)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.result (3) field write error: ", p), 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 *BalanceTask) 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 *BalanceTask) 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 *BalanceTask) String() string { - if p == nil { - return "" - } - - idVal := fmt.Sprintf("%v", p.Id) - commandVal := fmt.Sprintf("%v", p.Command) - resultVal := fmt.Sprintf("%v", p.Result_) - startTimeVal := fmt.Sprintf("%v", p.StartTime) - stopTimeVal := fmt.Sprintf("%v", p.StopTime) - return fmt.Sprintf("BalanceTask({Id:%s Command:%s Result_:%s StartTime:%s StopTime:%s})", idVal, commandVal, resultVal, startTimeVal, stopTimeVal) -} - -// 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 -} - -type ConfigItemBuilder struct { - obj *ConfigItem -} - -func NewConfigItemBuilder() *ConfigItemBuilder{ - return &ConfigItemBuilder{ - obj: NewConfigItem(), - } -} - -func (p ConfigItemBuilder) Emit() *ConfigItem{ - return &ConfigItem{ - Module: p.obj.Module, - Name: p.obj.Name, - Mode: p.obj.Mode, - Value: p.obj.Value, - } -} - -func (c *ConfigItemBuilder) Module(module ConfigModule) *ConfigItemBuilder { - c.obj.Module = module - return c -} - -func (c *ConfigItemBuilder) Name(name []byte) *ConfigItemBuilder { - c.obj.Name = name - return c -} - -func (c *ConfigItemBuilder) Mode(mode ConfigMode) *ConfigItemBuilder { - c.obj.Mode = mode - return c -} - -func (c *ConfigItemBuilder) Value(value *nebula0.Value) *ConfigItemBuilder { - c.obj.Value = value - return c -} - -func (c *ConfigItem) SetModule(module ConfigModule) *ConfigItem { - c.Module = module - return c -} - -func (c *ConfigItem) SetName(name []byte) *ConfigItem { - c.Name = name - return c -} - -func (c *ConfigItem) SetMode(mode ConfigMode) *ConfigItem { - c.Mode = mode - return c -} - -func (c *ConfigItem) SetValue(value *nebula0.Value) *ConfigItem { - c.Value = value - return c -} - -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 -} -type RegConfigReqBuilder struct { - obj *RegConfigReq -} - -func NewRegConfigReqBuilder() *RegConfigReqBuilder{ - return &RegConfigReqBuilder{ - obj: NewRegConfigReq(), - } -} - -func (p RegConfigReqBuilder) Emit() *RegConfigReq{ - return &RegConfigReq{ - Items: p.obj.Items, - } -} - -func (r *RegConfigReqBuilder) Items(items []*ConfigItem) *RegConfigReqBuilder { - r.obj.Items = items - return r -} - -func (r *RegConfigReq) SetItems(items []*ConfigItem) *RegConfigReq { - r.Items = items - return r -} - -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 ++ { - _elem58 := NewConfigItem() - if err := _elem58.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem58), err) - } - p.Items = append(p.Items, _elem58) - } - 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 -} - -type GetConfigReqBuilder struct { - obj *GetConfigReq -} - -func NewGetConfigReqBuilder() *GetConfigReqBuilder{ - return &GetConfigReqBuilder{ - obj: NewGetConfigReq(), - } -} - -func (p GetConfigReqBuilder) Emit() *GetConfigReq{ - return &GetConfigReq{ - Item: p.obj.Item, - } -} - -func (g *GetConfigReqBuilder) Item(item *ConfigItem) *GetConfigReqBuilder { - g.obj.Item = item - return g -} - -func (g *GetConfigReq) SetItem(item *ConfigItem) *GetConfigReq { - g.Item = item - return g -} - -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 -} - -type GetConfigRespBuilder struct { - obj *GetConfigResp -} - -func NewGetConfigRespBuilder() *GetConfigRespBuilder{ - return &GetConfigRespBuilder{ - obj: NewGetConfigResp(), - } -} - -func (p GetConfigRespBuilder) Emit() *GetConfigResp{ - return &GetConfigResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Items: p.obj.Items, - } -} - -func (g *GetConfigRespBuilder) Code(code nebula0.ErrorCode) *GetConfigRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetConfigRespBuilder) Leader(leader *nebula0.HostAddr) *GetConfigRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetConfigRespBuilder) Items(items []*ConfigItem) *GetConfigRespBuilder { - g.obj.Items = items - return g -} - -func (g *GetConfigResp) SetCode(code nebula0.ErrorCode) *GetConfigResp { - g.Code = code - return g -} - -func (g *GetConfigResp) SetLeader(leader *nebula0.HostAddr) *GetConfigResp { - g.Leader = leader - return g -} - -func (g *GetConfigResp) SetItems(items []*ConfigItem) *GetConfigResp { - g.Items = items - return g -} - -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 ++ { - _elem59 := NewConfigItem() - if err := _elem59.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) - } - p.Items = append(p.Items, _elem59) - } - 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 -} - -type SetConfigReqBuilder struct { - obj *SetConfigReq -} - -func NewSetConfigReqBuilder() *SetConfigReqBuilder{ - return &SetConfigReqBuilder{ - obj: NewSetConfigReq(), - } -} - -func (p SetConfigReqBuilder) Emit() *SetConfigReq{ - return &SetConfigReq{ - Item: p.obj.Item, - } -} - -func (s *SetConfigReqBuilder) Item(item *ConfigItem) *SetConfigReqBuilder { - s.obj.Item = item - return s -} - -func (s *SetConfigReq) SetItem(item *ConfigItem) *SetConfigReq { - s.Item = item - return s -} - -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 -} -type ListConfigsReqBuilder struct { - obj *ListConfigsReq -} - -func NewListConfigsReqBuilder() *ListConfigsReqBuilder{ - return &ListConfigsReqBuilder{ - obj: NewListConfigsReq(), - } -} - -func (p ListConfigsReqBuilder) Emit() *ListConfigsReq{ - return &ListConfigsReq{ - Space: p.obj.Space, - Module: p.obj.Module, - } -} - -func (l *ListConfigsReqBuilder) Space(space []byte) *ListConfigsReqBuilder { - l.obj.Space = space - return l -} - -func (l *ListConfigsReqBuilder) Module(module ConfigModule) *ListConfigsReqBuilder { - l.obj.Module = module - return l -} - -func (l *ListConfigsReq) SetSpace(space []byte) *ListConfigsReq { - l.Space = space - return l -} - -func (l *ListConfigsReq) SetModule(module ConfigModule) *ListConfigsReq { - l.Module = module - return l -} - -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 -} - -type ListConfigsRespBuilder struct { - obj *ListConfigsResp -} - -func NewListConfigsRespBuilder() *ListConfigsRespBuilder{ - return &ListConfigsRespBuilder{ - obj: NewListConfigsResp(), - } -} - -func (p ListConfigsRespBuilder) Emit() *ListConfigsResp{ - return &ListConfigsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Items: p.obj.Items, - } -} - -func (l *ListConfigsRespBuilder) Code(code nebula0.ErrorCode) *ListConfigsRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListConfigsRespBuilder) Leader(leader *nebula0.HostAddr) *ListConfigsRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListConfigsRespBuilder) Items(items []*ConfigItem) *ListConfigsRespBuilder { - l.obj.Items = items - return l -} - -func (l *ListConfigsResp) SetCode(code nebula0.ErrorCode) *ListConfigsResp { - l.Code = code - return l -} - -func (l *ListConfigsResp) SetLeader(leader *nebula0.HostAddr) *ListConfigsResp { - l.Leader = leader - return l -} - -func (l *ListConfigsResp) SetItems(items []*ConfigItem) *ListConfigsResp { - l.Items = items - return l -} - -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 ++ { - _elem60 := NewConfigItem() - if err := _elem60.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) - } - p.Items = append(p.Items, _elem60) - } - 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{} -} - -type CreateSnapshotReqBuilder struct { - obj *CreateSnapshotReq -} - -func NewCreateSnapshotReqBuilder() *CreateSnapshotReqBuilder{ - return &CreateSnapshotReqBuilder{ - obj: NewCreateSnapshotReq(), - } -} - -func (p CreateSnapshotReqBuilder) Emit() *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: -// - Names -type DropSnapshotReq struct { - Names [][]byte `thrift:"names,1" db:"names" json:"names"` -} - -func NewDropSnapshotReq() *DropSnapshotReq { - return &DropSnapshotReq{} -} - - -func (p *DropSnapshotReq) GetNames() [][]byte { - return p.Names -} -type DropSnapshotReqBuilder struct { - obj *DropSnapshotReq -} - -func NewDropSnapshotReqBuilder() *DropSnapshotReqBuilder{ - return &DropSnapshotReqBuilder{ - obj: NewDropSnapshotReq(), - } -} - -func (p DropSnapshotReqBuilder) Emit() *DropSnapshotReq{ - return &DropSnapshotReq{ - Names: p.obj.Names, - } -} - -func (d *DropSnapshotReqBuilder) Names(names [][]byte) *DropSnapshotReqBuilder { - d.obj.Names = names - return d -} - -func (d *DropSnapshotReq) SetNames(names [][]byte) *DropSnapshotReq { - d.Names = names - return d -} - -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 { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - p.Names = tSlice - for i := 0; i < size; i ++ { - var _elem61 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem61 = v - } - p.Names = append(p.Names, _elem61) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -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("names", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:names: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Names)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Names { - if err := oprot.WriteBinary(v); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:names: ", p), err) } - return err -} - -func (p *DropSnapshotReq) String() string { - if p == nil { - return "" - } - - namesVal := fmt.Sprintf("%v", p.Names) - return fmt.Sprintf("DropSnapshotReq({Names:%s})", namesVal) -} - -type ListSnapshotsReq struct { -} - -func NewListSnapshotsReq() *ListSnapshotsReq { - return &ListSnapshotsReq{} -} - -type ListSnapshotsReqBuilder struct { - obj *ListSnapshotsReq -} - -func NewListSnapshotsReqBuilder() *ListSnapshotsReqBuilder{ - return &ListSnapshotsReqBuilder{ - obj: NewListSnapshotsReq(), - } -} - -func (p ListSnapshotsReqBuilder) Emit() *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 -} -type SnapshotBuilder struct { - obj *Snapshot -} - -func NewSnapshotBuilder() *SnapshotBuilder{ - return &SnapshotBuilder{ - obj: NewSnapshot(), - } -} - -func (p SnapshotBuilder) Emit() *Snapshot{ - return &Snapshot{ - Name: p.obj.Name, - Status: p.obj.Status, - Hosts: p.obj.Hosts, - } -} - -func (s *SnapshotBuilder) Name(name []byte) *SnapshotBuilder { - s.obj.Name = name - return s -} - -func (s *SnapshotBuilder) Status(status SnapshotStatus) *SnapshotBuilder { - s.obj.Status = status - return s -} - -func (s *SnapshotBuilder) Hosts(hosts []byte) *SnapshotBuilder { - s.obj.Hosts = hosts - return s -} - -func (s *Snapshot) SetName(name []byte) *Snapshot { - s.Name = name - return s -} - -func (s *Snapshot) SetStatus(status SnapshotStatus) *Snapshot { - s.Status = status - return s -} - -func (s *Snapshot) SetHosts(hosts []byte) *Snapshot { - s.Hosts = hosts - return s -} - -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 -} - -type ListSnapshotsRespBuilder struct { - obj *ListSnapshotsResp -} - -func NewListSnapshotsRespBuilder() *ListSnapshotsRespBuilder{ - return &ListSnapshotsRespBuilder{ - obj: NewListSnapshotsResp(), - } -} - -func (p ListSnapshotsRespBuilder) Emit() *ListSnapshotsResp{ - return &ListSnapshotsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Snapshots: p.obj.Snapshots, - } -} - -func (l *ListSnapshotsRespBuilder) Code(code nebula0.ErrorCode) *ListSnapshotsRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListSnapshotsRespBuilder) Leader(leader *nebula0.HostAddr) *ListSnapshotsRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListSnapshotsRespBuilder) Snapshots(snapshots []*Snapshot) *ListSnapshotsRespBuilder { - l.obj.Snapshots = snapshots - return l -} - -func (l *ListSnapshotsResp) SetCode(code nebula0.ErrorCode) *ListSnapshotsResp { - l.Code = code - return l -} - -func (l *ListSnapshotsResp) SetLeader(leader *nebula0.HostAddr) *ListSnapshotsResp { - l.Leader = leader - return l -} - -func (l *ListSnapshotsResp) SetSnapshots(snapshots []*Snapshot) *ListSnapshotsResp { - l.Snapshots = snapshots - return l -} - -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 ++ { - _elem62 := NewSnapshot() - if err := _elem62.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem62), err) - } - p.Snapshots = append(p.Snapshots, _elem62) - } - 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 -} -type ListIndexStatusReqBuilder struct { - obj *ListIndexStatusReq -} - -func NewListIndexStatusReqBuilder() *ListIndexStatusReqBuilder{ - return &ListIndexStatusReqBuilder{ - obj: NewListIndexStatusReq(), - } -} - -func (p ListIndexStatusReqBuilder) Emit() *ListIndexStatusReq{ - return &ListIndexStatusReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (l *ListIndexStatusReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListIndexStatusReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListIndexStatusReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListIndexStatusReq { - l.SpaceID = spaceID - return l -} - -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 -} -type IndexStatusBuilder struct { - obj *IndexStatus -} - -func NewIndexStatusBuilder() *IndexStatusBuilder{ - return &IndexStatusBuilder{ - obj: NewIndexStatus(), - } -} - -func (p IndexStatusBuilder) Emit() *IndexStatus{ - return &IndexStatus{ - Name: p.obj.Name, - Status: p.obj.Status, - } -} - -func (i *IndexStatusBuilder) Name(name []byte) *IndexStatusBuilder { - i.obj.Name = name - return i -} - -func (i *IndexStatusBuilder) Status(status []byte) *IndexStatusBuilder { - i.obj.Status = status - return i -} - -func (i *IndexStatus) SetName(name []byte) *IndexStatus { - i.Name = name - return i -} - -func (i *IndexStatus) SetStatus(status []byte) *IndexStatus { - i.Status = status - return i -} - -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 -} - -type ListIndexStatusRespBuilder struct { - obj *ListIndexStatusResp -} - -func NewListIndexStatusRespBuilder() *ListIndexStatusRespBuilder{ - return &ListIndexStatusRespBuilder{ - obj: NewListIndexStatusResp(), - } -} - -func (p ListIndexStatusRespBuilder) Emit() *ListIndexStatusResp{ - return &ListIndexStatusResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Statuses: p.obj.Statuses, - } -} - -func (l *ListIndexStatusRespBuilder) Code(code nebula0.ErrorCode) *ListIndexStatusRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListIndexStatusRespBuilder) Leader(leader *nebula0.HostAddr) *ListIndexStatusRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListIndexStatusRespBuilder) Statuses(statuses []*IndexStatus) *ListIndexStatusRespBuilder { - l.obj.Statuses = statuses - return l -} - -func (l *ListIndexStatusResp) SetCode(code nebula0.ErrorCode) *ListIndexStatusResp { - l.Code = code - return l -} - -func (l *ListIndexStatusResp) SetLeader(leader *nebula0.HostAddr) *ListIndexStatusResp { - l.Leader = leader - return l -} - -func (l *ListIndexStatusResp) SetStatuses(statuses []*IndexStatus) *ListIndexStatusResp { - l.Statuses = statuses - return l -} - -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 ++ { - _elem63 := NewIndexStatus() - if err := _elem63.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem63), err) - } - p.Statuses = append(p.Statuses, _elem63) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *ListIndexStatusResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ListIndexStatusResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ListIndexStatusResp) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } - if err := oprot.WriteI32(int32(p.Code)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } - return err -} - -func (p *ListIndexStatusResp) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } - if err := p.Leader.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } - return err -} - -func (p *ListIndexStatusResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("statuses", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:statuses: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Statuses)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Statuses { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:statuses: ", p), err) } - return err -} - -func (p *ListIndexStatusResp) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - var leaderVal string - if p.Leader == nil { - leaderVal = "" - } else { - leaderVal = fmt.Sprintf("%v", p.Leader) - } - statusesVal := fmt.Sprintf("%v", p.Statuses) - return fmt.Sprintf("ListIndexStatusResp({Code:%s Leader:%s Statuses:%s})", codeVal, leaderVal, statusesVal) -} - -// Attributes: -// - Zones -// - ZoneName -type MergeZoneReq struct { - Zones [][]byte `thrift:"zones,1" db:"zones" json:"zones"` - ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` -} - -func NewMergeZoneReq() *MergeZoneReq { - return &MergeZoneReq{} -} - - -func (p *MergeZoneReq) GetZones() [][]byte { - return p.Zones -} - -func (p *MergeZoneReq) GetZoneName() []byte { - return p.ZoneName -} -type MergeZoneReqBuilder struct { - obj *MergeZoneReq -} - -func NewMergeZoneReqBuilder() *MergeZoneReqBuilder{ - return &MergeZoneReqBuilder{ - obj: NewMergeZoneReq(), - } -} - -func (p MergeZoneReqBuilder) Emit() *MergeZoneReq{ - return &MergeZoneReq{ - Zones: p.obj.Zones, - ZoneName: p.obj.ZoneName, - } -} - -func (m *MergeZoneReqBuilder) Zones(zones [][]byte) *MergeZoneReqBuilder { - m.obj.Zones = zones - return m -} - -func (m *MergeZoneReqBuilder) ZoneName(zoneName []byte) *MergeZoneReqBuilder { - m.obj.ZoneName = zoneName - return m -} - -func (m *MergeZoneReq) SetZones(zones [][]byte) *MergeZoneReq { - m.Zones = zones - return m -} - -func (m *MergeZoneReq) SetZoneName(zoneName []byte) *MergeZoneReq { - m.ZoneName = zoneName - return m -} - -func (p *MergeZoneReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *MergeZoneReq) ReadField1(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - p.Zones = tSlice - for i := 0; i < size; i ++ { - var _elem64 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem64 = v - } - p.Zones = append(p.Zones, _elem64) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *MergeZoneReq) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.ZoneName = v - } - return nil -} - -func (p *MergeZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("MergeZoneReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *MergeZoneReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("zones", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:zones: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.Zones)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Zones { - if err := oprot.WriteBinary(v); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:zones: ", p), err) } - return err -} - -func (p *MergeZoneReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } - if err := oprot.WriteBinary(p.ZoneName); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.zone_name (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:zone_name: ", p), err) } - return err -} - -func (p *MergeZoneReq) String() string { - if p == nil { - return "" - } - - zonesVal := fmt.Sprintf("%v", p.Zones) - zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - return fmt.Sprintf("MergeZoneReq({Zones:%s ZoneName:%s})", zonesVal, zoneNameVal) -} - -// 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 -} -type DropZoneReqBuilder struct { - obj *DropZoneReq -} - -func NewDropZoneReqBuilder() *DropZoneReqBuilder{ - return &DropZoneReqBuilder{ - obj: NewDropZoneReq(), - } -} - -func (p DropZoneReqBuilder) Emit() *DropZoneReq{ - return &DropZoneReq{ - ZoneName: p.obj.ZoneName, - } -} - -func (d *DropZoneReqBuilder) ZoneName(zoneName []byte) *DropZoneReqBuilder { - d.obj.ZoneName = zoneName - return d -} - -func (d *DropZoneReq) SetZoneName(zoneName []byte) *DropZoneReq { - d.ZoneName = zoneName - return d -} - -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: -// - ZoneName -// - ZoneItems -type DivideZoneReq struct { - ZoneName []byte `thrift:"zone_name,1" db:"zone_name" json:"zone_name"` - ZoneItems map[string][]*nebula0.HostAddr `thrift:"zone_items,2" db:"zone_items" json:"zone_items"` -} - -func NewDivideZoneReq() *DivideZoneReq { - return &DivideZoneReq{} -} - - -func (p *DivideZoneReq) GetZoneName() []byte { - return p.ZoneName -} - -func (p *DivideZoneReq) GetZoneItems() map[string][]*nebula0.HostAddr { - return p.ZoneItems -} -type DivideZoneReqBuilder struct { - obj *DivideZoneReq -} - -func NewDivideZoneReqBuilder() *DivideZoneReqBuilder{ - return &DivideZoneReqBuilder{ - obj: NewDivideZoneReq(), - } -} - -func (p DivideZoneReqBuilder) Emit() *DivideZoneReq{ - return &DivideZoneReq{ - ZoneName: p.obj.ZoneName, - ZoneItems: p.obj.ZoneItems, - } -} - -func (d *DivideZoneReqBuilder) ZoneName(zoneName []byte) *DivideZoneReqBuilder { - d.obj.ZoneName = zoneName - return d -} - -func (d *DivideZoneReqBuilder) ZoneItems(zoneItems map[string][]*nebula0.HostAddr) *DivideZoneReqBuilder { - d.obj.ZoneItems = zoneItems - return d -} - -func (d *DivideZoneReq) SetZoneName(zoneName []byte) *DivideZoneReq { - d.ZoneName = zoneName - return d -} - -func (d *DivideZoneReq) SetZoneItems(zoneItems map[string][]*nebula0.HostAddr) *DivideZoneReq { - d.ZoneItems = zoneItems - return d -} - -func (p *DivideZoneReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *DivideZoneReq) 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 *DivideZoneReq) ReadField2(iprot thrift.Protocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string][]*nebula0.HostAddr, size) - p.ZoneItems = tMap - for i := 0; i < size; i ++ { - var _key65 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key65 = v - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.HostAddr, 0, size) - _val66 := 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) - } - _val66 = append(_val66, _elem67) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.ZoneItems[_key65] = _val66 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *DivideZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("DivideZoneReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *DivideZoneReq) 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 *DivideZoneReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("zone_items", thrift.MAP, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_items: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.ZoneItems)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.ZoneItems { - 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.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:zone_items: ", p), err) } - return err -} - -func (p *DivideZoneReq) String() string { - if p == nil { - return "" - } - - zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - zoneItemsVal := fmt.Sprintf("%v", p.ZoneItems) - return fmt.Sprintf("DivideZoneReq({ZoneName:%s ZoneItems:%s})", zoneNameVal, zoneItemsVal) -} - -// Attributes: -// - OriginalZoneName -// - ZoneName -type RenameZoneReq struct { - OriginalZoneName []byte `thrift:"original_zone_name,1" db:"original_zone_name" json:"original_zone_name"` - ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` -} - -func NewRenameZoneReq() *RenameZoneReq { - return &RenameZoneReq{} -} - - -func (p *RenameZoneReq) GetOriginalZoneName() []byte { - return p.OriginalZoneName -} - -func (p *RenameZoneReq) GetZoneName() []byte { - return p.ZoneName -} -type RenameZoneReqBuilder struct { - obj *RenameZoneReq -} - -func NewRenameZoneReqBuilder() *RenameZoneReqBuilder{ - return &RenameZoneReqBuilder{ - obj: NewRenameZoneReq(), - } -} - -func (p RenameZoneReqBuilder) Emit() *RenameZoneReq{ - return &RenameZoneReq{ - OriginalZoneName: p.obj.OriginalZoneName, - ZoneName: p.obj.ZoneName, - } -} - -func (r *RenameZoneReqBuilder) OriginalZoneName(originalZoneName []byte) *RenameZoneReqBuilder { - r.obj.OriginalZoneName = originalZoneName - return r -} - -func (r *RenameZoneReqBuilder) ZoneName(zoneName []byte) *RenameZoneReqBuilder { - r.obj.ZoneName = zoneName - return r -} - -func (r *RenameZoneReq) SetOriginalZoneName(originalZoneName []byte) *RenameZoneReq { - r.OriginalZoneName = originalZoneName - return r -} - -func (r *RenameZoneReq) SetZoneName(zoneName []byte) *RenameZoneReq { - r.ZoneName = zoneName - return r -} - -func (p *RenameZoneReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *RenameZoneReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.OriginalZoneName = v - } - return nil -} - -func (p *RenameZoneReq) 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 *RenameZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("RenameZoneReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *RenameZoneReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("original_zone_name", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:original_zone_name: ", p), err) } - if err := oprot.WriteBinary(p.OriginalZoneName); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.original_zone_name (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:original_zone_name: ", p), err) } - return err -} - -func (p *RenameZoneReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } - if err := oprot.WriteBinary(p.ZoneName); err != nil { - 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 *RenameZoneReq) String() string { - if p == nil { - return "" - } - - originalZoneNameVal := fmt.Sprintf("%v", p.OriginalZoneName) - zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - return fmt.Sprintf("RenameZoneReq({OriginalZoneName:%s ZoneName:%s})", originalZoneNameVal, zoneNameVal) -} - -// Attributes: -// - Hosts -// - ZoneName -// - IsNew -type AddHostsIntoZoneReq struct { - Hosts []*nebula0.HostAddr `thrift:"hosts,1" db:"hosts" json:"hosts"` - ZoneName []byte `thrift:"zone_name,2" db:"zone_name" json:"zone_name"` - IsNew bool `thrift:"is_new,3" db:"is_new" json:"is_new"` -} - -func NewAddHostsIntoZoneReq() *AddHostsIntoZoneReq { - return &AddHostsIntoZoneReq{} -} - - -func (p *AddHostsIntoZoneReq) GetHosts() []*nebula0.HostAddr { - return p.Hosts -} - -func (p *AddHostsIntoZoneReq) GetZoneName() []byte { - return p.ZoneName -} - -func (p *AddHostsIntoZoneReq) GetIsNew() bool { - return p.IsNew -} -type AddHostsIntoZoneReqBuilder struct { - obj *AddHostsIntoZoneReq -} - -func NewAddHostsIntoZoneReqBuilder() *AddHostsIntoZoneReqBuilder{ - return &AddHostsIntoZoneReqBuilder{ - obj: NewAddHostsIntoZoneReq(), - } -} - -func (p AddHostsIntoZoneReqBuilder) Emit() *AddHostsIntoZoneReq{ - return &AddHostsIntoZoneReq{ - Hosts: p.obj.Hosts, - ZoneName: p.obj.ZoneName, - IsNew: p.obj.IsNew, - } -} - -func (a *AddHostsIntoZoneReqBuilder) Hosts(hosts []*nebula0.HostAddr) *AddHostsIntoZoneReqBuilder { - a.obj.Hosts = hosts - return a -} - -func (a *AddHostsIntoZoneReqBuilder) ZoneName(zoneName []byte) *AddHostsIntoZoneReqBuilder { - a.obj.ZoneName = zoneName - return a -} - -func (a *AddHostsIntoZoneReqBuilder) IsNew(isNew bool) *AddHostsIntoZoneReqBuilder { - a.obj.IsNew = isNew - return a -} - -func (a *AddHostsIntoZoneReq) SetHosts(hosts []*nebula0.HostAddr) *AddHostsIntoZoneReq { - a.Hosts = hosts - return a -} - -func (a *AddHostsIntoZoneReq) SetZoneName(zoneName []byte) *AddHostsIntoZoneReq { - a.ZoneName = zoneName - return a -} - -func (a *AddHostsIntoZoneReq) SetIsNew(isNew bool) *AddHostsIntoZoneReq { - a.IsNew = isNew - return a -} - -func (p *AddHostsIntoZoneReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AddHostsIntoZoneReq) ReadField1(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.HostAddr, 0, size) - p.Hosts = tSlice - for i := 0; i < size; i ++ { - _elem68 := nebula0.NewHostAddr() - if err := _elem68.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem68), err) - } - p.Hosts = append(p.Hosts, _elem68) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *AddHostsIntoZoneReq) 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 *AddHostsIntoZoneReq) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.IsNew = v - } - return nil -} - -func (p *AddHostsIntoZoneReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AddHostsIntoZoneReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *AddHostsIntoZoneReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:hosts: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Hosts)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Hosts { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:hosts: ", p), err) } - return err -} - -func (p *AddHostsIntoZoneReq) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("zone_name", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:zone_name: ", p), err) } - if err := oprot.WriteBinary(p.ZoneName); err != nil { - 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 *AddHostsIntoZoneReq) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("is_new", thrift.BOOL, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:is_new: ", p), err) } - if err := oprot.WriteBool(bool(p.IsNew)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.is_new (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:is_new: ", p), err) } - return err -} - -func (p *AddHostsIntoZoneReq) String() string { - if p == nil { - return "" - } - - hostsVal := fmt.Sprintf("%v", p.Hosts) - zoneNameVal := fmt.Sprintf("%v", p.ZoneName) - isNewVal := fmt.Sprintf("%v", p.IsNew) - return fmt.Sprintf("AddHostsIntoZoneReq({Hosts:%s ZoneName:%s IsNew:%s})", hostsVal, zoneNameVal, isNewVal) -} - -// 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 -} -type GetZoneReqBuilder struct { - obj *GetZoneReq -} - -func NewGetZoneReqBuilder() *GetZoneReqBuilder{ - return &GetZoneReqBuilder{ - obj: NewGetZoneReq(), - } -} - -func (p GetZoneReqBuilder) Emit() *GetZoneReq{ - return &GetZoneReq{ - ZoneName: p.obj.ZoneName, - } -} - -func (g *GetZoneReqBuilder) ZoneName(zoneName []byte) *GetZoneReqBuilder { - g.obj.ZoneName = zoneName - return g -} - -func (g *GetZoneReq) SetZoneName(zoneName []byte) *GetZoneReq { - g.ZoneName = zoneName - return g -} - -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 -} - -type GetZoneRespBuilder struct { - obj *GetZoneResp -} - -func NewGetZoneRespBuilder() *GetZoneRespBuilder{ - return &GetZoneRespBuilder{ - obj: NewGetZoneResp(), - } -} - -func (p GetZoneRespBuilder) Emit() *GetZoneResp{ - return &GetZoneResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Hosts: p.obj.Hosts, - } -} - -func (g *GetZoneRespBuilder) Code(code nebula0.ErrorCode) *GetZoneRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetZoneRespBuilder) Leader(leader *nebula0.HostAddr) *GetZoneRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetZoneRespBuilder) Hosts(hosts []*nebula0.HostAddr) *GetZoneRespBuilder { - g.obj.Hosts = hosts - return g -} - -func (g *GetZoneResp) SetCode(code nebula0.ErrorCode) *GetZoneResp { - g.Code = code - return g -} - -func (g *GetZoneResp) SetLeader(leader *nebula0.HostAddr) *GetZoneResp { - g.Leader = leader - return g -} - -func (g *GetZoneResp) SetHosts(hosts []*nebula0.HostAddr) *GetZoneResp { - g.Hosts = hosts - return g -} - -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 ++ { - _elem69 := nebula0.NewHostAddr() - if err := _elem69.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem69), err) - } - p.Hosts = append(p.Hosts, _elem69) - } - 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{} -} - -type ListZonesReqBuilder struct { - obj *ListZonesReq -} - -func NewListZonesReqBuilder() *ListZonesReqBuilder{ - return &ListZonesReqBuilder{ - obj: NewListZonesReq(), - } -} - -func (p ListZonesReqBuilder) Emit() *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 -} -type ZoneBuilder struct { - obj *Zone -} - -func NewZoneBuilder() *ZoneBuilder{ - return &ZoneBuilder{ - obj: NewZone(), - } -} - -func (p ZoneBuilder) Emit() *Zone{ - return &Zone{ - ZoneName: p.obj.ZoneName, - Nodes: p.obj.Nodes, - } -} - -func (z *ZoneBuilder) ZoneName(zoneName []byte) *ZoneBuilder { - z.obj.ZoneName = zoneName - return z -} - -func (z *ZoneBuilder) Nodes(nodes []*nebula0.HostAddr) *ZoneBuilder { - z.obj.Nodes = nodes - return z -} - -func (z *Zone) SetZoneName(zoneName []byte) *Zone { - z.ZoneName = zoneName - return z -} - -func (z *Zone) SetNodes(nodes []*nebula0.HostAddr) *Zone { - z.Nodes = nodes - return z -} - -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 ++ { - _elem70 := nebula0.NewHostAddr() - if err := _elem70.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem70), err) - } - p.Nodes = append(p.Nodes, _elem70) - } - 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 -} - -type ListZonesRespBuilder struct { - obj *ListZonesResp -} - -func NewListZonesRespBuilder() *ListZonesRespBuilder{ - return &ListZonesRespBuilder{ - obj: NewListZonesResp(), - } -} - -func (p ListZonesRespBuilder) Emit() *ListZonesResp{ - return &ListZonesResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Zones: p.obj.Zones, - } -} - -func (l *ListZonesRespBuilder) Code(code nebula0.ErrorCode) *ListZonesRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListZonesRespBuilder) Leader(leader *nebula0.HostAddr) *ListZonesRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListZonesRespBuilder) Zones(zones []*Zone) *ListZonesRespBuilder { - l.obj.Zones = zones - return l -} - -func (l *ListZonesResp) SetCode(code nebula0.ErrorCode) *ListZonesResp { - l.Code = code - return l -} - -func (l *ListZonesResp) SetLeader(leader *nebula0.HostAddr) *ListZonesResp { - l.Leader = leader - return l -} - -func (l *ListZonesResp) SetZones(zones []*Zone) *ListZonesResp { - l.Zones = zones - return l -} - -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 ++ { - _elem71 := NewZone() - if err := _elem71.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem71), err) - } - p.Zones = append(p.Zones, _elem71) - } - 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: -// - 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 -} -type AddListenerReqBuilder struct { - obj *AddListenerReq -} - -func NewAddListenerReqBuilder() *AddListenerReqBuilder{ - return &AddListenerReqBuilder{ - obj: NewAddListenerReq(), - } -} - -func (p AddListenerReqBuilder) Emit() *AddListenerReq{ - return &AddListenerReq{ - SpaceID: p.obj.SpaceID, - Type: p.obj.Type, - Hosts: p.obj.Hosts, - } -} - -func (a *AddListenerReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AddListenerReqBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AddListenerReqBuilder) Type(type_a1 ListenerType) *AddListenerReqBuilder { - a.obj.Type = type_a1 - return a -} - -func (a *AddListenerReqBuilder) Hosts(hosts []*nebula0.HostAddr) *AddListenerReqBuilder { - a.obj.Hosts = hosts - return a -} - -func (a *AddListenerReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *AddListenerReq { - a.SpaceID = spaceID - return a -} - -func (a *AddListenerReq) SetType(type_a1 ListenerType) *AddListenerReq { - a.Type = type_a1 - return a -} - -func (a *AddListenerReq) SetHosts(hosts []*nebula0.HostAddr) *AddListenerReq { - a.Hosts = hosts - return a -} - -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 ++ { - _elem72 := nebula0.NewHostAddr() - if err := _elem72.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem72), err) - } - p.Hosts = append(p.Hosts, _elem72) - } - 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 -} -type RemoveListenerReqBuilder struct { - obj *RemoveListenerReq -} - -func NewRemoveListenerReqBuilder() *RemoveListenerReqBuilder{ - return &RemoveListenerReqBuilder{ - obj: NewRemoveListenerReq(), - } -} - -func (p RemoveListenerReqBuilder) Emit() *RemoveListenerReq{ - return &RemoveListenerReq{ - SpaceID: p.obj.SpaceID, - Type: p.obj.Type, - } -} - -func (r *RemoveListenerReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *RemoveListenerReqBuilder { - r.obj.SpaceID = spaceID - return r -} - -func (r *RemoveListenerReqBuilder) Type(type_a1 ListenerType) *RemoveListenerReqBuilder { - r.obj.Type = type_a1 - return r -} - -func (r *RemoveListenerReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *RemoveListenerReq { - r.SpaceID = spaceID - return r -} - -func (r *RemoveListenerReq) SetType(type_a1 ListenerType) *RemoveListenerReq { - r.Type = type_a1 - return r -} - -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 -} -type ListListenerReqBuilder struct { - obj *ListListenerReq -} - -func NewListListenerReqBuilder() *ListListenerReqBuilder{ - return &ListListenerReqBuilder{ - obj: NewListListenerReq(), - } -} - -func (p ListListenerReqBuilder) Emit() *ListListenerReq{ - return &ListListenerReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (l *ListListenerReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ListListenerReqBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *ListListenerReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ListListenerReq { - l.SpaceID = spaceID - return l -} - -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 -} - -type ListenerInfoBuilder struct { - obj *ListenerInfo -} - -func NewListenerInfoBuilder() *ListenerInfoBuilder{ - return &ListenerInfoBuilder{ - obj: NewListenerInfo(), - } -} - -func (p ListenerInfoBuilder) Emit() *ListenerInfo{ - return &ListenerInfo{ - Type: p.obj.Type, - Host: p.obj.Host, - PartID: p.obj.PartID, - Status: p.obj.Status, - } -} - -func (l *ListenerInfoBuilder) Type(type_a1 ListenerType) *ListenerInfoBuilder { - l.obj.Type = type_a1 - return l -} - -func (l *ListenerInfoBuilder) Host(host *nebula0.HostAddr) *ListenerInfoBuilder { - l.obj.Host = host - return l -} - -func (l *ListenerInfoBuilder) PartID(partID nebula0.PartitionID) *ListenerInfoBuilder { - l.obj.PartID = partID - return l -} - -func (l *ListenerInfoBuilder) Status(status HostStatus) *ListenerInfoBuilder { - l.obj.Status = status - return l -} - -func (l *ListenerInfo) SetType(type_a1 ListenerType) *ListenerInfo { - l.Type = type_a1 - return l -} - -func (l *ListenerInfo) SetHost(host *nebula0.HostAddr) *ListenerInfo { - l.Host = host - return l -} - -func (l *ListenerInfo) SetPartID(partID nebula0.PartitionID) *ListenerInfo { - l.PartID = partID - return l -} - -func (l *ListenerInfo) SetStatus(status HostStatus) *ListenerInfo { - l.Status = status - return l -} - -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 -} - -type ListListenerRespBuilder struct { - obj *ListListenerResp -} - -func NewListListenerRespBuilder() *ListListenerRespBuilder{ - return &ListListenerRespBuilder{ - obj: NewListListenerResp(), - } -} - -func (p ListListenerRespBuilder) Emit() *ListListenerResp{ - return &ListListenerResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Listeners: p.obj.Listeners, - } -} - -func (l *ListListenerRespBuilder) Code(code nebula0.ErrorCode) *ListListenerRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListListenerRespBuilder) Leader(leader *nebula0.HostAddr) *ListListenerRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListListenerRespBuilder) Listeners(listeners []*ListenerInfo) *ListListenerRespBuilder { - l.obj.Listeners = listeners - return l -} - -func (l *ListListenerResp) SetCode(code nebula0.ErrorCode) *ListListenerResp { - l.Code = code - return l -} - -func (l *ListListenerResp) SetLeader(leader *nebula0.HostAddr) *ListListenerResp { - l.Leader = leader - return l -} - -func (l *ListListenerResp) SetListeners(listeners []*ListenerInfo) *ListListenerResp { - l.Listeners = listeners - return l -} - -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 ++ { - _elem73 := NewListenerInfo() - if err := _elem73.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem73), err) - } - p.Listeners = append(p.Listeners, _elem73) - } - 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 -} -type GetStatsReqBuilder struct { - obj *GetStatsReq -} - -func NewGetStatsReqBuilder() *GetStatsReqBuilder{ - return &GetStatsReqBuilder{ - obj: NewGetStatsReq(), - } -} - -func (p GetStatsReqBuilder) Emit() *GetStatsReq{ - return &GetStatsReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (g *GetStatsReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetStatsReqBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetStatsReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetStatsReq { - g.SpaceID = spaceID - return g -} - -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 -} - -type GetStatsRespBuilder struct { - obj *GetStatsResp -} - -func NewGetStatsRespBuilder() *GetStatsRespBuilder{ - return &GetStatsRespBuilder{ - obj: NewGetStatsResp(), - } -} - -func (p GetStatsRespBuilder) Emit() *GetStatsResp{ - return &GetStatsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Stats: p.obj.Stats, - } -} - -func (g *GetStatsRespBuilder) Code(code nebula0.ErrorCode) *GetStatsRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetStatsRespBuilder) Leader(leader *nebula0.HostAddr) *GetStatsRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetStatsRespBuilder) Stats(stats *StatsItem) *GetStatsRespBuilder { - g.obj.Stats = stats - return g -} - -func (g *GetStatsResp) SetCode(code nebula0.ErrorCode) *GetStatsResp { - g.Code = code - return g -} - -func (g *GetStatsResp) SetLeader(leader *nebula0.HostAddr) *GetStatsResp { - g.Leader = leader - return g -} - -func (g *GetStatsResp) SetStats(stats *StatsItem) *GetStatsResp { - g.Stats = stats - return g -} - -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 -// - Checkpoints -type HostBackupInfo struct { - Host *nebula0.HostAddr `thrift:"host,1" db:"host" json:"host"` - Checkpoints []*nebula0.CheckpointInfo `thrift:"checkpoints,2" db:"checkpoints" json:"checkpoints"` -} - -func NewHostBackupInfo() *HostBackupInfo { - return &HostBackupInfo{ - Host: nebula0.NewHostAddr(), - } -} - -var HostBackupInfo_Host_DEFAULT *nebula0.HostAddr -func (p *HostBackupInfo) GetHost() *nebula0.HostAddr { - if !p.IsSetHost() { - return HostBackupInfo_Host_DEFAULT - } -return p.Host -} - -func (p *HostBackupInfo) GetCheckpoints() []*nebula0.CheckpointInfo { - return p.Checkpoints -} -func (p *HostBackupInfo) IsSetHost() bool { - return p != nil && p.Host != nil -} - -type HostBackupInfoBuilder struct { - obj *HostBackupInfo -} - -func NewHostBackupInfoBuilder() *HostBackupInfoBuilder{ - return &HostBackupInfoBuilder{ - obj: NewHostBackupInfo(), - } -} - -func (p HostBackupInfoBuilder) Emit() *HostBackupInfo{ - return &HostBackupInfo{ - Host: p.obj.Host, - Checkpoints: p.obj.Checkpoints, - } -} - -func (h *HostBackupInfoBuilder) Host(host *nebula0.HostAddr) *HostBackupInfoBuilder { - h.obj.Host = host - return h -} - -func (h *HostBackupInfoBuilder) Checkpoints(checkpoints []*nebula0.CheckpointInfo) *HostBackupInfoBuilder { - h.obj.Checkpoints = checkpoints - return h -} - -func (h *HostBackupInfo) SetHost(host *nebula0.HostAddr) *HostBackupInfo { - h.Host = host - return h -} - -func (h *HostBackupInfo) SetCheckpoints(checkpoints []*nebula0.CheckpointInfo) *HostBackupInfo { - h.Checkpoints = checkpoints - return h -} - -func (p *HostBackupInfo) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *HostBackupInfo) 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 *HostBackupInfo) 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.Checkpoints = tSlice - for i := 0; i < size; i ++ { - _elem74 := nebula0.NewCheckpointInfo() - if err := _elem74.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem74), err) - } - p.Checkpoints = append(p.Checkpoints, _elem74) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *HostBackupInfo) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("HostBackupInfo"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *HostBackupInfo) 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 *HostBackupInfo) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("checkpoints", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:checkpoints: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Checkpoints)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Checkpoints { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - 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:checkpoints: ", p), err) } - return err -} - -func (p *HostBackupInfo) String() string { - if p == nil { - return "" - } - - var hostVal string - if p.Host == nil { - hostVal = "" - } else { - hostVal = fmt.Sprintf("%v", p.Host) - } - checkpointsVal := fmt.Sprintf("%v", p.Checkpoints) - return fmt.Sprintf("HostBackupInfo({Host:%s Checkpoints:%s})", hostVal, checkpointsVal) -} - -// Attributes: -// - Space -// - HostBackups -type SpaceBackupInfo struct { - Space *SpaceDesc `thrift:"space,1" db:"space" json:"space"` - HostBackups []*HostBackupInfo `thrift:"host_backups,2" db:"host_backups" json:"host_backups"` -} - -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) GetHostBackups() []*HostBackupInfo { - return p.HostBackups -} -func (p *SpaceBackupInfo) IsSetSpace() bool { - return p != nil && p.Space != nil -} - -type SpaceBackupInfoBuilder struct { - obj *SpaceBackupInfo -} - -func NewSpaceBackupInfoBuilder() *SpaceBackupInfoBuilder{ - return &SpaceBackupInfoBuilder{ - obj: NewSpaceBackupInfo(), - } -} - -func (p SpaceBackupInfoBuilder) Emit() *SpaceBackupInfo{ - return &SpaceBackupInfo{ - Space: p.obj.Space, - HostBackups: p.obj.HostBackups, - } -} - -func (s *SpaceBackupInfoBuilder) Space(space *SpaceDesc) *SpaceBackupInfoBuilder { - s.obj.Space = space - return s -} - -func (s *SpaceBackupInfoBuilder) HostBackups(hostBackups []*HostBackupInfo) *SpaceBackupInfoBuilder { - s.obj.HostBackups = hostBackups - return s -} - -func (s *SpaceBackupInfo) SetSpace(space *SpaceDesc) *SpaceBackupInfo { - s.Space = space - return s -} - -func (s *SpaceBackupInfo) SetHostBackups(hostBackups []*HostBackupInfo) *SpaceBackupInfo { - s.HostBackups = hostBackups - return s -} - -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([]*HostBackupInfo, 0, size) - p.HostBackups = tSlice - for i := 0; i < size; i ++ { - _elem75 := NewHostBackupInfo() - if err := _elem75.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem75), err) - } - p.HostBackups = append(p.HostBackups, _elem75) - } - 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("host_backups", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:host_backups: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.HostBackups)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.HostBackups { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - 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:host_backups: ", 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) - } - hostBackupsVal := fmt.Sprintf("%v", p.HostBackups) - return fmt.Sprintf("SpaceBackupInfo({Space:%s HostBackups:%s})", spaceVal, hostBackupsVal) -} - -// Attributes: -// - SpaceBackups -// - MetaFiles -// - BackupName -// - Full -// - AllSpaces -// - CreateTime -// - BaseBackupName -// - StorageHosts -// - ClusterID -type BackupMeta struct { - SpaceBackups map[nebula0.GraphSpaceID]*SpaceBackupInfo `thrift:"space_backups,1" db:"space_backups" json:"space_backups"` - MetaFiles [][]byte `thrift:"meta_files,2" db:"meta_files" json:"meta_files"` - BackupName []byte `thrift:"backup_name,3" db:"backup_name" json:"backup_name"` - Full bool `thrift:"full,4" db:"full" json:"full"` - AllSpaces bool `thrift:"all_spaces,5" db:"all_spaces" json:"all_spaces"` - CreateTime int64 `thrift:"create_time,6" db:"create_time" json:"create_time"` - BaseBackupName []byte `thrift:"base_backup_name,7" db:"base_backup_name" json:"base_backup_name"` - StorageHosts []*nebula0.HostAddr `thrift:"storage_hosts,8" db:"storage_hosts" json:"storage_hosts"` - ClusterID ClusterID `thrift:"cluster_id,9" db:"cluster_id" json:"cluster_id"` -} - -func NewBackupMeta() *BackupMeta { - return &BackupMeta{} -} - - -func (p *BackupMeta) GetSpaceBackups() map[nebula0.GraphSpaceID]*SpaceBackupInfo { - return p.SpaceBackups -} - -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) GetAllSpaces() bool { - return p.AllSpaces -} - -func (p *BackupMeta) GetCreateTime() int64 { - return p.CreateTime -} - -func (p *BackupMeta) GetBaseBackupName() []byte { - return p.BaseBackupName -} - -func (p *BackupMeta) GetStorageHosts() []*nebula0.HostAddr { - return p.StorageHosts -} - -func (p *BackupMeta) GetClusterID() ClusterID { - return p.ClusterID -} -type BackupMetaBuilder struct { - obj *BackupMeta -} - -func NewBackupMetaBuilder() *BackupMetaBuilder{ - return &BackupMetaBuilder{ - obj: NewBackupMeta(), - } -} - -func (p BackupMetaBuilder) Emit() *BackupMeta{ - return &BackupMeta{ - SpaceBackups: p.obj.SpaceBackups, - MetaFiles: p.obj.MetaFiles, - BackupName: p.obj.BackupName, - Full: p.obj.Full, - AllSpaces: p.obj.AllSpaces, - CreateTime: p.obj.CreateTime, - BaseBackupName: p.obj.BaseBackupName, - StorageHosts: p.obj.StorageHosts, - ClusterID: p.obj.ClusterID, - } -} - -func (b *BackupMetaBuilder) SpaceBackups(spaceBackups map[nebula0.GraphSpaceID]*SpaceBackupInfo) *BackupMetaBuilder { - b.obj.SpaceBackups = spaceBackups - return b -} - -func (b *BackupMetaBuilder) MetaFiles(metaFiles [][]byte) *BackupMetaBuilder { - b.obj.MetaFiles = metaFiles - return b -} - -func (b *BackupMetaBuilder) BackupName(backupName []byte) *BackupMetaBuilder { - b.obj.BackupName = backupName - return b -} - -func (b *BackupMetaBuilder) Full(full bool) *BackupMetaBuilder { - b.obj.Full = full - return b -} - -func (b *BackupMetaBuilder) AllSpaces(allSpaces bool) *BackupMetaBuilder { - b.obj.AllSpaces = allSpaces - return b -} - -func (b *BackupMetaBuilder) CreateTime(createTime int64) *BackupMetaBuilder { - b.obj.CreateTime = createTime - return b -} - -func (b *BackupMetaBuilder) BaseBackupName(baseBackupName []byte) *BackupMetaBuilder { - b.obj.BaseBackupName = baseBackupName - return b -} - -func (b *BackupMetaBuilder) StorageHosts(storageHosts []*nebula0.HostAddr) *BackupMetaBuilder { - b.obj.StorageHosts = storageHosts - return b -} - -func (b *BackupMetaBuilder) ClusterID(clusterID ClusterID) *BackupMetaBuilder { - b.obj.ClusterID = clusterID - return b -} - -func (b *BackupMeta) SetSpaceBackups(spaceBackups map[nebula0.GraphSpaceID]*SpaceBackupInfo) *BackupMeta { - b.SpaceBackups = spaceBackups - return b -} - -func (b *BackupMeta) SetMetaFiles(metaFiles [][]byte) *BackupMeta { - b.MetaFiles = metaFiles - return b -} - -func (b *BackupMeta) SetBackupName(backupName []byte) *BackupMeta { - b.BackupName = backupName - return b -} - -func (b *BackupMeta) SetFull(full bool) *BackupMeta { - b.Full = full - return b -} - -func (b *BackupMeta) SetAllSpaces(allSpaces bool) *BackupMeta { - b.AllSpaces = allSpaces - return b -} - -func (b *BackupMeta) SetCreateTime(createTime int64) *BackupMeta { - b.CreateTime = createTime - return b -} - -func (b *BackupMeta) SetBaseBackupName(baseBackupName []byte) *BackupMeta { - b.BaseBackupName = baseBackupName - return b -} - -func (b *BackupMeta) SetStorageHosts(storageHosts []*nebula0.HostAddr) *BackupMeta { - b.StorageHosts = storageHosts - return b -} - -func (b *BackupMeta) SetClusterID(clusterID ClusterID) *BackupMeta { - b.ClusterID = clusterID - return b -} - -func (p *BackupMeta) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - 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 *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.SpaceBackups = tMap - for i := 0; i < size; i ++ { - var _key76 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _key76 = temp - } - _val77 := NewSpaceBackupInfo() - if err := _val77.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val77), err) - } - p.SpaceBackups[_key76] = _val77 - } - 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 _elem78 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem78 = v - } - p.MetaFiles = append(p.MetaFiles, _elem78) - } - 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.AllSpaces = 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) ReadField7(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 7: ", err) - } else { - p.BaseBackupName = v - } - return nil -} - -func (p *BackupMeta) ReadField8(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.HostAddr, 0, size) - p.StorageHosts = tSlice - for i := 0; i < size; i ++ { - _elem79 := nebula0.NewHostAddr() - if err := _elem79.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem79), err) - } - p.StorageHosts = append(p.StorageHosts, _elem79) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *BackupMeta) ReadField9(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 9: ", err) - } else { - temp := ClusterID(v) - p.ClusterID = temp - } - return nil -} - -func (p *BackupMeta) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("BackupMeta"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *BackupMeta) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("space_backups", thrift.MAP, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_backups: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.SpaceBackups)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.SpaceBackups { - 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:space_backups: ", 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("all_spaces", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:all_spaces: ", p), err) } - if err := oprot.WriteBool(bool(p.AllSpaces)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.all_spaces (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:all_spaces: ", 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) writeField7(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("base_backup_name", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:base_backup_name: ", p), err) } - if err := oprot.WriteBinary(p.BaseBackupName); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.base_backup_name (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:base_backup_name: ", p), err) } - return err -} - -func (p *BackupMeta) writeField8(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("storage_hosts", thrift.LIST, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:storage_hosts: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StorageHosts)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.StorageHosts { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:storage_hosts: ", p), err) } - return err -} - -func (p *BackupMeta) writeField9(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:cluster_id: ", p), err) } - if err := oprot.WriteI64(int64(p.ClusterID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.cluster_id (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:cluster_id: ", p), err) } - return err -} - -func (p *BackupMeta) String() string { - if p == nil { - return "" - } - - spaceBackupsVal := fmt.Sprintf("%v", p.SpaceBackups) - metaFilesVal := fmt.Sprintf("%v", p.MetaFiles) - backupNameVal := fmt.Sprintf("%v", p.BackupName) - fullVal := fmt.Sprintf("%v", p.Full) - allSpacesVal := fmt.Sprintf("%v", p.AllSpaces) - createTimeVal := fmt.Sprintf("%v", p.CreateTime) - baseBackupNameVal := fmt.Sprintf("%v", p.BaseBackupName) - storageHostsVal := fmt.Sprintf("%v", p.StorageHosts) - clusterIDVal := fmt.Sprintf("%v", p.ClusterID) - return fmt.Sprintf("BackupMeta({SpaceBackups:%s MetaFiles:%s BackupName:%s Full:%s AllSpaces:%s CreateTime:%s BaseBackupName:%s StorageHosts:%s ClusterID:%s})", spaceBackupsVal, metaFilesVal, backupNameVal, fullVal, allSpacesVal, createTimeVal, baseBackupNameVal, storageHostsVal, clusterIDVal) -} - -// Attributes: -// - Spaces -// - BaseBackupName -// - ClusterID -type CreateBackupReq struct { - Spaces [][]byte `thrift:"spaces,1,optional" db:"spaces" json:"spaces,omitempty"` - BaseBackupName []byte `thrift:"base_backup_name,2,optional" db:"base_backup_name" json:"base_backup_name,omitempty"` - ClusterID *ClusterID `thrift:"cluster_id,3,optional" db:"cluster_id" json:"cluster_id,omitempty"` -} - -func NewCreateBackupReq() *CreateBackupReq { - return &CreateBackupReq{} -} - -var CreateBackupReq_Spaces_DEFAULT [][]byte - -func (p *CreateBackupReq) GetSpaces() [][]byte { - return p.Spaces -} -var CreateBackupReq_BaseBackupName_DEFAULT []byte - -func (p *CreateBackupReq) GetBaseBackupName() []byte { - return p.BaseBackupName -} -var CreateBackupReq_ClusterID_DEFAULT ClusterID -func (p *CreateBackupReq) GetClusterID() ClusterID { - if !p.IsSetClusterID() { - return CreateBackupReq_ClusterID_DEFAULT - } -return *p.ClusterID -} -func (p *CreateBackupReq) IsSetSpaces() bool { - return p != nil && p.Spaces != nil -} - -func (p *CreateBackupReq) IsSetBaseBackupName() bool { - return p != nil && p.BaseBackupName != nil -} - -func (p *CreateBackupReq) IsSetClusterID() bool { - return p != nil && p.ClusterID != nil -} - -type CreateBackupReqBuilder struct { - obj *CreateBackupReq -} - -func NewCreateBackupReqBuilder() *CreateBackupReqBuilder{ - return &CreateBackupReqBuilder{ - obj: NewCreateBackupReq(), - } -} - -func (p CreateBackupReqBuilder) Emit() *CreateBackupReq{ - return &CreateBackupReq{ - Spaces: p.obj.Spaces, - BaseBackupName: p.obj.BaseBackupName, - ClusterID: p.obj.ClusterID, - } -} - -func (c *CreateBackupReqBuilder) Spaces(spaces [][]byte) *CreateBackupReqBuilder { - c.obj.Spaces = spaces - return c -} - -func (c *CreateBackupReqBuilder) BaseBackupName(baseBackupName []byte) *CreateBackupReqBuilder { - c.obj.BaseBackupName = baseBackupName - return c -} - -func (c *CreateBackupReqBuilder) ClusterID(clusterID *ClusterID) *CreateBackupReqBuilder { - c.obj.ClusterID = clusterID - return c -} - -func (c *CreateBackupReq) SetSpaces(spaces [][]byte) *CreateBackupReq { - c.Spaces = spaces - return c -} - -func (c *CreateBackupReq) SetBaseBackupName(baseBackupName []byte) *CreateBackupReq { - c.BaseBackupName = baseBackupName - return c -} - -func (c *CreateBackupReq) SetClusterID(clusterID *ClusterID) *CreateBackupReq { - c.ClusterID = clusterID - return c -} - -func (p *CreateBackupReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - 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 _elem80 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem80 = v - } - p.Spaces = append(p.Spaces, _elem80) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *CreateBackupReq) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.BaseBackupName = v - } - return nil -} - -func (p *CreateBackupReq) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := ClusterID(v) - p.ClusterID = &temp - } - return nil -} - -func (p *CreateBackupReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("CreateBackupReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - 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) writeField2(oprot thrift.Protocol) (err error) { - if p.IsSetBaseBackupName() { - if err := oprot.WriteFieldBegin("base_backup_name", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:base_backup_name: ", p), err) } - if err := oprot.WriteBinary(p.BaseBackupName); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.base_backup_name (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:base_backup_name: ", p), err) } - } - return err -} - -func (p *CreateBackupReq) writeField3(oprot thrift.Protocol) (err error) { - if p.IsSetClusterID() { - if err := oprot.WriteFieldBegin("cluster_id", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cluster_id: ", p), err) } - if err := oprot.WriteI64(int64(*p.ClusterID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.cluster_id (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cluster_id: ", p), err) } - } - return err -} - -func (p *CreateBackupReq) String() string { - if p == nil { - return "" - } - - spacesVal := fmt.Sprintf("%v", p.Spaces) - baseBackupNameVal := fmt.Sprintf("%v", p.BaseBackupName) - var clusterIDVal string - if p.ClusterID == nil { - clusterIDVal = "" - } else { - clusterIDVal = fmt.Sprintf("%v", *p.ClusterID) - } - return fmt.Sprintf("CreateBackupReq({Spaces:%s BaseBackupName:%s ClusterID:%s})", spacesVal, baseBackupNameVal, clusterIDVal) -} - -// Attributes: -// - 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 -} - -type CreateBackupRespBuilder struct { - obj *CreateBackupResp -} - -func NewCreateBackupRespBuilder() *CreateBackupRespBuilder{ - return &CreateBackupRespBuilder{ - obj: NewCreateBackupResp(), - } -} - -func (p CreateBackupRespBuilder) Emit() *CreateBackupResp{ - return &CreateBackupResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Meta: p.obj.Meta, - } -} - -func (c *CreateBackupRespBuilder) Code(code nebula0.ErrorCode) *CreateBackupRespBuilder { - c.obj.Code = code - return c -} - -func (c *CreateBackupRespBuilder) Leader(leader *nebula0.HostAddr) *CreateBackupRespBuilder { - c.obj.Leader = leader - return c -} - -func (c *CreateBackupRespBuilder) Meta(meta *BackupMeta) *CreateBackupRespBuilder { - c.obj.Meta = meta - return c -} - -func (c *CreateBackupResp) SetCode(code nebula0.ErrorCode) *CreateBackupResp { - c.Code = code - return c -} - -func (c *CreateBackupResp) SetLeader(leader *nebula0.HostAddr) *CreateBackupResp { - c.Leader = leader - return c -} - -func (c *CreateBackupResp) SetMeta(meta *BackupMeta) *CreateBackupResp { - c.Meta = meta - return c -} - -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 -} - -type HostPairBuilder struct { - obj *HostPair -} - -func NewHostPairBuilder() *HostPairBuilder{ - return &HostPairBuilder{ - obj: NewHostPair(), - } -} - -func (p HostPairBuilder) Emit() *HostPair{ - return &HostPair{ - FromHost: p.obj.FromHost, - ToHost: p.obj.ToHost, - } -} - -func (h *HostPairBuilder) FromHost(fromHost *nebula0.HostAddr) *HostPairBuilder { - h.obj.FromHost = fromHost - return h -} - -func (h *HostPairBuilder) ToHost(toHost *nebula0.HostAddr) *HostPairBuilder { - h.obj.ToHost = toHost - return h -} - -func (h *HostPair) SetFromHost(fromHost *nebula0.HostAddr) *HostPair { - h.FromHost = fromHost - return h -} - -func (h *HostPair) SetToHost(toHost *nebula0.HostAddr) *HostPair { - h.ToHost = toHost - return h -} - -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 -} -type RestoreMetaReqBuilder struct { - obj *RestoreMetaReq -} - -func NewRestoreMetaReqBuilder() *RestoreMetaReqBuilder{ - return &RestoreMetaReqBuilder{ - obj: NewRestoreMetaReq(), - } -} - -func (p RestoreMetaReqBuilder) Emit() *RestoreMetaReq{ - return &RestoreMetaReq{ - Files: p.obj.Files, - Hosts: p.obj.Hosts, - } -} - -func (r *RestoreMetaReqBuilder) Files(files [][]byte) *RestoreMetaReqBuilder { - r.obj.Files = files - return r -} - -func (r *RestoreMetaReqBuilder) Hosts(hosts []*HostPair) *RestoreMetaReqBuilder { - r.obj.Hosts = hosts - return r -} - -func (r *RestoreMetaReq) SetFiles(files [][]byte) *RestoreMetaReq { - r.Files = files - return r -} - -func (r *RestoreMetaReq) SetHosts(hosts []*HostPair) *RestoreMetaReq { - r.Hosts = hosts - return r -} - -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 _elem81 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem81 = v - } - p.Files = append(p.Files, _elem81) - } - 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 ++ { - _elem82 := NewHostPair() - if err := _elem82.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem82), err) - } - p.Hosts = append(p.Hosts, _elem82) - } - 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: -// - PartID -// - Hosts -type PartInfo struct { - PartID nebula0.PartitionID `thrift:"part_id,1" db:"part_id" json:"part_id"` - Hosts []*nebula0.HostAddr `thrift:"hosts,2" db:"hosts" json:"hosts"` -} - -func NewPartInfo() *PartInfo { - return &PartInfo{} -} - - -func (p *PartInfo) GetPartID() nebula0.PartitionID { - return p.PartID -} - -func (p *PartInfo) GetHosts() []*nebula0.HostAddr { - return p.Hosts -} -type PartInfoBuilder struct { - obj *PartInfo -} - -func NewPartInfoBuilder() *PartInfoBuilder{ - return &PartInfoBuilder{ - obj: NewPartInfo(), - } -} - -func (p PartInfoBuilder) Emit() *PartInfo{ - return &PartInfo{ - PartID: p.obj.PartID, - Hosts: p.obj.Hosts, - } -} - -func (p *PartInfoBuilder) PartID(partID nebula0.PartitionID) *PartInfoBuilder { - p.obj.PartID = partID - return p -} - -func (p *PartInfoBuilder) Hosts(hosts []*nebula0.HostAddr) *PartInfoBuilder { - p.obj.Hosts = hosts - return p -} - -func (p *PartInfo) SetPartID(partID nebula0.PartitionID) *PartInfo { - p.PartID = partID - return p -} - -func (p *PartInfo) SetHosts(hosts []*nebula0.HostAddr) *PartInfo { - p.Hosts = hosts - return p -} - -func (p *PartInfo) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *PartInfo) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := nebula0.PartitionID(v) - p.PartID = temp - } - return nil -} - -func (p *PartInfo) ReadField2(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.HostAddr, 0, size) - p.Hosts = tSlice - for i := 0; i < size; i ++ { - _elem83 := nebula0.NewHostAddr() - if err := _elem83.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem83), err) - } - p.Hosts = append(p.Hosts, _elem83) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *PartInfo) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("PartInfo"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *PartInfo) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("part_id", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:part_id: ", p), err) } - if err := oprot.WriteI32(int32(p.PartID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.part_id (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:part_id: ", p), err) } - return err -} - -func (p *PartInfo) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("hosts", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:hosts: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Hosts)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.Hosts { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:hosts: ", p), err) } - return err -} - -func (p *PartInfo) String() string { - if p == nil { - return "" - } - - partIDVal := fmt.Sprintf("%v", p.PartID) - hostsVal := fmt.Sprintf("%v", p.Hosts) - return fmt.Sprintf("PartInfo({PartID:%s Hosts:%s})", partIDVal, hostsVal) -} - -// Attributes: -// - Code -// - Leader -// - PartHosts -type RestoreMetaResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` - PartHosts map[nebula0.GraphSpaceID][]*PartInfo `thrift:"part_hosts,3" db:"part_hosts" json:"part_hosts"` -} - -func NewRestoreMetaResp() *RestoreMetaResp { - return &RestoreMetaResp{ - Leader: nebula0.NewHostAddr(), - } -} - - -func (p *RestoreMetaResp) GetCode() nebula0.ErrorCode { - return p.Code -} -var RestoreMetaResp_Leader_DEFAULT *nebula0.HostAddr -func (p *RestoreMetaResp) GetLeader() *nebula0.HostAddr { - if !p.IsSetLeader() { - return RestoreMetaResp_Leader_DEFAULT - } -return p.Leader -} - -func (p *RestoreMetaResp) GetPartHosts() map[nebula0.GraphSpaceID][]*PartInfo { - return p.PartHosts -} -func (p *RestoreMetaResp) IsSetLeader() bool { - return p != nil && p.Leader != nil -} - -type RestoreMetaRespBuilder struct { - obj *RestoreMetaResp -} - -func NewRestoreMetaRespBuilder() *RestoreMetaRespBuilder{ - return &RestoreMetaRespBuilder{ - obj: NewRestoreMetaResp(), - } -} - -func (p RestoreMetaRespBuilder) Emit() *RestoreMetaResp{ - return &RestoreMetaResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - PartHosts: p.obj.PartHosts, - } -} - -func (r *RestoreMetaRespBuilder) Code(code nebula0.ErrorCode) *RestoreMetaRespBuilder { - r.obj.Code = code - return r -} - -func (r *RestoreMetaRespBuilder) Leader(leader *nebula0.HostAddr) *RestoreMetaRespBuilder { - r.obj.Leader = leader - return r -} - -func (r *RestoreMetaRespBuilder) PartHosts(partHosts map[nebula0.GraphSpaceID][]*PartInfo) *RestoreMetaRespBuilder { - r.obj.PartHosts = partHosts - return r -} - -func (r *RestoreMetaResp) SetCode(code nebula0.ErrorCode) *RestoreMetaResp { - r.Code = code - return r -} - -func (r *RestoreMetaResp) SetLeader(leader *nebula0.HostAddr) *RestoreMetaResp { - r.Leader = leader - return r -} - -func (r *RestoreMetaResp) SetPartHosts(partHosts map[nebula0.GraphSpaceID][]*PartInfo) *RestoreMetaResp { - r.PartHosts = partHosts - return r -} - -func (p *RestoreMetaResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *RestoreMetaResp) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := nebula0.ErrorCode(v) - p.Code = temp - } - return nil -} - -func (p *RestoreMetaResp) ReadField2(iprot thrift.Protocol) error { - p.Leader = nebula0.NewHostAddr() - if err := p.Leader.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) - } - return nil -} - -func (p *RestoreMetaResp) ReadField3(iprot thrift.Protocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.GraphSpaceID][]*PartInfo, size) - p.PartHosts = tMap - for i := 0; i < size; i ++ { - var _key84 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _key84 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*PartInfo, 0, size) - _val85 := tSlice - for i := 0; i < size; i ++ { - _elem86 := NewPartInfo() - if err := _elem86.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem86), err) - } - _val85 = append(_val85, _elem86) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.PartHosts[_key84] = _val85 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *RestoreMetaResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("RestoreMetaResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *RestoreMetaResp) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("code", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } - if err := oprot.WriteI32(int32(p.Code)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } - return err -} - -func (p *RestoreMetaResp) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("leader", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:leader: ", p), err) } - if err := p.Leader.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader: ", p), err) } - return err -} - -func (p *RestoreMetaResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("part_hosts", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:part_hosts: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PartHosts)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.PartHosts { - if err := oprot.WriteI32(int32(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range v { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - } - if err := oprot.WriteMapEnd(); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:part_hosts: ", p), err) } - return err -} - -func (p *RestoreMetaResp) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - var leaderVal string - if p.Leader == nil { - leaderVal = "" - } else { - leaderVal = fmt.Sprintf("%v", p.Leader) - } - partHostsVal := fmt.Sprintf("%v", p.PartHosts) - return fmt.Sprintf("RestoreMetaResp({Code:%s Leader:%s PartHosts:%s})", codeVal, leaderVal, partHostsVal) -} - -// Attributes: -// - Host -// - User -// - Pwd -// - ConnType -type ServiceClient struct { - Host *nebula0.HostAddr `thrift:"host,1,required" db:"host" json:"host"` - User []byte `thrift:"user,2,optional" db:"user" json:"user,omitempty"` - Pwd []byte `thrift:"pwd,3,optional" db:"pwd" json:"pwd,omitempty"` - ConnType []byte `thrift:"conn_type,4,optional" db:"conn_type" json:"conn_type,omitempty"` -} - -func NewServiceClient() *ServiceClient { - return &ServiceClient{ - Host: nebula0.NewHostAddr(), - } -} - -var ServiceClient_Host_DEFAULT *nebula0.HostAddr -func (p *ServiceClient) GetHost() *nebula0.HostAddr { - if !p.IsSetHost() { - return ServiceClient_Host_DEFAULT - } -return p.Host -} -var ServiceClient_User_DEFAULT []byte - -func (p *ServiceClient) GetUser() []byte { - return p.User -} -var ServiceClient_Pwd_DEFAULT []byte - -func (p *ServiceClient) GetPwd() []byte { - return p.Pwd -} -var ServiceClient_ConnType_DEFAULT []byte - -func (p *ServiceClient) GetConnType() []byte { - return p.ConnType -} -func (p *ServiceClient) IsSetHost() bool { - return p != nil && p.Host != nil -} - -func (p *ServiceClient) IsSetUser() bool { - return p != nil && p.User != nil -} - -func (p *ServiceClient) IsSetPwd() bool { - return p != nil && p.Pwd != nil -} - -func (p *ServiceClient) IsSetConnType() bool { - return p != nil && p.ConnType != nil -} - -type ServiceClientBuilder struct { - obj *ServiceClient -} - -func NewServiceClientBuilder() *ServiceClientBuilder{ - return &ServiceClientBuilder{ - obj: NewServiceClient(), - } -} - -func (p ServiceClientBuilder) Emit() *ServiceClient{ - return &ServiceClient{ - Host: p.obj.Host, - User: p.obj.User, - Pwd: p.obj.Pwd, - ConnType: p.obj.ConnType, - } -} - -func (s *ServiceClientBuilder) Host(host *nebula0.HostAddr) *ServiceClientBuilder { - s.obj.Host = host - return s -} - -func (s *ServiceClientBuilder) User(user []byte) *ServiceClientBuilder { - s.obj.User = user - return s -} - -func (s *ServiceClientBuilder) Pwd(pwd []byte) *ServiceClientBuilder { - s.obj.Pwd = pwd - return s -} - -func (s *ServiceClientBuilder) ConnType(connType []byte) *ServiceClientBuilder { - s.obj.ConnType = connType - return s -} - -func (s *ServiceClient) SetHost(host *nebula0.HostAddr) *ServiceClient { - s.Host = host - return s -} - -func (s *ServiceClient) SetUser(user []byte) *ServiceClient { - s.User = user - return s -} - -func (s *ServiceClient) SetPwd(pwd []byte) *ServiceClient { - s.Pwd = pwd - return s -} - -func (s *ServiceClient) SetConnType(connType []byte) *ServiceClient { - s.ConnType = connType - return s -} - -func (p *ServiceClient) 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 - } - 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 !issetHost{ - return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Host is not set")); - } - return nil -} - -func (p *ServiceClient) 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 *ServiceClient) 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 *ServiceClient) 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 *ServiceClient) ReadField4(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.ConnType = v - } - return nil -} - -func (p *ServiceClient) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ServiceClient"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *ServiceClient) 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 *ServiceClient) 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 *ServiceClient) 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 *ServiceClient) writeField4(oprot thrift.Protocol) (err error) { - if p.IsSetConnType() { - if err := oprot.WriteFieldBegin("conn_type", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:conn_type: ", p), err) } - if err := oprot.WriteBinary(p.ConnType); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.conn_type (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:conn_type: ", p), err) } - } - return err -} - -func (p *ServiceClient) 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) - connTypeVal := fmt.Sprintf("%v", p.ConnType) - return fmt.Sprintf("ServiceClient({Host:%s User:%s Pwd:%s ConnType:%s})", hostVal, userVal, pwdVal, connTypeVal) -} - -// Attributes: -// - Type -// - Clients -type SignInServiceReq struct { - Type ExternalServiceType `thrift:"type,1" db:"type" json:"type"` - Clients []*ServiceClient `thrift:"clients,2" db:"clients" json:"clients"` -} - -func NewSignInServiceReq() *SignInServiceReq { - return &SignInServiceReq{} -} - - -func (p *SignInServiceReq) GetType() ExternalServiceType { - return p.Type -} - -func (p *SignInServiceReq) GetClients() []*ServiceClient { - return p.Clients -} -type SignInServiceReqBuilder struct { - obj *SignInServiceReq -} - -func NewSignInServiceReqBuilder() *SignInServiceReqBuilder{ - return &SignInServiceReqBuilder{ - obj: NewSignInServiceReq(), - } -} - -func (p SignInServiceReqBuilder) Emit() *SignInServiceReq{ - return &SignInServiceReq{ - Type: p.obj.Type, - Clients: p.obj.Clients, - } -} - -func (s *SignInServiceReqBuilder) Type(type_a1 ExternalServiceType) *SignInServiceReqBuilder { - s.obj.Type = type_a1 - return s -} - -func (s *SignInServiceReqBuilder) Clients(clients []*ServiceClient) *SignInServiceReqBuilder { - s.obj.Clients = clients - return s -} - -func (s *SignInServiceReq) SetType(type_a1 ExternalServiceType) *SignInServiceReq { - s.Type = type_a1 - return s -} - -func (s *SignInServiceReq) SetClients(clients []*ServiceClient) *SignInServiceReq { - s.Clients = clients - return s -} - -func (p *SignInServiceReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *SignInServiceReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := ExternalServiceType(v) - p.Type = temp - } - return nil -} - -func (p *SignInServiceReq) ReadField2(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*ServiceClient, 0, size) - p.Clients = tSlice - for i := 0; i < size; i ++ { - _elem87 := NewServiceClient() - if err := _elem87.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem87), err) - } - p.Clients = append(p.Clients, _elem87) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *SignInServiceReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("SignInServiceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *SignInServiceReq) 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 *SignInServiceReq) 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 *SignInServiceReq) String() string { - if p == nil { - return "" - } - - typeVal := fmt.Sprintf("%v", p.Type) - clientsVal := fmt.Sprintf("%v", p.Clients) - return fmt.Sprintf("SignInServiceReq({Type:%s Clients:%s})", typeVal, clientsVal) -} - -// Attributes: -// - Type -type SignOutServiceReq struct { - Type ExternalServiceType `thrift:"type,1" db:"type" json:"type"` -} - -func NewSignOutServiceReq() *SignOutServiceReq { - return &SignOutServiceReq{} -} - - -func (p *SignOutServiceReq) GetType() ExternalServiceType { - return p.Type -} -type SignOutServiceReqBuilder struct { - obj *SignOutServiceReq -} - -func NewSignOutServiceReqBuilder() *SignOutServiceReqBuilder{ - return &SignOutServiceReqBuilder{ - obj: NewSignOutServiceReq(), - } -} - -func (p SignOutServiceReqBuilder) Emit() *SignOutServiceReq{ - return &SignOutServiceReq{ - Type: p.obj.Type, - } -} - -func (s *SignOutServiceReqBuilder) Type(type_a1 ExternalServiceType) *SignOutServiceReqBuilder { - s.obj.Type = type_a1 - return s -} - -func (s *SignOutServiceReq) SetType(type_a1 ExternalServiceType) *SignOutServiceReq { - s.Type = type_a1 - return s -} - -func (p *SignOutServiceReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *SignOutServiceReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := ExternalServiceType(v) - p.Type = temp - } - return nil -} - -func (p *SignOutServiceReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("SignOutServiceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *SignOutServiceReq) 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 *SignOutServiceReq) String() string { - if p == nil { - return "" - } - - typeVal := fmt.Sprintf("%v", p.Type) - return fmt.Sprintf("SignOutServiceReq({Type:%s})", typeVal) -} - -// Attributes: -// - Type -type ListServiceClientsReq struct { - Type ExternalServiceType `thrift:"type,1" db:"type" json:"type"` -} - -func NewListServiceClientsReq() *ListServiceClientsReq { - return &ListServiceClientsReq{} -} - - -func (p *ListServiceClientsReq) GetType() ExternalServiceType { - return p.Type -} -type ListServiceClientsReqBuilder struct { - obj *ListServiceClientsReq -} - -func NewListServiceClientsReqBuilder() *ListServiceClientsReqBuilder{ - return &ListServiceClientsReqBuilder{ - obj: NewListServiceClientsReq(), - } -} - -func (p ListServiceClientsReqBuilder) Emit() *ListServiceClientsReq{ - return &ListServiceClientsReq{ - Type: p.obj.Type, - } -} - -func (l *ListServiceClientsReqBuilder) Type(type_a1 ExternalServiceType) *ListServiceClientsReqBuilder { - l.obj.Type = type_a1 - return l -} - -func (l *ListServiceClientsReq) SetType(type_a1 ExternalServiceType) *ListServiceClientsReq { - l.Type = type_a1 - return l -} - -func (p *ListServiceClientsReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ListServiceClientsReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := ExternalServiceType(v) - p.Type = temp - } - return nil -} - -func (p *ListServiceClientsReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ListServiceClientsReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ListServiceClientsReq) 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 *ListServiceClientsReq) String() string { - if p == nil { - return "" - } - - typeVal := fmt.Sprintf("%v", p.Type) - return fmt.Sprintf("ListServiceClientsReq({Type:%s})", typeVal) -} - -// Attributes: -// - Code -// - Leader -// - Clients -type ListServiceClientsResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` - Clients map[ExternalServiceType][]*ServiceClient `thrift:"clients,3" db:"clients" json:"clients"` -} - -func NewListServiceClientsResp() *ListServiceClientsResp { - return &ListServiceClientsResp{ - Leader: nebula0.NewHostAddr(), - } -} - - -func (p *ListServiceClientsResp) GetCode() nebula0.ErrorCode { - return p.Code -} -var ListServiceClientsResp_Leader_DEFAULT *nebula0.HostAddr -func (p *ListServiceClientsResp) GetLeader() *nebula0.HostAddr { - if !p.IsSetLeader() { - return ListServiceClientsResp_Leader_DEFAULT - } -return p.Leader -} - -func (p *ListServiceClientsResp) GetClients() map[ExternalServiceType][]*ServiceClient { - return p.Clients -} -func (p *ListServiceClientsResp) IsSetLeader() bool { - return p != nil && p.Leader != nil -} - -type ListServiceClientsRespBuilder struct { - obj *ListServiceClientsResp -} - -func NewListServiceClientsRespBuilder() *ListServiceClientsRespBuilder{ - return &ListServiceClientsRespBuilder{ - obj: NewListServiceClientsResp(), - } -} - -func (p ListServiceClientsRespBuilder) Emit() *ListServiceClientsResp{ - return &ListServiceClientsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Clients: p.obj.Clients, - } -} - -func (l *ListServiceClientsRespBuilder) Code(code nebula0.ErrorCode) *ListServiceClientsRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListServiceClientsRespBuilder) Leader(leader *nebula0.HostAddr) *ListServiceClientsRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListServiceClientsRespBuilder) Clients(clients map[ExternalServiceType][]*ServiceClient) *ListServiceClientsRespBuilder { - l.obj.Clients = clients - return l -} - -func (l *ListServiceClientsResp) SetCode(code nebula0.ErrorCode) *ListServiceClientsResp { - l.Code = code - return l -} - -func (l *ListServiceClientsResp) SetLeader(leader *nebula0.HostAddr) *ListServiceClientsResp { - l.Leader = leader - return l -} - -func (l *ListServiceClientsResp) SetClients(clients map[ExternalServiceType][]*ServiceClient) *ListServiceClientsResp { - l.Clients = clients - return l -} - -func (p *ListServiceClientsResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ListServiceClientsResp) 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 *ListServiceClientsResp) 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 *ListServiceClientsResp) ReadField3(iprot thrift.Protocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[ExternalServiceType][]*ServiceClient, size) - p.Clients = tMap - for i := 0; i < size; i ++ { - var _key88 ExternalServiceType - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := ExternalServiceType(v) - _key88 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*ServiceClient, 0, size) - _val89 := tSlice - for i := 0; i < size; i ++ { - _elem90 := NewServiceClient() - if err := _elem90.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem90), err) - } - _val89 = append(_val89, _elem90) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Clients[_key88] = _val89 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *ListServiceClientsResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ListServiceClientsResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ListServiceClientsResp) 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 *ListServiceClientsResp) 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 *ListServiceClientsResp) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("clients", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:clients: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.Clients)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Clients { - 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:clients: ", p), err) } - return err -} - -func (p *ListServiceClientsResp) 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("ListServiceClientsResp({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 -} - -type FTIndexBuilder struct { - obj *FTIndex -} - -func NewFTIndexBuilder() *FTIndexBuilder{ - return &FTIndexBuilder{ - obj: NewFTIndex(), - } -} - -func (p FTIndexBuilder) Emit() *FTIndex{ - return &FTIndex{ - SpaceID: p.obj.SpaceID, - DependSchema: p.obj.DependSchema, - Fields: p.obj.Fields, - } -} - -func (f *FTIndexBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *FTIndexBuilder { - f.obj.SpaceID = spaceID - return f -} - -func (f *FTIndexBuilder) DependSchema(dependSchema *nebula0.SchemaID) *FTIndexBuilder { - f.obj.DependSchema = dependSchema - return f -} - -func (f *FTIndexBuilder) Fields(fields [][]byte) *FTIndexBuilder { - f.obj.Fields = fields - return f -} - -func (f *FTIndex) SetSpaceID(spaceID nebula0.GraphSpaceID) *FTIndex { - f.SpaceID = spaceID - return f -} - -func (f *FTIndex) SetDependSchema(dependSchema *nebula0.SchemaID) *FTIndex { - f.DependSchema = dependSchema - return f -} - -func (f *FTIndex) SetFields(fields [][]byte) *FTIndex { - f.Fields = fields - return f -} - -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 _elem91 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem91 = v - } - p.Fields = append(p.Fields, _elem91) - } - 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 -} - -type CreateFTIndexReqBuilder struct { - obj *CreateFTIndexReq -} - -func NewCreateFTIndexReqBuilder() *CreateFTIndexReqBuilder{ - return &CreateFTIndexReqBuilder{ - obj: NewCreateFTIndexReq(), - } -} - -func (p CreateFTIndexReqBuilder) Emit() *CreateFTIndexReq{ - return &CreateFTIndexReq{ - FulltextIndexName: p.obj.FulltextIndexName, - Index: p.obj.Index, - } -} - -func (c *CreateFTIndexReqBuilder) FulltextIndexName(fulltextIndexName []byte) *CreateFTIndexReqBuilder { - c.obj.FulltextIndexName = fulltextIndexName - return c -} - -func (c *CreateFTIndexReqBuilder) Index(index *FTIndex) *CreateFTIndexReqBuilder { - c.obj.Index = index - return c -} - -func (c *CreateFTIndexReq) SetFulltextIndexName(fulltextIndexName []byte) *CreateFTIndexReq { - c.FulltextIndexName = fulltextIndexName - return c -} - -func (c *CreateFTIndexReq) SetIndex(index *FTIndex) *CreateFTIndexReq { - c.Index = index - return c -} - -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 -} -type DropFTIndexReqBuilder struct { - obj *DropFTIndexReq -} - -func NewDropFTIndexReqBuilder() *DropFTIndexReqBuilder{ - return &DropFTIndexReqBuilder{ - obj: NewDropFTIndexReq(), - } -} - -func (p DropFTIndexReqBuilder) Emit() *DropFTIndexReq{ - return &DropFTIndexReq{ - SpaceID: p.obj.SpaceID, - FulltextIndexName: p.obj.FulltextIndexName, - } -} - -func (d *DropFTIndexReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DropFTIndexReqBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DropFTIndexReqBuilder) FulltextIndexName(fulltextIndexName []byte) *DropFTIndexReqBuilder { - d.obj.FulltextIndexName = fulltextIndexName - return d -} - -func (d *DropFTIndexReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *DropFTIndexReq { - d.SpaceID = spaceID - return d -} - -func (d *DropFTIndexReq) SetFulltextIndexName(fulltextIndexName []byte) *DropFTIndexReq { - d.FulltextIndexName = fulltextIndexName - return d -} - -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{} -} - -type ListFTIndexesReqBuilder struct { - obj *ListFTIndexesReq -} - -func NewListFTIndexesReqBuilder() *ListFTIndexesReqBuilder{ - return &ListFTIndexesReqBuilder{ - obj: NewListFTIndexesReq(), - } -} - -func (p ListFTIndexesReqBuilder) Emit() *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 -} - -type ListFTIndexesRespBuilder struct { - obj *ListFTIndexesResp -} - -func NewListFTIndexesRespBuilder() *ListFTIndexesRespBuilder{ - return &ListFTIndexesRespBuilder{ - obj: NewListFTIndexesResp(), - } -} - -func (p ListFTIndexesRespBuilder) Emit() *ListFTIndexesResp{ - return &ListFTIndexesResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Indexes: p.obj.Indexes, - } -} - -func (l *ListFTIndexesRespBuilder) Code(code nebula0.ErrorCode) *ListFTIndexesRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListFTIndexesRespBuilder) Leader(leader *nebula0.HostAddr) *ListFTIndexesRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListFTIndexesRespBuilder) Indexes(indexes map[string]*FTIndex) *ListFTIndexesRespBuilder { - l.obj.Indexes = indexes - return l -} - -func (l *ListFTIndexesResp) SetCode(code nebula0.ErrorCode) *ListFTIndexesResp { - l.Code = code - return l -} - -func (l *ListFTIndexesResp) SetLeader(leader *nebula0.HostAddr) *ListFTIndexesResp { - l.Leader = leader - return l -} - -func (l *ListFTIndexesResp) SetIndexes(indexes map[string]*FTIndex) *ListFTIndexesResp { - l.Indexes = indexes - return l -} - -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 _key92 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key92 = v - } - _val93 := NewFTIndex() - if err := _val93.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val93), err) - } - p.Indexes[_key92] = _val93 - } - 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 -} - -type QueryDescBuilder struct { - obj *QueryDesc -} - -func NewQueryDescBuilder() *QueryDescBuilder{ - return &QueryDescBuilder{ - obj: NewQueryDesc(), - } -} - -func (p QueryDescBuilder) Emit() *QueryDesc{ - return &QueryDesc{ - StartTime: p.obj.StartTime, - Status: p.obj.Status, - Duration: p.obj.Duration, - Query: p.obj.Query, - GraphAddr: p.obj.GraphAddr, - } -} - -func (q *QueryDescBuilder) StartTime(startTime nebula0.Timestamp) *QueryDescBuilder { - q.obj.StartTime = startTime - return q -} - -func (q *QueryDescBuilder) Status(status QueryStatus) *QueryDescBuilder { - q.obj.Status = status - return q -} - -func (q *QueryDescBuilder) Duration(duration int64) *QueryDescBuilder { - q.obj.Duration = duration - return q -} - -func (q *QueryDescBuilder) Query(query []byte) *QueryDescBuilder { - q.obj.Query = query - return q -} - -func (q *QueryDescBuilder) GraphAddr(graphAddr *nebula0.HostAddr) *QueryDescBuilder { - q.obj.GraphAddr = graphAddr - return q -} - -func (q *QueryDesc) SetStartTime(startTime nebula0.Timestamp) *QueryDesc { - q.StartTime = startTime - return q -} - -func (q *QueryDesc) SetStatus(status QueryStatus) *QueryDesc { - q.Status = status - return q -} - -func (q *QueryDesc) SetDuration(duration int64) *QueryDesc { - q.Duration = duration - return q -} - -func (q *QueryDesc) SetQuery(query []byte) *QueryDesc { - q.Query = query - return q -} - -func (q *QueryDesc) SetGraphAddr(graphAddr *nebula0.HostAddr) *QueryDesc { - q.GraphAddr = graphAddr - return q -} - -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 -} - -type SessionBuilder struct { - obj *Session -} - -func NewSessionBuilder() *SessionBuilder{ - return &SessionBuilder{ - obj: NewSession(), - } -} - -func (p SessionBuilder) Emit() *Session{ - return &Session{ - SessionID: p.obj.SessionID, - CreateTime: p.obj.CreateTime, - UpdateTime: p.obj.UpdateTime, - UserName: p.obj.UserName, - SpaceName: p.obj.SpaceName, - GraphAddr: p.obj.GraphAddr, - Timezone: p.obj.Timezone, - ClientIP: p.obj.ClientIP, - Configs: p.obj.Configs, - Queries: p.obj.Queries, - } -} - -func (s *SessionBuilder) SessionID(sessionID nebula0.SessionID) *SessionBuilder { - s.obj.SessionID = sessionID - return s -} - -func (s *SessionBuilder) CreateTime(createTime nebula0.Timestamp) *SessionBuilder { - s.obj.CreateTime = createTime - return s -} - -func (s *SessionBuilder) UpdateTime(updateTime nebula0.Timestamp) *SessionBuilder { - s.obj.UpdateTime = updateTime - return s -} - -func (s *SessionBuilder) UserName(userName []byte) *SessionBuilder { - s.obj.UserName = userName - return s -} - -func (s *SessionBuilder) SpaceName(spaceName []byte) *SessionBuilder { - s.obj.SpaceName = spaceName - return s -} - -func (s *SessionBuilder) GraphAddr(graphAddr *nebula0.HostAddr) *SessionBuilder { - s.obj.GraphAddr = graphAddr - return s -} - -func (s *SessionBuilder) Timezone(timezone int32) *SessionBuilder { - s.obj.Timezone = timezone - return s -} - -func (s *SessionBuilder) ClientIP(clientIP []byte) *SessionBuilder { - s.obj.ClientIP = clientIP - return s -} - -func (s *SessionBuilder) Configs(configs map[string]*nebula0.Value) *SessionBuilder { - s.obj.Configs = configs - return s -} - -func (s *SessionBuilder) Queries(queries map[nebula0.ExecutionPlanID]*QueryDesc) *SessionBuilder { - s.obj.Queries = queries - return s -} - -func (s *Session) SetSessionID(sessionID nebula0.SessionID) *Session { - s.SessionID = sessionID - return s -} - -func (s *Session) SetCreateTime(createTime nebula0.Timestamp) *Session { - s.CreateTime = createTime - return s -} - -func (s *Session) SetUpdateTime(updateTime nebula0.Timestamp) *Session { - s.UpdateTime = updateTime - return s -} - -func (s *Session) SetUserName(userName []byte) *Session { - s.UserName = userName - return s -} - -func (s *Session) SetSpaceName(spaceName []byte) *Session { - s.SpaceName = spaceName - return s -} - -func (s *Session) SetGraphAddr(graphAddr *nebula0.HostAddr) *Session { - s.GraphAddr = graphAddr - return s -} - -func (s *Session) SetTimezone(timezone int32) *Session { - s.Timezone = timezone - return s -} - -func (s *Session) SetClientIP(clientIP []byte) *Session { - s.ClientIP = clientIP - return s -} - -func (s *Session) SetConfigs(configs map[string]*nebula0.Value) *Session { - s.Configs = configs - return s -} - -func (s *Session) SetQueries(queries map[nebula0.ExecutionPlanID]*QueryDesc) *Session { - s.Queries = queries - return s -} - -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 _key94 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key94 = v - } - _val95 := nebula0.NewValue() - if err := _val95.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val95), err) - } - p.Configs[_key94] = _val95 - } - 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 _key96 nebula0.ExecutionPlanID - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.ExecutionPlanID(v) - _key96 = temp - } - _val97 := NewQueryDesc() - if err := _val97.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val97), err) - } - p.Queries[_key96] = _val97 - } - 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 -} - -type CreateSessionReqBuilder struct { - obj *CreateSessionReq -} - -func NewCreateSessionReqBuilder() *CreateSessionReqBuilder{ - return &CreateSessionReqBuilder{ - obj: NewCreateSessionReq(), - } -} - -func (p CreateSessionReqBuilder) Emit() *CreateSessionReq{ - return &CreateSessionReq{ - User: p.obj.User, - GraphAddr: p.obj.GraphAddr, - ClientIP: p.obj.ClientIP, - } -} - -func (c *CreateSessionReqBuilder) User(user []byte) *CreateSessionReqBuilder { - c.obj.User = user - return c -} - -func (c *CreateSessionReqBuilder) GraphAddr(graphAddr *nebula0.HostAddr) *CreateSessionReqBuilder { - c.obj.GraphAddr = graphAddr - return c -} - -func (c *CreateSessionReqBuilder) ClientIP(clientIP []byte) *CreateSessionReqBuilder { - c.obj.ClientIP = clientIP - return c -} - -func (c *CreateSessionReq) SetUser(user []byte) *CreateSessionReq { - c.User = user - return c -} - -func (c *CreateSessionReq) SetGraphAddr(graphAddr *nebula0.HostAddr) *CreateSessionReq { - c.GraphAddr = graphAddr - return c -} - -func (c *CreateSessionReq) SetClientIP(clientIP []byte) *CreateSessionReq { - c.ClientIP = clientIP - return c -} - -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 -} - -type CreateSessionRespBuilder struct { - obj *CreateSessionResp -} - -func NewCreateSessionRespBuilder() *CreateSessionRespBuilder{ - return &CreateSessionRespBuilder{ - obj: NewCreateSessionResp(), - } -} - -func (p CreateSessionRespBuilder) Emit() *CreateSessionResp{ - return &CreateSessionResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Session: p.obj.Session, - } -} - -func (c *CreateSessionRespBuilder) Code(code nebula0.ErrorCode) *CreateSessionRespBuilder { - c.obj.Code = code - return c -} - -func (c *CreateSessionRespBuilder) Leader(leader *nebula0.HostAddr) *CreateSessionRespBuilder { - c.obj.Leader = leader - return c -} - -func (c *CreateSessionRespBuilder) Session(session *Session) *CreateSessionRespBuilder { - c.obj.Session = session - return c -} - -func (c *CreateSessionResp) SetCode(code nebula0.ErrorCode) *CreateSessionResp { - c.Code = code - return c -} - -func (c *CreateSessionResp) SetLeader(leader *nebula0.HostAddr) *CreateSessionResp { - c.Leader = leader - return c -} - -func (c *CreateSessionResp) SetSession(session *Session) *CreateSessionResp { - c.Session = session - return c -} - -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 -} -type UpdateSessionsReqBuilder struct { - obj *UpdateSessionsReq -} - -func NewUpdateSessionsReqBuilder() *UpdateSessionsReqBuilder{ - return &UpdateSessionsReqBuilder{ - obj: NewUpdateSessionsReq(), - } -} - -func (p UpdateSessionsReqBuilder) Emit() *UpdateSessionsReq{ - return &UpdateSessionsReq{ - Sessions: p.obj.Sessions, - } -} - -func (u *UpdateSessionsReqBuilder) Sessions(sessions []*Session) *UpdateSessionsReqBuilder { - u.obj.Sessions = sessions - return u -} - -func (u *UpdateSessionsReq) SetSessions(sessions []*Session) *UpdateSessionsReq { - u.Sessions = sessions - return u -} - -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 ++ { - _elem98 := NewSession() - if err := _elem98.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem98), err) - } - p.Sessions = append(p.Sessions, _elem98) - } - 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 -} - -type UpdateSessionsRespBuilder struct { - obj *UpdateSessionsResp -} - -func NewUpdateSessionsRespBuilder() *UpdateSessionsRespBuilder{ - return &UpdateSessionsRespBuilder{ - obj: NewUpdateSessionsResp(), - } -} - -func (p UpdateSessionsRespBuilder) Emit() *UpdateSessionsResp{ - return &UpdateSessionsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - KilledQueries: p.obj.KilledQueries, - } -} - -func (u *UpdateSessionsRespBuilder) Code(code nebula0.ErrorCode) *UpdateSessionsRespBuilder { - u.obj.Code = code - return u -} - -func (u *UpdateSessionsRespBuilder) Leader(leader *nebula0.HostAddr) *UpdateSessionsRespBuilder { - u.obj.Leader = leader - return u -} - -func (u *UpdateSessionsRespBuilder) KilledQueries(killedQueries map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc) *UpdateSessionsRespBuilder { - u.obj.KilledQueries = killedQueries - return u -} - -func (u *UpdateSessionsResp) SetCode(code nebula0.ErrorCode) *UpdateSessionsResp { - u.Code = code - return u -} - -func (u *UpdateSessionsResp) SetLeader(leader *nebula0.HostAddr) *UpdateSessionsResp { - u.Leader = leader - return u -} - -func (u *UpdateSessionsResp) SetKilledQueries(killedQueries map[nebula0.SessionID]map[nebula0.ExecutionPlanID]*QueryDesc) *UpdateSessionsResp { - u.KilledQueries = killedQueries - return u -} - -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 _key99 nebula0.SessionID - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.SessionID(v) - _key99 = temp - } - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.ExecutionPlanID]*QueryDesc, size) - _val100 := tMap - for i := 0; i < size; i ++ { - var _key101 nebula0.ExecutionPlanID - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.ExecutionPlanID(v) - _key101 = temp - } - _val102 := NewQueryDesc() - if err := _val102.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val102), err) - } - _val100[_key101] = _val102 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - p.KilledQueries[_key99] = _val100 - } - 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{} -} - -type ListSessionsReqBuilder struct { - obj *ListSessionsReq -} - -func NewListSessionsReqBuilder() *ListSessionsReqBuilder{ - return &ListSessionsReqBuilder{ - obj: NewListSessionsReq(), - } -} - -func (p ListSessionsReqBuilder) Emit() *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 -} - -type ListSessionsRespBuilder struct { - obj *ListSessionsResp -} - -func NewListSessionsRespBuilder() *ListSessionsRespBuilder{ - return &ListSessionsRespBuilder{ - obj: NewListSessionsResp(), - } -} - -func (p ListSessionsRespBuilder) Emit() *ListSessionsResp{ - return &ListSessionsResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Sessions: p.obj.Sessions, - } -} - -func (l *ListSessionsRespBuilder) Code(code nebula0.ErrorCode) *ListSessionsRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListSessionsRespBuilder) Leader(leader *nebula0.HostAddr) *ListSessionsRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListSessionsRespBuilder) Sessions(sessions []*Session) *ListSessionsRespBuilder { - l.obj.Sessions = sessions - return l -} - -func (l *ListSessionsResp) SetCode(code nebula0.ErrorCode) *ListSessionsResp { - l.Code = code - return l -} - -func (l *ListSessionsResp) SetLeader(leader *nebula0.HostAddr) *ListSessionsResp { - l.Leader = leader - return l -} - -func (l *ListSessionsResp) SetSessions(sessions []*Session) *ListSessionsResp { - l.Sessions = sessions - return l -} - -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 ++ { - _elem103 := NewSession() - if err := _elem103.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem103), err) - } - p.Sessions = append(p.Sessions, _elem103) - } - 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 -} -type GetSessionReqBuilder struct { - obj *GetSessionReq -} - -func NewGetSessionReqBuilder() *GetSessionReqBuilder{ - return &GetSessionReqBuilder{ - obj: NewGetSessionReq(), - } -} - -func (p GetSessionReqBuilder) Emit() *GetSessionReq{ - return &GetSessionReq{ - SessionID: p.obj.SessionID, - } -} - -func (g *GetSessionReqBuilder) SessionID(sessionID nebula0.SessionID) *GetSessionReqBuilder { - g.obj.SessionID = sessionID - return g -} - -func (g *GetSessionReq) SetSessionID(sessionID nebula0.SessionID) *GetSessionReq { - g.SessionID = sessionID - return g -} - -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 -} - -type GetSessionRespBuilder struct { - obj *GetSessionResp -} - -func NewGetSessionRespBuilder() *GetSessionRespBuilder{ - return &GetSessionRespBuilder{ - obj: NewGetSessionResp(), - } -} - -func (p GetSessionRespBuilder) Emit() *GetSessionResp{ - return &GetSessionResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - Session: p.obj.Session, - } -} - -func (g *GetSessionRespBuilder) Code(code nebula0.ErrorCode) *GetSessionRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetSessionRespBuilder) Leader(leader *nebula0.HostAddr) *GetSessionRespBuilder { - g.obj.Leader = leader - return g -} - -func (g *GetSessionRespBuilder) Session(session *Session) *GetSessionRespBuilder { - g.obj.Session = session - return g -} - -func (g *GetSessionResp) SetCode(code nebula0.ErrorCode) *GetSessionResp { - g.Code = code - return g -} - -func (g *GetSessionResp) SetLeader(leader *nebula0.HostAddr) *GetSessionResp { - g.Leader = leader - return g -} - -func (g *GetSessionResp) SetSession(session *Session) *GetSessionResp { - g.Session = session - return g -} - -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 -} -type RemoveSessionReqBuilder struct { - obj *RemoveSessionReq -} - -func NewRemoveSessionReqBuilder() *RemoveSessionReqBuilder{ - return &RemoveSessionReqBuilder{ - obj: NewRemoveSessionReq(), - } -} - -func (p RemoveSessionReqBuilder) Emit() *RemoveSessionReq{ - return &RemoveSessionReq{ - SessionID: p.obj.SessionID, - } -} - -func (r *RemoveSessionReqBuilder) SessionID(sessionID nebula0.SessionID) *RemoveSessionReqBuilder { - r.obj.SessionID = sessionID - return r -} - -func (r *RemoveSessionReq) SetSessionID(sessionID nebula0.SessionID) *RemoveSessionReq { - r.SessionID = sessionID - return r -} - -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 -} -type KillQueryReqBuilder struct { - obj *KillQueryReq -} - -func NewKillQueryReqBuilder() *KillQueryReqBuilder{ - return &KillQueryReqBuilder{ - obj: NewKillQueryReq(), - } -} - -func (p KillQueryReqBuilder) Emit() *KillQueryReq{ - return &KillQueryReq{ - KillQueries: p.obj.KillQueries, - } -} - -func (k *KillQueryReqBuilder) KillQueries(killQueries map[nebula0.SessionID][]nebula0.ExecutionPlanID) *KillQueryReqBuilder { - k.obj.KillQueries = killQueries - return k -} - -func (k *KillQueryReq) SetKillQueries(killQueries map[nebula0.SessionID][]nebula0.ExecutionPlanID) *KillQueryReq { - k.KillQueries = killQueries - return k -} - -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 _key104 nebula0.SessionID - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.SessionID(v) - _key104 = temp - } - _, size, err := iprot.ReadSetBegin() - if err != nil { - return thrift.PrependError("error reading set begin: ", err) - } - tSet := make([]nebula0.ExecutionPlanID, 0, size) - _val105 := tSet - for i := 0; i < size; i ++ { - var _elem106 nebula0.ExecutionPlanID - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.ExecutionPlanID(v) - _elem106 = temp - } - _val105 = append(_val105, _elem106) - } - if err := iprot.ReadSetEnd(); err != nil { - return thrift.PrependError("error reading set end: ", err) - } - p.KillQueries[_key104] = _val105 - } - 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 -// - SpaceID -// - JobID -// - TaskID -// - Stats -type ReportTaskReq struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - SpaceID nebula0.GraphSpaceID `thrift:"space_id,2" db:"space_id" json:"space_id"` - JobID int32 `thrift:"job_id,3" db:"job_id" json:"job_id"` - TaskID int32 `thrift:"task_id,4" db:"task_id" json:"task_id"` - Stats *StatsItem `thrift:"stats,5,optional" db:"stats" json:"stats,omitempty"` -} - -func NewReportTaskReq() *ReportTaskReq { - return &ReportTaskReq{} -} - - -func (p *ReportTaskReq) GetCode() nebula0.ErrorCode { - return p.Code -} - -func (p *ReportTaskReq) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -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 -} - -type ReportTaskReqBuilder struct { - obj *ReportTaskReq -} - -func NewReportTaskReqBuilder() *ReportTaskReqBuilder{ - return &ReportTaskReqBuilder{ - obj: NewReportTaskReq(), - } -} - -func (p ReportTaskReqBuilder) Emit() *ReportTaskReq{ - return &ReportTaskReq{ - Code: p.obj.Code, - SpaceID: p.obj.SpaceID, - JobID: p.obj.JobID, - TaskID: p.obj.TaskID, - Stats: p.obj.Stats, - } -} - -func (r *ReportTaskReqBuilder) Code(code nebula0.ErrorCode) *ReportTaskReqBuilder { - r.obj.Code = code - return r -} - -func (r *ReportTaskReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ReportTaskReqBuilder { - r.obj.SpaceID = spaceID - return r -} - -func (r *ReportTaskReqBuilder) JobID(jobID int32) *ReportTaskReqBuilder { - r.obj.JobID = jobID - return r -} - -func (r *ReportTaskReqBuilder) TaskID(taskID int32) *ReportTaskReqBuilder { - r.obj.TaskID = taskID - return r -} - -func (r *ReportTaskReqBuilder) Stats(stats *StatsItem) *ReportTaskReqBuilder { - r.obj.Stats = stats - return r -} - -func (r *ReportTaskReq) SetCode(code nebula0.ErrorCode) *ReportTaskReq { - r.Code = code - return r -} - -func (r *ReportTaskReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ReportTaskReq { - r.SpaceID = spaceID - return r -} - -func (r *ReportTaskReq) SetJobID(jobID int32) *ReportTaskReq { - r.JobID = jobID - return r -} - -func (r *ReportTaskReq) SetTaskID(taskID int32) *ReportTaskReq { - r.TaskID = taskID - return r -} - -func (r *ReportTaskReq) SetStats(stats *StatsItem) *ReportTaskReq { - r.Stats = stats - return r -} - -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 - } - 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 *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 { - temp := nebula0.GraphSpaceID(v) - p.SpaceID = temp - } - 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.JobID = v - } - return nil -} - -func (p *ReportTaskReq) ReadField4(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.TaskID = v - } - return nil -} - -func (p *ReportTaskReq) ReadField5(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 := 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 *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("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 *ReportTaskReq) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("job_id", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:job_id: ", p), err) } - if err := oprot.WriteI32(int32(p.JobID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.job_id (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:job_id: ", p), err) } - return err -} - -func (p *ReportTaskReq) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("task_id", thrift.I32, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:task_id: ", p), err) } - if err := oprot.WriteI32(int32(p.TaskID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.task_id (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:task_id: ", p), err) } - return err -} - -func (p *ReportTaskReq) writeField5(oprot thrift.Protocol) (err error) { - if p.IsSetStats() { - if err := oprot.WriteFieldBegin("stats", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5: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 5:stats: ", p), err) } - } - return err -} - -func (p *ReportTaskReq) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - 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 SpaceID:%s JobID:%s TaskID:%s Stats:%s})", codeVal, spaceIDVal, jobIDVal, taskIDVal, statsVal) -} - -// Attributes: -// - Code -// - Leader -// - HostServices -type ListClusterInfoResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - Leader *nebula0.HostAddr `thrift:"leader,2" db:"leader" json:"leader"` - HostServices map[string][]*ServiceInfo `thrift:"host_services,3" db:"host_services" json:"host_services"` -} - -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) GetHostServices() map[string][]*ServiceInfo { - return p.HostServices -} -func (p *ListClusterInfoResp) IsSetLeader() bool { - return p != nil && p.Leader != nil -} - -type ListClusterInfoRespBuilder struct { - obj *ListClusterInfoResp -} - -func NewListClusterInfoRespBuilder() *ListClusterInfoRespBuilder{ - return &ListClusterInfoRespBuilder{ - obj: NewListClusterInfoResp(), - } -} - -func (p ListClusterInfoRespBuilder) Emit() *ListClusterInfoResp{ - return &ListClusterInfoResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - HostServices: p.obj.HostServices, - } -} - -func (l *ListClusterInfoRespBuilder) Code(code nebula0.ErrorCode) *ListClusterInfoRespBuilder { - l.obj.Code = code - return l -} - -func (l *ListClusterInfoRespBuilder) Leader(leader *nebula0.HostAddr) *ListClusterInfoRespBuilder { - l.obj.Leader = leader - return l -} - -func (l *ListClusterInfoRespBuilder) HostServices(hostServices map[string][]*ServiceInfo) *ListClusterInfoRespBuilder { - l.obj.HostServices = hostServices - return l -} - -func (l *ListClusterInfoResp) SetCode(code nebula0.ErrorCode) *ListClusterInfoResp { - l.Code = code - return l -} - -func (l *ListClusterInfoResp) SetLeader(leader *nebula0.HostAddr) *ListClusterInfoResp { - l.Leader = leader - return l -} - -func (l *ListClusterInfoResp) SetHostServices(hostServices map[string][]*ServiceInfo) *ListClusterInfoResp { - l.HostServices = hostServices - return l -} - -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 - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - 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.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[string][]*ServiceInfo, size) - p.HostServices = tMap - for i := 0; i < size; i ++ { - var _key107 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key107 = v - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*ServiceInfo, 0, size) - _val108 := tSlice - for i := 0; i < size; i ++ { - _elem109 := NewServiceInfo() - if err := _elem109.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem109), err) - } - _val108 = append(_val108, _elem109) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.HostServices[_key107] = _val108 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map 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 := oprot.WriteFieldStop(); err != nil { - return thrift.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("host_services", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:host_services: ", p), err) } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.LIST, len(p.HostServices)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.HostServices { - 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.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:host_services: ", 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) - } - hostServicesVal := fmt.Sprintf("%v", p.HostServices) - return fmt.Sprintf("ListClusterInfoResp({Code:%s Leader:%s HostServices:%s})", codeVal, leaderVal, hostServicesVal) -} - -type ListClusterInfoReq struct { -} - -func NewListClusterInfoReq() *ListClusterInfoReq { - return &ListClusterInfoReq{} -} - -type ListClusterInfoReqBuilder struct { - obj *ListClusterInfoReq -} - -func NewListClusterInfoReqBuilder() *ListClusterInfoReqBuilder{ - return &ListClusterInfoReqBuilder{ - obj: NewListClusterInfoReq(), - } -} - -func (p ListClusterInfoReqBuilder) Emit() *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 -} - -type GetMetaDirInfoRespBuilder struct { - obj *GetMetaDirInfoResp -} - -func NewGetMetaDirInfoRespBuilder() *GetMetaDirInfoRespBuilder{ - return &GetMetaDirInfoRespBuilder{ - obj: NewGetMetaDirInfoResp(), - } -} - -func (p GetMetaDirInfoRespBuilder) Emit() *GetMetaDirInfoResp{ - return &GetMetaDirInfoResp{ - Code: p.obj.Code, - Dir: p.obj.Dir, - } -} - -func (g *GetMetaDirInfoRespBuilder) Code(code nebula0.ErrorCode) *GetMetaDirInfoRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetMetaDirInfoRespBuilder) Dir(dir *nebula0.DirInfo) *GetMetaDirInfoRespBuilder { - g.obj.Dir = dir - return g -} - -func (g *GetMetaDirInfoResp) SetCode(code nebula0.ErrorCode) *GetMetaDirInfoResp { - g.Code = code - return g -} - -func (g *GetMetaDirInfoResp) SetDir(dir *nebula0.DirInfo) *GetMetaDirInfoResp { - g.Dir = dir - return g -} - -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{} -} - -type GetMetaDirInfoReqBuilder struct { - obj *GetMetaDirInfoReq -} - -func NewGetMetaDirInfoReqBuilder() *GetMetaDirInfoReqBuilder{ - return &GetMetaDirInfoReqBuilder{ - obj: NewGetMetaDirInfoReq(), - } -} - -func (p GetMetaDirInfoReqBuilder) Emit() *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,optional" 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 -} - -type VerifyClientVersionRespBuilder struct { - obj *VerifyClientVersionResp -} - -func NewVerifyClientVersionRespBuilder() *VerifyClientVersionRespBuilder{ - return &VerifyClientVersionRespBuilder{ - obj: NewVerifyClientVersionResp(), - } -} - -func (p VerifyClientVersionRespBuilder) Emit() *VerifyClientVersionResp{ - return &VerifyClientVersionResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - ErrorMsg: p.obj.ErrorMsg, - } -} - -func (v *VerifyClientVersionRespBuilder) Code(code nebula0.ErrorCode) *VerifyClientVersionRespBuilder { - v.obj.Code = code - return v -} - -func (v *VerifyClientVersionRespBuilder) Leader(leader *nebula0.HostAddr) *VerifyClientVersionRespBuilder { - v.obj.Leader = leader - return v -} - -func (v *VerifyClientVersionRespBuilder) ErrorMsg(errorMsg []byte) *VerifyClientVersionRespBuilder { - v.obj.ErrorMsg = errorMsg - return v -} - -func (v *VerifyClientVersionResp) SetCode(code nebula0.ErrorCode) *VerifyClientVersionResp { - v.Code = code - return v -} - -func (v *VerifyClientVersionResp) SetLeader(leader *nebula0.HostAddr) *VerifyClientVersionResp { - v.Leader = leader - return v -} - -func (v *VerifyClientVersionResp) SetErrorMsg(errorMsg []byte) *VerifyClientVersionResp { - v.ErrorMsg = errorMsg - return v -} - -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: -// - ClientVersion -// - Host -// - BuildVersion -type VerifyClientVersionReq struct { - ClientVersion []byte `thrift:"client_version,1,required" db:"client_version" json:"client_version"` - Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` - BuildVersion []byte `thrift:"build_version,3" db:"build_version" json:"build_version"` -} - -func NewVerifyClientVersionReq() *VerifyClientVersionReq { - return &VerifyClientVersionReq{ - ClientVersion: []byte("3.0.0"), - Host: nebula0.NewHostAddr(), - } -} - - -func (p *VerifyClientVersionReq) GetClientVersion() []byte { - return p.ClientVersion -} -var VerifyClientVersionReq_Host_DEFAULT *nebula0.HostAddr -func (p *VerifyClientVersionReq) GetHost() *nebula0.HostAddr { - if !p.IsSetHost() { - return VerifyClientVersionReq_Host_DEFAULT - } -return p.Host -} - -func (p *VerifyClientVersionReq) GetBuildVersion() []byte { - return p.BuildVersion -} -func (p *VerifyClientVersionReq) IsSetHost() bool { - return p != nil && p.Host != nil -} - -type VerifyClientVersionReqBuilder struct { - obj *VerifyClientVersionReq -} - -func NewVerifyClientVersionReqBuilder() *VerifyClientVersionReqBuilder{ - return &VerifyClientVersionReqBuilder{ - obj: NewVerifyClientVersionReq(), - } -} - -func (p VerifyClientVersionReqBuilder) Emit() *VerifyClientVersionReq{ - return &VerifyClientVersionReq{ - ClientVersion: p.obj.ClientVersion, - Host: p.obj.Host, - BuildVersion: p.obj.BuildVersion, - } -} - -func (v *VerifyClientVersionReqBuilder) ClientVersion(clientVersion []byte) *VerifyClientVersionReqBuilder { - v.obj.ClientVersion = clientVersion - return v -} - -func (v *VerifyClientVersionReqBuilder) Host(host *nebula0.HostAddr) *VerifyClientVersionReqBuilder { - v.obj.Host = host - return v -} - -func (v *VerifyClientVersionReqBuilder) BuildVersion(buildVersion []byte) *VerifyClientVersionReqBuilder { - v.obj.BuildVersion = buildVersion - return v -} - -func (v *VerifyClientVersionReq) SetClientVersion(clientVersion []byte) *VerifyClientVersionReq { - v.ClientVersion = clientVersion - return v -} - -func (v *VerifyClientVersionReq) SetHost(host *nebula0.HostAddr) *VerifyClientVersionReq { - v.Host = host - return v -} - -func (v *VerifyClientVersionReq) SetBuildVersion(buildVersion []byte) *VerifyClientVersionReq { - v.BuildVersion = buildVersion - return v -} - -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 issetClientVersion 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 - } - issetClientVersion = true - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := 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 !issetClientVersion{ - return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientVersion 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.ClientVersion = v - } - return nil -} - -func (p *VerifyClientVersionReq) 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 *VerifyClientVersionReq) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.BuildVersion = v - } - return nil -} - -func (p *VerifyClientVersionReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("VerifyClientVersionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *VerifyClientVersionReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("client_version", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_version: ", p), err) } - if err := oprot.WriteBinary(p.ClientVersion); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_version (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_version: ", p), err) } - return err -} - -func (p *VerifyClientVersionReq) 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 *VerifyClientVersionReq) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("build_version", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:build_version: ", p), err) } - if err := oprot.WriteBinary(p.BuildVersion); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.build_version (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:build_version: ", p), err) } - return err -} - -func (p *VerifyClientVersionReq) String() string { - if p == nil { - return "" - } - - clientVersionVal := fmt.Sprintf("%v", p.ClientVersion) - var hostVal string - if p.Host == nil { - hostVal = "" - } else { - hostVal = fmt.Sprintf("%v", p.Host) - } - buildVersionVal := fmt.Sprintf("%v", p.BuildVersion) - return fmt.Sprintf("VerifyClientVersionReq({ClientVersion:%s Host:%s BuildVersion:%s})", clientVersionVal, hostVal, buildVersionVal) -} - -// Attributes: -// - Code -// - Leader -// - ErrorMsg -type SaveGraphVersionResp 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,optional" db:"error_msg" json:"error_msg,omitempty"` -} - -func NewSaveGraphVersionResp() *SaveGraphVersionResp { - return &SaveGraphVersionResp{ - Leader: nebula0.NewHostAddr(), - } -} - - -func (p *SaveGraphVersionResp) GetCode() nebula0.ErrorCode { - return p.Code -} -var SaveGraphVersionResp_Leader_DEFAULT *nebula0.HostAddr -func (p *SaveGraphVersionResp) GetLeader() *nebula0.HostAddr { - if !p.IsSetLeader() { - return SaveGraphVersionResp_Leader_DEFAULT - } -return p.Leader -} -var SaveGraphVersionResp_ErrorMsg_DEFAULT []byte - -func (p *SaveGraphVersionResp) GetErrorMsg() []byte { - return p.ErrorMsg -} -func (p *SaveGraphVersionResp) IsSetLeader() bool { - return p != nil && p.Leader != nil -} - -func (p *SaveGraphVersionResp) IsSetErrorMsg() bool { - return p != nil && p.ErrorMsg != nil -} - -type SaveGraphVersionRespBuilder struct { - obj *SaveGraphVersionResp -} - -func NewSaveGraphVersionRespBuilder() *SaveGraphVersionRespBuilder{ - return &SaveGraphVersionRespBuilder{ - obj: NewSaveGraphVersionResp(), - } -} - -func (p SaveGraphVersionRespBuilder) Emit() *SaveGraphVersionResp{ - return &SaveGraphVersionResp{ - Code: p.obj.Code, - Leader: p.obj.Leader, - ErrorMsg: p.obj.ErrorMsg, - } -} - -func (s *SaveGraphVersionRespBuilder) Code(code nebula0.ErrorCode) *SaveGraphVersionRespBuilder { - s.obj.Code = code - return s -} - -func (s *SaveGraphVersionRespBuilder) Leader(leader *nebula0.HostAddr) *SaveGraphVersionRespBuilder { - s.obj.Leader = leader - return s -} - -func (s *SaveGraphVersionRespBuilder) ErrorMsg(errorMsg []byte) *SaveGraphVersionRespBuilder { - s.obj.ErrorMsg = errorMsg - return s -} - -func (s *SaveGraphVersionResp) SetCode(code nebula0.ErrorCode) *SaveGraphVersionResp { - s.Code = code - return s -} - -func (s *SaveGraphVersionResp) SetLeader(leader *nebula0.HostAddr) *SaveGraphVersionResp { - s.Leader = leader - return s -} - -func (s *SaveGraphVersionResp) SetErrorMsg(errorMsg []byte) *SaveGraphVersionResp { - s.ErrorMsg = errorMsg - return s -} - -func (p *SaveGraphVersionResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *SaveGraphVersionResp) 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 *SaveGraphVersionResp) 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 *SaveGraphVersionResp) 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 *SaveGraphVersionResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("SaveGraphVersionResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *SaveGraphVersionResp) 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 *SaveGraphVersionResp) 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 *SaveGraphVersionResp) 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 *SaveGraphVersionResp) 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("SaveGraphVersionResp({Code:%s Leader:%s ErrorMsg:%s})", codeVal, leaderVal, errorMsgVal) -} - -// Attributes: -// - ClientVersion -// - Host -// - BuildVersion -type SaveGraphVersionReq struct { - ClientVersion []byte `thrift:"client_version,1,required" db:"client_version" json:"client_version"` - Host *nebula0.HostAddr `thrift:"host,2" db:"host" json:"host"` - BuildVersion []byte `thrift:"build_version,3" db:"build_version" json:"build_version"` -} - -func NewSaveGraphVersionReq() *SaveGraphVersionReq { - return &SaveGraphVersionReq{ - ClientVersion: []byte("3.0.0"), - Host: nebula0.NewHostAddr(), - } -} - - -func (p *SaveGraphVersionReq) GetClientVersion() []byte { - return p.ClientVersion -} -var SaveGraphVersionReq_Host_DEFAULT *nebula0.HostAddr -func (p *SaveGraphVersionReq) GetHost() *nebula0.HostAddr { - if !p.IsSetHost() { - return SaveGraphVersionReq_Host_DEFAULT - } -return p.Host -} - -func (p *SaveGraphVersionReq) GetBuildVersion() []byte { - return p.BuildVersion -} -func (p *SaveGraphVersionReq) IsSetHost() bool { - return p != nil && p.Host != nil -} - -type SaveGraphVersionReqBuilder struct { - obj *SaveGraphVersionReq -} - -func NewSaveGraphVersionReqBuilder() *SaveGraphVersionReqBuilder{ - return &SaveGraphVersionReqBuilder{ - obj: NewSaveGraphVersionReq(), - } -} - -func (p SaveGraphVersionReqBuilder) Emit() *SaveGraphVersionReq{ - return &SaveGraphVersionReq{ - ClientVersion: p.obj.ClientVersion, - Host: p.obj.Host, - BuildVersion: p.obj.BuildVersion, - } -} - -func (s *SaveGraphVersionReqBuilder) ClientVersion(clientVersion []byte) *SaveGraphVersionReqBuilder { - s.obj.ClientVersion = clientVersion - return s -} - -func (s *SaveGraphVersionReqBuilder) Host(host *nebula0.HostAddr) *SaveGraphVersionReqBuilder { - s.obj.Host = host - return s -} - -func (s *SaveGraphVersionReqBuilder) BuildVersion(buildVersion []byte) *SaveGraphVersionReqBuilder { - s.obj.BuildVersion = buildVersion - return s -} - -func (s *SaveGraphVersionReq) SetClientVersion(clientVersion []byte) *SaveGraphVersionReq { - s.ClientVersion = clientVersion - return s -} - -func (s *SaveGraphVersionReq) SetHost(host *nebula0.HostAddr) *SaveGraphVersionReq { - s.Host = host - return s -} - -func (s *SaveGraphVersionReq) SetBuildVersion(buildVersion []byte) *SaveGraphVersionReq { - s.BuildVersion = buildVersion - return s -} - -func (p *SaveGraphVersionReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetClientVersion 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 - } - issetClientVersion = true - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := 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 !issetClientVersion{ - return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field ClientVersion is not set")); - } - return nil -} - -func (p *SaveGraphVersionReq) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.ClientVersion = v - } - return nil -} - -func (p *SaveGraphVersionReq) 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 *SaveGraphVersionReq) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.BuildVersion = v - } - return nil -} - -func (p *SaveGraphVersionReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("SaveGraphVersionReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *SaveGraphVersionReq) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("client_version", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:client_version: ", p), err) } - if err := oprot.WriteBinary(p.ClientVersion); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.client_version (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:client_version: ", p), err) } - return err -} - -func (p *SaveGraphVersionReq) 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 *SaveGraphVersionReq) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("build_version", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:build_version: ", p), err) } - if err := oprot.WriteBinary(p.BuildVersion); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.build_version (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:build_version: ", p), err) } - return err -} - -func (p *SaveGraphVersionReq) String() string { - if p == nil { - return "" - } - - clientVersionVal := fmt.Sprintf("%v", p.ClientVersion) - var hostVal string - if p.Host == nil { - hostVal = "" - } else { - hostVal = fmt.Sprintf("%v", p.Host) - } - buildVersionVal := fmt.Sprintf("%v", p.BuildVersion) - return fmt.Sprintf("SaveGraphVersionReq({ClientVersion:%s Host:%s BuildVersion:%s})", clientVersionVal, hostVal, buildVersionVal) -} - diff --git a/nebula/storage/GoUnusedProtection__.go b/nebula/storage/GoUnusedProtection__.go new file mode 100644 index 00000000..c5af79e3 --- /dev/null +++ b/nebula/storage/GoUnusedProtection__.go @@ -0,0 +1,6 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package storage + +var GoUnusedProtection__ int; + diff --git a/nebula/storage/constants.go b/nebula/storage/constants.go deleted file mode 100644 index 72719f8d..00000000 --- a/nebula/storage/constants.go +++ /dev/null @@ -1,30 +0,0 @@ -// Autogenerated by Thrift Compiler (facebook) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -// @generated - -package storage - -import ( - "bytes" - "context" - "sync" - "fmt" - thrift "github.com/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - meta1 "github.com/vesoft-inc/nebula-go/v3/nebula/meta" - -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = sync.Mutex{} -var _ = bytes.Equal -var _ = context.Background - -var _ = nebula0.GoUnusedProtection__ -var _ = meta1.GoUnusedProtection__ - -func init() { -} - diff --git a/nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go b/nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go new file mode 100755 index 00000000..f7dbb0f8 --- /dev/null +++ b/nebula/storage/graph_storage_service-remote/graph_storage_service-remote.go @@ -0,0 +1,703 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package main + +import ( + "context" + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/apache/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-go/v3/nebula" + "github.com/vesoft-inc/nebula-go/v3/nebula/meta" + "github.com/vesoft-inc/nebula-go/v3/nebula/storage" +) + +var _ = nebula.GoUnusedProtection__ +var _ = meta.GoUnusedProtection__ +var _ = storage.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse getNeighbors(GetNeighborsRequest req)") + fmt.Fprintln(os.Stderr, " GetDstBySrcResponse getDstBySrc(GetDstBySrcRequest 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, " ScanResponse scanVertex(ScanVertexRequest req)") + fmt.Fprintln(os.Stderr, " ScanResponse scanEdge(ScanEdgeRequest req)") + fmt.Fprintln(os.Stderr, " GetUUIDResp getUUID(GetUUIDReq req)") + fmt.Fprintln(os.Stderr, " LookupIndexResp lookupIndex(LookupIndexRequest req)") + fmt.Fprintln(os.Stderr, " GetNeighborsResponse lookupAndTraverse(LookupAndTraverseRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse chainUpdateEdge(UpdateEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse chainAddEdges(AddEdgesRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse chainDeleteEdges(DeleteEdgesRequest req)") + 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) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + var cfg *thrift.TConfiguration = nil + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransportConf(trans, cfg) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg) + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg) + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg) + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := storage.NewGraphStorageServiceClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "getNeighbors": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetNeighbors requires 1 args") + flag.Usage() + } + arg306 := flag.Arg(1) + mbTrans307 := thrift.NewTMemoryBufferLen(len(arg306)) + defer mbTrans307.Close() + _, err308 := mbTrans307.WriteString(arg306) + if err308 != nil { + Usage() + return + } + factory309 := thrift.NewTJSONProtocolFactory() + jsProt310 := factory309.GetProtocol(mbTrans307) + argvalue0 := storage.NewGetNeighborsRequest() + err311 := argvalue0.Read(context.Background(), jsProt310) + if err311 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetNeighbors(context.Background(), value0)) + fmt.Print("\n") + break + case "getDstBySrc": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetDstBySrc requires 1 args") + flag.Usage() + } + arg312 := flag.Arg(1) + mbTrans313 := thrift.NewTMemoryBufferLen(len(arg312)) + defer mbTrans313.Close() + _, err314 := mbTrans313.WriteString(arg312) + if err314 != nil { + Usage() + return + } + factory315 := thrift.NewTJSONProtocolFactory() + jsProt316 := factory315.GetProtocol(mbTrans313) + argvalue0 := storage.NewGetDstBySrcRequest() + err317 := argvalue0.Read(context.Background(), jsProt316) + if err317 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetDstBySrc(context.Background(), value0)) + fmt.Print("\n") + break + case "getProps": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetProps requires 1 args") + flag.Usage() + } + arg318 := flag.Arg(1) + mbTrans319 := thrift.NewTMemoryBufferLen(len(arg318)) + defer mbTrans319.Close() + _, err320 := mbTrans319.WriteString(arg318) + if err320 != nil { + Usage() + return + } + factory321 := thrift.NewTJSONProtocolFactory() + jsProt322 := factory321.GetProtocol(mbTrans319) + argvalue0 := storage.NewGetPropRequest() + err323 := argvalue0.Read(context.Background(), jsProt322) + if err323 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetProps(context.Background(), value0)) + fmt.Print("\n") + break + case "addVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddVertices requires 1 args") + flag.Usage() + } + arg324 := flag.Arg(1) + mbTrans325 := thrift.NewTMemoryBufferLen(len(arg324)) + defer mbTrans325.Close() + _, err326 := mbTrans325.WriteString(arg324) + if err326 != nil { + Usage() + return + } + factory327 := thrift.NewTJSONProtocolFactory() + jsProt328 := factory327.GetProtocol(mbTrans325) + argvalue0 := storage.NewAddVerticesRequest() + err329 := argvalue0.Read(context.Background(), jsProt328) + if err329 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddVertices(context.Background(), value0)) + fmt.Print("\n") + break + case "addEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddEdges requires 1 args") + flag.Usage() + } + arg330 := flag.Arg(1) + mbTrans331 := thrift.NewTMemoryBufferLen(len(arg330)) + defer mbTrans331.Close() + _, err332 := mbTrans331.WriteString(arg330) + if err332 != nil { + Usage() + return + } + factory333 := thrift.NewTJSONProtocolFactory() + jsProt334 := factory333.GetProtocol(mbTrans331) + argvalue0 := storage.NewAddEdgesRequest() + err335 := argvalue0.Read(context.Background(), jsProt334) + if err335 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddEdges(context.Background(), value0)) + fmt.Print("\n") + break + case "deleteEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteEdges requires 1 args") + flag.Usage() + } + arg336 := flag.Arg(1) + mbTrans337 := thrift.NewTMemoryBufferLen(len(arg336)) + defer mbTrans337.Close() + _, err338 := mbTrans337.WriteString(arg336) + if err338 != nil { + Usage() + return + } + factory339 := thrift.NewTJSONProtocolFactory() + jsProt340 := factory339.GetProtocol(mbTrans337) + argvalue0 := storage.NewDeleteEdgesRequest() + err341 := argvalue0.Read(context.Background(), jsProt340) + if err341 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteEdges(context.Background(), value0)) + fmt.Print("\n") + break + case "deleteVertices": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteVertices requires 1 args") + flag.Usage() + } + arg342 := flag.Arg(1) + mbTrans343 := thrift.NewTMemoryBufferLen(len(arg342)) + defer mbTrans343.Close() + _, err344 := mbTrans343.WriteString(arg342) + if err344 != nil { + Usage() + return + } + factory345 := thrift.NewTJSONProtocolFactory() + jsProt346 := factory345.GetProtocol(mbTrans343) + argvalue0 := storage.NewDeleteVerticesRequest() + err347 := argvalue0.Read(context.Background(), jsProt346) + if err347 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteVertices(context.Background(), value0)) + fmt.Print("\n") + break + case "deleteTags": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DeleteTags requires 1 args") + flag.Usage() + } + arg348 := flag.Arg(1) + mbTrans349 := thrift.NewTMemoryBufferLen(len(arg348)) + defer mbTrans349.Close() + _, err350 := mbTrans349.WriteString(arg348) + if err350 != nil { + Usage() + return + } + factory351 := thrift.NewTJSONProtocolFactory() + jsProt352 := factory351.GetProtocol(mbTrans349) + argvalue0 := storage.NewDeleteTagsRequest() + err353 := argvalue0.Read(context.Background(), jsProt352) + if err353 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DeleteTags(context.Background(), value0)) + fmt.Print("\n") + break + case "updateVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateVertex requires 1 args") + flag.Usage() + } + arg354 := flag.Arg(1) + mbTrans355 := thrift.NewTMemoryBufferLen(len(arg354)) + defer mbTrans355.Close() + _, err356 := mbTrans355.WriteString(arg354) + if err356 != nil { + Usage() + return + } + factory357 := thrift.NewTJSONProtocolFactory() + jsProt358 := factory357.GetProtocol(mbTrans355) + argvalue0 := storage.NewUpdateVertexRequest() + err359 := argvalue0.Read(context.Background(), jsProt358) + if err359 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateVertex(context.Background(), value0)) + fmt.Print("\n") + break + case "updateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "UpdateEdge requires 1 args") + flag.Usage() + } + arg360 := flag.Arg(1) + mbTrans361 := thrift.NewTMemoryBufferLen(len(arg360)) + defer mbTrans361.Close() + _, err362 := mbTrans361.WriteString(arg360) + if err362 != nil { + Usage() + return + } + factory363 := thrift.NewTJSONProtocolFactory() + jsProt364 := factory363.GetProtocol(mbTrans361) + argvalue0 := storage.NewUpdateEdgeRequest() + err365 := argvalue0.Read(context.Background(), jsProt364) + if err365 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.UpdateEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "scanVertex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanVertex requires 1 args") + flag.Usage() + } + arg366 := flag.Arg(1) + mbTrans367 := thrift.NewTMemoryBufferLen(len(arg366)) + defer mbTrans367.Close() + _, err368 := mbTrans367.WriteString(arg366) + if err368 != nil { + Usage() + return + } + factory369 := thrift.NewTJSONProtocolFactory() + jsProt370 := factory369.GetProtocol(mbTrans367) + argvalue0 := storage.NewScanVertexRequest() + err371 := argvalue0.Read(context.Background(), jsProt370) + if err371 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanVertex(context.Background(), value0)) + fmt.Print("\n") + break + case "scanEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ScanEdge requires 1 args") + flag.Usage() + } + arg372 := flag.Arg(1) + mbTrans373 := thrift.NewTMemoryBufferLen(len(arg372)) + defer mbTrans373.Close() + _, err374 := mbTrans373.WriteString(arg372) + if err374 != nil { + Usage() + return + } + factory375 := thrift.NewTJSONProtocolFactory() + jsProt376 := factory375.GetProtocol(mbTrans373) + argvalue0 := storage.NewScanEdgeRequest() + err377 := argvalue0.Read(context.Background(), jsProt376) + if err377 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ScanEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "getUUID": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetUUID requires 1 args") + flag.Usage() + } + arg378 := flag.Arg(1) + mbTrans379 := thrift.NewTMemoryBufferLen(len(arg378)) + defer mbTrans379.Close() + _, err380 := mbTrans379.WriteString(arg378) + if err380 != nil { + Usage() + return + } + factory381 := thrift.NewTJSONProtocolFactory() + jsProt382 := factory381.GetProtocol(mbTrans379) + argvalue0 := storage.NewGetUUIDReq() + err383 := argvalue0.Read(context.Background(), jsProt382) + if err383 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetUUID(context.Background(), value0)) + fmt.Print("\n") + break + case "lookupIndex": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupIndex requires 1 args") + flag.Usage() + } + arg384 := flag.Arg(1) + mbTrans385 := thrift.NewTMemoryBufferLen(len(arg384)) + defer mbTrans385.Close() + _, err386 := mbTrans385.WriteString(arg384) + if err386 != nil { + Usage() + return + } + factory387 := thrift.NewTJSONProtocolFactory() + jsProt388 := factory387.GetProtocol(mbTrans385) + argvalue0 := storage.NewLookupIndexRequest() + err389 := argvalue0.Read(context.Background(), jsProt388) + if err389 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupIndex(context.Background(), value0)) + fmt.Print("\n") + break + case "lookupAndTraverse": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "LookupAndTraverse requires 1 args") + flag.Usage() + } + arg390 := flag.Arg(1) + mbTrans391 := thrift.NewTMemoryBufferLen(len(arg390)) + defer mbTrans391.Close() + _, err392 := mbTrans391.WriteString(arg390) + if err392 != nil { + Usage() + return + } + factory393 := thrift.NewTJSONProtocolFactory() + jsProt394 := factory393.GetProtocol(mbTrans391) + argvalue0 := storage.NewLookupAndTraverseRequest() + err395 := argvalue0.Read(context.Background(), jsProt394) + if err395 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.LookupAndTraverse(context.Background(), value0)) + fmt.Print("\n") + break + case "chainUpdateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainUpdateEdge requires 1 args") + flag.Usage() + } + arg396 := flag.Arg(1) + mbTrans397 := thrift.NewTMemoryBufferLen(len(arg396)) + defer mbTrans397.Close() + _, err398 := mbTrans397.WriteString(arg396) + if err398 != nil { + Usage() + return + } + factory399 := thrift.NewTJSONProtocolFactory() + jsProt400 := factory399.GetProtocol(mbTrans397) + argvalue0 := storage.NewUpdateEdgeRequest() + err401 := argvalue0.Read(context.Background(), jsProt400) + if err401 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainUpdateEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "chainAddEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainAddEdges requires 1 args") + flag.Usage() + } + arg402 := flag.Arg(1) + mbTrans403 := thrift.NewTMemoryBufferLen(len(arg402)) + defer mbTrans403.Close() + _, err404 := mbTrans403.WriteString(arg402) + if err404 != nil { + Usage() + return + } + factory405 := thrift.NewTJSONProtocolFactory() + jsProt406 := factory405.GetProtocol(mbTrans403) + argvalue0 := storage.NewAddEdgesRequest() + err407 := argvalue0.Read(context.Background(), jsProt406) + if err407 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainAddEdges(context.Background(), value0)) + fmt.Print("\n") + break + case "chainDeleteEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainDeleteEdges requires 1 args") + flag.Usage() + } + arg408 := flag.Arg(1) + mbTrans409 := thrift.NewTMemoryBufferLen(len(arg408)) + defer mbTrans409.Close() + _, err410 := mbTrans409.WriteString(arg408) + if err410 != nil { + Usage() + return + } + factory411 := thrift.NewTJSONProtocolFactory() + jsProt412 := factory411.GetProtocol(mbTrans409) + argvalue0 := storage.NewDeleteEdgesRequest() + err413 := argvalue0.Read(context.Background(), jsProt412) + if err413 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainDeleteEdges(context.Background(), value0)) + fmt.Print("\n") + break + case "get": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Get requires 1 args") + flag.Usage() + } + arg414 := flag.Arg(1) + mbTrans415 := thrift.NewTMemoryBufferLen(len(arg414)) + defer mbTrans415.Close() + _, err416 := mbTrans415.WriteString(arg414) + if err416 != nil { + Usage() + return + } + factory417 := thrift.NewTJSONProtocolFactory() + jsProt418 := factory417.GetProtocol(mbTrans415) + argvalue0 := storage.NewKVGetRequest() + err419 := argvalue0.Read(context.Background(), jsProt418) + if err419 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Get(context.Background(), value0)) + fmt.Print("\n") + break + case "put": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Put requires 1 args") + flag.Usage() + } + arg420 := flag.Arg(1) + mbTrans421 := thrift.NewTMemoryBufferLen(len(arg420)) + defer mbTrans421.Close() + _, err422 := mbTrans421.WriteString(arg420) + if err422 != nil { + Usage() + return + } + factory423 := thrift.NewTJSONProtocolFactory() + jsProt424 := factory423.GetProtocol(mbTrans421) + argvalue0 := storage.NewKVPutRequest() + err425 := argvalue0.Read(context.Background(), jsProt424) + if err425 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Put(context.Background(), value0)) + fmt.Print("\n") + break + case "remove": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "Remove requires 1 args") + flag.Usage() + } + arg426 := flag.Arg(1) + mbTrans427 := thrift.NewTMemoryBufferLen(len(arg426)) + defer mbTrans427.Close() + _, err428 := mbTrans427.WriteString(arg426) + if err428 != nil { + Usage() + return + } + factory429 := thrift.NewTJSONProtocolFactory() + jsProt430 := factory429.GetProtocol(mbTrans427) + argvalue0 := storage.NewKVRemoveRequest() + err431 := argvalue0.Read(context.Background(), jsProt430) + if err431 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.Remove(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/nebula/storage/graphstorageservice.go b/nebula/storage/graphstorageservice.go deleted file mode 100644 index f31f8c52..00000000 --- a/nebula/storage/graphstorageservice.go +++ /dev/null @@ -1,7929 +0,0 @@ -// Autogenerated by Thrift Compiler (facebook) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -// @generated - -package storage - -import ( - "bytes" - "context" - "sync" - "fmt" - thrift "github.com/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - meta1 "github.com/vesoft-inc/nebula-go/v3/nebula/meta" - -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = sync.Mutex{} -var _ = bytes.Equal -var _ = context.Background - -var _ = nebula0.GoUnusedProtection__ -var _ = meta1.GoUnusedProtection__ -type GraphStorageService interface { - // Parameters: - // - Req - GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) - // Parameters: - // - Req - GetDstBySrc(ctx context.Context, req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) - // Parameters: - // - Req - GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, err error) - // Parameters: - // - Req - 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 *ScanResponse, err error) - // Parameters: - // - Req - ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanResponse, 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) - // Parameters: - // - Req - ChainDeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) - // 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 GraphStorageServiceClientInterface interface { - thrift.ClientInterface - // Parameters: - // - Req - GetNeighbors(req *GetNeighborsRequest) (_r *GetNeighborsResponse, err error) - // Parameters: - // - Req - GetDstBySrc(req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) - // Parameters: - // - Req - GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) - // Parameters: - // - Req - 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 *ScanResponse, err error) - // Parameters: - // - Req - ScanEdge(req *ScanEdgeRequest) (_r *ScanResponse, 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) - // Parameters: - // - Req - ChainDeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) - // 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 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) GetDstBySrc(req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) { - args := GraphStorageServiceGetDstBySrcArgs{ - Req : req, - } - err = p.CC.SendMsg("getDstBySrc", &args, thrift.CALL) - if err != nil { return } - return p.recvGetDstBySrc() -} - - -func (p *GraphStorageServiceClient) recvGetDstBySrc() (value *GetDstBySrcResponse, err error) { - var result GraphStorageServiceGetDstBySrcResult - err = p.CC.RecvMsg("getDstBySrc", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { - 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 *ScanResponse, 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 *ScanResponse, 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 *ScanResponse, 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 *ScanResponse, 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 -} - -// Parameters: -// - Req -func (p *GraphStorageServiceClient) ChainDeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { - args := GraphStorageServiceChainDeleteEdgesArgs{ - Req : req, - } - err = p.CC.SendMsg("chainDeleteEdges", &args, thrift.CALL) - if err != nil { return } - return p.recvChainDeleteEdges() -} - - -func (p *GraphStorageServiceClient) recvChainDeleteEdges() (value *ExecResponse, err error) { - var result GraphStorageServiceChainDeleteEdgesResult - err = p.CC.RecvMsg("chainDeleteEdges", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { - args := GraphStorageServiceGetArgs{ - Req : req, - } - err = p.CC.SendMsg("get", &args, thrift.CALL) - if err != nil { return } - return p.recvGet() -} - - -func (p *GraphStorageServiceClient) recvGet() (value *KVGetResponse, err error) { - var result GraphStorageServiceGetResult - err = p.CC.RecvMsg("get", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { - args := GraphStorageServicePutArgs{ - Req : req, - } - err = p.CC.SendMsg("put", &args, thrift.CALL) - if err != nil { return } - return p.recvPut() -} - - -func (p *GraphStorageServiceClient) recvPut() (value *ExecResponse, err error) { - var result GraphStorageServicePutResult - err = p.CC.RecvMsg("put", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { - args := GraphStorageServiceRemoveArgs{ - Req : req, - } - err = p.CC.SendMsg("remove", &args, thrift.CALL) - if err != nil { return } - return p.recvRemove() -} - - -func (p *GraphStorageServiceClient) recvRemove() (value *ExecResponse, err error) { - var result GraphStorageServiceRemoveResult - err = p.CC.RecvMsg("remove", &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) GetDstBySrc(req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphStorageServiceGetDstBySrcArgs{ - Req : req, - } - err = p.CC.SendMsg("getDstBySrc", &args, thrift.CALL) - if err != nil { return } - return p.recvGetDstBySrc() -} - - -func (p *GraphStorageServiceThreadsafeClient) recvGetDstBySrc() (value *GetDstBySrcResponse, err error) { - var result GraphStorageServiceGetDstBySrcResult - err = p.CC.RecvMsg("getDstBySrc", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceThreadsafeClient) GetProps(req *GetPropRequest) (_r *GetPropResponse, err error) { - 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 *ScanResponse, 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 *ScanResponse, 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 *ScanResponse, 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 *ScanResponse, 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 -} - -// Parameters: -// - Req -func (p *GraphStorageServiceThreadsafeClient) ChainDeleteEdges(req *DeleteEdgesRequest) (_r *ExecResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphStorageServiceChainDeleteEdgesArgs{ - Req : req, - } - err = p.CC.SendMsg("chainDeleteEdges", &args, thrift.CALL) - if err != nil { return } - return p.recvChainDeleteEdges() -} - - -func (p *GraphStorageServiceThreadsafeClient) recvChainDeleteEdges() (value *ExecResponse, err error) { - var result GraphStorageServiceChainDeleteEdgesResult - err = p.CC.RecvMsg("chainDeleteEdges", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceThreadsafeClient) Get(req *KVGetRequest) (_r *KVGetResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphStorageServiceGetArgs{ - Req : req, - } - err = p.CC.SendMsg("get", &args, thrift.CALL) - if err != nil { return } - return p.recvGet() -} - - -func (p *GraphStorageServiceThreadsafeClient) recvGet() (value *KVGetResponse, err error) { - var result GraphStorageServiceGetResult - err = p.CC.RecvMsg("get", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceThreadsafeClient) Put(req *KVPutRequest) (_r *ExecResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphStorageServicePutArgs{ - Req : req, - } - err = p.CC.SendMsg("put", &args, thrift.CALL) - if err != nil { return } - return p.recvPut() -} - - -func (p *GraphStorageServiceThreadsafeClient) recvPut() (value *ExecResponse, err error) { - var result GraphStorageServicePutResult - err = p.CC.RecvMsg("put", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceThreadsafeClient) Remove(req *KVRemoveRequest) (_r *ExecResponse, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := GraphStorageServiceRemoveArgs{ - Req : req, - } - err = p.CC.SendMsg("remove", &args, thrift.CALL) - if err != nil { return } - return p.recvRemove() -} - - -func (p *GraphStorageServiceThreadsafeClient) recvRemove() (value *ExecResponse, err error) { - var result GraphStorageServiceRemoveResult - err = p.CC.RecvMsg("remove", &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) GetDstBySrc(ctx context.Context, req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, err error) { - args := GraphStorageServiceGetDstBySrcArgs{ - Req : req, - } - var result GraphStorageServiceGetDstBySrcResult - err = p.RequestChannel.Call(ctx, "getDstBySrc", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceChannelClient) GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, err error) { - 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 *ScanResponse, 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 *ScanResponse, 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 -} - -// Parameters: -// - Req -func (p *GraphStorageServiceChannelClient) ChainDeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, err error) { - args := GraphStorageServiceChainDeleteEdgesArgs{ - Req : req, - } - var result GraphStorageServiceChainDeleteEdgesResult - err = p.RequestChannel.Call(ctx, "chainDeleteEdges", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceChannelClient) Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, err error) { - args := GraphStorageServiceGetArgs{ - Req : req, - } - var result GraphStorageServiceGetResult - err = p.RequestChannel.Call(ctx, "get", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceChannelClient) Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, err error) { - args := GraphStorageServicePutArgs{ - Req : req, - } - var result GraphStorageServicePutResult - err = p.RequestChannel.Call(ctx, "put", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *GraphStorageServiceChannelClient) Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, err error) { - args := GraphStorageServiceRemoveArgs{ - Req : req, - } - var result GraphStorageServiceRemoveResult - err = p.RequestChannel.Call(ctx, "remove", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - - -type GraphStorageServiceProcessor struct { - processorMap map[string]thrift.ProcessorFunctionContext - functionServiceMap map[string]string - handler GraphStorageService -} - -func (p *GraphStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { - p.processorMap[key] = processor -} - -func (p *GraphStorageServiceProcessor) AddToFunctionServiceMap(key, service string) { - p.functionServiceMap[key] = service -} - -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 (p *GraphStorageServiceProcessor) FunctionServiceMap() map[string]string { - return p.functionServiceMap -} - -func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { - self101 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} - self101.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} - self101.processorMap["getDstBySrc"] = &graphStorageServiceProcessorGetDstBySrc{handler:handler} - self101.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} - self101.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} - self101.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} - self101.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} - self101.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} - self101.processorMap["deleteTags"] = &graphStorageServiceProcessorDeleteTags{handler:handler} - self101.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} - self101.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} - self101.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} - self101.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} - self101.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} - self101.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} - self101.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} - self101.processorMap["chainUpdateEdge"] = &graphStorageServiceProcessorChainUpdateEdge{handler:handler} - self101.processorMap["chainAddEdges"] = &graphStorageServiceProcessorChainAddEdges{handler:handler} - self101.processorMap["chainDeleteEdges"] = &graphStorageServiceProcessorChainDeleteEdges{handler:handler} - self101.processorMap["get"] = &graphStorageServiceProcessorGet{handler:handler} - self101.processorMap["put"] = &graphStorageServiceProcessorPut{handler:handler} - self101.processorMap["remove"] = &graphStorageServiceProcessorRemove{handler:handler} - self101.functionServiceMap["getNeighbors"] = "GraphStorageService" - self101.functionServiceMap["getDstBySrc"] = "GraphStorageService" - self101.functionServiceMap["getProps"] = "GraphStorageService" - self101.functionServiceMap["addVertices"] = "GraphStorageService" - self101.functionServiceMap["addEdges"] = "GraphStorageService" - self101.functionServiceMap["deleteEdges"] = "GraphStorageService" - self101.functionServiceMap["deleteVertices"] = "GraphStorageService" - self101.functionServiceMap["deleteTags"] = "GraphStorageService" - self101.functionServiceMap["updateVertex"] = "GraphStorageService" - self101.functionServiceMap["updateEdge"] = "GraphStorageService" - self101.functionServiceMap["scanVertex"] = "GraphStorageService" - self101.functionServiceMap["scanEdge"] = "GraphStorageService" - self101.functionServiceMap["getUUID"] = "GraphStorageService" - self101.functionServiceMap["lookupIndex"] = "GraphStorageService" - self101.functionServiceMap["lookupAndTraverse"] = "GraphStorageService" - self101.functionServiceMap["chainUpdateEdge"] = "GraphStorageService" - self101.functionServiceMap["chainAddEdges"] = "GraphStorageService" - self101.functionServiceMap["chainDeleteEdges"] = "GraphStorageService" - self101.functionServiceMap["get"] = "GraphStorageService" - self101.functionServiceMap["put"] = "GraphStorageService" - self101.functionServiceMap["remove"] = "GraphStorageService" - return self101 -} - -type graphStorageServiceProcessorGetNeighbors struct { - handler GraphStorageService -} - -func (p *GraphStorageServiceGetNeighborsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 graphStorageServiceProcessorGetDstBySrc struct { - handler GraphStorageService -} - -func (p *GraphStorageServiceGetDstBySrcResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphStorageServiceProcessorGetDstBySrc) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphStorageServiceGetDstBySrcArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphStorageServiceProcessorGetDstBySrc) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("getDstBySrc", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *graphStorageServiceProcessorGetDstBySrc) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphStorageServiceGetDstBySrcArgs) - var result GraphStorageServiceGetDstBySrcResult - if retval, err := p.handler.GetDstBySrc(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getDstBySrc: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type graphStorageServiceProcessorGetProps struct { - handler GraphStorageService -} - -func (p *GraphStorageServiceGetPropsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceAddVerticesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceAddEdgesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceDeleteEdgesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceDeleteVerticesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceDeleteTagsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceUpdateVertexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceUpdateEdgeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceScanVertexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceScanEdgeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceGetUUIDResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceLookupIndexResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceLookupAndTraverseResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceChainUpdateEdgeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *GraphStorageServiceChainAddEdgesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 -} - -type graphStorageServiceProcessorChainDeleteEdges struct { - handler GraphStorageService -} - -func (p *GraphStorageServiceChainDeleteEdgesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphStorageServiceProcessorChainDeleteEdges) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphStorageServiceChainDeleteEdgesArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphStorageServiceProcessorChainDeleteEdges) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("chainDeleteEdges", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *graphStorageServiceProcessorChainDeleteEdges) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphStorageServiceChainDeleteEdgesArgs) - var result GraphStorageServiceChainDeleteEdgesResult - if retval, err := p.handler.ChainDeleteEdges(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainDeleteEdges: " + err.Error()) - return x, x - } - } else { - result.Success = retval - } - return &result, nil -} - -type graphStorageServiceProcessorGet struct { - handler GraphStorageService -} - -func (p *GraphStorageServiceGetResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphStorageServiceProcessorGet) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphStorageServiceGetArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphStorageServiceProcessorGet) Write(seqId int32, result thrift.WritableStruct, oprot 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 *graphStorageServiceProcessorGet) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphStorageServiceGetArgs) - var result GraphStorageServiceGetResult - 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 graphStorageServiceProcessorPut struct { - handler GraphStorageService -} - -func (p *GraphStorageServicePutResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphStorageServiceProcessorPut) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphStorageServicePutArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphStorageServiceProcessorPut) Write(seqId int32, result thrift.WritableStruct, oprot 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 *graphStorageServiceProcessorPut) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphStorageServicePutArgs) - var result GraphStorageServicePutResult - 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 graphStorageServiceProcessorRemove struct { - handler GraphStorageService -} - -func (p *GraphStorageServiceRemoveResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *graphStorageServiceProcessorRemove) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := GraphStorageServiceRemoveArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *graphStorageServiceProcessorRemove) Write(seqId int32, result thrift.WritableStruct, oprot 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 *graphStorageServiceProcessorRemove) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*GraphStorageServiceRemoveArgs) - var result GraphStorageServiceRemoveResult - 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 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 -} - -type GraphStorageServiceGetNeighborsArgsBuilder struct { - obj *GraphStorageServiceGetNeighborsArgs -} - -func NewGraphStorageServiceGetNeighborsArgsBuilder() *GraphStorageServiceGetNeighborsArgsBuilder{ - return &GraphStorageServiceGetNeighborsArgsBuilder{ - obj: NewGraphStorageServiceGetNeighborsArgs(), - } -} - -func (p GraphStorageServiceGetNeighborsArgsBuilder) Emit() *GraphStorageServiceGetNeighborsArgs{ - return &GraphStorageServiceGetNeighborsArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceGetNeighborsArgsBuilder) Req(req *GetNeighborsRequest) *GraphStorageServiceGetNeighborsArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceGetNeighborsArgs) SetReq(req *GetNeighborsRequest) *GraphStorageServiceGetNeighborsArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceGetNeighborsResultBuilder struct { - obj *GraphStorageServiceGetNeighborsResult -} - -func NewGraphStorageServiceGetNeighborsResultBuilder() *GraphStorageServiceGetNeighborsResultBuilder{ - return &GraphStorageServiceGetNeighborsResultBuilder{ - obj: NewGraphStorageServiceGetNeighborsResult(), - } -} - -func (p GraphStorageServiceGetNeighborsResultBuilder) Emit() *GraphStorageServiceGetNeighborsResult{ - return &GraphStorageServiceGetNeighborsResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceGetNeighborsResultBuilder) Success(success *GetNeighborsResponse) *GraphStorageServiceGetNeighborsResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceGetNeighborsResult) SetSuccess(success *GetNeighborsResponse) *GraphStorageServiceGetNeighborsResult { - g.Success = success - return g -} - -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 GraphStorageServiceGetDstBySrcArgs struct { - thrift.IRequest - Req *GetDstBySrcRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGraphStorageServiceGetDstBySrcArgs() *GraphStorageServiceGetDstBySrcArgs { - return &GraphStorageServiceGetDstBySrcArgs{ - Req: NewGetDstBySrcRequest(), - } -} - -var GraphStorageServiceGetDstBySrcArgs_Req_DEFAULT *GetDstBySrcRequest -func (p *GraphStorageServiceGetDstBySrcArgs) GetReq() *GetDstBySrcRequest { - if !p.IsSetReq() { - return GraphStorageServiceGetDstBySrcArgs_Req_DEFAULT - } -return p.Req -} -func (p *GraphStorageServiceGetDstBySrcArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type GraphStorageServiceGetDstBySrcArgsBuilder struct { - obj *GraphStorageServiceGetDstBySrcArgs -} - -func NewGraphStorageServiceGetDstBySrcArgsBuilder() *GraphStorageServiceGetDstBySrcArgsBuilder{ - return &GraphStorageServiceGetDstBySrcArgsBuilder{ - obj: NewGraphStorageServiceGetDstBySrcArgs(), - } -} - -func (p GraphStorageServiceGetDstBySrcArgsBuilder) Emit() *GraphStorageServiceGetDstBySrcArgs{ - return &GraphStorageServiceGetDstBySrcArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceGetDstBySrcArgsBuilder) Req(req *GetDstBySrcRequest) *GraphStorageServiceGetDstBySrcArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceGetDstBySrcArgs) SetReq(req *GetDstBySrcRequest) *GraphStorageServiceGetDstBySrcArgs { - g.Req = req - return g -} - -func (p *GraphStorageServiceGetDstBySrcArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceGetDstBySrcArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewGetDstBySrcRequest() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *GraphStorageServiceGetDstBySrcArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("getDstBySrc_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphStorageServiceGetDstBySrcArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *GraphStorageServiceGetDstBySrcArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GraphStorageServiceGetDstBySrcArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GraphStorageServiceGetDstBySrcResult struct { - thrift.IResponse - Success *GetDstBySrcResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphStorageServiceGetDstBySrcResult() *GraphStorageServiceGetDstBySrcResult { - return &GraphStorageServiceGetDstBySrcResult{} -} - -var GraphStorageServiceGetDstBySrcResult_Success_DEFAULT *GetDstBySrcResponse -func (p *GraphStorageServiceGetDstBySrcResult) GetSuccess() *GetDstBySrcResponse { - if !p.IsSetSuccess() { - return GraphStorageServiceGetDstBySrcResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphStorageServiceGetDstBySrcResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphStorageServiceGetDstBySrcResultBuilder struct { - obj *GraphStorageServiceGetDstBySrcResult -} - -func NewGraphStorageServiceGetDstBySrcResultBuilder() *GraphStorageServiceGetDstBySrcResultBuilder{ - return &GraphStorageServiceGetDstBySrcResultBuilder{ - obj: NewGraphStorageServiceGetDstBySrcResult(), - } -} - -func (p GraphStorageServiceGetDstBySrcResultBuilder) Emit() *GraphStorageServiceGetDstBySrcResult{ - return &GraphStorageServiceGetDstBySrcResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceGetDstBySrcResultBuilder) Success(success *GetDstBySrcResponse) *GraphStorageServiceGetDstBySrcResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceGetDstBySrcResult) SetSuccess(success *GetDstBySrcResponse) *GraphStorageServiceGetDstBySrcResult { - g.Success = success - return g -} - -func (p *GraphStorageServiceGetDstBySrcResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceGetDstBySrcResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewGetDstBySrcResponse() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *GraphStorageServiceGetDstBySrcResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("getDstBySrc_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphStorageServiceGetDstBySrcResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphStorageServiceGetDstBySrcResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphStorageServiceGetDstBySrcResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type GraphStorageServiceGetPropsArgs struct { - 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 -} - -type GraphStorageServiceGetPropsArgsBuilder struct { - obj *GraphStorageServiceGetPropsArgs -} - -func NewGraphStorageServiceGetPropsArgsBuilder() *GraphStorageServiceGetPropsArgsBuilder{ - return &GraphStorageServiceGetPropsArgsBuilder{ - obj: NewGraphStorageServiceGetPropsArgs(), - } -} - -func (p GraphStorageServiceGetPropsArgsBuilder) Emit() *GraphStorageServiceGetPropsArgs{ - return &GraphStorageServiceGetPropsArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceGetPropsArgsBuilder) Req(req *GetPropRequest) *GraphStorageServiceGetPropsArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceGetPropsArgs) SetReq(req *GetPropRequest) *GraphStorageServiceGetPropsArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceGetPropsResultBuilder struct { - obj *GraphStorageServiceGetPropsResult -} - -func NewGraphStorageServiceGetPropsResultBuilder() *GraphStorageServiceGetPropsResultBuilder{ - return &GraphStorageServiceGetPropsResultBuilder{ - obj: NewGraphStorageServiceGetPropsResult(), - } -} - -func (p GraphStorageServiceGetPropsResultBuilder) Emit() *GraphStorageServiceGetPropsResult{ - return &GraphStorageServiceGetPropsResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceGetPropsResultBuilder) Success(success *GetPropResponse) *GraphStorageServiceGetPropsResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceGetPropsResult) SetSuccess(success *GetPropResponse) *GraphStorageServiceGetPropsResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceAddVerticesArgsBuilder struct { - obj *GraphStorageServiceAddVerticesArgs -} - -func NewGraphStorageServiceAddVerticesArgsBuilder() *GraphStorageServiceAddVerticesArgsBuilder{ - return &GraphStorageServiceAddVerticesArgsBuilder{ - obj: NewGraphStorageServiceAddVerticesArgs(), - } -} - -func (p GraphStorageServiceAddVerticesArgsBuilder) Emit() *GraphStorageServiceAddVerticesArgs{ - return &GraphStorageServiceAddVerticesArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceAddVerticesArgsBuilder) Req(req *AddVerticesRequest) *GraphStorageServiceAddVerticesArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceAddVerticesArgs) SetReq(req *AddVerticesRequest) *GraphStorageServiceAddVerticesArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceAddVerticesResultBuilder struct { - obj *GraphStorageServiceAddVerticesResult -} - -func NewGraphStorageServiceAddVerticesResultBuilder() *GraphStorageServiceAddVerticesResultBuilder{ - return &GraphStorageServiceAddVerticesResultBuilder{ - obj: NewGraphStorageServiceAddVerticesResult(), - } -} - -func (p GraphStorageServiceAddVerticesResultBuilder) Emit() *GraphStorageServiceAddVerticesResult{ - return &GraphStorageServiceAddVerticesResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceAddVerticesResultBuilder) Success(success *ExecResponse) *GraphStorageServiceAddVerticesResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceAddVerticesResult) SetSuccess(success *ExecResponse) *GraphStorageServiceAddVerticesResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceAddEdgesArgsBuilder struct { - obj *GraphStorageServiceAddEdgesArgs -} - -func NewGraphStorageServiceAddEdgesArgsBuilder() *GraphStorageServiceAddEdgesArgsBuilder{ - return &GraphStorageServiceAddEdgesArgsBuilder{ - obj: NewGraphStorageServiceAddEdgesArgs(), - } -} - -func (p GraphStorageServiceAddEdgesArgsBuilder) Emit() *GraphStorageServiceAddEdgesArgs{ - return &GraphStorageServiceAddEdgesArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceAddEdgesArgsBuilder) Req(req *AddEdgesRequest) *GraphStorageServiceAddEdgesArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceAddEdgesArgs) SetReq(req *AddEdgesRequest) *GraphStorageServiceAddEdgesArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceAddEdgesResultBuilder struct { - obj *GraphStorageServiceAddEdgesResult -} - -func NewGraphStorageServiceAddEdgesResultBuilder() *GraphStorageServiceAddEdgesResultBuilder{ - return &GraphStorageServiceAddEdgesResultBuilder{ - obj: NewGraphStorageServiceAddEdgesResult(), - } -} - -func (p GraphStorageServiceAddEdgesResultBuilder) Emit() *GraphStorageServiceAddEdgesResult{ - return &GraphStorageServiceAddEdgesResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceAddEdgesResultBuilder) Success(success *ExecResponse) *GraphStorageServiceAddEdgesResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceAddEdgesResult) SetSuccess(success *ExecResponse) *GraphStorageServiceAddEdgesResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceDeleteEdgesArgsBuilder struct { - obj *GraphStorageServiceDeleteEdgesArgs -} - -func NewGraphStorageServiceDeleteEdgesArgsBuilder() *GraphStorageServiceDeleteEdgesArgsBuilder{ - return &GraphStorageServiceDeleteEdgesArgsBuilder{ - obj: NewGraphStorageServiceDeleteEdgesArgs(), - } -} - -func (p GraphStorageServiceDeleteEdgesArgsBuilder) Emit() *GraphStorageServiceDeleteEdgesArgs{ - return &GraphStorageServiceDeleteEdgesArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceDeleteEdgesArgsBuilder) Req(req *DeleteEdgesRequest) *GraphStorageServiceDeleteEdgesArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceDeleteEdgesArgs) SetReq(req *DeleteEdgesRequest) *GraphStorageServiceDeleteEdgesArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceDeleteEdgesResultBuilder struct { - obj *GraphStorageServiceDeleteEdgesResult -} - -func NewGraphStorageServiceDeleteEdgesResultBuilder() *GraphStorageServiceDeleteEdgesResultBuilder{ - return &GraphStorageServiceDeleteEdgesResultBuilder{ - obj: NewGraphStorageServiceDeleteEdgesResult(), - } -} - -func (p GraphStorageServiceDeleteEdgesResultBuilder) Emit() *GraphStorageServiceDeleteEdgesResult{ - return &GraphStorageServiceDeleteEdgesResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceDeleteEdgesResultBuilder) Success(success *ExecResponse) *GraphStorageServiceDeleteEdgesResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceDeleteEdgesResult) SetSuccess(success *ExecResponse) *GraphStorageServiceDeleteEdgesResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceDeleteVerticesArgsBuilder struct { - obj *GraphStorageServiceDeleteVerticesArgs -} - -func NewGraphStorageServiceDeleteVerticesArgsBuilder() *GraphStorageServiceDeleteVerticesArgsBuilder{ - return &GraphStorageServiceDeleteVerticesArgsBuilder{ - obj: NewGraphStorageServiceDeleteVerticesArgs(), - } -} - -func (p GraphStorageServiceDeleteVerticesArgsBuilder) Emit() *GraphStorageServiceDeleteVerticesArgs{ - return &GraphStorageServiceDeleteVerticesArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceDeleteVerticesArgsBuilder) Req(req *DeleteVerticesRequest) *GraphStorageServiceDeleteVerticesArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceDeleteVerticesArgs) SetReq(req *DeleteVerticesRequest) *GraphStorageServiceDeleteVerticesArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceDeleteVerticesResultBuilder struct { - obj *GraphStorageServiceDeleteVerticesResult -} - -func NewGraphStorageServiceDeleteVerticesResultBuilder() *GraphStorageServiceDeleteVerticesResultBuilder{ - return &GraphStorageServiceDeleteVerticesResultBuilder{ - obj: NewGraphStorageServiceDeleteVerticesResult(), - } -} - -func (p GraphStorageServiceDeleteVerticesResultBuilder) Emit() *GraphStorageServiceDeleteVerticesResult{ - return &GraphStorageServiceDeleteVerticesResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceDeleteVerticesResultBuilder) Success(success *ExecResponse) *GraphStorageServiceDeleteVerticesResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceDeleteVerticesResult) SetSuccess(success *ExecResponse) *GraphStorageServiceDeleteVerticesResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceDeleteTagsArgsBuilder struct { - obj *GraphStorageServiceDeleteTagsArgs -} - -func NewGraphStorageServiceDeleteTagsArgsBuilder() *GraphStorageServiceDeleteTagsArgsBuilder{ - return &GraphStorageServiceDeleteTagsArgsBuilder{ - obj: NewGraphStorageServiceDeleteTagsArgs(), - } -} - -func (p GraphStorageServiceDeleteTagsArgsBuilder) Emit() *GraphStorageServiceDeleteTagsArgs{ - return &GraphStorageServiceDeleteTagsArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceDeleteTagsArgsBuilder) Req(req *DeleteTagsRequest) *GraphStorageServiceDeleteTagsArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceDeleteTagsArgs) SetReq(req *DeleteTagsRequest) *GraphStorageServiceDeleteTagsArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceDeleteTagsResultBuilder struct { - obj *GraphStorageServiceDeleteTagsResult -} - -func NewGraphStorageServiceDeleteTagsResultBuilder() *GraphStorageServiceDeleteTagsResultBuilder{ - return &GraphStorageServiceDeleteTagsResultBuilder{ - obj: NewGraphStorageServiceDeleteTagsResult(), - } -} - -func (p GraphStorageServiceDeleteTagsResultBuilder) Emit() *GraphStorageServiceDeleteTagsResult{ - return &GraphStorageServiceDeleteTagsResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceDeleteTagsResultBuilder) Success(success *ExecResponse) *GraphStorageServiceDeleteTagsResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceDeleteTagsResult) SetSuccess(success *ExecResponse) *GraphStorageServiceDeleteTagsResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceUpdateVertexArgsBuilder struct { - obj *GraphStorageServiceUpdateVertexArgs -} - -func NewGraphStorageServiceUpdateVertexArgsBuilder() *GraphStorageServiceUpdateVertexArgsBuilder{ - return &GraphStorageServiceUpdateVertexArgsBuilder{ - obj: NewGraphStorageServiceUpdateVertexArgs(), - } -} - -func (p GraphStorageServiceUpdateVertexArgsBuilder) Emit() *GraphStorageServiceUpdateVertexArgs{ - return &GraphStorageServiceUpdateVertexArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceUpdateVertexArgsBuilder) Req(req *UpdateVertexRequest) *GraphStorageServiceUpdateVertexArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceUpdateVertexArgs) SetReq(req *UpdateVertexRequest) *GraphStorageServiceUpdateVertexArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceUpdateVertexResultBuilder struct { - obj *GraphStorageServiceUpdateVertexResult -} - -func NewGraphStorageServiceUpdateVertexResultBuilder() *GraphStorageServiceUpdateVertexResultBuilder{ - return &GraphStorageServiceUpdateVertexResultBuilder{ - obj: NewGraphStorageServiceUpdateVertexResult(), - } -} - -func (p GraphStorageServiceUpdateVertexResultBuilder) Emit() *GraphStorageServiceUpdateVertexResult{ - return &GraphStorageServiceUpdateVertexResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceUpdateVertexResultBuilder) Success(success *UpdateResponse) *GraphStorageServiceUpdateVertexResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceUpdateVertexResult) SetSuccess(success *UpdateResponse) *GraphStorageServiceUpdateVertexResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceUpdateEdgeArgsBuilder struct { - obj *GraphStorageServiceUpdateEdgeArgs -} - -func NewGraphStorageServiceUpdateEdgeArgsBuilder() *GraphStorageServiceUpdateEdgeArgsBuilder{ - return &GraphStorageServiceUpdateEdgeArgsBuilder{ - obj: NewGraphStorageServiceUpdateEdgeArgs(), - } -} - -func (p GraphStorageServiceUpdateEdgeArgsBuilder) Emit() *GraphStorageServiceUpdateEdgeArgs{ - return &GraphStorageServiceUpdateEdgeArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceUpdateEdgeArgsBuilder) Req(req *UpdateEdgeRequest) *GraphStorageServiceUpdateEdgeArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceUpdateEdgeArgs) SetReq(req *UpdateEdgeRequest) *GraphStorageServiceUpdateEdgeArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceUpdateEdgeResultBuilder struct { - obj *GraphStorageServiceUpdateEdgeResult -} - -func NewGraphStorageServiceUpdateEdgeResultBuilder() *GraphStorageServiceUpdateEdgeResultBuilder{ - return &GraphStorageServiceUpdateEdgeResultBuilder{ - obj: NewGraphStorageServiceUpdateEdgeResult(), - } -} - -func (p GraphStorageServiceUpdateEdgeResultBuilder) Emit() *GraphStorageServiceUpdateEdgeResult{ - return &GraphStorageServiceUpdateEdgeResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceUpdateEdgeResultBuilder) Success(success *UpdateResponse) *GraphStorageServiceUpdateEdgeResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceUpdateEdgeResult) SetSuccess(success *UpdateResponse) *GraphStorageServiceUpdateEdgeResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceScanVertexArgsBuilder struct { - obj *GraphStorageServiceScanVertexArgs -} - -func NewGraphStorageServiceScanVertexArgsBuilder() *GraphStorageServiceScanVertexArgsBuilder{ - return &GraphStorageServiceScanVertexArgsBuilder{ - obj: NewGraphStorageServiceScanVertexArgs(), - } -} - -func (p GraphStorageServiceScanVertexArgsBuilder) Emit() *GraphStorageServiceScanVertexArgs{ - return &GraphStorageServiceScanVertexArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceScanVertexArgsBuilder) Req(req *ScanVertexRequest) *GraphStorageServiceScanVertexArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceScanVertexArgs) SetReq(req *ScanVertexRequest) *GraphStorageServiceScanVertexArgs { - g.Req = req - return g -} - -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 *ScanResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphStorageServiceScanVertexResult() *GraphStorageServiceScanVertexResult { - return &GraphStorageServiceScanVertexResult{} -} - -var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanResponse -func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanResponse { - if !p.IsSetSuccess() { - return GraphStorageServiceScanVertexResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphStorageServiceScanVertexResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphStorageServiceScanVertexResultBuilder struct { - obj *GraphStorageServiceScanVertexResult -} - -func NewGraphStorageServiceScanVertexResultBuilder() *GraphStorageServiceScanVertexResultBuilder{ - return &GraphStorageServiceScanVertexResultBuilder{ - obj: NewGraphStorageServiceScanVertexResult(), - } -} - -func (p GraphStorageServiceScanVertexResultBuilder) Emit() *GraphStorageServiceScanVertexResult{ - return &GraphStorageServiceScanVertexResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceScanVertexResultBuilder) Success(success *ScanResponse) *GraphStorageServiceScanVertexResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceScanVertexResult) SetSuccess(success *ScanResponse) *GraphStorageServiceScanVertexResult { - g.Success = success - return g -} - -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 = NewScanResponse() - 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 -} - -type GraphStorageServiceScanEdgeArgsBuilder struct { - obj *GraphStorageServiceScanEdgeArgs -} - -func NewGraphStorageServiceScanEdgeArgsBuilder() *GraphStorageServiceScanEdgeArgsBuilder{ - return &GraphStorageServiceScanEdgeArgsBuilder{ - obj: NewGraphStorageServiceScanEdgeArgs(), - } -} - -func (p GraphStorageServiceScanEdgeArgsBuilder) Emit() *GraphStorageServiceScanEdgeArgs{ - return &GraphStorageServiceScanEdgeArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceScanEdgeArgsBuilder) Req(req *ScanEdgeRequest) *GraphStorageServiceScanEdgeArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceScanEdgeArgs) SetReq(req *ScanEdgeRequest) *GraphStorageServiceScanEdgeArgs { - g.Req = req - return g -} - -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 *ScanResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphStorageServiceScanEdgeResult() *GraphStorageServiceScanEdgeResult { - return &GraphStorageServiceScanEdgeResult{} -} - -var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanResponse -func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanResponse { - if !p.IsSetSuccess() { - return GraphStorageServiceScanEdgeResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphStorageServiceScanEdgeResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphStorageServiceScanEdgeResultBuilder struct { - obj *GraphStorageServiceScanEdgeResult -} - -func NewGraphStorageServiceScanEdgeResultBuilder() *GraphStorageServiceScanEdgeResultBuilder{ - return &GraphStorageServiceScanEdgeResultBuilder{ - obj: NewGraphStorageServiceScanEdgeResult(), - } -} - -func (p GraphStorageServiceScanEdgeResultBuilder) Emit() *GraphStorageServiceScanEdgeResult{ - return &GraphStorageServiceScanEdgeResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceScanEdgeResultBuilder) Success(success *ScanResponse) *GraphStorageServiceScanEdgeResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceScanEdgeResult) SetSuccess(success *ScanResponse) *GraphStorageServiceScanEdgeResult { - g.Success = success - return g -} - -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 = NewScanResponse() - 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 -} - -type GraphStorageServiceGetUUIDArgsBuilder struct { - obj *GraphStorageServiceGetUUIDArgs -} - -func NewGraphStorageServiceGetUUIDArgsBuilder() *GraphStorageServiceGetUUIDArgsBuilder{ - return &GraphStorageServiceGetUUIDArgsBuilder{ - obj: NewGraphStorageServiceGetUUIDArgs(), - } -} - -func (p GraphStorageServiceGetUUIDArgsBuilder) Emit() *GraphStorageServiceGetUUIDArgs{ - return &GraphStorageServiceGetUUIDArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceGetUUIDArgsBuilder) Req(req *GetUUIDReq) *GraphStorageServiceGetUUIDArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceGetUUIDArgs) SetReq(req *GetUUIDReq) *GraphStorageServiceGetUUIDArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceGetUUIDResultBuilder struct { - obj *GraphStorageServiceGetUUIDResult -} - -func NewGraphStorageServiceGetUUIDResultBuilder() *GraphStorageServiceGetUUIDResultBuilder{ - return &GraphStorageServiceGetUUIDResultBuilder{ - obj: NewGraphStorageServiceGetUUIDResult(), - } -} - -func (p GraphStorageServiceGetUUIDResultBuilder) Emit() *GraphStorageServiceGetUUIDResult{ - return &GraphStorageServiceGetUUIDResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceGetUUIDResultBuilder) Success(success *GetUUIDResp) *GraphStorageServiceGetUUIDResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceGetUUIDResult) SetSuccess(success *GetUUIDResp) *GraphStorageServiceGetUUIDResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceLookupIndexArgsBuilder struct { - obj *GraphStorageServiceLookupIndexArgs -} - -func NewGraphStorageServiceLookupIndexArgsBuilder() *GraphStorageServiceLookupIndexArgsBuilder{ - return &GraphStorageServiceLookupIndexArgsBuilder{ - obj: NewGraphStorageServiceLookupIndexArgs(), - } -} - -func (p GraphStorageServiceLookupIndexArgsBuilder) Emit() *GraphStorageServiceLookupIndexArgs{ - return &GraphStorageServiceLookupIndexArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceLookupIndexArgsBuilder) Req(req *LookupIndexRequest) *GraphStorageServiceLookupIndexArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceLookupIndexArgs) SetReq(req *LookupIndexRequest) *GraphStorageServiceLookupIndexArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceLookupIndexResultBuilder struct { - obj *GraphStorageServiceLookupIndexResult -} - -func NewGraphStorageServiceLookupIndexResultBuilder() *GraphStorageServiceLookupIndexResultBuilder{ - return &GraphStorageServiceLookupIndexResultBuilder{ - obj: NewGraphStorageServiceLookupIndexResult(), - } -} - -func (p GraphStorageServiceLookupIndexResultBuilder) Emit() *GraphStorageServiceLookupIndexResult{ - return &GraphStorageServiceLookupIndexResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceLookupIndexResultBuilder) Success(success *LookupIndexResp) *GraphStorageServiceLookupIndexResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceLookupIndexResult) SetSuccess(success *LookupIndexResp) *GraphStorageServiceLookupIndexResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceLookupAndTraverseArgsBuilder struct { - obj *GraphStorageServiceLookupAndTraverseArgs -} - -func NewGraphStorageServiceLookupAndTraverseArgsBuilder() *GraphStorageServiceLookupAndTraverseArgsBuilder{ - return &GraphStorageServiceLookupAndTraverseArgsBuilder{ - obj: NewGraphStorageServiceLookupAndTraverseArgs(), - } -} - -func (p GraphStorageServiceLookupAndTraverseArgsBuilder) Emit() *GraphStorageServiceLookupAndTraverseArgs{ - return &GraphStorageServiceLookupAndTraverseArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceLookupAndTraverseArgsBuilder) Req(req *LookupAndTraverseRequest) *GraphStorageServiceLookupAndTraverseArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceLookupAndTraverseArgs) SetReq(req *LookupAndTraverseRequest) *GraphStorageServiceLookupAndTraverseArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceLookupAndTraverseResultBuilder struct { - obj *GraphStorageServiceLookupAndTraverseResult -} - -func NewGraphStorageServiceLookupAndTraverseResultBuilder() *GraphStorageServiceLookupAndTraverseResultBuilder{ - return &GraphStorageServiceLookupAndTraverseResultBuilder{ - obj: NewGraphStorageServiceLookupAndTraverseResult(), - } -} - -func (p GraphStorageServiceLookupAndTraverseResultBuilder) Emit() *GraphStorageServiceLookupAndTraverseResult{ - return &GraphStorageServiceLookupAndTraverseResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceLookupAndTraverseResultBuilder) Success(success *GetNeighborsResponse) *GraphStorageServiceLookupAndTraverseResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceLookupAndTraverseResult) SetSuccess(success *GetNeighborsResponse) *GraphStorageServiceLookupAndTraverseResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceChainUpdateEdgeArgsBuilder struct { - obj *GraphStorageServiceChainUpdateEdgeArgs -} - -func NewGraphStorageServiceChainUpdateEdgeArgsBuilder() *GraphStorageServiceChainUpdateEdgeArgsBuilder{ - return &GraphStorageServiceChainUpdateEdgeArgsBuilder{ - obj: NewGraphStorageServiceChainUpdateEdgeArgs(), - } -} - -func (p GraphStorageServiceChainUpdateEdgeArgsBuilder) Emit() *GraphStorageServiceChainUpdateEdgeArgs{ - return &GraphStorageServiceChainUpdateEdgeArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceChainUpdateEdgeArgsBuilder) Req(req *UpdateEdgeRequest) *GraphStorageServiceChainUpdateEdgeArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceChainUpdateEdgeArgs) SetReq(req *UpdateEdgeRequest) *GraphStorageServiceChainUpdateEdgeArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceChainUpdateEdgeResultBuilder struct { - obj *GraphStorageServiceChainUpdateEdgeResult -} - -func NewGraphStorageServiceChainUpdateEdgeResultBuilder() *GraphStorageServiceChainUpdateEdgeResultBuilder{ - return &GraphStorageServiceChainUpdateEdgeResultBuilder{ - obj: NewGraphStorageServiceChainUpdateEdgeResult(), - } -} - -func (p GraphStorageServiceChainUpdateEdgeResultBuilder) Emit() *GraphStorageServiceChainUpdateEdgeResult{ - return &GraphStorageServiceChainUpdateEdgeResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceChainUpdateEdgeResultBuilder) Success(success *UpdateResponse) *GraphStorageServiceChainUpdateEdgeResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceChainUpdateEdgeResult) SetSuccess(success *UpdateResponse) *GraphStorageServiceChainUpdateEdgeResult { - g.Success = success - return g -} - -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 -} - -type GraphStorageServiceChainAddEdgesArgsBuilder struct { - obj *GraphStorageServiceChainAddEdgesArgs -} - -func NewGraphStorageServiceChainAddEdgesArgsBuilder() *GraphStorageServiceChainAddEdgesArgsBuilder{ - return &GraphStorageServiceChainAddEdgesArgsBuilder{ - obj: NewGraphStorageServiceChainAddEdgesArgs(), - } -} - -func (p GraphStorageServiceChainAddEdgesArgsBuilder) Emit() *GraphStorageServiceChainAddEdgesArgs{ - return &GraphStorageServiceChainAddEdgesArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceChainAddEdgesArgsBuilder) Req(req *AddEdgesRequest) *GraphStorageServiceChainAddEdgesArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceChainAddEdgesArgs) SetReq(req *AddEdgesRequest) *GraphStorageServiceChainAddEdgesArgs { - g.Req = req - return g -} - -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,optional" 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 -} - -type GraphStorageServiceChainAddEdgesResultBuilder struct { - obj *GraphStorageServiceChainAddEdgesResult -} - -func NewGraphStorageServiceChainAddEdgesResultBuilder() *GraphStorageServiceChainAddEdgesResultBuilder{ - return &GraphStorageServiceChainAddEdgesResultBuilder{ - obj: NewGraphStorageServiceChainAddEdgesResult(), - } -} - -func (p GraphStorageServiceChainAddEdgesResultBuilder) Emit() *GraphStorageServiceChainAddEdgesResult{ - return &GraphStorageServiceChainAddEdgesResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceChainAddEdgesResultBuilder) Success(success *ExecResponse) *GraphStorageServiceChainAddEdgesResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceChainAddEdgesResult) SetSuccess(success *ExecResponse) *GraphStorageServiceChainAddEdgesResult { - g.Success = success - return g -} - -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) -} - -// Attributes: -// - Req -type GraphStorageServiceChainDeleteEdgesArgs struct { - thrift.IRequest - Req *DeleteEdgesRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGraphStorageServiceChainDeleteEdgesArgs() *GraphStorageServiceChainDeleteEdgesArgs { - return &GraphStorageServiceChainDeleteEdgesArgs{ - Req: NewDeleteEdgesRequest(), - } -} - -var GraphStorageServiceChainDeleteEdgesArgs_Req_DEFAULT *DeleteEdgesRequest -func (p *GraphStorageServiceChainDeleteEdgesArgs) GetReq() *DeleteEdgesRequest { - if !p.IsSetReq() { - return GraphStorageServiceChainDeleteEdgesArgs_Req_DEFAULT - } -return p.Req -} -func (p *GraphStorageServiceChainDeleteEdgesArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type GraphStorageServiceChainDeleteEdgesArgsBuilder struct { - obj *GraphStorageServiceChainDeleteEdgesArgs -} - -func NewGraphStorageServiceChainDeleteEdgesArgsBuilder() *GraphStorageServiceChainDeleteEdgesArgsBuilder{ - return &GraphStorageServiceChainDeleteEdgesArgsBuilder{ - obj: NewGraphStorageServiceChainDeleteEdgesArgs(), - } -} - -func (p GraphStorageServiceChainDeleteEdgesArgsBuilder) Emit() *GraphStorageServiceChainDeleteEdgesArgs{ - return &GraphStorageServiceChainDeleteEdgesArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceChainDeleteEdgesArgsBuilder) Req(req *DeleteEdgesRequest) *GraphStorageServiceChainDeleteEdgesArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceChainDeleteEdgesArgs) SetReq(req *DeleteEdgesRequest) *GraphStorageServiceChainDeleteEdgesArgs { - g.Req = req - return g -} - -func (p *GraphStorageServiceChainDeleteEdgesArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceChainDeleteEdgesArgs) 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 *GraphStorageServiceChainDeleteEdgesArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("chainDeleteEdges_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphStorageServiceChainDeleteEdgesArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *GraphStorageServiceChainDeleteEdgesArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GraphStorageServiceChainDeleteEdgesArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GraphStorageServiceChainDeleteEdgesResult struct { - thrift.IResponse - Success *ExecResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphStorageServiceChainDeleteEdgesResult() *GraphStorageServiceChainDeleteEdgesResult { - return &GraphStorageServiceChainDeleteEdgesResult{} -} - -var GraphStorageServiceChainDeleteEdgesResult_Success_DEFAULT *ExecResponse -func (p *GraphStorageServiceChainDeleteEdgesResult) GetSuccess() *ExecResponse { - if !p.IsSetSuccess() { - return GraphStorageServiceChainDeleteEdgesResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphStorageServiceChainDeleteEdgesResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphStorageServiceChainDeleteEdgesResultBuilder struct { - obj *GraphStorageServiceChainDeleteEdgesResult -} - -func NewGraphStorageServiceChainDeleteEdgesResultBuilder() *GraphStorageServiceChainDeleteEdgesResultBuilder{ - return &GraphStorageServiceChainDeleteEdgesResultBuilder{ - obj: NewGraphStorageServiceChainDeleteEdgesResult(), - } -} - -func (p GraphStorageServiceChainDeleteEdgesResultBuilder) Emit() *GraphStorageServiceChainDeleteEdgesResult{ - return &GraphStorageServiceChainDeleteEdgesResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceChainDeleteEdgesResultBuilder) Success(success *ExecResponse) *GraphStorageServiceChainDeleteEdgesResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceChainDeleteEdgesResult) SetSuccess(success *ExecResponse) *GraphStorageServiceChainDeleteEdgesResult { - g.Success = success - return g -} - -func (p *GraphStorageServiceChainDeleteEdgesResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceChainDeleteEdgesResult) 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 *GraphStorageServiceChainDeleteEdgesResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("chainDeleteEdges_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GraphStorageServiceChainDeleteEdgesResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphStorageServiceChainDeleteEdgesResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphStorageServiceChainDeleteEdgesResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type GraphStorageServiceGetArgs struct { - thrift.IRequest - Req *KVGetRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGraphStorageServiceGetArgs() *GraphStorageServiceGetArgs { - return &GraphStorageServiceGetArgs{ - Req: NewKVGetRequest(), - } -} - -var GraphStorageServiceGetArgs_Req_DEFAULT *KVGetRequest -func (p *GraphStorageServiceGetArgs) GetReq() *KVGetRequest { - if !p.IsSetReq() { - return GraphStorageServiceGetArgs_Req_DEFAULT - } -return p.Req -} -func (p *GraphStorageServiceGetArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type GraphStorageServiceGetArgsBuilder struct { - obj *GraphStorageServiceGetArgs -} - -func NewGraphStorageServiceGetArgsBuilder() *GraphStorageServiceGetArgsBuilder{ - return &GraphStorageServiceGetArgsBuilder{ - obj: NewGraphStorageServiceGetArgs(), - } -} - -func (p GraphStorageServiceGetArgsBuilder) Emit() *GraphStorageServiceGetArgs{ - return &GraphStorageServiceGetArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceGetArgsBuilder) Req(req *KVGetRequest) *GraphStorageServiceGetArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceGetArgs) SetReq(req *KVGetRequest) *GraphStorageServiceGetArgs { - g.Req = req - return g -} - -func (p *GraphStorageServiceGetArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceGetArgs) 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 *GraphStorageServiceGetArgs) 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 *GraphStorageServiceGetArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *GraphStorageServiceGetArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GraphStorageServiceGetArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GraphStorageServiceGetResult struct { - thrift.IResponse - Success *KVGetResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphStorageServiceGetResult() *GraphStorageServiceGetResult { - return &GraphStorageServiceGetResult{} -} - -var GraphStorageServiceGetResult_Success_DEFAULT *KVGetResponse -func (p *GraphStorageServiceGetResult) GetSuccess() *KVGetResponse { - if !p.IsSetSuccess() { - return GraphStorageServiceGetResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphStorageServiceGetResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphStorageServiceGetResultBuilder struct { - obj *GraphStorageServiceGetResult -} - -func NewGraphStorageServiceGetResultBuilder() *GraphStorageServiceGetResultBuilder{ - return &GraphStorageServiceGetResultBuilder{ - obj: NewGraphStorageServiceGetResult(), - } -} - -func (p GraphStorageServiceGetResultBuilder) Emit() *GraphStorageServiceGetResult{ - return &GraphStorageServiceGetResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceGetResultBuilder) Success(success *KVGetResponse) *GraphStorageServiceGetResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceGetResult) SetSuccess(success *KVGetResponse) *GraphStorageServiceGetResult { - g.Success = success - return g -} - -func (p *GraphStorageServiceGetResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceGetResult) 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 *GraphStorageServiceGetResult) 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 *GraphStorageServiceGetResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphStorageServiceGetResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphStorageServiceGetResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type GraphStorageServicePutArgs struct { - thrift.IRequest - Req *KVPutRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGraphStorageServicePutArgs() *GraphStorageServicePutArgs { - return &GraphStorageServicePutArgs{ - Req: NewKVPutRequest(), - } -} - -var GraphStorageServicePutArgs_Req_DEFAULT *KVPutRequest -func (p *GraphStorageServicePutArgs) GetReq() *KVPutRequest { - if !p.IsSetReq() { - return GraphStorageServicePutArgs_Req_DEFAULT - } -return p.Req -} -func (p *GraphStorageServicePutArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type GraphStorageServicePutArgsBuilder struct { - obj *GraphStorageServicePutArgs -} - -func NewGraphStorageServicePutArgsBuilder() *GraphStorageServicePutArgsBuilder{ - return &GraphStorageServicePutArgsBuilder{ - obj: NewGraphStorageServicePutArgs(), - } -} - -func (p GraphStorageServicePutArgsBuilder) Emit() *GraphStorageServicePutArgs{ - return &GraphStorageServicePutArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServicePutArgsBuilder) Req(req *KVPutRequest) *GraphStorageServicePutArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServicePutArgs) SetReq(req *KVPutRequest) *GraphStorageServicePutArgs { - g.Req = req - return g -} - -func (p *GraphStorageServicePutArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServicePutArgs) 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 *GraphStorageServicePutArgs) 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 *GraphStorageServicePutArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *GraphStorageServicePutArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GraphStorageServicePutArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GraphStorageServicePutResult struct { - thrift.IResponse - Success *ExecResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphStorageServicePutResult() *GraphStorageServicePutResult { - return &GraphStorageServicePutResult{} -} - -var GraphStorageServicePutResult_Success_DEFAULT *ExecResponse -func (p *GraphStorageServicePutResult) GetSuccess() *ExecResponse { - if !p.IsSetSuccess() { - return GraphStorageServicePutResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphStorageServicePutResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphStorageServicePutResultBuilder struct { - obj *GraphStorageServicePutResult -} - -func NewGraphStorageServicePutResultBuilder() *GraphStorageServicePutResultBuilder{ - return &GraphStorageServicePutResultBuilder{ - obj: NewGraphStorageServicePutResult(), - } -} - -func (p GraphStorageServicePutResultBuilder) Emit() *GraphStorageServicePutResult{ - return &GraphStorageServicePutResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServicePutResultBuilder) Success(success *ExecResponse) *GraphStorageServicePutResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServicePutResult) SetSuccess(success *ExecResponse) *GraphStorageServicePutResult { - g.Success = success - return g -} - -func (p *GraphStorageServicePutResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServicePutResult) 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 *GraphStorageServicePutResult) 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 *GraphStorageServicePutResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphStorageServicePutResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphStorageServicePutResult({Success:%s})", successVal) -} - -// Attributes: -// - Req -type GraphStorageServiceRemoveArgs struct { - thrift.IRequest - Req *KVRemoveRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewGraphStorageServiceRemoveArgs() *GraphStorageServiceRemoveArgs { - return &GraphStorageServiceRemoveArgs{ - Req: NewKVRemoveRequest(), - } -} - -var GraphStorageServiceRemoveArgs_Req_DEFAULT *KVRemoveRequest -func (p *GraphStorageServiceRemoveArgs) GetReq() *KVRemoveRequest { - if !p.IsSetReq() { - return GraphStorageServiceRemoveArgs_Req_DEFAULT - } -return p.Req -} -func (p *GraphStorageServiceRemoveArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type GraphStorageServiceRemoveArgsBuilder struct { - obj *GraphStorageServiceRemoveArgs -} - -func NewGraphStorageServiceRemoveArgsBuilder() *GraphStorageServiceRemoveArgsBuilder{ - return &GraphStorageServiceRemoveArgsBuilder{ - obj: NewGraphStorageServiceRemoveArgs(), - } -} - -func (p GraphStorageServiceRemoveArgsBuilder) Emit() *GraphStorageServiceRemoveArgs{ - return &GraphStorageServiceRemoveArgs{ - Req: p.obj.Req, - } -} - -func (g *GraphStorageServiceRemoveArgsBuilder) Req(req *KVRemoveRequest) *GraphStorageServiceRemoveArgsBuilder { - g.obj.Req = req - return g -} - -func (g *GraphStorageServiceRemoveArgs) SetReq(req *KVRemoveRequest) *GraphStorageServiceRemoveArgs { - g.Req = req - return g -} - -func (p *GraphStorageServiceRemoveArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceRemoveArgs) 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 *GraphStorageServiceRemoveArgs) 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 *GraphStorageServiceRemoveArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *GraphStorageServiceRemoveArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("GraphStorageServiceRemoveArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type GraphStorageServiceRemoveResult struct { - thrift.IResponse - Success *ExecResponse `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewGraphStorageServiceRemoveResult() *GraphStorageServiceRemoveResult { - return &GraphStorageServiceRemoveResult{} -} - -var GraphStorageServiceRemoveResult_Success_DEFAULT *ExecResponse -func (p *GraphStorageServiceRemoveResult) GetSuccess() *ExecResponse { - if !p.IsSetSuccess() { - return GraphStorageServiceRemoveResult_Success_DEFAULT - } -return p.Success -} -func (p *GraphStorageServiceRemoveResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type GraphStorageServiceRemoveResultBuilder struct { - obj *GraphStorageServiceRemoveResult -} - -func NewGraphStorageServiceRemoveResultBuilder() *GraphStorageServiceRemoveResultBuilder{ - return &GraphStorageServiceRemoveResultBuilder{ - obj: NewGraphStorageServiceRemoveResult(), - } -} - -func (p GraphStorageServiceRemoveResultBuilder) Emit() *GraphStorageServiceRemoveResult{ - return &GraphStorageServiceRemoveResult{ - Success: p.obj.Success, - } -} - -func (g *GraphStorageServiceRemoveResultBuilder) Success(success *ExecResponse) *GraphStorageServiceRemoveResultBuilder { - g.obj.Success = success - return g -} - -func (g *GraphStorageServiceRemoveResult) SetSuccess(success *ExecResponse) *GraphStorageServiceRemoveResult { - g.Success = success - return g -} - -func (p *GraphStorageServiceRemoveResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GraphStorageServiceRemoveResult) 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 *GraphStorageServiceRemoveResult) 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 *GraphStorageServiceRemoveResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *GraphStorageServiceRemoveResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("GraphStorageServiceRemoveResult({Success:%s})", successVal) -} - - diff --git a/nebula/storage/internal_storage_service-remote/internal_storage_service-remote.go b/nebula/storage/internal_storage_service-remote/internal_storage_service-remote.go new file mode 100755 index 00000000..32de924e --- /dev/null +++ b/nebula/storage/internal_storage_service-remote/internal_storage_service-remote.go @@ -0,0 +1,235 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package main + +import ( + "context" + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/apache/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-go/v3/nebula" + "github.com/vesoft-inc/nebula-go/v3/nebula/meta" + "github.com/vesoft-inc/nebula-go/v3/nebula/storage" +) + +var _ = nebula.GoUnusedProtection__ +var _ = meta.GoUnusedProtection__ +var _ = storage.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " ExecResponse chainAddEdges(ChainAddEdgesRequest req)") + fmt.Fprintln(os.Stderr, " UpdateResponse chainUpdateEdge(ChainUpdateEdgeRequest req)") + fmt.Fprintln(os.Stderr, " ExecResponse chainDeleteEdges(ChainDeleteEdgesRequest req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + var cfg *thrift.TConfiguration = nil + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransportConf(trans, cfg) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg) + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg) + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg) + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := storage.NewInternalStorageServiceClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "chainAddEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainAddEdges requires 1 args") + flag.Usage() + } + arg622 := flag.Arg(1) + mbTrans623 := thrift.NewTMemoryBufferLen(len(arg622)) + defer mbTrans623.Close() + _, err624 := mbTrans623.WriteString(arg622) + if err624 != nil { + Usage() + return + } + factory625 := thrift.NewTJSONProtocolFactory() + jsProt626 := factory625.GetProtocol(mbTrans623) + argvalue0 := storage.NewChainAddEdgesRequest() + err627 := argvalue0.Read(context.Background(), jsProt626) + if err627 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainAddEdges(context.Background(), value0)) + fmt.Print("\n") + break + case "chainUpdateEdge": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainUpdateEdge requires 1 args") + flag.Usage() + } + arg628 := flag.Arg(1) + mbTrans629 := thrift.NewTMemoryBufferLen(len(arg628)) + defer mbTrans629.Close() + _, err630 := mbTrans629.WriteString(arg628) + if err630 != nil { + Usage() + return + } + factory631 := thrift.NewTJSONProtocolFactory() + jsProt632 := factory631.GetProtocol(mbTrans629) + argvalue0 := storage.NewChainUpdateEdgeRequest() + err633 := argvalue0.Read(context.Background(), jsProt632) + if err633 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainUpdateEdge(context.Background(), value0)) + fmt.Print("\n") + break + case "chainDeleteEdges": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ChainDeleteEdges requires 1 args") + flag.Usage() + } + arg634 := flag.Arg(1) + mbTrans635 := thrift.NewTMemoryBufferLen(len(arg634)) + defer mbTrans635.Close() + _, err636 := mbTrans635.WriteString(arg634) + if err636 != nil { + Usage() + return + } + factory637 := thrift.NewTJSONProtocolFactory() + jsProt638 := factory637.GetProtocol(mbTrans635) + argvalue0 := storage.NewChainDeleteEdgesRequest() + err639 := argvalue0.Read(context.Background(), jsProt638) + if err639 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ChainDeleteEdges(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/nebula/storage/storage-consts.go b/nebula/storage/storage-consts.go new file mode 100644 index 00000000..10c4588a --- /dev/null +++ b/nebula/storage/storage-consts.go @@ -0,0 +1,35 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package storage + +import ( + "bytes" + "context" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" + "github.com/vesoft-inc/nebula-go/v3/nebula" + "github.com/vesoft-inc/nebula-go/v3/nebula/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +var _ = nebula.GoUnusedProtection__ +var _ = meta.GoUnusedProtection__ + +func init() { +} + diff --git a/nebula/storage/storage.go b/nebula/storage/storage.go new file mode 100644 index 00000000..563deb7e --- /dev/null +++ b/nebula/storage/storage.go @@ -0,0 +1,29818 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package storage + +import ( + "bytes" + "context" + "database/sql/driver" + "errors" + "fmt" + "time" + thrift "github.com/apache/thrift/lib/go/thrift" + "strings" + "regexp" + "github.com/vesoft-inc/nebula-go/v3/nebula" + "github.com/vesoft-inc/nebula-go/v3/nebula/meta" + +) + +// (needed to ensure safety because of naive import list construction.) +var _ = thrift.ZERO +var _ = fmt.Printf +var _ = errors.New +var _ = context.Background +var _ = time.Now +var _ = bytes.Equal +// (needed by validator.) +var _ = strings.Contains +var _ = regexp.MatchString + +var _ = nebula.GoUnusedProtection__ +var _ = meta.GoUnusedProtection__ +type StatType int64 +const ( + StatType_SUM StatType = 1 + StatType_COUNT StatType = 2 + StatType_AVG StatType = 3 + StatType_MAX StatType = 4 + StatType_MIN StatType = 5 +) + +func (p StatType) String() string { + switch p { + case StatType_SUM: return "SUM" + case StatType_COUNT: return "COUNT" + case StatType_AVG: return "AVG" + case StatType_MAX: return "MAX" + case StatType_MIN: return "MIN" + } + return "" +} + +func StatTypeFromString(s string) (StatType, error) { + switch s { + case "SUM": return StatType_SUM, nil + case "COUNT": return StatType_COUNT, nil + case "AVG": return StatType_AVG, nil + case "MAX": return StatType_MAX, nil + case "MIN": return StatType_MIN, nil + } + return StatType(0), fmt.Errorf("not a valid StatType string") +} + + +func StatTypePtr(v StatType) *StatType { return &v } + +func (p StatType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *StatType) UnmarshalText(text []byte) error { +q, err := StatTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *StatType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = StatType(v) +return nil +} + +func (p * StatType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type OrderDirection int64 +const ( + OrderDirection_ASCENDING OrderDirection = 1 + OrderDirection_DESCENDING OrderDirection = 2 +) + +func (p OrderDirection) String() string { + switch p { + case OrderDirection_ASCENDING: return "ASCENDING" + case OrderDirection_DESCENDING: return "DESCENDING" + } + return "" +} + +func OrderDirectionFromString(s string) (OrderDirection, error) { + switch s { + case "ASCENDING": return OrderDirection_ASCENDING, nil + case "DESCENDING": return OrderDirection_DESCENDING, nil + } + return OrderDirection(0), fmt.Errorf("not a valid OrderDirection string") +} + + +func OrderDirectionPtr(v OrderDirection) *OrderDirection { return &v } + +func (p OrderDirection) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *OrderDirection) UnmarshalText(text []byte) error { +q, err := OrderDirectionFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *OrderDirection) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = OrderDirection(v) +return nil +} + +func (p * OrderDirection) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type EdgeDirection int64 +const ( + EdgeDirection_BOTH EdgeDirection = 1 + EdgeDirection_IN_EDGE EdgeDirection = 2 + EdgeDirection_OUT_EDGE EdgeDirection = 3 +) + +func (p EdgeDirection) String() string { + switch p { + case EdgeDirection_BOTH: return "BOTH" + case EdgeDirection_IN_EDGE: return "IN_EDGE" + case EdgeDirection_OUT_EDGE: return "OUT_EDGE" + } + return "" +} + +func EdgeDirectionFromString(s string) (EdgeDirection, error) { + switch s { + case "BOTH": return EdgeDirection_BOTH, nil + case "IN_EDGE": return EdgeDirection_IN_EDGE, nil + case "OUT_EDGE": return EdgeDirection_OUT_EDGE, nil + } + return EdgeDirection(0), fmt.Errorf("not a valid EdgeDirection string") +} + + +func EdgeDirectionPtr(v EdgeDirection) *EdgeDirection { return &v } + +func (p EdgeDirection) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *EdgeDirection) UnmarshalText(text []byte) error { +q, err := EdgeDirectionFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *EdgeDirection) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = EdgeDirection(v) +return nil +} + +func (p * EdgeDirection) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type ScanType int64 +const ( + ScanType_PREFIX ScanType = 1 + ScanType_RANGE ScanType = 2 +) + +func (p ScanType) String() string { + switch p { + case ScanType_PREFIX: return "PREFIX" + case ScanType_RANGE: return "RANGE" + } + return "" +} + +func ScanTypeFromString(s string) (ScanType, error) { + switch s { + case "PREFIX": return ScanType_PREFIX, nil + case "RANGE": return ScanType_RANGE, nil + } + return ScanType(0), fmt.Errorf("not a valid ScanType string") +} + + +func ScanTypePtr(v ScanType) *ScanType { return &v } + +func (p ScanType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *ScanType) UnmarshalText(text []byte) error { +q, err := ScanTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *ScanType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = ScanType(v) +return nil +} + +func (p * ScanType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +type EngineSignType int64 +const ( + EngineSignType_BLOCK_ON EngineSignType = 1 + EngineSignType_BLOCK_OFF EngineSignType = 2 +) + +func (p EngineSignType) String() string { + switch p { + case EngineSignType_BLOCK_ON: return "BLOCK_ON" + case EngineSignType_BLOCK_OFF: return "BLOCK_OFF" + } + return "" +} + +func EngineSignTypeFromString(s string) (EngineSignType, error) { + switch s { + case "BLOCK_ON": return EngineSignType_BLOCK_ON, nil + case "BLOCK_OFF": return EngineSignType_BLOCK_OFF, nil + } + return EngineSignType(0), fmt.Errorf("not a valid EngineSignType string") +} + + +func EngineSignTypePtr(v EngineSignType) *EngineSignType { return &v } + +func (p EngineSignType) MarshalText() ([]byte, error) { +return []byte(p.String()), nil +} + +func (p *EngineSignType) UnmarshalText(text []byte) error { +q, err := EngineSignTypeFromString(string(text)) +if (err != nil) { +return err +} +*p = q +return nil +} + +func (p *EngineSignType) Scan(value interface{}) error { +v, ok := value.(int64) +if !ok { +return errors.New("Scan value is not int64") +} +*p = EngineSignType(v) +return nil +} + +func (p * EngineSignType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } +return int64(*p), nil +} +// Attributes: +// - SessionID +// - PlanID +// - ProfileDetail +type RequestCommon struct { + SessionID *nebula.SessionID `thrift:"session_id,1" db:"session_id" json:"session_id,omitempty"` + PlanID *nebula.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 nebula.SessionID +func (p *RequestCommon) GetSessionID() nebula.SessionID { + if !p.IsSetSessionID() { + return RequestCommon_SessionID_DEFAULT + } +return *p.SessionID +} +var RequestCommon_PlanID_DEFAULT nebula.ExecutionPlanID +func (p *RequestCommon) GetPlanID() nebula.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.SessionID != nil +} + +func (p *RequestCommon) IsSetPlanID() bool { + return p.PlanID != nil +} + +func (p *RequestCommon) IsSetProfileDetail() bool { + return p.ProfileDetail != nil +} + +func (p *RequestCommon) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RequestCommon) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.SessionID(v) + p.SessionID = &temp +} + return nil +} + +func (p *RequestCommon) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.ExecutionPlanID(v) + p.PlanID = &temp +} + return nil +} + +func (p *RequestCommon) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ProfileDetail = &v +} + return nil +} + +func (p *RequestCommon) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RequestCommon"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RequestCommon) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSessionID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.SessionID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.session_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:session_id: ", p), err) } + } + return err +} + +func (p *RequestCommon) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetPlanID() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.PlanID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.plan_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:plan_id: ", p), err) } + } + return err +} + +func (p *RequestCommon) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetProfileDetail() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(*p.ProfileDetail)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.profile_detail (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:profile_detail: ", p), err) } + } + return err +} + +func (p *RequestCommon) Equals(other *RequestCommon) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SessionID != other.SessionID { + if p.SessionID == nil || other.SessionID == nil { + return false + } + if (*p.SessionID) != (*other.SessionID) { return false } + } + if p.PlanID != other.PlanID { + if p.PlanID == nil || other.PlanID == nil { + return false + } + if (*p.PlanID) != (*other.PlanID) { return false } + } + if p.ProfileDetail != other.ProfileDetail { + if p.ProfileDetail == nil || other.ProfileDetail == nil { + return false + } + if (*p.ProfileDetail) != (*other.ProfileDetail) { return false } + } + return true +} + +func (p *RequestCommon) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RequestCommon(%+v)", *p) +} + +func (p *RequestCommon) Validate() error { + return nil +} +// Attributes: +// - Code +// - PartID +// - Leader +type PartitionResult_ struct { + Code nebula.ErrorCode `thrift:"code,1,required" db:"code" json:"code"` + PartID nebula.PartitionID `thrift:"part_id,2,required" db:"part_id" json:"part_id"` + Leader *nebula.HostAddr `thrift:"leader,3" db:"leader" json:"leader,omitempty"` +} + +func NewPartitionResult_() *PartitionResult_ { + return &PartitionResult_{} +} + + +func (p *PartitionResult_) GetCode() nebula.ErrorCode { + return p.Code +} + +func (p *PartitionResult_) GetPartID() nebula.PartitionID { + return p.PartID +} +var PartitionResult__Leader_DEFAULT *nebula.HostAddr +func (p *PartitionResult_) GetLeader() *nebula.HostAddr { + if !p.IsSetLeader() { + return PartitionResult__Leader_DEFAULT + } +return p.Leader +} +func (p *PartitionResult_) IsSetLeader() bool { + return p.Leader != nil +} + +func (p *PartitionResult_) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetCode = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetPartID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetCode{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Code is not set")); + } + if !issetPartID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field PartID is not set")); + } + return nil +} + +func (p *PartitionResult_) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *PartitionResult_) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *PartitionResult_) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Leader = &nebula.HostAddr{} + if err := p.Leader.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Leader), err) + } + return nil +} + +func (p *PartitionResult_) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "PartitionResult"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *PartitionResult_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *PartitionResult_) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *PartitionResult_) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLeader() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Leader), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:leader: ", p), err) } + } + return err +} + +func (p *PartitionResult_) Equals(other *PartitionResult_) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if p.PartID != other.PartID { return false } + if !p.Leader.Equals(other.Leader) { return false } + return true +} + +func (p *PartitionResult_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("PartitionResult_(%+v)", *p) +} + +func (p *PartitionResult_) Validate() error { + return nil +} +// Attributes: +// - FailedParts +// - LatencyInUs +// - LatencyDetailUs +type ResponseCommon struct { + FailedParts []*PartitionResult_ `thrift:"failed_parts,1,required" db:"failed_parts" json:"failed_parts"` + LatencyInUs int64 `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() int64 { + 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.LatencyDetailUs != nil +} + +func (p *ResponseCommon) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetFailedParts = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetLatencyInUs = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetFailedParts{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field FailedParts is not set")); + } + if !issetLatencyInUs{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field LatencyInUs is not set")); + } + return nil +} + +func (p *ResponseCommon) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem0 := &PartitionResult_{} + if err := _elem0.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem0), err) + } + p.FailedParts = append(p.FailedParts, _elem0) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ResponseCommon) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.LatencyInUs = v +} + return nil +} + +func (p *ResponseCommon) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key1 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key1 = v +} +var _val2 int32 + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val2 = v +} + p.LatencyDetailUs[_key1] = _val2 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ResponseCommon) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ResponseCommon"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ResponseCommon) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.FailedParts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.FailedParts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:failed_parts: ", p), err) } + return err +} + +func (p *ResponseCommon) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "latency_in_us", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.LatencyInUs)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.latency_in_us (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:latency_in_us: ", p), err) } + return err +} + +func (p *ResponseCommon) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLatencyDetailUs() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:latency_detail_us: ", p), err) } + } + return err +} + +func (p *ResponseCommon) Equals(other *ResponseCommon) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.FailedParts) != len(other.FailedParts) { return false } + for i, _tgt := range p.FailedParts { + _src3 := other.FailedParts[i] + if !_tgt.Equals(_src3) { return false } + } + if p.LatencyInUs != other.LatencyInUs { return false } + if len(p.LatencyDetailUs) != len(other.LatencyDetailUs) { return false } + for k, _tgt := range p.LatencyDetailUs { + _src4 := other.LatencyDetailUs[k] + if _tgt != _src4 { return false } + } + return true +} + +func (p *ResponseCommon) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ResponseCommon(%+v)", *p) +} + +func (p *ResponseCommon) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StatProp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *StatProp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *StatProp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := StatType(v) + p.Stat = temp +} + return nil +} + +func (p *StatProp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "StatProp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StatProp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *StatProp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "prop", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:prop: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:prop: ", p), err) } + return err +} + +func (p *StatProp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "stat", thrift.I32, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stat: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Stat)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.stat (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stat: ", p), err) } + return err +} + +func (p *StatProp) Equals(other *StatProp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Alias, other.Alias) != 0 { return false } + if bytes.Compare(p.Prop, other.Prop) != 0 { return false } + if p.Stat != other.Stat { return false } + return true +} + +func (p *StatProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StatProp(%+v)", *p) +} + +func (p *StatProp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *Expr) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Alias = v +} + return nil +} + +func (p *Expr) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Expr = v +} + return nil +} + +func (p *Expr) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "Expr"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *Expr) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "alias", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:alias: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Alias); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.alias (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:alias: ", p), err) } + return err +} + +func (p *Expr) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "expr", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:expr: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Expr); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.expr (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:expr: ", p), err) } + return err +} + +func (p *Expr) Equals(other *Expr) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Alias, other.Alias) != 0 { return false } + if bytes.Compare(p.Expr, other.Expr) != 0 { return false } + return true +} + +func (p *Expr) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("Expr(%+v)", *p) +} + +func (p *Expr) Validate() error { + return nil +} +// Attributes: +// - Type +// - Props +type EdgeProp struct { + Type nebula.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() nebula.EdgeType { + return p.Type +} + +func (p *EdgeProp) GetProps() [][]byte { + return p.Props +} +func (p *EdgeProp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeProp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.EdgeType(v) + p.Type = temp +} + return nil +} + +func (p *EdgeProp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem5 = v +} + p.Props = append(p.Props, _elem5) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *EdgeProp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "EdgeProp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeProp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Type)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:type: ", p), err) } + return err +} + +func (p *EdgeProp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *EdgeProp) Equals(other *EdgeProp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Type != other.Type { return false } + if len(p.Props) != len(other.Props) { return false } + for i, _tgt := range p.Props { + _src6 := other.Props[i] + if bytes.Compare(_tgt, _src6) != 0 { return false } + } + return true +} + +func (p *EdgeProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EdgeProp(%+v)", *p) +} + +func (p *EdgeProp) Validate() error { + return nil +} +// Attributes: +// - Tag +// - Props +type VertexProp struct { + Tag nebula.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() nebula.TagID { + return p.Tag +} + +func (p *VertexProp) GetProps() [][]byte { + return p.Props +} +func (p *VertexProp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *VertexProp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.TagID(v) + p.Tag = temp +} + return nil +} + +func (p *VertexProp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem7 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem7 = v +} + p.Props = append(p.Props, _elem7) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *VertexProp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "VertexProp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *VertexProp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "tag", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:tag: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Tag)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag: ", p), err) } + return err +} + +func (p *VertexProp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *VertexProp) Equals(other *VertexProp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Tag != other.Tag { return false } + if len(p.Props) != len(other.Props) { return false } + for i, _tgt := range p.Props { + _src8 := other.Props[i] + if bytes.Compare(_tgt, _src8) != 0 { return false } + } + return true +} + +func (p *VertexProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("VertexProp(%+v)", *p) +} + +func (p *VertexProp) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *OrderBy) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Prop = v +} + return nil +} + +func (p *OrderBy) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := OrderDirection(v) + p.Direction = temp +} + return nil +} + +func (p *OrderBy) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "OrderBy"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *OrderBy) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "prop", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:prop: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Prop); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.prop (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:prop: ", p), err) } + return err +} + +func (p *OrderBy) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "direction", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:direction: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Direction)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:direction: ", p), err) } + return err +} + +func (p *OrderBy) Equals(other *OrderBy) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Prop, other.Prop) != 0 { return false } + if p.Direction != other.Direction { return false } + return true +} + +func (p *OrderBy) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("OrderBy(%+v)", *p) +} + +func (p *OrderBy) Validate() error { + return nil +} +// Attributes: +// - EdgeTypes +// - EdgeDirection +// - Dedup +// - StatProps +// - VertexProps +// - EdgeProps +// - Expressions +// - OrderBy +// - Random +// - Limit +// - Filter +// - TagFilter +type TraverseSpec struct { + EdgeTypes []nebula.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"` + TagFilter []byte `thrift:"tag_filter,12" db:"tag_filter" json:"tag_filter,omitempty"` +} + +func NewTraverseSpec() *TraverseSpec { + return &TraverseSpec{ +EdgeDirection: 1, +} +} + + +func (p *TraverseSpec) GetEdgeTypes() []nebula.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 +} +var TraverseSpec_TagFilter_DEFAULT []byte + +func (p *TraverseSpec) GetTagFilter() []byte { + return p.TagFilter +} +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) IsSetTagFilter() bool { + return p.TagFilter != nil +} + +func (p *TraverseSpec) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.LIST { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.LIST { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.LIST { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.I64 { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 11: + if fieldTypeId == thrift.STRING { + if err := p.ReadField11(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 12: + if fieldTypeId == thrift.STRING { + if err := p.ReadField12(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TraverseSpec) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.EdgeType, 0, size) + p.EdgeTypes = tSlice + for i := 0; i < size; i ++ { +var _elem9 nebula.EdgeType + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.EdgeType(v) + _elem9 = temp +} + p.EdgeTypes = append(p.EdgeTypes, _elem9) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EdgeDirection(v) + p.EdgeDirection = temp +} + return nil +} + +func (p *TraverseSpec) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *TraverseSpec) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem10 := &StatProp{} + if err := _elem10.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem10), err) + } + p.StatProps = append(p.StatProps, _elem10) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem11 := &VertexProp{} + if err := _elem11.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem11), err) + } + p.VertexProps = append(p.VertexProps, _elem11) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem12 := &EdgeProp{} + if err := _elem12.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem12), err) + } + p.EdgeProps = append(p.EdgeProps, _elem12) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem13 := &Expr{} + if err := _elem13.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem13), err) + } + p.Expressions = append(p.Expressions, _elem13) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem14 := &OrderBy{} + if err := _elem14.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem14), err) + } + p.OrderBy = append(p.OrderBy, _elem14) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TraverseSpec) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Random = &v +} + return nil +} + +func (p *TraverseSpec) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 10: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *TraverseSpec) ReadField11(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 11: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *TraverseSpec) ReadField12(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 12: ", err) +} else { + p.TagFilter = v +} + return nil +} + +func (p *TraverseSpec) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TraverseSpec"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + if err := p.writeField11(ctx, oprot); err != nil { return err } + if err := p.writeField12(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TraverseSpec) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.I32, len(p.EdgeTypes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeTypes { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:edge_types: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.EdgeDirection)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_direction (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_direction: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "dedup", thrift.BOOL, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:dedup: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:dedup: ", p), err) } + return err +} + +func (p *TraverseSpec) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetStatProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.StatProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StatProps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:stat_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:vertex_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:edge_props: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin(ctx, "expressions", thrift.LIST, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:expressions: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:expressions: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:order_by: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetRandom() { + if err := oprot.WriteFieldBegin(ctx, "random", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:random: ", p), err) } + if err := oprot.WriteBool(ctx, bool(*p.Random)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.random (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:random: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin(ctx, "limit", thrift.I64, 10); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 10:limit: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (10) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:limit: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField11(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin(ctx, "filter", thrift.STRING, 11); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 11:filter: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (11) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 11:filter: ", p), err) } + } + return err +} + +func (p *TraverseSpec) writeField12(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTagFilter() { + if err := oprot.WriteFieldBegin(ctx, "tag_filter", thrift.STRING, 12); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:tag_filter: ", p), err) } + if err := oprot.WriteBinary(ctx, p.TagFilter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_filter (12) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 12:tag_filter: ", p), err) } + } + return err +} + +func (p *TraverseSpec) Equals(other *TraverseSpec) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.EdgeTypes) != len(other.EdgeTypes) { return false } + for i, _tgt := range p.EdgeTypes { + _src15 := other.EdgeTypes[i] + if _tgt != _src15 { return false } + } + if p.EdgeDirection != other.EdgeDirection { return false } + if p.Dedup != other.Dedup { return false } + if len(p.StatProps) != len(other.StatProps) { return false } + for i, _tgt := range p.StatProps { + _src16 := other.StatProps[i] + if !_tgt.Equals(_src16) { return false } + } + if len(p.VertexProps) != len(other.VertexProps) { return false } + for i, _tgt := range p.VertexProps { + _src17 := other.VertexProps[i] + if !_tgt.Equals(_src17) { return false } + } + if len(p.EdgeProps) != len(other.EdgeProps) { return false } + for i, _tgt := range p.EdgeProps { + _src18 := other.EdgeProps[i] + if !_tgt.Equals(_src18) { return false } + } + if len(p.Expressions) != len(other.Expressions) { return false } + for i, _tgt := range p.Expressions { + _src19 := other.Expressions[i] + if !_tgt.Equals(_src19) { return false } + } + if len(p.OrderBy) != len(other.OrderBy) { return false } + for i, _tgt := range p.OrderBy { + _src20 := other.OrderBy[i] + if !_tgt.Equals(_src20) { return false } + } + if p.Random != other.Random { + if p.Random == nil || other.Random == nil { + return false + } + if (*p.Random) != (*other.Random) { return false } + } + if p.Limit != other.Limit { + if p.Limit == nil || other.Limit == nil { + return false + } + if (*p.Limit) != (*other.Limit) { return false } + } + if bytes.Compare(p.Filter, other.Filter) != 0 { return false } + if bytes.Compare(p.TagFilter, other.TagFilter) != 0 { return false } + return true +} + +func (p *TraverseSpec) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TraverseSpec(%+v)", *p) +} + +func (p *TraverseSpec) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - ColumnNames +// - Parts +// - TraverseSpec +// - Common +type GetNeighborsRequest struct { + SpaceID nebula.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[nebula.PartitionID][]*nebula.Value `thrift:"parts,3" db:"parts" json:"parts"` + TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` + Common *RequestCommon `thrift:"common,5" db:"common" json:"common,omitempty"` +} + +func NewGetNeighborsRequest() *GetNeighborsRequest { + return &GetNeighborsRequest{} +} + + +func (p *GetNeighborsRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetNeighborsRequest) GetColumnNames() [][]byte { + return p.ColumnNames +} + +func (p *GetNeighborsRequest) GetParts() map[nebula.PartitionID][]*nebula.Value { + 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.TraverseSpec != nil +} + +func (p *GetNeighborsRequest) IsSetCommon() bool { + return p.Common != nil +} + +func (p *GetNeighborsRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetNeighborsRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetNeighborsRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem21 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem21 = v +} + p.ColumnNames = append(p.ColumnNames, _elem21) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetNeighborsRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*nebula.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key22 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key22 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.Value, 0, size) + _val23 := tSlice + for i := 0; i < size; i ++ { + _elem24 := &nebula.Value{} + if err := _elem24.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) + } + _val23 = append(_val23, _elem24) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key22] = _val23 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetNeighborsRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.TraverseSpec = &TraverseSpec{ + EdgeDirection: 1, +} + if err := p.TraverseSpec.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TraverseSpec), err) + } + return nil +} + +func (p *GetNeighborsRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *GetNeighborsRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetNeighborsRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetNeighborsRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.ColumnNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnNames { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:column_names: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TraverseSpec), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:traverse_spec: ", p), err) } + return err +} + +func (p *GetNeighborsRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:common: ", p), err) } + } + return err +} + +func (p *GetNeighborsRequest) Equals(other *GetNeighborsRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.ColumnNames) != len(other.ColumnNames) { return false } + for i, _tgt := range p.ColumnNames { + _src25 := other.ColumnNames[i] + if bytes.Compare(_tgt, _src25) != 0 { return false } + } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src26 := other.Parts[k] + if len(_tgt) != len(_src26) { return false } + for i, _tgt := range _tgt { + _src27 := _src26[i] + if !_tgt.Equals(_src27) { return false } + } + } + if !p.TraverseSpec.Equals(other.TraverseSpec) { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *GetNeighborsRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetNeighborsRequest(%+v)", *p) +} + +func (p *GetNeighborsRequest) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Vertices +type GetNeighborsResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Vertices *nebula.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 *nebula.DataSet +func (p *GetNeighborsResponse) GetVertices() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *GetNeighborsResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *GetNeighborsResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Vertices = &nebula.DataSet{} + if err := p.Vertices.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vertices), err) + } + return nil +} + +func (p *GetNeighborsResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetNeighborsResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetNeighborsResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *GetNeighborsResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetVertices() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vertices), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertices: ", p), err) } + } + return err +} + +func (p *GetNeighborsResponse) Equals(other *GetNeighborsResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Vertices.Equals(other.Vertices) { return false } + return true +} + +func (p *GetNeighborsResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetNeighborsResponse(%+v)", *p) +} + +func (p *GetNeighborsResponse) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - EdgeTypes +// - Common +type GetDstBySrcRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID][]*nebula.Value `thrift:"parts,2" db:"parts" json:"parts"` + EdgeTypes []nebula.EdgeType `thrift:"edge_types,3" db:"edge_types" json:"edge_types"` + Common *RequestCommon `thrift:"common,4" db:"common" json:"common,omitempty"` +} + +func NewGetDstBySrcRequest() *GetDstBySrcRequest { + return &GetDstBySrcRequest{} +} + + +func (p *GetDstBySrcRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetDstBySrcRequest) GetParts() map[nebula.PartitionID][]*nebula.Value { + return p.Parts +} + +func (p *GetDstBySrcRequest) GetEdgeTypes() []nebula.EdgeType { + return p.EdgeTypes +} +var GetDstBySrcRequest_Common_DEFAULT *RequestCommon +func (p *GetDstBySrcRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return GetDstBySrcRequest_Common_DEFAULT + } +return p.Common +} +func (p *GetDstBySrcRequest) IsSetCommon() bool { + return p.Common != nil +} + +func (p *GetDstBySrcRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetDstBySrcRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetDstBySrcRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*nebula.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key28 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key28 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.Value, 0, size) + _val29 := tSlice + for i := 0; i < size; i ++ { + _elem30 := &nebula.Value{} + if err := _elem30.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) + } + _val29 = append(_val29, _elem30) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key28] = _val29 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetDstBySrcRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.EdgeType, 0, size) + p.EdgeTypes = tSlice + for i := 0; i < size; i ++ { +var _elem31 nebula.EdgeType + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.EdgeType(v) + _elem31 = temp +} + p.EdgeTypes = append(p.EdgeTypes, _elem31) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetDstBySrcRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *GetDstBySrcRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetDstBySrcRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetDstBySrcRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetDstBySrcRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *GetDstBySrcRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "edge_types", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_types: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.EdgeTypes)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeTypes { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_types: ", p), err) } + return err +} + +func (p *GetDstBySrcRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:common: ", p), err) } + } + return err +} + +func (p *GetDstBySrcRequest) Equals(other *GetDstBySrcRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src32 := other.Parts[k] + if len(_tgt) != len(_src32) { return false } + for i, _tgt := range _tgt { + _src33 := _src32[i] + if !_tgt.Equals(_src33) { return false } + } + } + if len(p.EdgeTypes) != len(other.EdgeTypes) { return false } + for i, _tgt := range p.EdgeTypes { + _src34 := other.EdgeTypes[i] + if _tgt != _src34 { return false } + } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *GetDstBySrcRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDstBySrcRequest(%+v)", *p) +} + +func (p *GetDstBySrcRequest) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Dsts +type GetDstBySrcResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Dsts *nebula.DataSet `thrift:"dsts,2" db:"dsts" json:"dsts,omitempty"` +} + +func NewGetDstBySrcResponse() *GetDstBySrcResponse { + return &GetDstBySrcResponse{} +} + +var GetDstBySrcResponse_Result__DEFAULT *ResponseCommon +func (p *GetDstBySrcResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return GetDstBySrcResponse_Result__DEFAULT + } +return p.Result_ +} +var GetDstBySrcResponse_Dsts_DEFAULT *nebula.DataSet +func (p *GetDstBySrcResponse) GetDsts() *nebula.DataSet { + if !p.IsSetDsts() { + return GetDstBySrcResponse_Dsts_DEFAULT + } +return p.Dsts +} +func (p *GetDstBySrcResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *GetDstBySrcResponse) IsSetDsts() bool { + return p.Dsts != nil +} + +func (p *GetDstBySrcResponse) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *GetDstBySrcResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *GetDstBySrcResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Dsts = &nebula.DataSet{} + if err := p.Dsts.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dsts), err) + } + return nil +} + +func (p *GetDstBySrcResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetDstBySrcResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetDstBySrcResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *GetDstBySrcResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetDsts() { + if err := oprot.WriteFieldBegin(ctx, "dsts", thrift.STRUCT, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dsts: ", p), err) } + if err := p.Dsts.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dsts), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dsts: ", p), err) } + } + return err +} + +func (p *GetDstBySrcResponse) Equals(other *GetDstBySrcResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Dsts.Equals(other.Dsts) { return false } + return true +} + +func (p *GetDstBySrcResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetDstBySrcResponse(%+v)", *p) +} + +func (p *GetDstBySrcResponse) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ExecResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *ExecResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ExecResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ExecResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *ExecResponse) Equals(other *ExecResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + return true +} + +func (p *ExecResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ExecResponse(%+v)", *p) +} + +func (p *ExecResponse) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - VertexProps +// - EdgeProps +// - Expressions +// - Dedup +// - OrderBy +// - Limit +// - Filter +// - Common +type GetPropRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID][]*nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetPropRequest) GetParts() map[nebula.PartitionID][]*nebula.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.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) IsSetCommon() bool { + return p.Common != nil +} + +func (p *GetPropRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.LIST { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.I64 { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRING { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPropRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetPropRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*nebula.Row, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key35 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key35 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.Row, 0, size) + _val36 := tSlice + for i := 0; i < size; i ++ { + _elem37 := &nebula.Row{} + if err := _elem37.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem37), err) + } + _val36 = append(_val36, _elem37) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key35] = _val36 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem38 := &VertexProp{} + if err := _elem38.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem38), err) + } + p.VertexProps = append(p.VertexProps, _elem38) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem39 := &EdgeProp{} + if err := _elem39.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem39), err) + } + p.EdgeProps = append(p.EdgeProps, _elem39) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem40 := &Expr{} + if err := _elem40.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem40), err) + } + p.Expressions = append(p.Expressions, _elem40) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Dedup = v +} + return nil +} + +func (p *GetPropRequest) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem41 := &OrderBy{} + if err := _elem41.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem41), err) + } + p.OrderBy = append(p.OrderBy, _elem41) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *GetPropRequest) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *GetPropRequest) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *GetPropRequest) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *GetPropRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetPropRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPropRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetVertexProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.VertexProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.VertexProps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEdgeProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.EdgeProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.EdgeProps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:edge_props: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetExpressions() { + if err := oprot.WriteFieldBegin(ctx, "expressions", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:expressions: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Expressions)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Expressions { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:expressions: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "dedup", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:dedup: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.Dedup)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.dedup (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:dedup: ", p), err) } + return err +} + +func (p *GetPropRequest) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:order_by: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin(ctx, "limit", thrift.I64, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:limit: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:limit: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin(ctx, "filter", thrift.STRING, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:filter: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:filter: ", p), err) } + } + return err +} + +func (p *GetPropRequest) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:common: ", p), err) } + } + return err +} + +func (p *GetPropRequest) Equals(other *GetPropRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src42 := other.Parts[k] + if len(_tgt) != len(_src42) { return false } + for i, _tgt := range _tgt { + _src43 := _src42[i] + if !_tgt.Equals(_src43) { return false } + } + } + if len(p.VertexProps) != len(other.VertexProps) { return false } + for i, _tgt := range p.VertexProps { + _src44 := other.VertexProps[i] + if !_tgt.Equals(_src44) { return false } + } + if len(p.EdgeProps) != len(other.EdgeProps) { return false } + for i, _tgt := range p.EdgeProps { + _src45 := other.EdgeProps[i] + if !_tgt.Equals(_src45) { return false } + } + if len(p.Expressions) != len(other.Expressions) { return false } + for i, _tgt := range p.Expressions { + _src46 := other.Expressions[i] + if !_tgt.Equals(_src46) { return false } + } + if p.Dedup != other.Dedup { return false } + if len(p.OrderBy) != len(other.OrderBy) { return false } + for i, _tgt := range p.OrderBy { + _src47 := other.OrderBy[i] + if !_tgt.Equals(_src47) { return false } + } + if p.Limit != other.Limit { + if p.Limit == nil || other.Limit == nil { + return false + } + if (*p.Limit) != (*other.Limit) { return false } + } + if bytes.Compare(p.Filter, other.Filter) != 0 { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *GetPropRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPropRequest(%+v)", *p) +} + +func (p *GetPropRequest) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Props +type GetPropResponse struct { + Result_ *ResponseCommon `thrift:"result,1" db:"result" json:"result"` + Props *nebula.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 *nebula.DataSet +func (p *GetPropResponse) GetProps() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetPropResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *GetPropResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Props = &nebula.DataSet{} + if err := p.Props.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *GetPropResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetPropResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetPropResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *GetPropResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *GetPropResponse) Equals(other *GetPropResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Props.Equals(other.Props) { return false } + return true +} + +func (p *GetPropResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetPropResponse(%+v)", *p) +} + +func (p *GetPropResponse) Validate() error { + return nil +} +// Attributes: +// - TagID +// - Props +type NewTag_ struct { + TagID nebula.TagID `thrift:"tag_id,1" db:"tag_id" json:"tag_id"` + Props []*nebula.Value `thrift:"props,2" db:"props" json:"props"` +} + +func NewNewTag_() *NewTag_ { + return &NewTag_{} +} + + +func (p *NewTag_) GetTagID() nebula.TagID { + return p.TagID +} + +func (p *NewTag_) GetProps() []*nebula.Value { + return p.Props +} +func (p *NewTag_) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *NewTag_) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *NewTag_) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.Value, 0, size) + p.Props = tSlice + for i := 0; i < size; i ++ { + _elem48 := &nebula.Value{} + if err := _elem48.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem48), err) + } + p.Props = append(p.Props, _elem48) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewTag_) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "NewTag"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *NewTag_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:tag_id: ", p), err) } + return err +} + +func (p *NewTag_) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *NewTag_) Equals(other *NewTag_) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.TagID != other.TagID { return false } + if len(p.Props) != len(other.Props) { return false } + for i, _tgt := range p.Props { + _src49 := other.Props[i] + if !_tgt.Equals(_src49) { return false } + } + return true +} + +func (p *NewTag_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NewTag_(%+v)", *p) +} + +func (p *NewTag_) Validate() error { + return nil +} +// Attributes: +// - ID +// - Tags +type NewVertex_ struct { + ID *nebula.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 *nebula.Value +func (p *NewVertex_) GetID() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *NewVertex_) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.ID = &nebula.Value{} + if err := p.ID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ID), err) + } + return nil +} + +func (p *NewVertex_) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem50 := &NewTag_{} + if err := _elem50.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) + } + p.Tags = append(p.Tags, _elem50) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewVertex_) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "NewVertex"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *NewVertex_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *NewVertex_) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tags: ", p), err) } + return err +} + +func (p *NewVertex_) Equals(other *NewVertex_) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.ID.Equals(other.ID) { return false } + if len(p.Tags) != len(other.Tags) { return false } + for i, _tgt := range p.Tags { + _src51 := other.Tags[i] + if !_tgt.Equals(_src51) { return false } + } + return true +} + +func (p *NewVertex_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NewVertex_(%+v)", *p) +} + +func (p *NewVertex_) Validate() error { + return nil +} +// Attributes: +// - Src +// - EdgeType +// - Ranking +// - Dst +type EdgeKey struct { + Src *nebula.Value `thrift:"src,1" db:"src" json:"src"` + EdgeType nebula.EdgeType `thrift:"edge_type,2" db:"edge_type" json:"edge_type"` + Ranking nebula.EdgeRanking `thrift:"ranking,3" db:"ranking" json:"ranking"` + Dst *nebula.Value `thrift:"dst,4" db:"dst" json:"dst"` +} + +func NewEdgeKey() *EdgeKey { + return &EdgeKey{} +} + +var EdgeKey_Src_DEFAULT *nebula.Value +func (p *EdgeKey) GetSrc() *nebula.Value { + if !p.IsSetSrc() { + return EdgeKey_Src_DEFAULT + } +return p.Src +} + +func (p *EdgeKey) GetEdgeType() nebula.EdgeType { + return p.EdgeType +} + +func (p *EdgeKey) GetRanking() nebula.EdgeRanking { + return p.Ranking +} +var EdgeKey_Dst_DEFAULT *nebula.Value +func (p *EdgeKey) GetDst() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *EdgeKey) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Src = &nebula.Value{} + if err := p.Src.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Src), err) + } + return nil +} + +func (p *EdgeKey) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.EdgeType(v) + p.EdgeType = temp +} + return nil +} + +func (p *EdgeKey) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula.EdgeRanking(v) + p.Ranking = temp +} + return nil +} + +func (p *EdgeKey) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Dst = &nebula.Value{} + if err := p.Dst.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dst), err) + } + return nil +} + +func (p *EdgeKey) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "EdgeKey"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *EdgeKey) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Src), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:src: ", p), err) } + return err +} + +func (p *EdgeKey) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.EdgeType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:edge_type: ", p), err) } + return err +} + +func (p *EdgeKey) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "ranking", thrift.I64, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:ranking: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Ranking)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ranking (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:ranking: ", p), err) } + return err +} + +func (p *EdgeKey) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dst), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:dst: ", p), err) } + return err +} + +func (p *EdgeKey) Equals(other *EdgeKey) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Src.Equals(other.Src) { return false } + if p.EdgeType != other.EdgeType { return false } + if p.Ranking != other.Ranking { return false } + if !p.Dst.Equals(other.Dst) { return false } + return true +} + +func (p *EdgeKey) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("EdgeKey(%+v)", *p) +} + +func (p *EdgeKey) Validate() error { + return nil +} +// Attributes: +// - Key +// - Props +type NewEdge_ struct { + Key *EdgeKey `thrift:"key,1" db:"key" json:"key"` + Props []*nebula.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() []*nebula.Value { + return p.Props +} +func (p *NewEdge_) IsSetKey() bool { + return p.Key != nil +} + +func (p *NewEdge_) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *NewEdge_) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Key = &EdgeKey{} + if err := p.Key.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Key), err) + } + return nil +} + +func (p *NewEdge_) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.Value, 0, size) + p.Props = tSlice + for i := 0; i < size; i ++ { + _elem52 := &nebula.Value{} + if err := _elem52.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem52), err) + } + p.Props = append(p.Props, _elem52) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *NewEdge_) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "NewEdge"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *NewEdge_) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Key), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:key: ", p), err) } + return err +} + +func (p *NewEdge_) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "props", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Props)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Props { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + return err +} + +func (p *NewEdge_) Equals(other *NewEdge_) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Key.Equals(other.Key) { return false } + if len(p.Props) != len(other.Props) { return false } + for i, _tgt := range p.Props { + _src53 := other.Props[i] + if !_tgt.Equals(_src53) { return false } + } + return true +} + +func (p *NewEdge_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("NewEdge_(%+v)", *p) +} + +func (p *NewEdge_) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +// - IgnoreExistedIndex +// - Common +type AddVerticesRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID][]*NewVertex_ `thrift:"parts,2" db:"parts" json:"parts"` + PropNames map[nebula.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"` + IgnoreExistedIndex bool `thrift:"ignore_existed_index,5" db:"ignore_existed_index" json:"ignore_existed_index"` + Common *RequestCommon `thrift:"common,6" db:"common" json:"common,omitempty"` +} + +func NewAddVerticesRequest() *AddVerticesRequest { + return &AddVerticesRequest{} +} + + +func (p *AddVerticesRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *AddVerticesRequest) GetParts() map[nebula.PartitionID][]*NewVertex_ { + return p.Parts +} + +func (p *AddVerticesRequest) GetPropNames() map[nebula.TagID][][]byte { + return p.PropNames +} + +func (p *AddVerticesRequest) GetIfNotExists() bool { + return p.IfNotExists +} + +func (p *AddVerticesRequest) GetIgnoreExistedIndex() bool { + return p.IgnoreExistedIndex +} +var AddVerticesRequest_Common_DEFAULT *RequestCommon +func (p *AddVerticesRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return AddVerticesRequest_Common_DEFAULT + } +return p.Common +} +func (p *AddVerticesRequest) IsSetCommon() bool { + return p.Common != nil +} + +func (p *AddVerticesRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AddVerticesRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*NewVertex_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key54 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key54 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewVertex_, 0, size) + _val55 := tSlice + for i := 0; i < size; i ++ { + _elem56 := &NewVertex_{} + if err := _elem56.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) + } + _val55 = append(_val55, _elem56) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key54] = _val55 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.TagID][][]byte, size) + p.PropNames = tMap + for i := 0; i < size; i ++ { +var _key57 nebula.TagID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.TagID(v) + _key57 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val58 := tSlice + for i := 0; i < size; i ++ { +var _elem59 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem59 = v +} + _val58 = append(_val58, _elem59) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.PropNames[_key57] = _val58 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddVerticesRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddVerticesRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IgnoreExistedIndex = v +} + return nil +} + +func (p *AddVerticesRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *AddVerticesRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddVerticesRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddVerticesRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "ignore_existed_index", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignore_existed_index: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.IgnoreExistedIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ignore_existed_index (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignore_existed_index: ", p), err) } + return err +} + +func (p *AddVerticesRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "common", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:common: ", p), err) } + if err := p.Common.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:common: ", p), err) } + } + return err +} + +func (p *AddVerticesRequest) Equals(other *AddVerticesRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src60 := other.Parts[k] + if len(_tgt) != len(_src60) { return false } + for i, _tgt := range _tgt { + _src61 := _src60[i] + if !_tgt.Equals(_src61) { return false } + } + } + if len(p.PropNames) != len(other.PropNames) { return false } + for k, _tgt := range p.PropNames { + _src62 := other.PropNames[k] + if len(_tgt) != len(_src62) { return false } + for i, _tgt := range _tgt { + _src63 := _src62[i] + if bytes.Compare(_tgt, _src63) != 0 { return false } + } + } + if p.IfNotExists != other.IfNotExists { return false } + if p.IgnoreExistedIndex != other.IgnoreExistedIndex { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *AddVerticesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddVerticesRequest(%+v)", *p) +} + +func (p *AddVerticesRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +// - IgnoreExistedIndex +// - Common +type AddEdgesRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.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"` + IgnoreExistedIndex bool `thrift:"ignore_existed_index,5" db:"ignore_existed_index" json:"ignore_existed_index"` + Common *RequestCommon `thrift:"common,6" db:"common" json:"common,omitempty"` +} + +func NewAddEdgesRequest() *AddEdgesRequest { + return &AddEdgesRequest{} +} + + +func (p *AddEdgesRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *AddEdgesRequest) GetParts() map[nebula.PartitionID][]*NewEdge_ { + return p.Parts +} + +func (p *AddEdgesRequest) GetPropNames() [][]byte { + return p.PropNames +} + +func (p *AddEdgesRequest) GetIfNotExists() bool { + return p.IfNotExists +} + +func (p *AddEdgesRequest) GetIgnoreExistedIndex() bool { + return p.IgnoreExistedIndex +} +var AddEdgesRequest_Common_DEFAULT *RequestCommon +func (p *AddEdgesRequest) GetCommon() *RequestCommon { + if !p.IsSetCommon() { + return AddEdgesRequest_Common_DEFAULT + } +return p.Common +} +func (p *AddEdgesRequest) IsSetCommon() bool { + return p.Common != nil +} + +func (p *AddEdgesRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AddEdgesRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*NewEdge_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key64 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key64 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewEdge_, 0, size) + _val65 := tSlice + for i := 0; i < size; i ++ { + _elem66 := &NewEdge_{} + if err := _elem66.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem66), err) + } + _val65 = append(_val65, _elem66) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key64] = _val65 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem67 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem67 = v +} + p.PropNames = append(p.PropNames, _elem67) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddEdgesRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *AddEdgesRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IgnoreExistedIndex = v +} + return nil +} + +func (p *AddEdgesRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *AddEdgesRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddEdgesRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddEdgesRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PropNames { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "ignore_existed_index", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignore_existed_index: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.IgnoreExistedIndex)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.ignore_existed_index (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignore_existed_index: ", p), err) } + return err +} + +func (p *AddEdgesRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "common", thrift.STRUCT, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:common: ", p), err) } + if err := p.Common.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:common: ", p), err) } + } + return err +} + +func (p *AddEdgesRequest) Equals(other *AddEdgesRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src68 := other.Parts[k] + if len(_tgt) != len(_src68) { return false } + for i, _tgt := range _tgt { + _src69 := _src68[i] + if !_tgt.Equals(_src69) { return false } + } + } + if len(p.PropNames) != len(other.PropNames) { return false } + for i, _tgt := range p.PropNames { + _src70 := other.PropNames[i] + if bytes.Compare(_tgt, _src70) != 0 { return false } + } + if p.IfNotExists != other.IfNotExists { return false } + if p.IgnoreExistedIndex != other.IgnoreExistedIndex { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *AddEdgesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddEdgesRequest(%+v)", *p) +} + +func (p *AddEdgesRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - Common +type DeleteVerticesRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID][]*nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteVerticesRequest) GetParts() map[nebula.PartitionID][]*nebula.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.Common != nil +} + +func (p *DeleteVerticesRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DeleteVerticesRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DeleteVerticesRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*nebula.Value, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key71 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key71 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.Value, 0, size) + _val72 := tSlice + for i := 0; i < size; i ++ { + _elem73 := &nebula.Value{} + if err := _elem73.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem73), err) + } + _val72 = append(_val72, _elem73) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key71] = _val72 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteVerticesRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *DeleteVerticesRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DeleteVerticesRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DeleteVerticesRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DeleteVerticesRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *DeleteVerticesRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:common: ", p), err) } + } + return err +} + +func (p *DeleteVerticesRequest) Equals(other *DeleteVerticesRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src74 := other.Parts[k] + if len(_tgt) != len(_src74) { return false } + for i, _tgt := range _tgt { + _src75 := _src74[i] + if !_tgt.Equals(_src75) { return false } + } + } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *DeleteVerticesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteVerticesRequest(%+v)", *p) +} + +func (p *DeleteVerticesRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - Common +type DeleteEdgesRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteEdgesRequest) GetParts() map[nebula.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.Common != nil +} + +func (p *DeleteEdgesRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DeleteEdgesRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DeleteEdgesRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*EdgeKey, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key76 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key76 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeKey, 0, size) + _val77 := tSlice + for i := 0; i < size; i ++ { + _elem78 := &EdgeKey{} + if err := _elem78.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem78), err) + } + _val77 = append(_val77, _elem78) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key76] = _val77 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteEdgesRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *DeleteEdgesRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DeleteEdgesRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DeleteEdgesRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DeleteEdgesRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *DeleteEdgesRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:common: ", p), err) } + } + return err +} + +func (p *DeleteEdgesRequest) Equals(other *DeleteEdgesRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src79 := other.Parts[k] + if len(_tgt) != len(_src79) { return false } + for i, _tgt := range _tgt { + _src80 := _src79[i] + if !_tgt.Equals(_src80) { return false } + } + } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *DeleteEdgesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteEdgesRequest(%+v)", *p) +} + +func (p *DeleteEdgesRequest) Validate() error { + return nil +} +// Attributes: +// - ID +// - Tags +type DelTags struct { + ID *nebula.Value `thrift:"id,1" db:"id" json:"id"` + Tags []nebula.TagID `thrift:"tags,2" db:"tags" json:"tags"` +} + +func NewDelTags() *DelTags { + return &DelTags{} +} + +var DelTags_ID_DEFAULT *nebula.Value +func (p *DelTags) GetID() *nebula.Value { + if !p.IsSetID() { + return DelTags_ID_DEFAULT + } +return p.ID +} + +func (p *DelTags) GetTags() []nebula.TagID { + return p.Tags +} +func (p *DelTags) IsSetID() bool { + return p.ID != nil +} + +func (p *DelTags) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DelTags) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.ID = &nebula.Value{} + if err := p.ID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ID), err) + } + return nil +} + +func (p *DelTags) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.TagID, 0, size) + p.Tags = tSlice + for i := 0; i < size; i ++ { +var _elem81 nebula.TagID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.TagID(v) + _elem81 = temp +} + p.Tags = append(p.Tags, _elem81) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DelTags) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DelTags"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DelTags) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:id: ", p), err) } + return err +} + +func (p *DelTags) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "tags", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:tags: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Tags)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Tags { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:tags: ", p), err) } + return err +} + +func (p *DelTags) Equals(other *DelTags) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.ID.Equals(other.ID) { return false } + if len(p.Tags) != len(other.Tags) { return false } + for i, _tgt := range p.Tags { + _src82 := other.Tags[i] + if _tgt != _src82 { return false } + } + return true +} + +func (p *DelTags) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DelTags(%+v)", *p) +} + +func (p *DelTags) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - Common +type DeleteTagsRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *DeleteTagsRequest) GetParts() map[nebula.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.Common != nil +} + +func (p *DeleteTagsRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DeleteTagsRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *DeleteTagsRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*DelTags, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key83 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key83 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*DelTags, 0, size) + _val84 := tSlice + for i := 0; i < size; i ++ { + _elem85 := &DelTags{} + if err := _elem85.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem85), err) + } + _val84 = append(_val84, _elem85) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key83] = _val84 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *DeleteTagsRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *DeleteTagsRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DeleteTagsRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DeleteTagsRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *DeleteTagsRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *DeleteTagsRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:common: ", p), err) } + } + return err +} + +func (p *DeleteTagsRequest) Equals(other *DeleteTagsRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src86 := other.Parts[k] + if len(_tgt) != len(_src86) { return false } + for i, _tgt := range _tgt { + _src87 := _src86[i] + if !_tgt.Equals(_src87) { return false } + } + } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *DeleteTagsRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DeleteTagsRequest(%+v)", *p) +} + +func (p *DeleteTagsRequest) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Props +type UpdateResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Props *nebula.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 *nebula.DataSet +func (p *UpdateResponse) GetProps() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *UpdateResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *UpdateResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Props = &nebula.DataSet{} + if err := p.Props.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *UpdateResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "UpdateResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *UpdateResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *UpdateResponse) Equals(other *UpdateResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Props.Equals(other.Props) { return false } + return true +} + +func (p *UpdateResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateResponse(%+v)", *p) +} + +func (p *UpdateResponse) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetName = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetValue = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetName{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Name is not set")); + } + if !issetValue{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Value is not set")); + } + return nil +} + +func (p *UpdatedProp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *UpdatedProp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Value = v +} + return nil +} + +func (p *UpdatedProp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "UpdatedProp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdatedProp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:name: ", p), err) } + return err +} + +func (p *UpdatedProp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "value", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:value: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Value); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.value (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:value: ", p), err) } + return err +} + +func (p *UpdatedProp) Equals(other *UpdatedProp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if bytes.Compare(p.Value, other.Value) != 0 { return false } + return true +} + +func (p *UpdatedProp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdatedProp(%+v)", *p) +} + +func (p *UpdatedProp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - VertexID +// - TagID +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +// - Common +type UpdateVertexRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + VertexID *nebula.Value `thrift:"vertex_id,3" db:"vertex_id" json:"vertex_id"` + TagID nebula.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"` + 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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateVertexRequest) GetPartID() nebula.PartitionID { + return p.PartID +} +var UpdateVertexRequest_VertexID_DEFAULT *nebula.Value +func (p *UpdateVertexRequest) GetVertexID() *nebula.Value { + if !p.IsSetVertexID() { + return UpdateVertexRequest_VertexID_DEFAULT + } +return p.VertexID +} + +func (p *UpdateVertexRequest) GetTagID() nebula.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.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) IsSetCommon() bool { + return p.Common != nil +} + +func (p *UpdateVertexRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetTagID bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + issetTagID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.LIST { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRING { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetTagID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field TagID is not set")); + } + return nil +} + +func (p *UpdateVertexRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.VertexID = &nebula.Value{} + if err := p.VertexID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.VertexID), err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula.TagID(v) + p.TagID = temp +} + return nil +} + +func (p *UpdateVertexRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem88 := &UpdatedProp{} + if err := _elem88.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem88), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem88) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateVertexRequest) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem89 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem89 = v +} + p.ReturnProps = append(p.ReturnProps, _elem89) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateVertexRequest) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateVertexRequest) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *UpdateVertexRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "UpdateVertexRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateVertexRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.VertexID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:vertex_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.TagID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.tag_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:tag_id: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:updated_props: ", p), err) } + return err +} + +func (p *UpdateVertexRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin(ctx, "insertable", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:insertable: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:insertable: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:return_props: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin(ctx, "condition", thrift.STRING, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:condition: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:condition: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:common: ", p), err) } + } + return err +} + +func (p *UpdateVertexRequest) Equals(other *UpdateVertexRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if !p.VertexID.Equals(other.VertexID) { return false } + if p.TagID != other.TagID { return false } + if len(p.UpdatedProps) != len(other.UpdatedProps) { return false } + for i, _tgt := range p.UpdatedProps { + _src90 := other.UpdatedProps[i] + if !_tgt.Equals(_src90) { return false } + } + if p.Insertable != other.Insertable { return false } + if len(p.ReturnProps) != len(other.ReturnProps) { return false } + for i, _tgt := range p.ReturnProps { + _src91 := other.ReturnProps[i] + if bytes.Compare(_tgt, _src91) != 0 { return false } + } + if bytes.Compare(p.Condition, other.Condition) != 0 { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *UpdateVertexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateVertexRequest(%+v)", *p) +} + +func (p *UpdateVertexRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - EdgeKey +// - UpdatedProps +// - Insertable +// - ReturnProps +// - Condition +// - Common +type UpdateEdgeRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.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"` + 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{} +} + + +func (p *UpdateEdgeRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *UpdateEdgeRequest) GetPartID() nebula.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.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) IsSetCommon() bool { + return p.Common != nil +} + +func (p *UpdateEdgeRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.LIST { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.EdgeKey = &EdgeKey{} + if err := p.EdgeKey.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EdgeKey), err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem92 := &UpdatedProp{} + if err := _elem92.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem92), err) + } + p.UpdatedProps = append(p.UpdatedProps, _elem92) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Insertable = v +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem93 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem93 = v +} + p.ReturnProps = append(p.ReturnProps, _elem93) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *UpdateEdgeRequest) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Condition = v +} + return nil +} + +func (p *UpdateEdgeRequest) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *UpdateEdgeRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "UpdateEdgeRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *UpdateEdgeRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EdgeKey), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_key: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.UpdatedProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.UpdatedProps { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:updated_props: ", p), err) } + return err +} + +func (p *UpdateEdgeRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetInsertable() { + if err := oprot.WriteFieldBegin(ctx, "insertable", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:insertable: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.Insertable)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.insertable (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:insertable: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetReturnProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.ReturnProps)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnProps { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:return_props: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCondition() { + if err := oprot.WriteFieldBegin(ctx, "condition", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:condition: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Condition); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.condition (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:condition: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:common: ", p), err) } + } + return err +} + +func (p *UpdateEdgeRequest) Equals(other *UpdateEdgeRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if !p.EdgeKey.Equals(other.EdgeKey) { return false } + if len(p.UpdatedProps) != len(other.UpdatedProps) { return false } + for i, _tgt := range p.UpdatedProps { + _src94 := other.UpdatedProps[i] + if !_tgt.Equals(_src94) { return false } + } + if p.Insertable != other.Insertable { return false } + if len(p.ReturnProps) != len(other.ReturnProps) { return false } + for i, _tgt := range p.ReturnProps { + _src95 := other.ReturnProps[i] + if bytes.Compare(_tgt, _src95) != 0 { return false } + } + if bytes.Compare(p.Condition, other.Condition) != 0 { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *UpdateEdgeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("UpdateEdgeRequest(%+v)", *p) +} + +func (p *UpdateEdgeRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - Name +// - Common +type GetUUIDReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *GetUUIDReq) GetPartID() nebula.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.Common != nil +} + +func (p *GetUUIDReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetUUIDReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *GetUUIDReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *GetUUIDReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *GetUUIDReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *GetUUIDReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetUUIDReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetUUIDReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:name: ", p), err) } + return err +} + +func (p *GetUUIDReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:common: ", p), err) } + } + return err +} + +func (p *GetUUIDReq) Equals(other *GetUUIDReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *GetUUIDReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUUIDReq(%+v)", *p) +} + +func (p *GetUUIDReq) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - ID +type GetUUIDResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + ID *nebula.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 *nebula.Value +func (p *GetUUIDResp) GetID() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *GetUUIDResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *GetUUIDResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.ID = &nebula.Value{} + if err := p.ID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.ID), err) + } + return nil +} + +func (p *GetUUIDResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetUUIDResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetUUIDResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *GetUUIDResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.ID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:id: ", p), err) } + return err +} + +func (p *GetUUIDResp) Equals(other *GetUUIDResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.ID.Equals(other.ID) { return false } + return true +} + +func (p *GetUUIDResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetUUIDResp(%+v)", *p) +} + +func (p *GetUUIDResp) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Data +// - StatData +type LookupIndexResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Data *nebula.DataSet `thrift:"data,2" db:"data" json:"data,omitempty"` + StatData *nebula.DataSet `thrift:"stat_data,3" db:"stat_data" json:"stat_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 *nebula.DataSet +func (p *LookupIndexResp) GetData() *nebula.DataSet { + if !p.IsSetData() { + return LookupIndexResp_Data_DEFAULT + } +return p.Data +} +var LookupIndexResp_StatData_DEFAULT *nebula.DataSet +func (p *LookupIndexResp) GetStatData() *nebula.DataSet { + if !p.IsSetStatData() { + return LookupIndexResp_StatData_DEFAULT + } +return p.StatData +} +func (p *LookupIndexResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *LookupIndexResp) IsSetData() bool { + return p.Data != nil +} + +func (p *LookupIndexResp) IsSetStatData() bool { + return p.StatData != nil +} + +func (p *LookupIndexResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *LookupIndexResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *LookupIndexResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Data = &nebula.DataSet{} + if err := p.Data.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Data), err) + } + return nil +} + +func (p *LookupIndexResp) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.StatData = &nebula.DataSet{} + if err := p.StatData.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StatData), err) + } + return nil +} + +func (p *LookupIndexResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "LookupIndexResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupIndexResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *LookupIndexResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetData() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Data), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:data: ", p), err) } + } + return err +} + +func (p *LookupIndexResp) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetStatData() { + if err := oprot.WriteFieldBegin(ctx, "stat_data", thrift.STRUCT, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stat_data: ", p), err) } + if err := p.StatData.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StatData), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stat_data: ", p), err) } + } + return err +} + +func (p *LookupIndexResp) Equals(other *LookupIndexResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Data.Equals(other.Data) { return false } + if !p.StatData.Equals(other.StatData) { return false } + return true +} + +func (p *LookupIndexResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupIndexResp(%+v)", *p) +} + +func (p *LookupIndexResp) Validate() error { + return nil +} +// Attributes: +// - ColumnName +// - ScanType +// - BeginValue +// - EndValue +// - IncludeBegin +// - IncludeEnd +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 *nebula.Value `thrift:"begin_value,3" db:"begin_value" json:"begin_value"` + EndValue *nebula.Value `thrift:"end_value,4" db:"end_value" json:"end_value"` + IncludeBegin bool `thrift:"include_begin,5" db:"include_begin" json:"include_begin"` + IncludeEnd bool `thrift:"include_end,6" db:"include_end" json:"include_end"` +} + +func NewIndexColumnHint() *IndexColumnHint { + return &IndexColumnHint{ +IncludeBegin: true, +} +} + + +func (p *IndexColumnHint) GetColumnName() []byte { + return p.ColumnName +} + +func (p *IndexColumnHint) GetScanType() ScanType { + return p.ScanType +} +var IndexColumnHint_BeginValue_DEFAULT *nebula.Value +func (p *IndexColumnHint) GetBeginValue() *nebula.Value { + if !p.IsSetBeginValue() { + return IndexColumnHint_BeginValue_DEFAULT + } +return p.BeginValue +} +var IndexColumnHint_EndValue_DEFAULT *nebula.Value +func (p *IndexColumnHint) GetEndValue() *nebula.Value { + if !p.IsSetEndValue() { + return IndexColumnHint_EndValue_DEFAULT + } +return p.EndValue +} + +func (p *IndexColumnHint) GetIncludeBegin() bool { + return p.IncludeBegin +} + +func (p *IndexColumnHint) GetIncludeEnd() bool { + return p.IncludeEnd +} +func (p *IndexColumnHint) IsSetBeginValue() bool { + return p.BeginValue != nil +} + +func (p *IndexColumnHint) IsSetEndValue() bool { + return p.EndValue != nil +} + +func (p *IndexColumnHint) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.ColumnName = v +} + return nil +} + +func (p *IndexColumnHint) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := ScanType(v) + p.ScanType = temp +} + return nil +} + +func (p *IndexColumnHint) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.BeginValue = &nebula.Value{} + if err := p.BeginValue.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.BeginValue), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.EndValue = &nebula.Value{} + if err := p.EndValue.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.EndValue), err) + } + return nil +} + +func (p *IndexColumnHint) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.IncludeBegin = v +} + return nil +} + +func (p *IndexColumnHint) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.IncludeEnd = v +} + return nil +} + +func (p *IndexColumnHint) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IndexColumnHint"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexColumnHint) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, p.ColumnName); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.column_name (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:column_name: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.ScanType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.scan_type (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:scan_type: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.BeginValue), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:begin_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.EndValue), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:end_value: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "include_begin", thrift.BOOL, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:include_begin: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.IncludeBegin)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.include_begin (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:include_begin: ", p), err) } + return err +} + +func (p *IndexColumnHint) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "include_end", thrift.BOOL, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:include_end: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.IncludeEnd)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.include_end (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:include_end: ", p), err) } + return err +} + +func (p *IndexColumnHint) Equals(other *IndexColumnHint) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.ColumnName, other.ColumnName) != 0 { return false } + if p.ScanType != other.ScanType { return false } + if !p.BeginValue.Equals(other.BeginValue) { return false } + if !p.EndValue.Equals(other.EndValue) { return false } + if p.IncludeBegin != other.IncludeBegin { return false } + if p.IncludeEnd != other.IncludeEnd { return false } + return true +} + +func (p *IndexColumnHint) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexColumnHint(%+v)", *p) +} + +func (p *IndexColumnHint) Validate() error { + return nil +} +// Attributes: +// - IndexID +// - Filter +// - ColumnHints +type IndexQueryContext struct { + IndexID nebula.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() nebula.IndexID { + return p.IndexID +} + +func (p *IndexQueryContext) GetFilter() []byte { + return p.Filter +} + +func (p *IndexQueryContext) GetColumnHints() []*IndexColumnHint { + return p.ColumnHints +} +func (p *IndexQueryContext) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *IndexQueryContext) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *IndexQueryContext) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *IndexQueryContext) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem96 := &IndexColumnHint{ + IncludeBegin: true, +} + if err := _elem96.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem96), err) + } + p.ColumnHints = append(p.ColumnHints, _elem96) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexQueryContext) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IndexQueryContext"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexQueryContext) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:index_id: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "filter", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:filter: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:filter: ", p), err) } + return err +} + +func (p *IndexQueryContext) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.ColumnHints)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ColumnHints { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:column_hints: ", p), err) } + return err +} + +func (p *IndexQueryContext) Equals(other *IndexQueryContext) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.IndexID != other.IndexID { return false } + if bytes.Compare(p.Filter, other.Filter) != 0 { return false } + if len(p.ColumnHints) != len(other.ColumnHints) { return false } + for i, _tgt := range p.ColumnHints { + _src97 := other.ColumnHints[i] + if !_tgt.Equals(_src97) { return false } + } + return true +} + +func (p *IndexQueryContext) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexQueryContext(%+v)", *p) +} + +func (p *IndexQueryContext) Validate() error { + return nil +} +// Attributes: +// - Contexts +// - SchemaID +type IndexSpec struct { + Contexts []*IndexQueryContext `thrift:"contexts,1,required" db:"contexts" json:"contexts"` + SchemaID *nebula.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 *nebula.SchemaID +func (p *IndexSpec) GetSchemaID() *nebula.SchemaID { + if !p.IsSetSchemaID() { + return IndexSpec_SchemaID_DEFAULT + } +return p.SchemaID +} +func (p *IndexSpec) IsSetSchemaID() bool { + return p.SchemaID != nil +} + +func (p *IndexSpec) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetContexts bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetContexts = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetContexts{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Contexts is not set")); + } + return nil +} + +func (p *IndexSpec) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem98 := &IndexQueryContext{} + if err := _elem98.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem98), err) + } + p.Contexts = append(p.Contexts, _elem98) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *IndexSpec) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.SchemaID = &nebula.SchemaID{} + if err := p.SchemaID.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.SchemaID), err) + } + return nil +} + +func (p *IndexSpec) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "IndexSpec"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *IndexSpec) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "contexts", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:contexts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Contexts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Contexts { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:contexts: ", p), err) } + return err +} + +func (p *IndexSpec) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.SchemaID), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:schema_id: ", p), err) } + return err +} + +func (p *IndexSpec) Equals(other *IndexSpec) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.Contexts) != len(other.Contexts) { return false } + for i, _tgt := range p.Contexts { + _src99 := other.Contexts[i] + if !_tgt.Equals(_src99) { return false } + } + if !p.SchemaID.Equals(other.SchemaID) { return false } + return true +} + +func (p *IndexSpec) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("IndexSpec(%+v)", *p) +} + +func (p *IndexSpec) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - ReturnColumns +// - Common +// - Limit +// - OrderBy +// - StatColumns +type LookupIndexRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula.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"` + OrderBy []*OrderBy `thrift:"order_by,7" db:"order_by" json:"order_by,omitempty"` + StatColumns []*StatProp `thrift:"stat_columns,8" db:"stat_columns" json:"stat_columns,omitempty"` +} + +func NewLookupIndexRequest() *LookupIndexRequest { + return &LookupIndexRequest{} +} + + +func (p *LookupIndexRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupIndexRequest) GetParts() []nebula.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 +} +var LookupIndexRequest_OrderBy_DEFAULT []*OrderBy + +func (p *LookupIndexRequest) GetOrderBy() []*OrderBy { + return p.OrderBy +} +var LookupIndexRequest_StatColumns_DEFAULT []*StatProp + +func (p *LookupIndexRequest) GetStatColumns() []*StatProp { + return p.StatColumns +} +func (p *LookupIndexRequest) IsSetIndices() bool { + return p.Indices != nil +} + +func (p *LookupIndexRequest) IsSetReturnColumns() bool { + return p.ReturnColumns != nil +} + +func (p *LookupIndexRequest) IsSetCommon() bool { + return p.Common != nil +} + +func (p *LookupIndexRequest) IsSetLimit() bool { + return p.Limit != nil +} + +func (p *LookupIndexRequest) IsSetOrderBy() bool { + return p.OrderBy != nil +} + +func (p *LookupIndexRequest) IsSetStatColumns() bool { + return p.StatColumns != nil +} + +func (p *LookupIndexRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSpaceID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetParts = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.LIST { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.LIST { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupIndexRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *LookupIndexRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem100 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem100 = temp +} + p.Parts = append(p.Parts, _elem100) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Indices = &IndexSpec{} + if err := p.Indices.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem101 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem101 = v +} + p.ReturnColumns = append(p.ReturnColumns, _elem101) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.Limit = &v +} + return nil +} + +func (p *LookupIndexRequest) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 ++ { + _elem102 := &OrderBy{} + if err := _elem102.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem102), err) + } + p.OrderBy = append(p.OrderBy, _elem102) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*StatProp, 0, size) + p.StatColumns = tSlice + for i := 0; i < size; i ++ { + _elem103 := &StatProp{} + if err := _elem103.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem103), err) + } + p.StatColumns = append(p.StatColumns, _elem103) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupIndexRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "LookupIndexRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupIndexRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupIndexRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetReturnColumns() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:return_columns: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:common: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetLimit() { + if err := oprot.WriteFieldBegin(ctx, "limit", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:limit: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:limit: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetOrderBy() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRUCT, len(p.OrderBy)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.OrderBy { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:order_by: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetStatColumns() { + if err := oprot.WriteFieldBegin(ctx, "stat_columns", thrift.LIST, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:stat_columns: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.StatColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.StatColumns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:stat_columns: ", p), err) } + } + return err +} + +func (p *LookupIndexRequest) Equals(other *LookupIndexRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for i, _tgt := range p.Parts { + _src104 := other.Parts[i] + if _tgt != _src104 { return false } + } + if !p.Indices.Equals(other.Indices) { return false } + if len(p.ReturnColumns) != len(other.ReturnColumns) { return false } + for i, _tgt := range p.ReturnColumns { + _src105 := other.ReturnColumns[i] + if bytes.Compare(_tgt, _src105) != 0 { return false } + } + if !p.Common.Equals(other.Common) { return false } + if p.Limit != other.Limit { + if p.Limit == nil || other.Limit == nil { + return false + } + if (*p.Limit) != (*other.Limit) { return false } + } + if len(p.OrderBy) != len(other.OrderBy) { return false } + for i, _tgt := range p.OrderBy { + _src106 := other.OrderBy[i] + if !_tgt.Equals(_src106) { return false } + } + if len(p.StatColumns) != len(other.StatColumns) { return false } + for i, _tgt := range p.StatColumns { + _src107 := other.StatColumns[i] + if !_tgt.Equals(_src107) { return false } + } + return true +} + +func (p *LookupIndexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupIndexRequest(%+v)", *p) +} + +func (p *LookupIndexRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - Indices +// - TraverseSpec +// - Common +type LookupAndTraverseRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1,required" db:"space_id" json:"space_id"` + Parts []nebula.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{} +} + + +func (p *LookupAndTraverseRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *LookupAndTraverseRequest) GetParts() []nebula.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.Indices != nil +} + +func (p *LookupAndTraverseRequest) IsSetTraverseSpec() bool { + return p.TraverseSpec != nil +} + +func (p *LookupAndTraverseRequest) IsSetCommon() bool { + return p.Common != nil +} + +func (p *LookupAndTraverseRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); 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(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetSpaceID = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetParts = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSpaceID{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field SpaceID is not set")); + } + if !issetParts{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *LookupAndTraverseRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem108 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem108 = temp +} + p.Parts = append(p.Parts, _elem108) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Indices = &IndexSpec{} + if err := p.Indices.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Indices), err) + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.TraverseSpec = &TraverseSpec{ + EdgeDirection: 1, +} + if err := p.TraverseSpec.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TraverseSpec), err) + } + return nil +} + +func (p *LookupAndTraverseRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *LookupAndTraverseRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "LookupAndTraverseRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *LookupAndTraverseRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Indices), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:indices: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TraverseSpec), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:traverse_spec: ", p), err) } + return err +} + +func (p *LookupAndTraverseRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:common: ", p), err) } + } + return err +} + +func (p *LookupAndTraverseRequest) Equals(other *LookupAndTraverseRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for i, _tgt := range p.Parts { + _src109 := other.Parts[i] + if _tgt != _src109 { return false } + } + if !p.Indices.Equals(other.Indices) { return false } + if !p.TraverseSpec.Equals(other.TraverseSpec) { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *LookupAndTraverseRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("LookupAndTraverseRequest(%+v)", *p) +} + +func (p *LookupAndTraverseRequest) Validate() error { + return nil +} +// Attributes: +// - NextCursor +type ScanCursor struct { + NextCursor []byte `thrift:"next_cursor,1" db:"next_cursor" json:"next_cursor,omitempty"` +} + +func NewScanCursor() *ScanCursor { + return &ScanCursor{} +} + +var ScanCursor_NextCursor_DEFAULT []byte + +func (p *ScanCursor) GetNextCursor() []byte { + return p.NextCursor +} +func (p *ScanCursor) IsSetNextCursor() bool { + return p.NextCursor != nil +} + +func (p *ScanCursor) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ScanCursor) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.NextCursor = v +} + return nil +} + +func (p *ScanCursor) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ScanCursor"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanCursor) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetNextCursor() { + if err := oprot.WriteFieldBegin(ctx, "next_cursor", thrift.STRING, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:next_cursor: ", p), err) } + if err := oprot.WriteBinary(ctx, p.NextCursor); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.next_cursor (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:next_cursor: ", p), err) } + } + return err +} + +func (p *ScanCursor) Equals(other *ScanCursor) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if bytes.Compare(p.NextCursor, other.NextCursor) != 0 { return false } + return true +} + +func (p *ScanCursor) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanCursor(%+v)", *p) +} + +func (p *ScanCursor) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +// - Common +type ScanVertexRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID]*ScanCursor `thrift:"parts,2" db:"parts" json:"parts"` + ReturnColumns []*VertexProp `thrift:"return_columns,3" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,4" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,5" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,6" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,7" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,8" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,9" db:"enable_read_from_follower" json:"enable_read_from_follower"` + Common *RequestCommon `thrift:"common,10" db:"common" json:"common,omitempty"` +} + +func NewScanVertexRequest() *ScanVertexRequest { + return &ScanVertexRequest{ +EnableReadFromFollower: true, +} +} + + +func (p *ScanVertexRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanVertexRequest) GetParts() map[nebula.PartitionID]*ScanCursor { + return p.Parts +} + +func (p *ScanVertexRequest) GetReturnColumns() []*VertexProp { + 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) 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) IsSetCommon() bool { + return p.Common != nil +} + +func (p *ScanVertexRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ScanVertexRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ScanVertexRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID]*ScanCursor, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key110 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key110 = temp +} + _val111 := &ScanCursor{} + if err := _val111.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val111), err) + } + p.Parts[_key110] = _val111 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ScanVertexRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*VertexProp, 0, size) + p.ReturnColumns = tSlice + for i := 0; i < size; i ++ { + _elem112 := &VertexProp{} + if err := _elem112.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem112), err) + } + p.ReturnColumns = append(p.ReturnColumns, _elem112) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ScanVertexRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanVertexRequest) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanVertexRequest) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *ScanVertexRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ScanVertexRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanVertexRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "return_columns", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_columns: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_columns: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "limit", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:limit: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:limit: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:start_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin(ctx, "end_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:end_time: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:end_time: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin(ctx, "filter", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:filter: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:filter: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "only_latest_version", thrift.BOOL, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:only_latest_version: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:only_latest_version: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "enable_read_from_follower", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanVertexRequest) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:common: ", p), err) } + } + return err +} + +func (p *ScanVertexRequest) Equals(other *ScanVertexRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src113 := other.Parts[k] + if !_tgt.Equals(_src113) { return false } + } + if len(p.ReturnColumns) != len(other.ReturnColumns) { return false } + for i, _tgt := range p.ReturnColumns { + _src114 := other.ReturnColumns[i] + if !_tgt.Equals(_src114) { return false } + } + if p.Limit != other.Limit { return false } + if p.StartTime != other.StartTime { + if p.StartTime == nil || other.StartTime == nil { + return false + } + if (*p.StartTime) != (*other.StartTime) { return false } + } + if p.EndTime != other.EndTime { + if p.EndTime == nil || other.EndTime == nil { + return false + } + if (*p.EndTime) != (*other.EndTime) { return false } + } + if bytes.Compare(p.Filter, other.Filter) != 0 { return false } + if p.OnlyLatestVersion != other.OnlyLatestVersion { return false } + if p.EnableReadFromFollower != other.EnableReadFromFollower { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *ScanVertexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanVertexRequest(%+v)", *p) +} + +func (p *ScanVertexRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - ReturnColumns +// - Limit +// - StartTime +// - EndTime +// - Filter +// - OnlyLatestVersion +// - EnableReadFromFollower +// - Common +type ScanEdgeRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID]*ScanCursor `thrift:"parts,2" db:"parts" json:"parts"` + ReturnColumns []*EdgeProp `thrift:"return_columns,3" db:"return_columns" json:"return_columns"` + Limit int64 `thrift:"limit,4" db:"limit" json:"limit"` + StartTime *int64 `thrift:"start_time,5" db:"start_time" json:"start_time,omitempty"` + EndTime *int64 `thrift:"end_time,6" db:"end_time" json:"end_time,omitempty"` + Filter []byte `thrift:"filter,7" db:"filter" json:"filter,omitempty"` + OnlyLatestVersion bool `thrift:"only_latest_version,8" db:"only_latest_version" json:"only_latest_version"` + EnableReadFromFollower bool `thrift:"enable_read_from_follower,9" db:"enable_read_from_follower" json:"enable_read_from_follower"` + Common *RequestCommon `thrift:"common,10" db:"common" json:"common,omitempty"` +} + +func NewScanEdgeRequest() *ScanEdgeRequest { + return &ScanEdgeRequest{ +EnableReadFromFollower: true, +} +} + + +func (p *ScanEdgeRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *ScanEdgeRequest) GetParts() map[nebula.PartitionID]*ScanCursor { + return p.Parts +} + +func (p *ScanEdgeRequest) GetReturnColumns() []*EdgeProp { + 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) 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) IsSetCommon() bool { + return p.Common != nil +} + +func (p *ScanEdgeRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 7: + if fieldTypeId == thrift.STRING { + if err := p.ReadField7(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 8: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField8(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 9: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField9(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField10(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ScanEdgeRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ScanEdgeRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID]*ScanCursor, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key115 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key115 = temp +} + _val116 := &ScanCursor{} + if err := _val116.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val116), err) + } + p.Parts[_key115] = _val116 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ScanEdgeRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeProp, 0, size) + p.ReturnColumns = tSlice + for i := 0; i < size; i ++ { + _elem117 := &EdgeProp{} + if err := _elem117.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem117), err) + } + p.ReturnColumns = append(p.ReturnColumns, _elem117) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ScanEdgeRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Limit = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.StartTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.EndTime = &v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField7(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 7: ", err) +} else { + p.Filter = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField8(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 8: ", err) +} else { + p.OnlyLatestVersion = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField9(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 9: ", err) +} else { + p.EnableReadFromFollower = v +} + return nil +} + +func (p *ScanEdgeRequest) ReadField10(ctx context.Context, iprot thrift.TProtocol) error { + p.Common = &RequestCommon{} + if err := p.Common.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) + } + return nil +} + +func (p *ScanEdgeRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ScanEdgeRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + if err := p.writeField7(ctx, oprot); err != nil { return err } + if err := p.writeField8(ctx, oprot); err != nil { return err } + if err := p.writeField9(ctx, oprot); err != nil { return err } + if err := p.writeField10(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanEdgeRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.STRUCT, len(p.Parts)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "return_columns", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_columns: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.ReturnColumns)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.ReturnColumns { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_columns: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "limit", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:limit: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Limit)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.limit (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:limit: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetStartTime() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.StartTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.start_time (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:start_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEndTime() { + if err := oprot.WriteFieldBegin(ctx, "end_time", thrift.I64, 6); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:end_time: ", p), err) } + if err := oprot.WriteI64(ctx, int64(*p.EndTime)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.end_time (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:end_time: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField7(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetFilter() { + if err := oprot.WriteFieldBegin(ctx, "filter", thrift.STRING, 7); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:filter: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Filter); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.filter (7) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 7:filter: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) writeField8(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "only_latest_version", thrift.BOOL, 8); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:only_latest_version: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.OnlyLatestVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (8) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 8:only_latest_version: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField9(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "enable_read_from_follower", thrift.BOOL, 9); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 9:enable_read_from_follower: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.EnableReadFromFollower)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.enable_read_from_follower (9) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 9:enable_read_from_follower: ", p), err) } + return err +} + +func (p *ScanEdgeRequest) writeField10(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetCommon() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 10:common: ", p), err) } + } + return err +} + +func (p *ScanEdgeRequest) Equals(other *ScanEdgeRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src118 := other.Parts[k] + if !_tgt.Equals(_src118) { return false } + } + if len(p.ReturnColumns) != len(other.ReturnColumns) { return false } + for i, _tgt := range p.ReturnColumns { + _src119 := other.ReturnColumns[i] + if !_tgt.Equals(_src119) { return false } + } + if p.Limit != other.Limit { return false } + if p.StartTime != other.StartTime { + if p.StartTime == nil || other.StartTime == nil { + return false + } + if (*p.StartTime) != (*other.StartTime) { return false } + } + if p.EndTime != other.EndTime { + if p.EndTime == nil || other.EndTime == nil { + return false + } + if (*p.EndTime) != (*other.EndTime) { return false } + } + if bytes.Compare(p.Filter, other.Filter) != 0 { return false } + if p.OnlyLatestVersion != other.OnlyLatestVersion { return false } + if p.EnableReadFromFollower != other.EnableReadFromFollower { return false } + if !p.Common.Equals(other.Common) { return false } + return true +} + +func (p *ScanEdgeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanEdgeRequest(%+v)", *p) +} + +func (p *ScanEdgeRequest) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Props +// - Cursors +type ScanResponse struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Props *nebula.DataSet `thrift:"props,2" db:"props" json:"props,omitempty"` + Cursors map[nebula.PartitionID]*ScanCursor `thrift:"cursors,3" db:"cursors" json:"cursors"` +} + +func NewScanResponse() *ScanResponse { + return &ScanResponse{} +} + +var ScanResponse_Result__DEFAULT *ResponseCommon +func (p *ScanResponse) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ScanResponse_Result__DEFAULT + } +return p.Result_ +} +var ScanResponse_Props_DEFAULT *nebula.DataSet +func (p *ScanResponse) GetProps() *nebula.DataSet { + if !p.IsSetProps() { + return ScanResponse_Props_DEFAULT + } +return p.Props +} + +func (p *ScanResponse) GetCursors() map[nebula.PartitionID]*ScanCursor { + return p.Cursors +} +func (p *ScanResponse) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *ScanResponse) IsSetProps() bool { + return p.Props != nil +} + +func (p *ScanResponse) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.MAP { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ScanResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *ScanResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Props = &nebula.DataSet{} + if err := p.Props.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) + } + return nil +} + +func (p *ScanResponse) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID]*ScanCursor, size) + p.Cursors = tMap + for i := 0; i < size; i ++ { +var _key120 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key120 = temp +} + _val121 := &ScanCursor{} + if err := _val121.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val121), err) + } + p.Cursors[_key120] = _val121 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ScanResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ScanResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ScanResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *ScanResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetProps() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } + } + return err +} + +func (p *ScanResponse) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "cursors", thrift.MAP, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursors: ", p), err) } + if err := oprot.WriteMapBegin(ctx, thrift.I32, thrift.STRUCT, len(p.Cursors)); err != nil { + return thrift.PrependError("error writing map begin: ", err) + } + for k, v := range p.Cursors { + if err := oprot.WriteI32(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursors: ", p), err) } + return err +} + +func (p *ScanResponse) Equals(other *ScanResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Props.Equals(other.Props) { return false } + if len(p.Cursors) != len(other.Cursors) { return false } + for k, _tgt := range p.Cursors { + _src122 := other.Cursors[k] + if !_tgt.Equals(_src122) { return false } + } + return true +} + +func (p *ScanResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ScanResponse(%+v)", *p) +} + +func (p *ScanResponse) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - TaskSpecificParas +type TaskPara struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula.PartitionID `thrift:"parts,2" db:"parts" json:"parts,omitempty"` + TaskSpecificParas [][]byte `thrift:"task_specific_paras,3" db:"task_specific_paras" json:"task_specific_paras,omitempty"` +} + +func NewTaskPara() *TaskPara { + return &TaskPara{} +} + + +func (p *TaskPara) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +var TaskPara_Parts_DEFAULT []nebula.PartitionID + +func (p *TaskPara) GetParts() []nebula.PartitionID { + return p.Parts +} +var TaskPara_TaskSpecificParas_DEFAULT [][]byte + +func (p *TaskPara) GetTaskSpecificParas() [][]byte { + return p.TaskSpecificParas +} +func (p *TaskPara) IsSetParts() bool { + return p.Parts != nil +} + +func (p *TaskPara) IsSetTaskSpecificParas() bool { + return p.TaskSpecificParas != nil +} + +func (p *TaskPara) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TaskPara) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *TaskPara) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem123 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem123 = temp +} + p.Parts = append(p.Parts, _elem123) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + p.TaskSpecificParas = tSlice + for i := 0; i < size; i ++ { +var _elem124 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem124 = v +} + p.TaskSpecificParas = append(p.TaskSpecificParas, _elem124) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *TaskPara) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TaskPara"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TaskPara) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *TaskPara) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetParts() { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + } + return err +} + +func (p *TaskPara) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetTaskSpecificParas() { + if err := oprot.WriteFieldBegin(ctx, "task_specific_paras", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_specific_paras: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(p.TaskSpecificParas)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.TaskSpecificParas { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_specific_paras: ", p), err) } + } + return err +} + +func (p *TaskPara) Equals(other *TaskPara) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for i, _tgt := range p.Parts { + _src125 := other.Parts[i] + if _tgt != _src125 { return false } + } + if len(p.TaskSpecificParas) != len(other.TaskSpecificParas) { return false } + for i, _tgt := range p.TaskSpecificParas { + _src126 := other.TaskSpecificParas[i] + if bytes.Compare(_tgt, _src126) != 0 { return false } + } + return true +} + +func (p *TaskPara) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TaskPara(%+v)", *p) +} + +func (p *TaskPara) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - ReturnPartly +type KVGetRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *KVGetRequest) GetParts() map[nebula.PartitionID][][]byte { + return p.Parts +} + +func (p *KVGetRequest) GetReturnPartly() bool { + return p.ReturnPartly +} +func (p *KVGetRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *KVGetRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *KVGetRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key127 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key127 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val128 := tSlice + for i := 0; i < size; i ++ { +var _elem129 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem129 = v +} + _val128 = append(_val128, _elem129) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key127] = _val128 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.ReturnPartly = v +} + return nil +} + +func (p *KVGetRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "KVGetRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *KVGetRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *KVGetRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVGetRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.ReturnPartly)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.return_partly (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_partly: ", p), err) } + return err +} + +func (p *KVGetRequest) Equals(other *KVGetRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src130 := other.Parts[k] + if len(_tgt) != len(_src130) { return false } + for i, _tgt := range _tgt { + _src131 := _src130[i] + if bytes.Compare(_tgt, _src131) != 0 { return false } + } + } + if p.ReturnPartly != other.ReturnPartly { return false } + return true +} + +func (p *KVGetRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVGetRequest(%+v)", *p) +} + +func (p *KVGetRequest) Validate() error { + return nil +} +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *KVGetResponse) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *KVGetResponse) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + 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 _key132 string + if v, err := iprot.ReadString(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _key132 = v +} +var _val133 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _val133 = v +} + p.KeyValues[_key132] = _val133 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVGetResponse) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "KVGetResponse"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *KVGetResponse) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *KVGetResponse) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, string(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:key_values: ", p), err) } + return err +} + +func (p *KVGetResponse) Equals(other *KVGetResponse) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if len(p.KeyValues) != len(other.KeyValues) { return false } + for k, _tgt := range p.KeyValues { + _src134 := other.KeyValues[k] + if bytes.Compare(_tgt, _src134) != 0 { return false } + } + return true +} + +func (p *KVGetResponse) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVGetResponse(%+v)", *p) +} + +func (p *KVGetResponse) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +type KVPutRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID][]*nebula.KeyValue `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVPutRequest() *KVPutRequest { + return &KVPutRequest{} +} + + +func (p *KVPutRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *KVPutRequest) GetParts() map[nebula.PartitionID][]*nebula.KeyValue { + return p.Parts +} +func (p *KVPutRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *KVPutRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *KVPutRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*nebula.KeyValue, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key135 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key135 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.KeyValue, 0, size) + _val136 := tSlice + for i := 0; i < size; i ++ { + _elem137 := &nebula.KeyValue{} + if err := _elem137.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem137), err) + } + _val136 = append(_val136, _elem137) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key135] = _val136 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVPutRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "KVPutRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *KVPutRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *KVPutRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVPutRequest) Equals(other *KVPutRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src138 := other.Parts[k] + if len(_tgt) != len(_src138) { return false } + for i, _tgt := range _tgt { + _src139 := _src138[i] + if !_tgt.Equals(_src139) { return false } + } + } + return true +} + +func (p *KVPutRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVPutRequest(%+v)", *p) +} + +func (p *KVPutRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +type KVRemoveRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID][][]byte `thrift:"parts,2" db:"parts" json:"parts"` +} + +func NewKVRemoveRequest() *KVRemoveRequest { + return &KVRemoveRequest{} +} + + +func (p *KVRemoveRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *KVRemoveRequest) GetParts() map[nebula.PartitionID][][]byte { + return p.Parts +} +func (p *KVRemoveRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *KVRemoveRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *KVRemoveRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][][]byte, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key140 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key140 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([][]byte, 0, size) + _val141 := tSlice + for i := 0; i < size; i ++ { +var _elem142 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem142 = v +} + _val141 = append(_val141, _elem142) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key140] = _val141 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *KVRemoveRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "KVRemoveRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *KVRemoveRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *KVRemoveRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRING, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *KVRemoveRequest) Equals(other *KVRemoveRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src143 := other.Parts[k] + if len(_tgt) != len(_src143) { return false } + for i, _tgt := range _tgt { + _src144 := _src143[i] + if bytes.Compare(_tgt, _src144) != 0 { return false } + } + } + return true +} + +func (p *KVRemoveRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("KVRemoveRequest(%+v)", *p) +} + +func (p *KVRemoveRequest) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Stats +type AdminExecResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Stats *meta.StatsItem `thrift:"stats,2" db:"stats" json:"stats,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_Stats_DEFAULT *meta.StatsItem +func (p *AdminExecResp) GetStats() *meta.StatsItem { + if !p.IsSetStats() { + return AdminExecResp_Stats_DEFAULT + } +return p.Stats +} +func (p *AdminExecResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *AdminExecResp) IsSetStats() bool { + return p.Stats != nil +} + +func (p *AdminExecResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *AdminExecResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *AdminExecResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Stats = &meta.StatsItem{} + if err := p.Stats.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Stats), err) + } + return nil +} + +func (p *AdminExecResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AdminExecResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AdminExecResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *AdminExecResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetStats() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Stats), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:stats: ", p), err) } + } + return err +} + +func (p *AdminExecResp) Equals(other *AdminExecResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Stats.Equals(other.Stats) { return false } + return true +} + +func (p *AdminExecResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AdminExecResp(%+v)", *p) +} + +func (p *AdminExecResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - NewLeader_ +type TransLeaderReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + NewLeader_ *nebula.HostAddr `thrift:"new_leader,3" db:"new_leader" json:"new_leader"` +} + +func NewTransLeaderReq() *TransLeaderReq { + return &TransLeaderReq{} +} + + +func (p *TransLeaderReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *TransLeaderReq) GetPartID() nebula.PartitionID { + return p.PartID +} +var TransLeaderReq_NewLeader__DEFAULT *nebula.HostAddr +func (p *TransLeaderReq) GetNewLeader_() *nebula.HostAddr { + if !p.IsSetNewLeader_() { + return TransLeaderReq_NewLeader__DEFAULT + } +return p.NewLeader_ +} +func (p *TransLeaderReq) IsSetNewLeader_() bool { + return p.NewLeader_ != nil +} + +func (p *TransLeaderReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *TransLeaderReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *TransLeaderReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *TransLeaderReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.NewLeader_ = &nebula.HostAddr{} + if err := p.NewLeader_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.NewLeader_), err) + } + return nil +} + +func (p *TransLeaderReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "TransLeaderReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *TransLeaderReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *TransLeaderReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *TransLeaderReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.NewLeader_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:new_leader: ", p), err) } + return err +} + +func (p *TransLeaderReq) Equals(other *TransLeaderReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if !p.NewLeader_.Equals(other.NewLeader_) { return false } + return true +} + +func (p *TransLeaderReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TransLeaderReq(%+v)", *p) +} + +func (p *TransLeaderReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - AsLearner +// - Peers +type AddPartReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + AsLearner bool `thrift:"as_learner,3" db:"as_learner" json:"as_learner"` + Peers []*nebula.HostAddr `thrift:"peers,4" db:"peers" json:"peers"` +} + +func NewAddPartReq() *AddPartReq { + return &AddPartReq{} +} + + +func (p *AddPartReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *AddPartReq) GetPartID() nebula.PartitionID { + return p.PartID +} + +func (p *AddPartReq) GetAsLearner() bool { + return p.AsLearner +} + +func (p *AddPartReq) GetPeers() []*nebula.HostAddr { + return p.Peers +} +func (p *AddPartReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.LIST { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddPartReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AddPartReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddPartReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.AsLearner = v +} + return nil +} + +func (p *AddPartReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Peers = tSlice + for i := 0; i < size; i ++ { + _elem145 := &nebula.HostAddr{} + if err := _elem145.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem145), err) + } + p.Peers = append(p.Peers, _elem145) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *AddPartReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddPartReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddPartReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AddPartReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddPartReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.AsLearner)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.as_learner (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:as_learner: ", p), err) } + return err +} + +func (p *AddPartReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "peers", thrift.LIST, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:peers: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:peers: ", p), err) } + return err +} + +func (p *AddPartReq) Equals(other *AddPartReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if p.AsLearner != other.AsLearner { return false } + if len(p.Peers) != len(other.Peers) { return false } + for i, _tgt := range p.Peers { + _src146 := other.Peers[i] + if !_tgt.Equals(_src146) { return false } + } + return true +} + +func (p *AddPartReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddPartReq(%+v)", *p) +} + +func (p *AddPartReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - Learner +type AddLearnerReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Learner *nebula.HostAddr `thrift:"learner,3" db:"learner" json:"learner"` +} + +func NewAddLearnerReq() *AddLearnerReq { + return &AddLearnerReq{} +} + + +func (p *AddLearnerReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *AddLearnerReq) GetPartID() nebula.PartitionID { + return p.PartID +} +var AddLearnerReq_Learner_DEFAULT *nebula.HostAddr +func (p *AddLearnerReq) GetLearner() *nebula.HostAddr { + if !p.IsSetLearner() { + return AddLearnerReq_Learner_DEFAULT + } +return p.Learner +} +func (p *AddLearnerReq) IsSetLearner() bool { + return p.Learner != nil +} + +func (p *AddLearnerReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddLearnerReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *AddLearnerReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *AddLearnerReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Learner = &nebula.HostAddr{} + if err := p.Learner.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Learner), err) + } + return nil +} + +func (p *AddLearnerReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddLearnerReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddLearnerReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *AddLearnerReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *AddLearnerReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Learner), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:learner: ", p), err) } + return err +} + +func (p *AddLearnerReq) Equals(other *AddLearnerReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if !p.Learner.Equals(other.Learner) { return false } + return true +} + +func (p *AddLearnerReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddLearnerReq(%+v)", *p) +} + +func (p *AddLearnerReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +type RemovePartReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` +} + +func NewRemovePartReq() *RemovePartReq { + return &RemovePartReq{} +} + + +func (p *RemovePartReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *RemovePartReq) GetPartID() nebula.PartitionID { + return p.PartID +} +func (p *RemovePartReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RemovePartReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *RemovePartReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *RemovePartReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RemovePartReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RemovePartReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *RemovePartReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *RemovePartReq) Equals(other *RemovePartReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + return true +} + +func (p *RemovePartReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RemovePartReq(%+v)", *p) +} + +func (p *RemovePartReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - Peer +// - Add +type MemberChangeReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peer *nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *MemberChangeReq) GetPartID() nebula.PartitionID { + return p.PartID +} +var MemberChangeReq_Peer_DEFAULT *nebula.HostAddr +func (p *MemberChangeReq) GetPeer() *nebula.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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *MemberChangeReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *MemberChangeReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *MemberChangeReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Peer = &nebula.HostAddr{} + if err := p.Peer.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Peer), err) + } + return nil +} + +func (p *MemberChangeReq) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Add = v +} + return nil +} + +func (p *MemberChangeReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "MemberChangeReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *MemberChangeReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Peer), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peer: ", p), err) } + return err +} + +func (p *MemberChangeReq) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "add", thrift.BOOL, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:add: ", p), err) } + if err := oprot.WriteBool(ctx, bool(p.Add)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.add (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:add: ", p), err) } + return err +} + +func (p *MemberChangeReq) Equals(other *MemberChangeReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if !p.Peer.Equals(other.Peer) { return false } + if p.Add != other.Add { return false } + return true +} + +func (p *MemberChangeReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("MemberChangeReq(%+v)", *p) +} + +func (p *MemberChangeReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - Target +type CatchUpDataReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Target *nebula.HostAddr `thrift:"target,3" db:"target" json:"target"` +} + +func NewCatchUpDataReq() *CatchUpDataReq { + return &CatchUpDataReq{} +} + + +func (p *CatchUpDataReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *CatchUpDataReq) GetPartID() nebula.PartitionID { + return p.PartID +} +var CatchUpDataReq_Target_DEFAULT *nebula.HostAddr +func (p *CatchUpDataReq) GetTarget() *nebula.HostAddr { + if !p.IsSetTarget() { + return CatchUpDataReq_Target_DEFAULT + } +return p.Target +} +func (p *CatchUpDataReq) IsSetTarget() bool { + return p.Target != nil +} + +func (p *CatchUpDataReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CatchUpDataReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *CatchUpDataReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CatchUpDataReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + p.Target = &nebula.HostAddr{} + if err := p.Target.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Target), err) + } + return nil +} + +func (p *CatchUpDataReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CatchUpDataReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CatchUpDataReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *CatchUpDataReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CatchUpDataReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Target), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:target: ", p), err) } + return err +} + +func (p *CatchUpDataReq) Equals(other *CatchUpDataReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if !p.Target.Equals(other.Target) { return false } + return true +} + +func (p *CatchUpDataReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CatchUpDataReq(%+v)", *p) +} + +func (p *CatchUpDataReq) Validate() error { + return nil +} +type GetLeaderReq struct { +} + +func NewGetLeaderReq() *GetLeaderReq { + return &GetLeaderReq{} +} + +func (p *GetLeaderReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetLeaderReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetLeaderReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetLeaderReq) Equals(other *GetLeaderReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *GetLeaderReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetLeaderReq(%+v)", *p) +} + +func (p *GetLeaderReq) Validate() error { + return nil +} +// Attributes: +// - SpaceIds +// - Name +type CreateCPRequest struct { + SpaceIds []nebula.GraphSpaceID `thrift:"space_ids,1" db:"space_ids" json:"space_ids"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewCreateCPRequest() *CreateCPRequest { + return &CreateCPRequest{} +} + + +func (p *CreateCPRequest) GetSpaceIds() []nebula.GraphSpaceID { + return p.SpaceIds +} + +func (p *CreateCPRequest) GetName() []byte { + return p.Name +} +func (p *CreateCPRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateCPRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.GraphSpaceID, 0, size) + p.SpaceIds = tSlice + for i := 0; i < size; i ++ { +var _elem147 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _elem147 = temp +} + p.SpaceIds = append(p.SpaceIds, _elem147) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateCPRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *CreateCPRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateCPRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateCPRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "space_ids", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_ids: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.SpaceIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.SpaceIds { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_ids: ", p), err) } + return err +} + +func (p *CreateCPRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *CreateCPRequest) Equals(other *CreateCPRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.SpaceIds) != len(other.SpaceIds) { return false } + for i, _tgt := range p.SpaceIds { + _src148 := other.SpaceIds[i] + if _tgt != _src148 { return false } + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + return true +} + +func (p *CreateCPRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateCPRequest(%+v)", *p) +} + +func (p *CreateCPRequest) Validate() error { + return nil +} +// Attributes: +// - Code +// - Info +type CreateCPResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + Info []*nebula.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` +} + +func NewCreateCPResp() *CreateCPResp { + return &CreateCPResp{} +} + + +func (p *CreateCPResp) GetCode() nebula.ErrorCode { + return p.Code +} + +func (p *CreateCPResp) GetInfo() []*nebula.CheckpointInfo { + return p.Info +} +func (p *CreateCPResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CreateCPResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *CreateCPResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.CheckpointInfo, 0, size) + p.Info = tSlice + for i := 0; i < size; i ++ { + _elem149 := &nebula.CheckpointInfo{} + if err := _elem149.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem149), err) + } + p.Info = append(p.Info, _elem149) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CreateCPResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CreateCPResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CreateCPResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *CreateCPResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "info", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:info: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Info)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Info { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:info: ", p), err) } + return err +} + +func (p *CreateCPResp) Equals(other *CreateCPResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if len(p.Info) != len(other.Info) { return false } + for i, _tgt := range p.Info { + _src150 := other.Info[i] + if !_tgt.Equals(_src150) { return false } + } + return true +} + +func (p *CreateCPResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CreateCPResp(%+v)", *p) +} + +func (p *CreateCPResp) Validate() error { + return nil +} +// Attributes: +// - SpaceIds +// - Name +type DropCPRequest struct { + SpaceIds []nebula.GraphSpaceID `thrift:"space_ids,1" db:"space_ids" json:"space_ids"` + Name []byte `thrift:"name,2" db:"name" json:"name"` +} + +func NewDropCPRequest() *DropCPRequest { + return &DropCPRequest{} +} + + +func (p *DropCPRequest) GetSpaceIds() []nebula.GraphSpaceID { + return p.SpaceIds +} + +func (p *DropCPRequest) GetName() []byte { + return p.Name +} +func (p *DropCPRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRING { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropCPRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.GraphSpaceID, 0, size) + p.SpaceIds = tSlice + for i := 0; i < size; i ++ { +var _elem151 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _elem151 = temp +} + p.SpaceIds = append(p.SpaceIds, _elem151) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *DropCPRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Name = v +} + return nil +} + +func (p *DropCPRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropCPRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropCPRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "space_ids", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_ids: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.SpaceIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.SpaceIds { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_ids: ", p), err) } + return err +} + +func (p *DropCPRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "name", thrift.STRING, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:name: ", p), err) } + if err := oprot.WriteBinary(ctx, p.Name); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.name (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:name: ", p), err) } + return err +} + +func (p *DropCPRequest) Equals(other *DropCPRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.SpaceIds) != len(other.SpaceIds) { return false } + for i, _tgt := range p.SpaceIds { + _src152 := other.SpaceIds[i] + if _tgt != _src152 { return false } + } + if bytes.Compare(p.Name, other.Name) != 0 { return false } + return true +} + +func (p *DropCPRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropCPRequest(%+v)", *p) +} + +func (p *DropCPRequest) Validate() error { + return nil +} +// Attributes: +// - Code +type DropCPResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` +} + +func NewDropCPResp() *DropCPResp { + return &DropCPResp{} +} + + +func (p *DropCPResp) GetCode() nebula.ErrorCode { + return p.Code +} +func (p *DropCPResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *DropCPResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *DropCPResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "DropCPResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *DropCPResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *DropCPResp) Equals(other *DropCPResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + return true +} + +func (p *DropCPResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("DropCPResp(%+v)", *p) +} + +func (p *DropCPResp) Validate() error { + return nil +} +// Attributes: +// - SpaceIds +// - Sign +type BlockingSignRequest struct { + SpaceIds []nebula.GraphSpaceID `thrift:"space_ids,1" db:"space_ids" json:"space_ids"` + Sign EngineSignType `thrift:"sign,2,required" db:"sign" json:"sign"` +} + +func NewBlockingSignRequest() *BlockingSignRequest { + return &BlockingSignRequest{} +} + + +func (p *BlockingSignRequest) GetSpaceIds() []nebula.GraphSpaceID { + return p.SpaceIds +} + +func (p *BlockingSignRequest) GetSign() EngineSignType { + return p.Sign +} +func (p *BlockingSignRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetSign bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + issetSign = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetSign{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Sign is not set")); + } + return nil +} + +func (p *BlockingSignRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.GraphSpaceID, 0, size) + p.SpaceIds = tSlice + for i := 0; i < size; i ++ { +var _elem153 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _elem153 = temp +} + p.SpaceIds = append(p.SpaceIds, _elem153) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *BlockingSignRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := EngineSignType(v) + p.Sign = temp +} + return nil +} + +func (p *BlockingSignRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "BlockingSignRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *BlockingSignRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "space_ids", thrift.LIST, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_ids: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.SpaceIds)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.SpaceIds { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_ids: ", p), err) } + return err +} + +func (p *BlockingSignRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "sign", thrift.I32, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:sign: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Sign)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.sign (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:sign: ", p), err) } + return err +} + +func (p *BlockingSignRequest) Equals(other *BlockingSignRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if len(p.SpaceIds) != len(other.SpaceIds) { return false } + for i, _tgt := range p.SpaceIds { + _src154 := other.SpaceIds[i] + if _tgt != _src154 { return false } + } + if p.Sign != other.Sign { return false } + return true +} + +func (p *BlockingSignRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BlockingSignRequest(%+v)", *p) +} + +func (p *BlockingSignRequest) Validate() error { + return nil +} +// Attributes: +// - Code +type BlockingSignResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` +} + +func NewBlockingSignResp() *BlockingSignResp { + return &BlockingSignResp{} +} + + +func (p *BlockingSignResp) GetCode() nebula.ErrorCode { + return p.Code +} +func (p *BlockingSignResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *BlockingSignResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *BlockingSignResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "BlockingSignResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *BlockingSignResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *BlockingSignResp) Equals(other *BlockingSignResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + return true +} + +func (p *BlockingSignResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("BlockingSignResp(%+v)", *p) +} + +func (p *BlockingSignResp) Validate() error { + return nil +} +// Attributes: +// - Code +// - LeaderParts +type GetLeaderPartsResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` + LeaderParts map[nebula.GraphSpaceID][]nebula.PartitionID `thrift:"leader_parts,2" db:"leader_parts" json:"leader_parts"` +} + +func NewGetLeaderPartsResp() *GetLeaderPartsResp { + return &GetLeaderPartsResp{} +} + + +func (p *GetLeaderPartsResp) GetCode() nebula.ErrorCode { + return p.Code +} + +func (p *GetLeaderPartsResp) GetLeaderParts() map[nebula.GraphSpaceID][]nebula.PartitionID { + return p.LeaderParts +} +func (p *GetLeaderPartsResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GetLeaderPartsResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *GetLeaderPartsResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.GraphSpaceID][]nebula.PartitionID, size) + p.LeaderParts = tMap + for i := 0; i < size; i ++ { +var _key155 nebula.GraphSpaceID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.GraphSpaceID(v) + _key155 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + _val156 := tSlice + for i := 0; i < size; i ++ { +var _elem157 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem157 = temp +} + _val156 = append(_val156, _elem157) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.LeaderParts[_key155] = _val156 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *GetLeaderPartsResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "GetLeaderPartsResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GetLeaderPartsResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *GetLeaderPartsResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:leader_parts: ", p), err) } + return err +} + +func (p *GetLeaderPartsResp) Equals(other *GetLeaderPartsResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + if len(p.LeaderParts) != len(other.LeaderParts) { return false } + for k, _tgt := range p.LeaderParts { + _src158 := other.LeaderParts[k] + if len(_tgt) != len(_src158) { return false } + for i, _tgt := range _tgt { + _src159 := _src158[i] + if _tgt != _src159 { return false } + } + } + return true +} + +func (p *GetLeaderPartsResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GetLeaderPartsResp(%+v)", *p) +} + +func (p *GetLeaderPartsResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - PartID +// - Peers +type CheckPeersReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + PartID nebula.PartitionID `thrift:"part_id,2" db:"part_id" json:"part_id"` + Peers []*nebula.HostAddr `thrift:"peers,3" db:"peers" json:"peers"` +} + +func NewCheckPeersReq() *CheckPeersReq { + return &CheckPeersReq{} +} + + +func (p *CheckPeersReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *CheckPeersReq) GetPartID() nebula.PartitionID { + return p.PartID +} + +func (p *CheckPeersReq) GetPeers() []*nebula.HostAddr { + return p.Peers +} +func (p *CheckPeersReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *CheckPeersReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *CheckPeersReq) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + temp := nebula.PartitionID(v) + p.PartID = temp +} + return nil +} + +func (p *CheckPeersReq) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*nebula.HostAddr, 0, size) + p.Peers = tSlice + for i := 0; i < size; i ++ { + _elem160 := &nebula.HostAddr{} + if err := _elem160.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem160), err) + } + p.Peers = append(p.Peers, _elem160) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *CheckPeersReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "CheckPeersReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *CheckPeersReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *CheckPeersReq) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.PartID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.part_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:part_id: ", p), err) } + return err +} + +func (p *CheckPeersReq) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "peers", thrift.LIST, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:peers: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(p.Peers)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Peers { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:peers: ", p), err) } + return err +} + +func (p *CheckPeersReq) Equals(other *CheckPeersReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if p.PartID != other.PartID { return false } + if len(p.Peers) != len(other.Peers) { return false } + for i, _tgt := range p.Peers { + _src161 := other.Peers[i] + if !_tgt.Equals(_src161) { return false } + } + return true +} + +func (p *CheckPeersReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("CheckPeersReq(%+v)", *p) +} + +func (p *CheckPeersReq) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - IndexID +type RebuildIndexRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts []nebula.PartitionID `thrift:"parts,2" db:"parts" json:"parts"` + IndexID nebula.IndexID `thrift:"index_id,3" db:"index_id" json:"index_id"` +} + +func NewRebuildIndexRequest() *RebuildIndexRequest { + return &RebuildIndexRequest{} +} + + +func (p *RebuildIndexRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *RebuildIndexRequest) GetParts() []nebula.PartitionID { + return p.Parts +} + +func (p *RebuildIndexRequest) GetIndexID() nebula.IndexID { + return p.IndexID +} +func (p *RebuildIndexRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.LIST { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *RebuildIndexRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *RebuildIndexRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem162 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem162 = temp +} + p.Parts = append(p.Parts, _elem162) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *RebuildIndexRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + temp := nebula.IndexID(v) + p.IndexID = temp +} + return nil +} + +func (p *RebuildIndexRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "RebuildIndexRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *RebuildIndexRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.LIST, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.IndexID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.index_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:index_id: ", p), err) } + return err +} + +func (p *RebuildIndexRequest) Equals(other *RebuildIndexRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for i, _tgt := range p.Parts { + _src163 := other.Parts[i] + if _tgt != _src163 { return false } + } + if p.IndexID != other.IndexID { return false } + return true +} + +func (p *RebuildIndexRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("RebuildIndexRequest(%+v)", *p) +} + +func (p *RebuildIndexRequest) Validate() error { + return nil +} +// Attributes: +// - Result_ +// - Dir +type ListClusterInfoResp struct { + Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` + Dir *nebula.DirInfo `thrift:"dir,2" db:"dir" json:"dir"` +} + +func NewListClusterInfoResp() *ListClusterInfoResp { + return &ListClusterInfoResp{} +} + +var ListClusterInfoResp_Result__DEFAULT *ResponseCommon +func (p *ListClusterInfoResp) GetResult_() *ResponseCommon { + if !p.IsSetResult_() { + return ListClusterInfoResp_Result__DEFAULT + } +return p.Result_ +} +var ListClusterInfoResp_Dir_DEFAULT *nebula.DirInfo +func (p *ListClusterInfoResp) GetDir() *nebula.DirInfo { + if !p.IsSetDir() { + return ListClusterInfoResp_Dir_DEFAULT + } +return p.Dir +} +func (p *ListClusterInfoResp) IsSetResult_() bool { + return p.Result_ != nil +} + +func (p *ListClusterInfoResp) IsSetDir() bool { + return p.Dir != nil +} + +func (p *ListClusterInfoResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetResult_ bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + issetResult_ = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetResult_{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); + } + return nil +} + +func (p *ListClusterInfoResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Result_ = &ResponseCommon{} + if err := p.Result_.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) + } + return nil +} + +func (p *ListClusterInfoResp) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + p.Dir = &nebula.DirInfo{} + if err := p.Dir.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dir), err) + } + return nil +} + +func (p *ListClusterInfoResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListClusterInfoResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dir), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dir: ", p), err) } + return err +} + +func (p *ListClusterInfoResp) Equals(other *ListClusterInfoResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.Result_.Equals(other.Result_) { return false } + if !p.Dir.Equals(other.Dir) { return false } + return true +} + +func (p *ListClusterInfoResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListClusterInfoResp(%+v)", *p) +} + +func (p *ListClusterInfoResp) Validate() error { + return nil +} +type ListClusterInfoReq struct { +} + +func NewListClusterInfoReq() *ListClusterInfoReq { + return &ListClusterInfoReq{} +} + +func (p *ListClusterInfoReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + 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(ctx, fieldTypeId); err != nil { + return err + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ListClusterInfoReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ListClusterInfoReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ListClusterInfoReq) Equals(other *ListClusterInfoReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + return true +} + +func (p *ListClusterInfoReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ListClusterInfoReq(%+v)", *p) +} + +func (p *ListClusterInfoReq) Validate() error { + return nil +} +// Attributes: +// - JobType +// - JobID +// - TaskID +// - Para +type AddTaskRequest struct { + JobType meta.JobType `thrift:"job_type,1" db:"job_type" json:"job_type"` + 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"` +} + +func NewAddTaskRequest() *AddTaskRequest { + return &AddTaskRequest{} +} + + +func (p *AddTaskRequest) GetJobType() meta.JobType { + return p.JobType +} + +func (p *AddTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *AddTaskRequest) GetTaskID() int32 { + return p.TaskID +} +var AddTaskRequest_Para_DEFAULT *TaskPara +func (p *AddTaskRequest) GetPara() *TaskPara { + if !p.IsSetPara() { + return AddTaskRequest_Para_DEFAULT + } +return p.Para +} +func (p *AddTaskRequest) IsSetPara() bool { + return p.Para != nil +} + +func (p *AddTaskRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I32 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddTaskRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := meta.JobType(v) + p.JobType = temp +} + return nil +} + +func (p *AddTaskRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *AddTaskRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *AddTaskRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + p.Para = &TaskPara{} + if err := p.Para.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Para), err) + } + return nil +} + +func (p *AddTaskRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddTaskRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddTaskRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "job_type", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_type: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.JobType)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_type (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_type: ", p), err) } + return err +} + +func (p *AddTaskRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:job_id: ", p), err) } + return err +} + +func (p *AddTaskRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:task_id: ", p), err) } + return err +} + +func (p *AddTaskRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Para), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:para: ", p), err) } + return err +} + +func (p *AddTaskRequest) Equals(other *AddTaskRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.JobType != other.JobType { return false } + if p.JobID != other.JobID { return false } + if p.TaskID != other.TaskID { return false } + if !p.Para.Equals(other.Para) { return false } + return true +} + +func (p *AddTaskRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddTaskRequest(%+v)", *p) +} + +func (p *AddTaskRequest) Validate() error { + return nil +} +// Attributes: +// - Code +type AddTaskResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` +} + +func NewAddTaskResp() *AddTaskResp { + return &AddTaskResp{} +} + + +func (p *AddTaskResp) GetCode() nebula.ErrorCode { + return p.Code +} +func (p *AddTaskResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *AddTaskResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *AddTaskResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "AddTaskResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *AddTaskResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *AddTaskResp) Equals(other *AddTaskResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + return true +} + +func (p *AddTaskResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("AddTaskResp(%+v)", *p) +} + +func (p *AddTaskResp) Validate() error { + return nil +} +// Attributes: +// - JobID +// - TaskID +type StopTaskRequest 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 NewStopTaskRequest() *StopTaskRequest { + return &StopTaskRequest{} +} + + +func (p *StopTaskRequest) GetJobID() int32 { + return p.JobID +} + +func (p *StopTaskRequest) GetTaskID() int32 { + return p.TaskID +} +func (p *StopTaskRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I32 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StopTaskRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + p.JobID = v +} + return nil +} + +func (p *StopTaskRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.TaskID = v +} + return nil +} + +func (p *StopTaskRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "StopTaskRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StopTaskRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.JobID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.job_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_id: ", p), err) } + return err +} + +func (p *StopTaskRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.TaskID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.task_id (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:task_id: ", p), err) } + return err +} + +func (p *StopTaskRequest) Equals(other *StopTaskRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.JobID != other.JobID { return false } + if p.TaskID != other.TaskID { return false } + return true +} + +func (p *StopTaskRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StopTaskRequest(%+v)", *p) +} + +func (p *StopTaskRequest) Validate() error { + return nil +} +// Attributes: +// - Code +type StopTaskResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` +} + +func NewStopTaskResp() *StopTaskResp { + return &StopTaskResp{} +} + + +func (p *StopTaskResp) GetCode() nebula.ErrorCode { + return p.Code +} +func (p *StopTaskResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StopTaskResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *StopTaskResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "StopTaskResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StopTaskResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *StopTaskResp) Equals(other *StopTaskResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + return true +} + +func (p *StopTaskResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StopTaskResp(%+v)", *p) +} + +func (p *StopTaskResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +type ClearSpaceReq struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` +} + +func NewClearSpaceReq() *ClearSpaceReq { + return &ClearSpaceReq{} +} + + +func (p *ClearSpaceReq) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} +func (p *ClearSpaceReq) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ClearSpaceReq) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ClearSpaceReq) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ClearSpaceReq"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ClearSpaceReq) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ClearSpaceReq) Equals(other *ClearSpaceReq) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + return true +} + +func (p *ClearSpaceReq) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ClearSpaceReq(%+v)", *p) +} + +func (p *ClearSpaceReq) Validate() error { + return nil +} +// Attributes: +// - Code +type ClearSpaceResp struct { + Code nebula.ErrorCode `thrift:"code,1" db:"code" json:"code"` +} + +func NewClearSpaceResp() *ClearSpaceResp { + return &ClearSpaceResp{} +} + + +func (p *ClearSpaceResp) GetCode() nebula.ErrorCode { + return p.Code +} +func (p *ClearSpaceResp) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ClearSpaceResp) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.ErrorCode(v) + p.Code = temp +} + return nil +} + +func (p *ClearSpaceResp) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ClearSpaceResp"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ClearSpaceResp) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "code", thrift.I32, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:code: ", p), err) } + if err := oprot.WriteI32(ctx, int32(p.Code)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.code (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:code: ", p), err) } + return err +} + +func (p *ClearSpaceResp) Equals(other *ClearSpaceResp) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.Code != other.Code { return false } + return true +} + +func (p *ClearSpaceResp) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ClearSpaceResp(%+v)", *p) +} + +func (p *ClearSpaceResp) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - PropNames +// - IfNotExists +// - Term +// - EdgeVersion +type ChainAddEdgesRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *ChainAddEdgesRequest) GetParts() map[nebula.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.EdgeVersion != nil +} + +func (p *ChainAddEdgesRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.LIST { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.BOOL { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.I64 { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 6: + if fieldTypeId == thrift.I64 { + if err := p.ReadField6(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ChainAddEdgesRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ChainAddEdgesRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*NewEdge_, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key164 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key164 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*NewEdge_, 0, size) + _val165 := tSlice + for i := 0; i < size; i ++ { + _elem166 := &NewEdge_{} + if err := _elem166.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem166), err) + } + _val165 = append(_val165, _elem166) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key164] = _val165 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ChainAddEdgesRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + 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 _elem167 []byte + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + _elem167 = v +} + p.PropNames = append(p.PropNames, _elem167) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ChainAddEdgesRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBool(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.IfNotExists = v +} + return nil +} + +func (p *ChainAddEdgesRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 5: ", err) +} else { + p.Term = v +} + return nil +} + +func (p *ChainAddEdgesRequest) ReadField6(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 6: ", err) +} else { + p.EdgeVersion = &v +} + return nil +} + +func (p *ChainAddEdgesRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ChainAddEdgesRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + if err := p.writeField6(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ChainAddEdgesRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, thrift.STRING, len(p.PropNames)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.PropNames { + if err := oprot.WriteBinary(ctx, v); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:prop_names: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, bool(p.IfNotExists)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.if_not_exists (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:if_not_exists: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "term", thrift.I64, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:term: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (5) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:term: ", p), err) } + return err +} + +func (p *ChainAddEdgesRequest) writeField6(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEdgeVersion() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.EdgeVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_version (6) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 6:edge_version: ", p), err) } + } + return err +} + +func (p *ChainAddEdgesRequest) Equals(other *ChainAddEdgesRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src168 := other.Parts[k] + if len(_tgt) != len(_src168) { return false } + for i, _tgt := range _tgt { + _src169 := _src168[i] + if !_tgt.Equals(_src169) { return false } + } + } + if len(p.PropNames) != len(other.PropNames) { return false } + for i, _tgt := range p.PropNames { + _src170 := other.PropNames[i] + if bytes.Compare(_tgt, _src170) != 0 { return false } + } + if p.IfNotExists != other.IfNotExists { return false } + if p.Term != other.Term { return false } + if p.EdgeVersion != other.EdgeVersion { + if p.EdgeVersion == nil || other.EdgeVersion == nil { + return false + } + if (*p.EdgeVersion) != (*other.EdgeVersion) { return false } + } + return true +} + +func (p *ChainAddEdgesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChainAddEdgesRequest(%+v)", *p) +} + +func (p *ChainAddEdgesRequest) Validate() error { + return nil +} +// 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 nebula.GraphSpaceID `thrift:"space_id,4" db:"space_id" json:"space_id"` + Parts []nebula.PartitionID `thrift:"parts,5,required" db:"parts" json:"parts"` +} + +func NewChainUpdateEdgeRequest() *ChainUpdateEdgeRequest { + return &ChainUpdateEdgeRequest{} +} + +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() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *ChainUpdateEdgeRequest) GetParts() []nebula.PartitionID { + return p.Parts +} +func (p *ChainUpdateEdgeRequest) IsSetUpdateEdgeRequest() bool { + return p.UpdateEdgeRequest != nil +} + +func (p *ChainUpdateEdgeRequest) IsSetEdgeVersion() bool { + return p.EdgeVersion != nil +} + +func (p *ChainUpdateEdgeRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + var issetParts bool = false; + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.I64 { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.I64 { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I32 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 5: + if fieldTypeId == thrift.LIST { + if err := p.ReadField5(ctx, iprot); err != nil { + return err + } + issetParts = true + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + if !issetParts{ + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Parts is not set")); + } + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.UpdateEdgeRequest = &UpdateEdgeRequest{} + if err := p.UpdateEdgeRequest.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.UpdateEdgeRequest), err) + } + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 2: ", err) +} else { + p.Term = v +} + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.EdgeVersion = &v +} + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ChainUpdateEdgeRequest) ReadField5(ctx context.Context, iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]nebula.PartitionID, 0, size) + p.Parts = tSlice + for i := 0; i < size; i ++ { +var _elem171 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _elem171 = temp +} + p.Parts = append(p.Parts, _elem171) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + return nil +} + +func (p *ChainUpdateEdgeRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ChainUpdateEdgeRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + if err := p.writeField5(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ChainUpdateEdgeRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.UpdateEdgeRequest), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:update_edge_request: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "term", thrift.I64, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:term: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (2) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:term: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetEdgeVersion() { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int64(*p.EdgeVersion)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.edge_version (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_version: ", p), err) } + } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:space_id: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) writeField5(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.LIST, 5); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:parts: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.I32, len(p.Parts)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range p.Parts { + if err := oprot.WriteI32(ctx, int32(v)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 5:parts: ", p), err) } + return err +} + +func (p *ChainUpdateEdgeRequest) Equals(other *ChainUpdateEdgeRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if !p.UpdateEdgeRequest.Equals(other.UpdateEdgeRequest) { return false } + if p.Term != other.Term { return false } + if p.EdgeVersion != other.EdgeVersion { + if p.EdgeVersion == nil || other.EdgeVersion == nil { + return false + } + if (*p.EdgeVersion) != (*other.EdgeVersion) { return false } + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for i, _tgt := range p.Parts { + _src172 := other.Parts[i] + if _tgt != _src172 { return false } + } + return true +} + +func (p *ChainUpdateEdgeRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChainUpdateEdgeRequest(%+v)", *p) +} + +func (p *ChainUpdateEdgeRequest) Validate() error { + return nil +} +// Attributes: +// - SpaceID +// - Parts +// - TxnID +// - Term +type ChainDeleteEdgesRequest struct { + SpaceID nebula.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` + Parts map[nebula.PartitionID][]*EdgeKey `thrift:"parts,2" db:"parts" json:"parts"` + TxnID []byte `thrift:"txn_id,3" db:"txn_id" json:"txn_id"` + Term int64 `thrift:"term,4" db:"term" json:"term"` +} + +func NewChainDeleteEdgesRequest() *ChainDeleteEdgesRequest { + return &ChainDeleteEdgesRequest{} +} + + +func (p *ChainDeleteEdgesRequest) GetSpaceID() nebula.GraphSpaceID { + return p.SpaceID +} + +func (p *ChainDeleteEdgesRequest) GetParts() map[nebula.PartitionID][]*EdgeKey { + return p.Parts +} + +func (p *ChainDeleteEdgesRequest) GetTxnID() []byte { + return p.TxnID +} + +func (p *ChainDeleteEdgesRequest) GetTerm() int64 { + return p.Term +} +func (p *ChainDeleteEdgesRequest) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 2: + if fieldTypeId == thrift.MAP { + if err := p.ReadField2(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 3: + if fieldTypeId == thrift.STRING { + if err := p.ReadField3(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + case 4: + if fieldTypeId == thrift.I64 { + if err := p.ReadField4(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *ChainDeleteEdgesRequest) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 1: ", err) +} else { + temp := nebula.GraphSpaceID(v) + p.SpaceID = temp +} + return nil +} + +func (p *ChainDeleteEdgesRequest) ReadField2(ctx context.Context, iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin(ctx) + if err != nil { + return thrift.PrependError("error reading map begin: ", err) + } + tMap := make(map[nebula.PartitionID][]*EdgeKey, size) + p.Parts = tMap + for i := 0; i < size; i ++ { +var _key173 nebula.PartitionID + if v, err := iprot.ReadI32(ctx); err != nil { + return thrift.PrependError("error reading field 0: ", err) +} else { + temp := nebula.PartitionID(v) + _key173 = temp +} + _, size, err := iprot.ReadListBegin(ctx) + if err != nil { + return thrift.PrependError("error reading list begin: ", err) + } + tSlice := make([]*EdgeKey, 0, size) + _val174 := tSlice + for i := 0; i < size; i ++ { + _elem175 := &EdgeKey{} + if err := _elem175.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem175), err) + } + _val174 = append(_val174, _elem175) + } + if err := iprot.ReadListEnd(ctx); err != nil { + return thrift.PrependError("error reading list end: ", err) + } + p.Parts[_key173] = _val174 + } + if err := iprot.ReadMapEnd(ctx); err != nil { + return thrift.PrependError("error reading map end: ", err) + } + return nil +} + +func (p *ChainDeleteEdgesRequest) ReadField3(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadBinary(ctx); err != nil { + return thrift.PrependError("error reading field 3: ", err) +} else { + p.TxnID = v +} + return nil +} + +func (p *ChainDeleteEdgesRequest) ReadField4(ctx context.Context, iprot thrift.TProtocol) error { + if v, err := iprot.ReadI64(ctx); err != nil { + return thrift.PrependError("error reading field 4: ", err) +} else { + p.Term = v +} + return nil +} + +func (p *ChainDeleteEdgesRequest) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "ChainDeleteEdgesRequest"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + if err := p.writeField2(ctx, oprot); err != nil { return err } + if err := p.writeField3(ctx, oprot); err != nil { return err } + if err := p.writeField4(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *ChainDeleteEdgesRequest) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "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(ctx, int32(p.SpaceID)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } + return err +} + +func (p *ChainDeleteEdgesRequest) writeField2(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "parts", thrift.MAP, 2); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } + if err := oprot.WriteMapBegin(ctx, 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(ctx, int32(k)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } + if err := oprot.WriteListBegin(ctx, thrift.STRUCT, len(v)); err != nil { + return thrift.PrependError("error writing list begin: ", err) + } + for _, v := range v { + if err := v.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) + } + } + if err := oprot.WriteListEnd(ctx); err != nil { + return thrift.PrependError("error writing list end: ", err) + } + } + if err := oprot.WriteMapEnd(ctx); err != nil { + return thrift.PrependError("error writing map end: ", err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 2:parts: ", p), err) } + return err +} + +func (p *ChainDeleteEdgesRequest) writeField3(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "txn_id", thrift.STRING, 3); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:txn_id: ", p), err) } + if err := oprot.WriteBinary(ctx, p.TxnID); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.txn_id (3) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 3:txn_id: ", p), err) } + return err +} + +func (p *ChainDeleteEdgesRequest) writeField4(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "term", thrift.I64, 4); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:term: ", p), err) } + if err := oprot.WriteI64(ctx, int64(p.Term)); err != nil { + return thrift.PrependError(fmt.Sprintf("%T.term (4) field write error: ", p), err) } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 4:term: ", p), err) } + return err +} + +func (p *ChainDeleteEdgesRequest) Equals(other *ChainDeleteEdgesRequest) bool { + if p == other { + return true + } else if p == nil || other == nil { + return false + } + if p.SpaceID != other.SpaceID { return false } + if len(p.Parts) != len(other.Parts) { return false } + for k, _tgt := range p.Parts { + _src176 := other.Parts[k] + if len(_tgt) != len(_src176) { return false } + for i, _tgt := range _tgt { + _src177 := _src176[i] + if !_tgt.Equals(_src177) { return false } + } + } + if bytes.Compare(p.TxnID, other.TxnID) != 0 { return false } + if p.Term != other.Term { return false } + return true +} + +func (p *ChainDeleteEdgesRequest) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("ChainDeleteEdgesRequest(%+v)", *p) +} + +func (p *ChainDeleteEdgesRequest) Validate() error { + return nil +} +type GraphStorageService interface { + // Parameters: + // - Req + GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, _err error) + // Parameters: + // - Req + GetDstBySrc(ctx context.Context, req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, _err error) + // Parameters: + // - Req + GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, _err error) + // Parameters: + // - Req + 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 *ScanResponse, _err error) + // Parameters: + // - Req + ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanResponse, _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) + // Parameters: + // - Req + ChainDeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, _err error) + // 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 GraphStorageServiceClient struct { + c thrift.TClient + meta thrift.ResponseMeta +} + +func NewGraphStorageServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewGraphStorageServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewGraphStorageServiceClient(c thrift.TClient) *GraphStorageServiceClient { + return &GraphStorageServiceClient{ + c: c, + } +} + +func (p *GraphStorageServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *GraphStorageServiceClient) LastResponseMeta_() thrift.ResponseMeta { + return p.meta +} + +func (p *GraphStorageServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { + p.meta = meta +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetNeighbors(ctx context.Context, req *GetNeighborsRequest) (_r *GetNeighborsResponse, _err error) { + var _args178 GraphStorageServiceGetNeighborsArgs + _args178.Req = req + var _result180 GraphStorageServiceGetNeighborsResult + var _meta179 thrift.ResponseMeta + _meta179, _err = p.Client_().Call(ctx, "getNeighbors", &_args178, &_result180) + p.SetLastResponseMeta_(_meta179) + if _err != nil { + return + } + if _ret181 := _result180.GetSuccess(); _ret181 != nil { + return _ret181, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getNeighbors failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetDstBySrc(ctx context.Context, req *GetDstBySrcRequest) (_r *GetDstBySrcResponse, _err error) { + var _args182 GraphStorageServiceGetDstBySrcArgs + _args182.Req = req + var _result184 GraphStorageServiceGetDstBySrcResult + var _meta183 thrift.ResponseMeta + _meta183, _err = p.Client_().Call(ctx, "getDstBySrc", &_args182, &_result184) + p.SetLastResponseMeta_(_meta183) + if _err != nil { + return + } + if _ret185 := _result184.GetSuccess(); _ret185 != nil { + return _ret185, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getDstBySrc failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetProps(ctx context.Context, req *GetPropRequest) (_r *GetPropResponse, _err error) { + var _args186 GraphStorageServiceGetPropsArgs + _args186.Req = req + var _result188 GraphStorageServiceGetPropsResult + var _meta187 thrift.ResponseMeta + _meta187, _err = p.Client_().Call(ctx, "getProps", &_args186, &_result188) + p.SetLastResponseMeta_(_meta187) + if _err != nil { + return + } + if _ret189 := _result188.GetSuccess(); _ret189 != nil { + return _ret189, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getProps failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddVertices(ctx context.Context, req *AddVerticesRequest) (_r *ExecResponse, _err error) { + var _args190 GraphStorageServiceAddVerticesArgs + _args190.Req = req + var _result192 GraphStorageServiceAddVerticesResult + var _meta191 thrift.ResponseMeta + _meta191, _err = p.Client_().Call(ctx, "addVertices", &_args190, &_result192) + p.SetLastResponseMeta_(_meta191) + if _err != nil { + return + } + if _ret193 := _result192.GetSuccess(); _ret193 != nil { + return _ret193, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addVertices failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) AddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, _err error) { + var _args194 GraphStorageServiceAddEdgesArgs + _args194.Req = req + var _result196 GraphStorageServiceAddEdgesResult + var _meta195 thrift.ResponseMeta + _meta195, _err = p.Client_().Call(ctx, "addEdges", &_args194, &_result196) + p.SetLastResponseMeta_(_meta195) + if _err != nil { + return + } + if _ret197 := _result196.GetSuccess(); _ret197 != nil { + return _ret197, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addEdges failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, _err error) { + var _args198 GraphStorageServiceDeleteEdgesArgs + _args198.Req = req + var _result200 GraphStorageServiceDeleteEdgesResult + var _meta199 thrift.ResponseMeta + _meta199, _err = p.Client_().Call(ctx, "deleteEdges", &_args198, &_result200) + p.SetLastResponseMeta_(_meta199) + if _err != nil { + return + } + if _ret201 := _result200.GetSuccess(); _ret201 != nil { + return _ret201, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "deleteEdges failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteVertices(ctx context.Context, req *DeleteVerticesRequest) (_r *ExecResponse, _err error) { + var _args202 GraphStorageServiceDeleteVerticesArgs + _args202.Req = req + var _result204 GraphStorageServiceDeleteVerticesResult + var _meta203 thrift.ResponseMeta + _meta203, _err = p.Client_().Call(ctx, "deleteVertices", &_args202, &_result204) + p.SetLastResponseMeta_(_meta203) + if _err != nil { + return + } + if _ret205 := _result204.GetSuccess(); _ret205 != nil { + return _ret205, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "deleteVertices failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) DeleteTags(ctx context.Context, req *DeleteTagsRequest) (_r *ExecResponse, _err error) { + var _args206 GraphStorageServiceDeleteTagsArgs + _args206.Req = req + var _result208 GraphStorageServiceDeleteTagsResult + var _meta207 thrift.ResponseMeta + _meta207, _err = p.Client_().Call(ctx, "deleteTags", &_args206, &_result208) + p.SetLastResponseMeta_(_meta207) + if _err != nil { + return + } + if _ret209 := _result208.GetSuccess(); _ret209 != nil { + return _ret209, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "deleteTags failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateVertex(ctx context.Context, req *UpdateVertexRequest) (_r *UpdateResponse, _err error) { + var _args210 GraphStorageServiceUpdateVertexArgs + _args210.Req = req + var _result212 GraphStorageServiceUpdateVertexResult + var _meta211 thrift.ResponseMeta + _meta211, _err = p.Client_().Call(ctx, "updateVertex", &_args210, &_result212) + p.SetLastResponseMeta_(_meta211) + if _err != nil { + return + } + if _ret213 := _result212.GetSuccess(); _ret213 != nil { + return _ret213, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "updateVertex failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) UpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, _err error) { + var _args214 GraphStorageServiceUpdateEdgeArgs + _args214.Req = req + var _result216 GraphStorageServiceUpdateEdgeResult + var _meta215 thrift.ResponseMeta + _meta215, _err = p.Client_().Call(ctx, "updateEdge", &_args214, &_result216) + p.SetLastResponseMeta_(_meta215) + if _err != nil { + return + } + if _ret217 := _result216.GetSuccess(); _ret217 != nil { + return _ret217, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "updateEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanVertex(ctx context.Context, req *ScanVertexRequest) (_r *ScanResponse, _err error) { + var _args218 GraphStorageServiceScanVertexArgs + _args218.Req = req + var _result220 GraphStorageServiceScanVertexResult + var _meta219 thrift.ResponseMeta + _meta219, _err = p.Client_().Call(ctx, "scanVertex", &_args218, &_result220) + p.SetLastResponseMeta_(_meta219) + if _err != nil { + return + } + if _ret221 := _result220.GetSuccess(); _ret221 != nil { + return _ret221, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "scanVertex failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ScanEdge(ctx context.Context, req *ScanEdgeRequest) (_r *ScanResponse, _err error) { + var _args222 GraphStorageServiceScanEdgeArgs + _args222.Req = req + var _result224 GraphStorageServiceScanEdgeResult + var _meta223 thrift.ResponseMeta + _meta223, _err = p.Client_().Call(ctx, "scanEdge", &_args222, &_result224) + p.SetLastResponseMeta_(_meta223) + if _err != nil { + return + } + if _ret225 := _result224.GetSuccess(); _ret225 != nil { + return _ret225, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "scanEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) GetUUID(ctx context.Context, req *GetUUIDReq) (_r *GetUUIDResp, _err error) { + var _args226 GraphStorageServiceGetUUIDArgs + _args226.Req = req + var _result228 GraphStorageServiceGetUUIDResult + var _meta227 thrift.ResponseMeta + _meta227, _err = p.Client_().Call(ctx, "getUUID", &_args226, &_result228) + p.SetLastResponseMeta_(_meta227) + if _err != nil { + return + } + if _ret229 := _result228.GetSuccess(); _ret229 != nil { + return _ret229, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getUUID failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupIndex(ctx context.Context, req *LookupIndexRequest) (_r *LookupIndexResp, _err error) { + var _args230 GraphStorageServiceLookupIndexArgs + _args230.Req = req + var _result232 GraphStorageServiceLookupIndexResult + var _meta231 thrift.ResponseMeta + _meta231, _err = p.Client_().Call(ctx, "lookupIndex", &_args230, &_result232) + p.SetLastResponseMeta_(_meta231) + if _err != nil { + return + } + if _ret233 := _result232.GetSuccess(); _ret233 != nil { + return _ret233, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "lookupIndex failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) LookupAndTraverse(ctx context.Context, req *LookupAndTraverseRequest) (_r *GetNeighborsResponse, _err error) { + var _args234 GraphStorageServiceLookupAndTraverseArgs + _args234.Req = req + var _result236 GraphStorageServiceLookupAndTraverseResult + var _meta235 thrift.ResponseMeta + _meta235, _err = p.Client_().Call(ctx, "lookupAndTraverse", &_args234, &_result236) + p.SetLastResponseMeta_(_meta235) + if _err != nil { + return + } + if _ret237 := _result236.GetSuccess(); _ret237 != nil { + return _ret237, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "lookupAndTraverse failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ChainUpdateEdge(ctx context.Context, req *UpdateEdgeRequest) (_r *UpdateResponse, _err error) { + var _args238 GraphStorageServiceChainUpdateEdgeArgs + _args238.Req = req + var _result240 GraphStorageServiceChainUpdateEdgeResult + var _meta239 thrift.ResponseMeta + _meta239, _err = p.Client_().Call(ctx, "chainUpdateEdge", &_args238, &_result240) + p.SetLastResponseMeta_(_meta239) + if _err != nil { + return + } + if _ret241 := _result240.GetSuccess(); _ret241 != nil { + return _ret241, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "chainUpdateEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ChainAddEdges(ctx context.Context, req *AddEdgesRequest) (_r *ExecResponse, _err error) { + var _args242 GraphStorageServiceChainAddEdgesArgs + _args242.Req = req + var _result244 GraphStorageServiceChainAddEdgesResult + var _meta243 thrift.ResponseMeta + _meta243, _err = p.Client_().Call(ctx, "chainAddEdges", &_args242, &_result244) + p.SetLastResponseMeta_(_meta243) + if _err != nil { + return + } + if _ret245 := _result244.GetSuccess(); _ret245 != nil { + return _ret245, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "chainAddEdges failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) ChainDeleteEdges(ctx context.Context, req *DeleteEdgesRequest) (_r *ExecResponse, _err error) { + var _args246 GraphStorageServiceChainDeleteEdgesArgs + _args246.Req = req + var _result248 GraphStorageServiceChainDeleteEdgesResult + var _meta247 thrift.ResponseMeta + _meta247, _err = p.Client_().Call(ctx, "chainDeleteEdges", &_args246, &_result248) + p.SetLastResponseMeta_(_meta247) + if _err != nil { + return + } + if _ret249 := _result248.GetSuccess(); _ret249 != nil { + return _ret249, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "chainDeleteEdges failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) Get(ctx context.Context, req *KVGetRequest) (_r *KVGetResponse, _err error) { + var _args250 GraphStorageServiceGetArgs + _args250.Req = req + var _result252 GraphStorageServiceGetResult + var _meta251 thrift.ResponseMeta + _meta251, _err = p.Client_().Call(ctx, "get", &_args250, &_result252) + p.SetLastResponseMeta_(_meta251) + if _err != nil { + return + } + if _ret253 := _result252.GetSuccess(); _ret253 != nil { + return _ret253, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "get failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) Put(ctx context.Context, req *KVPutRequest) (_r *ExecResponse, _err error) { + var _args254 GraphStorageServicePutArgs + _args254.Req = req + var _result256 GraphStorageServicePutResult + var _meta255 thrift.ResponseMeta + _meta255, _err = p.Client_().Call(ctx, "put", &_args254, &_result256) + p.SetLastResponseMeta_(_meta255) + if _err != nil { + return + } + if _ret257 := _result256.GetSuccess(); _ret257 != nil { + return _ret257, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "put failed: unknown result") +} + +// Parameters: +// - Req +func (p *GraphStorageServiceClient) Remove(ctx context.Context, req *KVRemoveRequest) (_r *ExecResponse, _err error) { + var _args258 GraphStorageServiceRemoveArgs + _args258.Req = req + var _result260 GraphStorageServiceRemoveResult + var _meta259 thrift.ResponseMeta + _meta259, _err = p.Client_().Call(ctx, "remove", &_args258, &_result260) + p.SetLastResponseMeta_(_meta259) + if _err != nil { + return + } + if _ret261 := _result260.GetSuccess(); _ret261 != nil { + return _ret261, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "remove failed: unknown result") +} + +type GraphStorageServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler GraphStorageService +} + +func (p *GraphStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *GraphStorageServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *GraphStorageServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewGraphStorageServiceProcessor(handler GraphStorageService) *GraphStorageServiceProcessor { + + self262 := &GraphStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self262.processorMap["getNeighbors"] = &graphStorageServiceProcessorGetNeighbors{handler:handler} + self262.processorMap["getDstBySrc"] = &graphStorageServiceProcessorGetDstBySrc{handler:handler} + self262.processorMap["getProps"] = &graphStorageServiceProcessorGetProps{handler:handler} + self262.processorMap["addVertices"] = &graphStorageServiceProcessorAddVertices{handler:handler} + self262.processorMap["addEdges"] = &graphStorageServiceProcessorAddEdges{handler:handler} + self262.processorMap["deleteEdges"] = &graphStorageServiceProcessorDeleteEdges{handler:handler} + self262.processorMap["deleteVertices"] = &graphStorageServiceProcessorDeleteVertices{handler:handler} + self262.processorMap["deleteTags"] = &graphStorageServiceProcessorDeleteTags{handler:handler} + self262.processorMap["updateVertex"] = &graphStorageServiceProcessorUpdateVertex{handler:handler} + self262.processorMap["updateEdge"] = &graphStorageServiceProcessorUpdateEdge{handler:handler} + self262.processorMap["scanVertex"] = &graphStorageServiceProcessorScanVertex{handler:handler} + self262.processorMap["scanEdge"] = &graphStorageServiceProcessorScanEdge{handler:handler} + self262.processorMap["getUUID"] = &graphStorageServiceProcessorGetUUID{handler:handler} + self262.processorMap["lookupIndex"] = &graphStorageServiceProcessorLookupIndex{handler:handler} + self262.processorMap["lookupAndTraverse"] = &graphStorageServiceProcessorLookupAndTraverse{handler:handler} + self262.processorMap["chainUpdateEdge"] = &graphStorageServiceProcessorChainUpdateEdge{handler:handler} + self262.processorMap["chainAddEdges"] = &graphStorageServiceProcessorChainAddEdges{handler:handler} + self262.processorMap["chainDeleteEdges"] = &graphStorageServiceProcessorChainDeleteEdges{handler:handler} + self262.processorMap["get"] = &graphStorageServiceProcessorGet{handler:handler} + self262.processorMap["put"] = &graphStorageServiceProcessorPut{handler:handler} + self262.processorMap["remove"] = &graphStorageServiceProcessorRemove{handler:handler} +return self262 +} + +func (p *GraphStorageServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { return false, thrift.WrapTException(err2) } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x263 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x263.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x263 + +} + +type graphStorageServiceProcessorGetNeighbors struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetNeighbors) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err264 error + args := GraphStorageServiceGetNeighborsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getNeighbors", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceGetNeighborsResult{} + if retval, err2 := p.handler.GetNeighbors(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc265 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getNeighbors: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getNeighbors", thrift.EXCEPTION, seqId); err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if err2 := _exc265.Write(ctx, oprot); _write_err264 == nil && err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err264 == nil && err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err264 == nil && err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if _write_err264 != nil { + return false, thrift.WrapTException(_write_err264) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getNeighbors", thrift.REPLY, seqId); err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err264 == nil && err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err264 == nil && err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err264 == nil && err2 != nil { + _write_err264 = thrift.WrapTException(err2) + } + if _write_err264 != nil { + return false, thrift.WrapTException(_write_err264) + } + return true, err +} + +type graphStorageServiceProcessorGetDstBySrc struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetDstBySrc) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err266 error + args := GraphStorageServiceGetDstBySrcArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getDstBySrc", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceGetDstBySrcResult{} + if retval, err2 := p.handler.GetDstBySrc(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc267 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getDstBySrc: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getDstBySrc", thrift.EXCEPTION, seqId); err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if err2 := _exc267.Write(ctx, oprot); _write_err266 == nil && err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err266 == nil && err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err266 == nil && err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if _write_err266 != nil { + return false, thrift.WrapTException(_write_err266) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getDstBySrc", thrift.REPLY, seqId); err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err266 == nil && err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err266 == nil && err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err266 == nil && err2 != nil { + _write_err266 = thrift.WrapTException(err2) + } + if _write_err266 != nil { + return false, thrift.WrapTException(_write_err266) + } + return true, err +} + +type graphStorageServiceProcessorGetProps struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetProps) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err268 error + args := GraphStorageServiceGetPropsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getProps", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceGetPropsResult{} + if retval, err2 := p.handler.GetProps(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc269 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getProps: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getProps", thrift.EXCEPTION, seqId); err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if err2 := _exc269.Write(ctx, oprot); _write_err268 == nil && err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err268 == nil && err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err268 == nil && err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if _write_err268 != nil { + return false, thrift.WrapTException(_write_err268) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getProps", thrift.REPLY, seqId); err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err268 == nil && err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err268 == nil && err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err268 == nil && err2 != nil { + _write_err268 = thrift.WrapTException(err2) + } + if _write_err268 != nil { + return false, thrift.WrapTException(_write_err268) + } + return true, err +} + +type graphStorageServiceProcessorAddVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddVertices) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err270 error + args := GraphStorageServiceAddVerticesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addVertices", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceAddVerticesResult{} + if retval, err2 := p.handler.AddVertices(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc271 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addVertices: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addVertices", thrift.EXCEPTION, seqId); err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if err2 := _exc271.Write(ctx, oprot); _write_err270 == nil && err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err270 == nil && err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err270 == nil && err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if _write_err270 != nil { + return false, thrift.WrapTException(_write_err270) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addVertices", thrift.REPLY, seqId); err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err270 == nil && err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err270 == nil && err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err270 == nil && err2 != nil { + _write_err270 = thrift.WrapTException(err2) + } + if _write_err270 != nil { + return false, thrift.WrapTException(_write_err270) + } + return true, err +} + +type graphStorageServiceProcessorAddEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorAddEdges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err272 error + args := GraphStorageServiceAddEdgesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addEdges", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceAddEdgesResult{} + if retval, err2 := p.handler.AddEdges(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc273 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addEdges: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addEdges", thrift.EXCEPTION, seqId); err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if err2 := _exc273.Write(ctx, oprot); _write_err272 == nil && err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err272 == nil && err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err272 == nil && err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if _write_err272 != nil { + return false, thrift.WrapTException(_write_err272) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addEdges", thrift.REPLY, seqId); err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err272 == nil && err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err272 == nil && err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err272 == nil && err2 != nil { + _write_err272 = thrift.WrapTException(err2) + } + if _write_err272 != nil { + return false, thrift.WrapTException(_write_err272) + } + return true, err +} + +type graphStorageServiceProcessorDeleteEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteEdges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err274 error + args := GraphStorageServiceDeleteEdgesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "deleteEdges", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceDeleteEdgesResult{} + if retval, err2 := p.handler.DeleteEdges(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc275 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteEdges: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "deleteEdges", thrift.EXCEPTION, seqId); err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if err2 := _exc275.Write(ctx, oprot); _write_err274 == nil && err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err274 == nil && err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err274 == nil && err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if _write_err274 != nil { + return false, thrift.WrapTException(_write_err274) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "deleteEdges", thrift.REPLY, seqId); err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err274 == nil && err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err274 == nil && err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err274 == nil && err2 != nil { + _write_err274 = thrift.WrapTException(err2) + } + if _write_err274 != nil { + return false, thrift.WrapTException(_write_err274) + } + return true, err +} + +type graphStorageServiceProcessorDeleteVertices struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteVertices) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err276 error + args := GraphStorageServiceDeleteVerticesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "deleteVertices", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceDeleteVerticesResult{} + if retval, err2 := p.handler.DeleteVertices(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc277 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteVertices: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "deleteVertices", thrift.EXCEPTION, seqId); err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if err2 := _exc277.Write(ctx, oprot); _write_err276 == nil && err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err276 == nil && err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err276 == nil && err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if _write_err276 != nil { + return false, thrift.WrapTException(_write_err276) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "deleteVertices", thrift.REPLY, seqId); err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err276 == nil && err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err276 == nil && err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err276 == nil && err2 != nil { + _write_err276 = thrift.WrapTException(err2) + } + if _write_err276 != nil { + return false, thrift.WrapTException(_write_err276) + } + return true, err +} + +type graphStorageServiceProcessorDeleteTags struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorDeleteTags) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err278 error + args := GraphStorageServiceDeleteTagsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "deleteTags", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceDeleteTagsResult{} + if retval, err2 := p.handler.DeleteTags(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc279 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing deleteTags: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "deleteTags", thrift.EXCEPTION, seqId); err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if err2 := _exc279.Write(ctx, oprot); _write_err278 == nil && err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err278 == nil && err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err278 == nil && err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if _write_err278 != nil { + return false, thrift.WrapTException(_write_err278) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "deleteTags", thrift.REPLY, seqId); err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err278 == nil && err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err278 == nil && err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err278 == nil && err2 != nil { + _write_err278 = thrift.WrapTException(err2) + } + if _write_err278 != nil { + return false, thrift.WrapTException(_write_err278) + } + return true, err +} + +type graphStorageServiceProcessorUpdateVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateVertex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err280 error + args := GraphStorageServiceUpdateVertexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "updateVertex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceUpdateVertexResult{} + if retval, err2 := p.handler.UpdateVertex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc281 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateVertex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "updateVertex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if err2 := _exc281.Write(ctx, oprot); _write_err280 == nil && err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err280 == nil && err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err280 == nil && err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if _write_err280 != nil { + return false, thrift.WrapTException(_write_err280) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "updateVertex", thrift.REPLY, seqId); err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err280 == nil && err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err280 == nil && err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err280 == nil && err2 != nil { + _write_err280 = thrift.WrapTException(err2) + } + if _write_err280 != nil { + return false, thrift.WrapTException(_write_err280) + } + return true, err +} + +type graphStorageServiceProcessorUpdateEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorUpdateEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err282 error + args := GraphStorageServiceUpdateEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "updateEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceUpdateEdgeResult{} + if retval, err2 := p.handler.UpdateEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc283 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing updateEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "updateEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if err2 := _exc283.Write(ctx, oprot); _write_err282 == nil && err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err282 == nil && err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err282 == nil && err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if _write_err282 != nil { + return false, thrift.WrapTException(_write_err282) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "updateEdge", thrift.REPLY, seqId); err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err282 == nil && err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err282 == nil && err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err282 == nil && err2 != nil { + _write_err282 = thrift.WrapTException(err2) + } + if _write_err282 != nil { + return false, thrift.WrapTException(_write_err282) + } + return true, err +} + +type graphStorageServiceProcessorScanVertex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanVertex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err284 error + args := GraphStorageServiceScanVertexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "scanVertex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceScanVertexResult{} + if retval, err2 := p.handler.ScanVertex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc285 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanVertex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "scanVertex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if err2 := _exc285.Write(ctx, oprot); _write_err284 == nil && err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err284 == nil && err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err284 == nil && err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if _write_err284 != nil { + return false, thrift.WrapTException(_write_err284) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "scanVertex", thrift.REPLY, seqId); err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err284 == nil && err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err284 == nil && err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err284 == nil && err2 != nil { + _write_err284 = thrift.WrapTException(err2) + } + if _write_err284 != nil { + return false, thrift.WrapTException(_write_err284) + } + return true, err +} + +type graphStorageServiceProcessorScanEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorScanEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err286 error + args := GraphStorageServiceScanEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "scanEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceScanEdgeResult{} + if retval, err2 := p.handler.ScanEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc287 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing scanEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "scanEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if err2 := _exc287.Write(ctx, oprot); _write_err286 == nil && err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err286 == nil && err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err286 == nil && err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if _write_err286 != nil { + return false, thrift.WrapTException(_write_err286) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "scanEdge", thrift.REPLY, seqId); err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err286 == nil && err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err286 == nil && err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err286 == nil && err2 != nil { + _write_err286 = thrift.WrapTException(err2) + } + if _write_err286 != nil { + return false, thrift.WrapTException(_write_err286) + } + return true, err +} + +type graphStorageServiceProcessorGetUUID struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGetUUID) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err288 error + args := GraphStorageServiceGetUUIDArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getUUID", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceGetUUIDResult{} + if retval, err2 := p.handler.GetUUID(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc289 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getUUID: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getUUID", thrift.EXCEPTION, seqId); err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if err2 := _exc289.Write(ctx, oprot); _write_err288 == nil && err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err288 == nil && err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err288 == nil && err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if _write_err288 != nil { + return false, thrift.WrapTException(_write_err288) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getUUID", thrift.REPLY, seqId); err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err288 == nil && err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err288 == nil && err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err288 == nil && err2 != nil { + _write_err288 = thrift.WrapTException(err2) + } + if _write_err288 != nil { + return false, thrift.WrapTException(_write_err288) + } + return true, err +} + +type graphStorageServiceProcessorLookupIndex struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupIndex) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err290 error + args := GraphStorageServiceLookupIndexArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "lookupIndex", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceLookupIndexResult{} + if retval, err2 := p.handler.LookupIndex(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc291 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupIndex: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "lookupIndex", thrift.EXCEPTION, seqId); err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if err2 := _exc291.Write(ctx, oprot); _write_err290 == nil && err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err290 == nil && err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err290 == nil && err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if _write_err290 != nil { + return false, thrift.WrapTException(_write_err290) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "lookupIndex", thrift.REPLY, seqId); err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err290 == nil && err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err290 == nil && err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err290 == nil && err2 != nil { + _write_err290 = thrift.WrapTException(err2) + } + if _write_err290 != nil { + return false, thrift.WrapTException(_write_err290) + } + return true, err +} + +type graphStorageServiceProcessorLookupAndTraverse struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorLookupAndTraverse) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err292 error + args := GraphStorageServiceLookupAndTraverseArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "lookupAndTraverse", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceLookupAndTraverseResult{} + if retval, err2 := p.handler.LookupAndTraverse(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc293 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lookupAndTraverse: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "lookupAndTraverse", thrift.EXCEPTION, seqId); err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if err2 := _exc293.Write(ctx, oprot); _write_err292 == nil && err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err292 == nil && err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err292 == nil && err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if _write_err292 != nil { + return false, thrift.WrapTException(_write_err292) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "lookupAndTraverse", thrift.REPLY, seqId); err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err292 == nil && err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err292 == nil && err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err292 == nil && err2 != nil { + _write_err292 = thrift.WrapTException(err2) + } + if _write_err292 != nil { + return false, thrift.WrapTException(_write_err292) + } + return true, err +} + +type graphStorageServiceProcessorChainUpdateEdge struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorChainUpdateEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err294 error + args := GraphStorageServiceChainUpdateEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "chainUpdateEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceChainUpdateEdgeResult{} + if retval, err2 := p.handler.ChainUpdateEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc295 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainUpdateEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "chainUpdateEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if err2 := _exc295.Write(ctx, oprot); _write_err294 == nil && err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err294 == nil && err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err294 == nil && err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if _write_err294 != nil { + return false, thrift.WrapTException(_write_err294) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "chainUpdateEdge", thrift.REPLY, seqId); err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err294 == nil && err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err294 == nil && err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err294 == nil && err2 != nil { + _write_err294 = thrift.WrapTException(err2) + } + if _write_err294 != nil { + return false, thrift.WrapTException(_write_err294) + } + return true, err +} + +type graphStorageServiceProcessorChainAddEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorChainAddEdges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err296 error + args := GraphStorageServiceChainAddEdgesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "chainAddEdges", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceChainAddEdgesResult{} + if retval, err2 := p.handler.ChainAddEdges(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc297 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainAddEdges: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "chainAddEdges", thrift.EXCEPTION, seqId); err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if err2 := _exc297.Write(ctx, oprot); _write_err296 == nil && err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err296 == nil && err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err296 == nil && err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if _write_err296 != nil { + return false, thrift.WrapTException(_write_err296) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "chainAddEdges", thrift.REPLY, seqId); err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err296 == nil && err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err296 == nil && err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err296 == nil && err2 != nil { + _write_err296 = thrift.WrapTException(err2) + } + if _write_err296 != nil { + return false, thrift.WrapTException(_write_err296) + } + return true, err +} + +type graphStorageServiceProcessorChainDeleteEdges struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorChainDeleteEdges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err298 error + args := GraphStorageServiceChainDeleteEdgesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "chainDeleteEdges", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceChainDeleteEdgesResult{} + if retval, err2 := p.handler.ChainDeleteEdges(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc299 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainDeleteEdges: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "chainDeleteEdges", thrift.EXCEPTION, seqId); err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if err2 := _exc299.Write(ctx, oprot); _write_err298 == nil && err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err298 == nil && err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err298 == nil && err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if _write_err298 != nil { + return false, thrift.WrapTException(_write_err298) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "chainDeleteEdges", thrift.REPLY, seqId); err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err298 == nil && err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err298 == nil && err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err298 == nil && err2 != nil { + _write_err298 = thrift.WrapTException(err2) + } + if _write_err298 != nil { + return false, thrift.WrapTException(_write_err298) + } + return true, err +} + +type graphStorageServiceProcessorGet struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorGet) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err300 error + args := GraphStorageServiceGetArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "get", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceGetResult{} + if retval, err2 := p.handler.Get(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc301 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing get: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "get", thrift.EXCEPTION, seqId); err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if err2 := _exc301.Write(ctx, oprot); _write_err300 == nil && err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err300 == nil && err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err300 == nil && err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if _write_err300 != nil { + return false, thrift.WrapTException(_write_err300) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "get", thrift.REPLY, seqId); err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err300 == nil && err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err300 == nil && err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err300 == nil && err2 != nil { + _write_err300 = thrift.WrapTException(err2) + } + if _write_err300 != nil { + return false, thrift.WrapTException(_write_err300) + } + return true, err +} + +type graphStorageServiceProcessorPut struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorPut) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err302 error + args := GraphStorageServicePutArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "put", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServicePutResult{} + if retval, err2 := p.handler.Put(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc303 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing put: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "put", thrift.EXCEPTION, seqId); err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if err2 := _exc303.Write(ctx, oprot); _write_err302 == nil && err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err302 == nil && err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err302 == nil && err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if _write_err302 != nil { + return false, thrift.WrapTException(_write_err302) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "put", thrift.REPLY, seqId); err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err302 == nil && err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err302 == nil && err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err302 == nil && err2 != nil { + _write_err302 = thrift.WrapTException(err2) + } + if _write_err302 != nil { + return false, thrift.WrapTException(_write_err302) + } + return true, err +} + +type graphStorageServiceProcessorRemove struct { + handler GraphStorageService +} + +func (p *graphStorageServiceProcessorRemove) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err304 error + args := GraphStorageServiceRemoveArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "remove", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := GraphStorageServiceRemoveResult{} + if retval, err2 := p.handler.Remove(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc305 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing remove: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "remove", thrift.EXCEPTION, seqId); err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if err2 := _exc305.Write(ctx, oprot); _write_err304 == nil && err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err304 == nil && err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err304 == nil && err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if _write_err304 != nil { + return false, thrift.WrapTException(_write_err304) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "remove", thrift.REPLY, seqId); err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err304 == nil && err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err304 == nil && err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err304 == nil && err2 != nil { + _write_err304 = thrift.WrapTException(err2) + } + if _write_err304 != nil { + return false, thrift.WrapTException(_write_err304) + } + return true, err +} + + +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetNeighborsRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getNeighbors_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetNeighborsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetNeighborsResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetNeighborsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getNeighbors_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetNeighborsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 GraphStorageServiceGetDstBySrcArgs struct { + Req *GetDstBySrcRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetDstBySrcArgs() *GraphStorageServiceGetDstBySrcArgs { + return &GraphStorageServiceGetDstBySrcArgs{} +} + +var GraphStorageServiceGetDstBySrcArgs_Req_DEFAULT *GetDstBySrcRequest +func (p *GraphStorageServiceGetDstBySrcArgs) GetReq() *GetDstBySrcRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetDstBySrcArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetDstBySrcArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceGetDstBySrcArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetDstBySrcRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getDstBySrc_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GraphStorageServiceGetDstBySrcArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetDstBySrcArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceGetDstBySrcResult struct { + Success *GetDstBySrcResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetDstBySrcResult() *GraphStorageServiceGetDstBySrcResult { + return &GraphStorageServiceGetDstBySrcResult{} +} + +var GraphStorageServiceGetDstBySrcResult_Success_DEFAULT *GetDstBySrcResponse +func (p *GraphStorageServiceGetDstBySrcResult) GetSuccess() *GetDstBySrcResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetDstBySrcResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetDstBySrcResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceGetDstBySrcResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetDstBySrcResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getDstBySrc_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetDstBySrcResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphStorageServiceGetDstBySrcResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetDstBySrcResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetPropRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getProps_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetPropsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetPropResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetPropsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getProps_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetPropsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddVerticesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addVertices_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceAddVerticesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddVerticesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addVertices_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceAddVerticesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddEdgesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addEdges_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceAddEdgesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceAddEdgesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addEdges_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceAddEdgesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DeleteEdgesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "deleteEdges_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "deleteEdges_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceDeleteEdgesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DeleteVerticesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "deleteVertices_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "deleteVertices_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceDeleteVerticesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 GraphStorageServiceDeleteTagsArgs struct { + Req *DeleteTagsRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceDeleteTagsArgs() *GraphStorageServiceDeleteTagsArgs { + return &GraphStorageServiceDeleteTagsArgs{} +} + +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.Req != nil +} + +func (p *GraphStorageServiceDeleteTagsArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteTagsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DeleteTagsRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteTagsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "deleteTags_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceDeleteTagsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphStorageServiceDeleteTagsArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceDeleteTagsResult struct { + 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.Success != nil +} + +func (p *GraphStorageServiceDeleteTagsResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteTagsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceDeleteTagsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "deleteTags_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceDeleteTagsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphStorageServiceDeleteTagsResult(%+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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &UpdateVertexRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "updateVertex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceUpdateVertexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &UpdateResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateVertexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "updateVertex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceUpdateVertexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &UpdateEdgeRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "updateEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &UpdateResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "updateEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceUpdateEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ScanVertexRequest{ + EnableReadFromFollower: true, +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "scanVertex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceScanVertexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanVertexResult() *GraphStorageServiceScanVertexResult { + return &GraphStorageServiceScanVertexResult{} +} + +var GraphStorageServiceScanVertexResult_Success_DEFAULT *ScanResponse +func (p *GraphStorageServiceScanVertexResult) GetSuccess() *ScanResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanVertexResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanVertexResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceScanVertexResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ScanResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanVertexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "scanVertex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceScanVertexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ScanEdgeRequest{ + EnableReadFromFollower: true, +} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "scanEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceScanEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *ScanResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceScanEdgeResult() *GraphStorageServiceScanEdgeResult { + return &GraphStorageServiceScanEdgeResult{} +} + +var GraphStorageServiceScanEdgeResult_Success_DEFAULT *ScanResponse +func (p *GraphStorageServiceScanEdgeResult) GetSuccess() *ScanResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceScanEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceScanEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceScanEdgeResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ScanResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceScanEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "scanEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceScanEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetUUIDReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getUUID_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetUUIDArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetUUIDResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetUUIDResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getUUID_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetUUIDResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &LookupIndexRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "lookupIndex_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceLookupIndexArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &LookupIndexResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupIndexResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "lookupIndex_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceLookupIndexResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &LookupAndTraverseRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "lookupAndTraverse_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetNeighborsResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "lookupAndTraverse_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceLookupAndTraverseResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 GraphStorageServiceChainUpdateEdgeArgs struct { + Req *UpdateEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceChainUpdateEdgeArgs() *GraphStorageServiceChainUpdateEdgeArgs { + return &GraphStorageServiceChainUpdateEdgeArgs{} +} + +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.Req != nil +} + +func (p *GraphStorageServiceChainUpdateEdgeArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &UpdateEdgeRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainUpdateEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphStorageServiceChainUpdateEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceChainUpdateEdgeResult struct { + 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.Success != nil +} + +func (p *GraphStorageServiceChainUpdateEdgeResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &UpdateResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainUpdateEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceChainUpdateEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphStorageServiceChainUpdateEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceChainAddEdgesArgs struct { + Req *AddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceChainAddEdgesArgs() *GraphStorageServiceChainAddEdgesArgs { + return &GraphStorageServiceChainAddEdgesArgs{} +} + +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.Req != nil +} + +func (p *GraphStorageServiceChainAddEdgesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddEdgesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainAddEdges_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphStorageServiceChainAddEdgesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceChainAddEdgesResult struct { + 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.Success != nil +} + +func (p *GraphStorageServiceChainAddEdgesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainAddEdges_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceChainAddEdgesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 "" + } + return fmt.Sprintf("GraphStorageServiceChainAddEdgesResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceChainDeleteEdgesArgs struct { + Req *DeleteEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceChainDeleteEdgesArgs() *GraphStorageServiceChainDeleteEdgesArgs { + return &GraphStorageServiceChainDeleteEdgesArgs{} +} + +var GraphStorageServiceChainDeleteEdgesArgs_Req_DEFAULT *DeleteEdgesRequest +func (p *GraphStorageServiceChainDeleteEdgesArgs) GetReq() *DeleteEdgesRequest { + if !p.IsSetReq() { + return GraphStorageServiceChainDeleteEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceChainDeleteEdgesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceChainDeleteEdgesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceChainDeleteEdgesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DeleteEdgesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceChainDeleteEdgesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainDeleteEdges_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceChainDeleteEdgesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GraphStorageServiceChainDeleteEdgesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceChainDeleteEdgesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceChainDeleteEdgesResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceChainDeleteEdgesResult() *GraphStorageServiceChainDeleteEdgesResult { + return &GraphStorageServiceChainDeleteEdgesResult{} +} + +var GraphStorageServiceChainDeleteEdgesResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceChainDeleteEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceChainDeleteEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceChainDeleteEdgesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceChainDeleteEdgesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceChainDeleteEdgesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceChainDeleteEdgesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainDeleteEdges_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceChainDeleteEdgesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphStorageServiceChainDeleteEdgesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceChainDeleteEdgesResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceGetArgs struct { + Req *KVGetRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceGetArgs() *GraphStorageServiceGetArgs { + return &GraphStorageServiceGetArgs{} +} + +var GraphStorageServiceGetArgs_Req_DEFAULT *KVGetRequest +func (p *GraphStorageServiceGetArgs) GetReq() *KVGetRequest { + if !p.IsSetReq() { + return GraphStorageServiceGetArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceGetArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceGetArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &KVGetRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceGetArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "get_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GraphStorageServiceGetArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceGetResult struct { + Success *KVGetResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceGetResult() *GraphStorageServiceGetResult { + return &GraphStorageServiceGetResult{} +} + +var GraphStorageServiceGetResult_Success_DEFAULT *KVGetResponse +func (p *GraphStorageServiceGetResult) GetSuccess() *KVGetResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceGetResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceGetResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceGetResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceGetResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &KVGetResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceGetResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "get_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceGetResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphStorageServiceGetResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceGetResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServicePutArgs struct { + Req *KVPutRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServicePutArgs() *GraphStorageServicePutArgs { + return &GraphStorageServicePutArgs{} +} + +var GraphStorageServicePutArgs_Req_DEFAULT *KVPutRequest +func (p *GraphStorageServicePutArgs) GetReq() *KVPutRequest { + if !p.IsSetReq() { + return GraphStorageServicePutArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServicePutArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServicePutArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServicePutArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &KVPutRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServicePutArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "put_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServicePutArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GraphStorageServicePutArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServicePutArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServicePutResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServicePutResult() *GraphStorageServicePutResult { + return &GraphStorageServicePutResult{} +} + +var GraphStorageServicePutResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServicePutResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServicePutResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServicePutResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServicePutResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServicePutResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServicePutResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "put_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServicePutResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphStorageServicePutResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServicePutResult(%+v)", *p) +} + +// Attributes: +// - Req +type GraphStorageServiceRemoveArgs struct { + Req *KVRemoveRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewGraphStorageServiceRemoveArgs() *GraphStorageServiceRemoveArgs { + return &GraphStorageServiceRemoveArgs{} +} + +var GraphStorageServiceRemoveArgs_Req_DEFAULT *KVRemoveRequest +func (p *GraphStorageServiceRemoveArgs) GetReq() *KVRemoveRequest { + if !p.IsSetReq() { + return GraphStorageServiceRemoveArgs_Req_DEFAULT + } +return p.Req +} +func (p *GraphStorageServiceRemoveArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *GraphStorageServiceRemoveArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceRemoveArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &KVRemoveRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *GraphStorageServiceRemoveArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "remove_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceRemoveArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *GraphStorageServiceRemoveArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceRemoveArgs(%+v)", *p) +} + +// Attributes: +// - Success +type GraphStorageServiceRemoveResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewGraphStorageServiceRemoveResult() *GraphStorageServiceRemoveResult { + return &GraphStorageServiceRemoveResult{} +} + +var GraphStorageServiceRemoveResult_Success_DEFAULT *ExecResponse +func (p *GraphStorageServiceRemoveResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return GraphStorageServiceRemoveResult_Success_DEFAULT + } +return p.Success +} +func (p *GraphStorageServiceRemoveResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *GraphStorageServiceRemoveResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *GraphStorageServiceRemoveResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *GraphStorageServiceRemoveResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "remove_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *GraphStorageServiceRemoveResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *GraphStorageServiceRemoveResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("GraphStorageServiceRemoveResult(%+v)", *p) +} + + +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 *DropCPResp, _err error) + // Parameters: + // - Req + BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *BlockingSignResp, _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 *AddTaskRequest) (_r *AddTaskResp, _err error) + // Parameters: + // - Req + StopAdminTask(ctx context.Context, req *StopTaskRequest) (_r *StopTaskResp, _err error) + // Parameters: + // - Req + ClearSpace(ctx context.Context, req *ClearSpaceReq) (_r *ClearSpaceResp, _err error) +} + +type StorageAdminServiceClient struct { + c thrift.TClient + meta thrift.ResponseMeta +} + +func NewStorageAdminServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewStorageAdminServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewStorageAdminServiceClient(c thrift.TClient) *StorageAdminServiceClient { + return &StorageAdminServiceClient{ + c: c, + } +} + +func (p *StorageAdminServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *StorageAdminServiceClient) LastResponseMeta_() thrift.ResponseMeta { + return p.meta +} + +func (p *StorageAdminServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { + p.meta = meta +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) TransLeader(ctx context.Context, req *TransLeaderReq) (_r *AdminExecResp, _err error) { + var _args432 StorageAdminServiceTransLeaderArgs + _args432.Req = req + var _result434 StorageAdminServiceTransLeaderResult + var _meta433 thrift.ResponseMeta + _meta433, _err = p.Client_().Call(ctx, "transLeader", &_args432, &_result434) + p.SetLastResponseMeta_(_meta433) + if _err != nil { + return + } + if _ret435 := _result434.GetSuccess(); _ret435 != nil { + return _ret435, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "transLeader failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddPart(ctx context.Context, req *AddPartReq) (_r *AdminExecResp, _err error) { + var _args436 StorageAdminServiceAddPartArgs + _args436.Req = req + var _result438 StorageAdminServiceAddPartResult + var _meta437 thrift.ResponseMeta + _meta437, _err = p.Client_().Call(ctx, "addPart", &_args436, &_result438) + p.SetLastResponseMeta_(_meta437) + if _err != nil { + return + } + if _ret439 := _result438.GetSuccess(); _ret439 != nil { + return _ret439, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addPart failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddLearner(ctx context.Context, req *AddLearnerReq) (_r *AdminExecResp, _err error) { + var _args440 StorageAdminServiceAddLearnerArgs + _args440.Req = req + var _result442 StorageAdminServiceAddLearnerResult + var _meta441 thrift.ResponseMeta + _meta441, _err = p.Client_().Call(ctx, "addLearner", &_args440, &_result442) + p.SetLastResponseMeta_(_meta441) + if _err != nil { + return + } + if _ret443 := _result442.GetSuccess(); _ret443 != nil { + return _ret443, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addLearner failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) RemovePart(ctx context.Context, req *RemovePartReq) (_r *AdminExecResp, _err error) { + var _args444 StorageAdminServiceRemovePartArgs + _args444.Req = req + var _result446 StorageAdminServiceRemovePartResult + var _meta445 thrift.ResponseMeta + _meta445, _err = p.Client_().Call(ctx, "removePart", &_args444, &_result446) + p.SetLastResponseMeta_(_meta445) + if _err != nil { + return + } + if _ret447 := _result446.GetSuccess(); _ret447 != nil { + return _ret447, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "removePart failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) MemberChange(ctx context.Context, req *MemberChangeReq) (_r *AdminExecResp, _err error) { + var _args448 StorageAdminServiceMemberChangeArgs + _args448.Req = req + var _result450 StorageAdminServiceMemberChangeResult + var _meta449 thrift.ResponseMeta + _meta449, _err = p.Client_().Call(ctx, "memberChange", &_args448, &_result450) + p.SetLastResponseMeta_(_meta449) + if _err != nil { + return + } + if _ret451 := _result450.GetSuccess(); _ret451 != nil { + return _ret451, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "memberChange failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) WaitingForCatchUpData(ctx context.Context, req *CatchUpDataReq) (_r *AdminExecResp, _err error) { + var _args452 StorageAdminServiceWaitingForCatchUpDataArgs + _args452.Req = req + var _result454 StorageAdminServiceWaitingForCatchUpDataResult + var _meta453 thrift.ResponseMeta + _meta453, _err = p.Client_().Call(ctx, "waitingForCatchUpData", &_args452, &_result454) + p.SetLastResponseMeta_(_meta453) + if _err != nil { + return + } + if _ret455 := _result454.GetSuccess(); _ret455 != nil { + return _ret455, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "waitingForCatchUpData failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CreateCheckpoint(ctx context.Context, req *CreateCPRequest) (_r *CreateCPResp, _err error) { + var _args456 StorageAdminServiceCreateCheckpointArgs + _args456.Req = req + var _result458 StorageAdminServiceCreateCheckpointResult + var _meta457 thrift.ResponseMeta + _meta457, _err = p.Client_().Call(ctx, "createCheckpoint", &_args456, &_result458) + p.SetLastResponseMeta_(_meta457) + if _err != nil { + return + } + if _ret459 := _result458.GetSuccess(); _ret459 != nil { + return _ret459, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "createCheckpoint failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) DropCheckpoint(ctx context.Context, req *DropCPRequest) (_r *DropCPResp, _err error) { + var _args460 StorageAdminServiceDropCheckpointArgs + _args460.Req = req + var _result462 StorageAdminServiceDropCheckpointResult + var _meta461 thrift.ResponseMeta + _meta461, _err = p.Client_().Call(ctx, "dropCheckpoint", &_args460, &_result462) + p.SetLastResponseMeta_(_meta461) + if _err != nil { + return + } + if _ret463 := _result462.GetSuccess(); _ret463 != nil { + return _ret463, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "dropCheckpoint failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *BlockingSignResp, _err error) { + var _args464 StorageAdminServiceBlockingWritesArgs + _args464.Req = req + var _result466 StorageAdminServiceBlockingWritesResult + var _meta465 thrift.ResponseMeta + _meta465, _err = p.Client_().Call(ctx, "blockingWrites", &_args464, &_result466) + p.SetLastResponseMeta_(_meta465) + if _err != nil { + return + } + if _ret467 := _result466.GetSuccess(); _ret467 != nil { + return _ret467, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "blockingWrites failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) GetLeaderParts(ctx context.Context, req *GetLeaderReq) (_r *GetLeaderPartsResp, _err error) { + var _args468 StorageAdminServiceGetLeaderPartsArgs + _args468.Req = req + var _result470 StorageAdminServiceGetLeaderPartsResult + var _meta469 thrift.ResponseMeta + _meta469, _err = p.Client_().Call(ctx, "getLeaderParts", &_args468, &_result470) + p.SetLastResponseMeta_(_meta469) + if _err != nil { + return + } + if _ret471 := _result470.GetSuccess(); _ret471 != nil { + return _ret471, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "getLeaderParts failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) CheckPeers(ctx context.Context, req *CheckPeersReq) (_r *AdminExecResp, _err error) { + var _args472 StorageAdminServiceCheckPeersArgs + _args472.Req = req + var _result474 StorageAdminServiceCheckPeersResult + var _meta473 thrift.ResponseMeta + _meta473, _err = p.Client_().Call(ctx, "checkPeers", &_args472, &_result474) + p.SetLastResponseMeta_(_meta473) + if _err != nil { + return + } + if _ret475 := _result474.GetSuccess(); _ret475 != nil { + return _ret475, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "checkPeers failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) AddAdminTask(ctx context.Context, req *AddTaskRequest) (_r *AddTaskResp, _err error) { + var _args476 StorageAdminServiceAddAdminTaskArgs + _args476.Req = req + var _result478 StorageAdminServiceAddAdminTaskResult + var _meta477 thrift.ResponseMeta + _meta477, _err = p.Client_().Call(ctx, "addAdminTask", &_args476, &_result478) + p.SetLastResponseMeta_(_meta477) + if _err != nil { + return + } + if _ret479 := _result478.GetSuccess(); _ret479 != nil { + return _ret479, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "addAdminTask failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) StopAdminTask(ctx context.Context, req *StopTaskRequest) (_r *StopTaskResp, _err error) { + var _args480 StorageAdminServiceStopAdminTaskArgs + _args480.Req = req + var _result482 StorageAdminServiceStopAdminTaskResult + var _meta481 thrift.ResponseMeta + _meta481, _err = p.Client_().Call(ctx, "stopAdminTask", &_args480, &_result482) + p.SetLastResponseMeta_(_meta481) + if _err != nil { + return + } + if _ret483 := _result482.GetSuccess(); _ret483 != nil { + return _ret483, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "stopAdminTask failed: unknown result") +} + +// Parameters: +// - Req +func (p *StorageAdminServiceClient) ClearSpace(ctx context.Context, req *ClearSpaceReq) (_r *ClearSpaceResp, _err error) { + var _args484 StorageAdminServiceClearSpaceArgs + _args484.Req = req + var _result486 StorageAdminServiceClearSpaceResult + var _meta485 thrift.ResponseMeta + _meta485, _err = p.Client_().Call(ctx, "clearSpace", &_args484, &_result486) + p.SetLastResponseMeta_(_meta485) + if _err != nil { + return + } + if _ret487 := _result486.GetSuccess(); _ret487 != nil { + return _ret487, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "clearSpace failed: unknown result") +} + +type StorageAdminServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler StorageAdminService +} + +func (p *StorageAdminServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *StorageAdminServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *StorageAdminServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { + + self488 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self488.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} + self488.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} + self488.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} + self488.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} + self488.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} + self488.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} + self488.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} + self488.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} + self488.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} + self488.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} + self488.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} + self488.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} + self488.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} + self488.processorMap["clearSpace"] = &storageAdminServiceProcessorClearSpace{handler:handler} +return self488 +} + +func (p *StorageAdminServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { return false, thrift.WrapTException(err2) } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x489 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x489.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x489 + +} + +type storageAdminServiceProcessorTransLeader struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorTransLeader) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err490 error + args := StorageAdminServiceTransLeaderArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "transLeader", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceTransLeaderResult{} + if retval, err2 := p.handler.TransLeader(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc491 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing transLeader: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "transLeader", thrift.EXCEPTION, seqId); err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if err2 := _exc491.Write(ctx, oprot); _write_err490 == nil && err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err490 == nil && err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err490 == nil && err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if _write_err490 != nil { + return false, thrift.WrapTException(_write_err490) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "transLeader", thrift.REPLY, seqId); err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err490 == nil && err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err490 == nil && err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err490 == nil && err2 != nil { + _write_err490 = thrift.WrapTException(err2) + } + if _write_err490 != nil { + return false, thrift.WrapTException(_write_err490) + } + return true, err +} + +type storageAdminServiceProcessorAddPart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddPart) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err492 error + args := StorageAdminServiceAddPartArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addPart", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceAddPartResult{} + if retval, err2 := p.handler.AddPart(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc493 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addPart: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addPart", thrift.EXCEPTION, seqId); err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if err2 := _exc493.Write(ctx, oprot); _write_err492 == nil && err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err492 == nil && err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err492 == nil && err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if _write_err492 != nil { + return false, thrift.WrapTException(_write_err492) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addPart", thrift.REPLY, seqId); err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err492 == nil && err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err492 == nil && err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err492 == nil && err2 != nil { + _write_err492 = thrift.WrapTException(err2) + } + if _write_err492 != nil { + return false, thrift.WrapTException(_write_err492) + } + return true, err +} + +type storageAdminServiceProcessorAddLearner struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddLearner) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err494 error + args := StorageAdminServiceAddLearnerArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addLearner", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceAddLearnerResult{} + if retval, err2 := p.handler.AddLearner(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc495 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addLearner: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addLearner", thrift.EXCEPTION, seqId); err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if err2 := _exc495.Write(ctx, oprot); _write_err494 == nil && err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err494 == nil && err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err494 == nil && err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if _write_err494 != nil { + return false, thrift.WrapTException(_write_err494) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addLearner", thrift.REPLY, seqId); err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err494 == nil && err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err494 == nil && err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err494 == nil && err2 != nil { + _write_err494 = thrift.WrapTException(err2) + } + if _write_err494 != nil { + return false, thrift.WrapTException(_write_err494) + } + return true, err +} + +type storageAdminServiceProcessorRemovePart struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorRemovePart) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err496 error + args := StorageAdminServiceRemovePartArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "removePart", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceRemovePartResult{} + if retval, err2 := p.handler.RemovePart(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc497 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing removePart: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "removePart", thrift.EXCEPTION, seqId); err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if err2 := _exc497.Write(ctx, oprot); _write_err496 == nil && err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err496 == nil && err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err496 == nil && err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if _write_err496 != nil { + return false, thrift.WrapTException(_write_err496) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "removePart", thrift.REPLY, seqId); err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err496 == nil && err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err496 == nil && err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err496 == nil && err2 != nil { + _write_err496 = thrift.WrapTException(err2) + } + if _write_err496 != nil { + return false, thrift.WrapTException(_write_err496) + } + return true, err +} + +type storageAdminServiceProcessorMemberChange struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorMemberChange) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err498 error + args := StorageAdminServiceMemberChangeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "memberChange", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceMemberChangeResult{} + if retval, err2 := p.handler.MemberChange(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc499 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing memberChange: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "memberChange", thrift.EXCEPTION, seqId); err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if err2 := _exc499.Write(ctx, oprot); _write_err498 == nil && err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err498 == nil && err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err498 == nil && err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if _write_err498 != nil { + return false, thrift.WrapTException(_write_err498) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "memberChange", thrift.REPLY, seqId); err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err498 == nil && err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err498 == nil && err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err498 == nil && err2 != nil { + _write_err498 = thrift.WrapTException(err2) + } + if _write_err498 != nil { + return false, thrift.WrapTException(_write_err498) + } + return true, err +} + +type storageAdminServiceProcessorWaitingForCatchUpData struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorWaitingForCatchUpData) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err500 error + args := StorageAdminServiceWaitingForCatchUpDataArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "waitingForCatchUpData", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceWaitingForCatchUpDataResult{} + if retval, err2 := p.handler.WaitingForCatchUpData(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc501 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing waitingForCatchUpData: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "waitingForCatchUpData", thrift.EXCEPTION, seqId); err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if err2 := _exc501.Write(ctx, oprot); _write_err500 == nil && err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err500 == nil && err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err500 == nil && err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if _write_err500 != nil { + return false, thrift.WrapTException(_write_err500) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "waitingForCatchUpData", thrift.REPLY, seqId); err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err500 == nil && err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err500 == nil && err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err500 == nil && err2 != nil { + _write_err500 = thrift.WrapTException(err2) + } + if _write_err500 != nil { + return false, thrift.WrapTException(_write_err500) + } + return true, err +} + +type storageAdminServiceProcessorCreateCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCreateCheckpoint) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err502 error + args := StorageAdminServiceCreateCheckpointArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "createCheckpoint", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceCreateCheckpointResult{} + if retval, err2 := p.handler.CreateCheckpoint(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc503 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing createCheckpoint: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "createCheckpoint", thrift.EXCEPTION, seqId); err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if err2 := _exc503.Write(ctx, oprot); _write_err502 == nil && err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err502 == nil && err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err502 == nil && err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if _write_err502 != nil { + return false, thrift.WrapTException(_write_err502) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "createCheckpoint", thrift.REPLY, seqId); err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err502 == nil && err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err502 == nil && err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err502 == nil && err2 != nil { + _write_err502 = thrift.WrapTException(err2) + } + if _write_err502 != nil { + return false, thrift.WrapTException(_write_err502) + } + return true, err +} + +type storageAdminServiceProcessorDropCheckpoint struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorDropCheckpoint) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err504 error + args := StorageAdminServiceDropCheckpointArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "dropCheckpoint", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceDropCheckpointResult{} + if retval, err2 := p.handler.DropCheckpoint(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc505 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing dropCheckpoint: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "dropCheckpoint", thrift.EXCEPTION, seqId); err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if err2 := _exc505.Write(ctx, oprot); _write_err504 == nil && err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err504 == nil && err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err504 == nil && err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if _write_err504 != nil { + return false, thrift.WrapTException(_write_err504) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "dropCheckpoint", thrift.REPLY, seqId); err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err504 == nil && err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err504 == nil && err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err504 == nil && err2 != nil { + _write_err504 = thrift.WrapTException(err2) + } + if _write_err504 != nil { + return false, thrift.WrapTException(_write_err504) + } + return true, err +} + +type storageAdminServiceProcessorBlockingWrites struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorBlockingWrites) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err506 error + args := StorageAdminServiceBlockingWritesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "blockingWrites", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceBlockingWritesResult{} + if retval, err2 := p.handler.BlockingWrites(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc507 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing blockingWrites: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "blockingWrites", thrift.EXCEPTION, seqId); err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if err2 := _exc507.Write(ctx, oprot); _write_err506 == nil && err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err506 == nil && err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err506 == nil && err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if _write_err506 != nil { + return false, thrift.WrapTException(_write_err506) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "blockingWrites", thrift.REPLY, seqId); err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err506 == nil && err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err506 == nil && err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err506 == nil && err2 != nil { + _write_err506 = thrift.WrapTException(err2) + } + if _write_err506 != nil { + return false, thrift.WrapTException(_write_err506) + } + return true, err +} + +type storageAdminServiceProcessorGetLeaderParts struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorGetLeaderParts) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err508 error + args := StorageAdminServiceGetLeaderPartsArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "getLeaderParts", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceGetLeaderPartsResult{} + if retval, err2 := p.handler.GetLeaderParts(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc509 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing getLeaderParts: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "getLeaderParts", thrift.EXCEPTION, seqId); err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if err2 := _exc509.Write(ctx, oprot); _write_err508 == nil && err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err508 == nil && err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err508 == nil && err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if _write_err508 != nil { + return false, thrift.WrapTException(_write_err508) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "getLeaderParts", thrift.REPLY, seqId); err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err508 == nil && err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err508 == nil && err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err508 == nil && err2 != nil { + _write_err508 = thrift.WrapTException(err2) + } + if _write_err508 != nil { + return false, thrift.WrapTException(_write_err508) + } + return true, err +} + +type storageAdminServiceProcessorCheckPeers struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorCheckPeers) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err510 error + args := StorageAdminServiceCheckPeersArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "checkPeers", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceCheckPeersResult{} + if retval, err2 := p.handler.CheckPeers(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc511 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing checkPeers: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "checkPeers", thrift.EXCEPTION, seqId); err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if err2 := _exc511.Write(ctx, oprot); _write_err510 == nil && err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err510 == nil && err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err510 == nil && err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if _write_err510 != nil { + return false, thrift.WrapTException(_write_err510) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "checkPeers", thrift.REPLY, seqId); err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err510 == nil && err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err510 == nil && err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err510 == nil && err2 != nil { + _write_err510 = thrift.WrapTException(err2) + } + if _write_err510 != nil { + return false, thrift.WrapTException(_write_err510) + } + return true, err +} + +type storageAdminServiceProcessorAddAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorAddAdminTask) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err512 error + args := StorageAdminServiceAddAdminTaskArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "addAdminTask", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceAddAdminTaskResult{} + if retval, err2 := p.handler.AddAdminTask(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc513 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing addAdminTask: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "addAdminTask", thrift.EXCEPTION, seqId); err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if err2 := _exc513.Write(ctx, oprot); _write_err512 == nil && err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err512 == nil && err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err512 == nil && err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if _write_err512 != nil { + return false, thrift.WrapTException(_write_err512) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "addAdminTask", thrift.REPLY, seqId); err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err512 == nil && err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err512 == nil && err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err512 == nil && err2 != nil { + _write_err512 = thrift.WrapTException(err2) + } + if _write_err512 != nil { + return false, thrift.WrapTException(_write_err512) + } + return true, err +} + +type storageAdminServiceProcessorStopAdminTask struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorStopAdminTask) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err514 error + args := StorageAdminServiceStopAdminTaskArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "stopAdminTask", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceStopAdminTaskResult{} + if retval, err2 := p.handler.StopAdminTask(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc515 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing stopAdminTask: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "stopAdminTask", thrift.EXCEPTION, seqId); err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if err2 := _exc515.Write(ctx, oprot); _write_err514 == nil && err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err514 == nil && err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err514 == nil && err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if _write_err514 != nil { + return false, thrift.WrapTException(_write_err514) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "stopAdminTask", thrift.REPLY, seqId); err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err514 == nil && err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err514 == nil && err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err514 == nil && err2 != nil { + _write_err514 = thrift.WrapTException(err2) + } + if _write_err514 != nil { + return false, thrift.WrapTException(_write_err514) + } + return true, err +} + +type storageAdminServiceProcessorClearSpace struct { + handler StorageAdminService +} + +func (p *storageAdminServiceProcessorClearSpace) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err516 error + args := StorageAdminServiceClearSpaceArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "clearSpace", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := StorageAdminServiceClearSpaceResult{} + if retval, err2 := p.handler.ClearSpace(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc517 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing clearSpace: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "clearSpace", thrift.EXCEPTION, seqId); err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if err2 := _exc517.Write(ctx, oprot); _write_err516 == nil && err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err516 == nil && err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err516 == nil && err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if _write_err516 != nil { + return false, thrift.WrapTException(_write_err516) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "clearSpace", thrift.REPLY, seqId); err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err516 == nil && err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err516 == nil && err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err516 == nil && err2 != nil { + _write_err516 = thrift.WrapTException(err2) + } + if _write_err516 != nil { + return false, thrift.WrapTException(_write_err516) + } + return true, err +} + + +// 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &TransLeaderReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "transLeader_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceTransLeaderArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceTransLeaderResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "transLeader_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceTransLeaderResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddPartReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addPart_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceAddPartArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddPartResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addPart_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceAddPartResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddLearnerReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addLearner_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceAddLearnerArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddLearnerResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addLearner_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceAddLearnerResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &RemovePartReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "removePart_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceRemovePartArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceRemovePartResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "removePart_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceRemovePartResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &MemberChangeReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "memberChange_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceMemberChangeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceMemberChangeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "memberChange_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceMemberChangeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CatchUpDataReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "waitingForCatchUpData_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "waitingForCatchUpData_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceWaitingForCatchUpDataResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CreateCPRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createCheckpoint_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &CreateCPResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "createCheckpoint_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceCreateCheckpointResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &DropCPRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropCheckpoint_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceDropCheckpointArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *DropCPResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceDropCheckpointResult() *StorageAdminServiceDropCheckpointResult { + return &StorageAdminServiceDropCheckpointResult{} +} + +var StorageAdminServiceDropCheckpointResult_Success_DEFAULT *DropCPResp +func (p *StorageAdminServiceDropCheckpointResult) GetSuccess() *DropCPResp { + if !p.IsSetSuccess() { + return StorageAdminServiceDropCheckpointResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceDropCheckpointResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceDropCheckpointResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &DropCPResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceDropCheckpointResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "dropCheckpoint_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceDropCheckpointResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &BlockingSignRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "blockingWrites_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceBlockingWritesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *BlockingSignResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceBlockingWritesResult() *StorageAdminServiceBlockingWritesResult { + return &StorageAdminServiceBlockingWritesResult{} +} + +var StorageAdminServiceBlockingWritesResult_Success_DEFAULT *BlockingSignResp +func (p *StorageAdminServiceBlockingWritesResult) GetSuccess() *BlockingSignResp { + if !p.IsSetSuccess() { + return StorageAdminServiceBlockingWritesResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceBlockingWritesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceBlockingWritesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &BlockingSignResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceBlockingWritesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "blockingWrites_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceBlockingWritesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &GetLeaderReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getLeaderParts_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &GetLeaderPartsResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "getLeaderParts_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceGetLeaderPartsResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &CheckPeersReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "checkPeers_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceCheckPeersArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AdminExecResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceCheckPeersResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "checkPeers_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceCheckPeersResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *AddTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceAddAdminTaskArgs() *StorageAdminServiceAddAdminTaskArgs { + return &StorageAdminServiceAddAdminTaskArgs{} +} + +var StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT *AddTaskRequest +func (p *StorageAdminServiceAddAdminTaskArgs) GetReq() *AddTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceAddAdminTaskArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &AddTaskRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addAdminTask_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *AddTaskResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceAddAdminTaskResult() *StorageAdminServiceAddAdminTaskResult { + return &StorageAdminServiceAddAdminTaskResult{} +} + +var StorageAdminServiceAddAdminTaskResult_Success_DEFAULT *AddTaskResp +func (p *StorageAdminServiceAddAdminTaskResult) GetSuccess() *AddTaskResp { + if !p.IsSetSuccess() { + return StorageAdminServiceAddAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceAddAdminTaskResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &AddTaskResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "addAdminTask_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceAddAdminTaskResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *StopTaskRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceStopAdminTaskArgs() *StorageAdminServiceStopAdminTaskArgs { + return &StorageAdminServiceStopAdminTaskArgs{} +} + +var StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT *StopTaskRequest +func (p *StorageAdminServiceStopAdminTaskArgs) GetReq() *StopTaskRequest { + if !p.IsSetReq() { + return StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceStopAdminTaskArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &StopTaskRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "stopAdminTask_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); 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 *StopTaskResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceStopAdminTaskResult() *StorageAdminServiceStopAdminTaskResult { + return &StorageAdminServiceStopAdminTaskResult{} +} + +var StorageAdminServiceStopAdminTaskResult_Success_DEFAULT *StopTaskResp +func (p *StorageAdminServiceStopAdminTaskResult) GetSuccess() *StopTaskResp { + if !p.IsSetSuccess() { + return StorageAdminServiceStopAdminTaskResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceStopAdminTaskResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &StopTaskResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "stopAdminTask_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceStopAdminTaskResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); 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) +} + +// Attributes: +// - Req +type StorageAdminServiceClearSpaceArgs struct { + Req *ClearSpaceReq `thrift:"req,1" db:"req" json:"req"` +} + +func NewStorageAdminServiceClearSpaceArgs() *StorageAdminServiceClearSpaceArgs { + return &StorageAdminServiceClearSpaceArgs{} +} + +var StorageAdminServiceClearSpaceArgs_Req_DEFAULT *ClearSpaceReq +func (p *StorageAdminServiceClearSpaceArgs) GetReq() *ClearSpaceReq { + if !p.IsSetReq() { + return StorageAdminServiceClearSpaceArgs_Req_DEFAULT + } +return p.Req +} +func (p *StorageAdminServiceClearSpaceArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *StorageAdminServiceClearSpaceArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceClearSpaceArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ClearSpaceReq{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *StorageAdminServiceClearSpaceArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "clearSpace_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceClearSpaceArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *StorageAdminServiceClearSpaceArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceClearSpaceArgs(%+v)", *p) +} + +// Attributes: +// - Success +type StorageAdminServiceClearSpaceResult struct { + Success *ClearSpaceResp `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewStorageAdminServiceClearSpaceResult() *StorageAdminServiceClearSpaceResult { + return &StorageAdminServiceClearSpaceResult{} +} + +var StorageAdminServiceClearSpaceResult_Success_DEFAULT *ClearSpaceResp +func (p *StorageAdminServiceClearSpaceResult) GetSuccess() *ClearSpaceResp { + if !p.IsSetSuccess() { + return StorageAdminServiceClearSpaceResult_Success_DEFAULT + } +return p.Success +} +func (p *StorageAdminServiceClearSpaceResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *StorageAdminServiceClearSpaceResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *StorageAdminServiceClearSpaceResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ClearSpaceResp{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *StorageAdminServiceClearSpaceResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "clearSpace_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *StorageAdminServiceClearSpaceResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *StorageAdminServiceClearSpaceResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("StorageAdminServiceClearSpaceResult(%+v)", *p) +} + + +type InternalStorageService interface { + // Parameters: + // - Req + ChainAddEdges(ctx context.Context, req *ChainAddEdgesRequest) (_r *ExecResponse, _err error) + // Parameters: + // - Req + ChainUpdateEdge(ctx context.Context, req *ChainUpdateEdgeRequest) (_r *UpdateResponse, _err error) + // Parameters: + // - Req + ChainDeleteEdges(ctx context.Context, req *ChainDeleteEdgesRequest) (_r *ExecResponse, _err error) +} + +type InternalStorageServiceClient struct { + c thrift.TClient + meta thrift.ResponseMeta +} + +func NewInternalStorageServiceClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *InternalStorageServiceClient { + return &InternalStorageServiceClient{ + c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)), + } +} + +func NewInternalStorageServiceClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *InternalStorageServiceClient { + return &InternalStorageServiceClient{ + c: thrift.NewTStandardClient(iprot, oprot), + } +} + +func NewInternalStorageServiceClient(c thrift.TClient) *InternalStorageServiceClient { + return &InternalStorageServiceClient{ + c: c, + } +} + +func (p *InternalStorageServiceClient) Client_() thrift.TClient { + return p.c +} + +func (p *InternalStorageServiceClient) LastResponseMeta_() thrift.ResponseMeta { + return p.meta +} + +func (p *InternalStorageServiceClient) SetLastResponseMeta_(meta thrift.ResponseMeta) { + p.meta = meta +} + +// Parameters: +// - Req +func (p *InternalStorageServiceClient) ChainAddEdges(ctx context.Context, req *ChainAddEdgesRequest) (_r *ExecResponse, _err error) { + var _args602 InternalStorageServiceChainAddEdgesArgs + _args602.Req = req + var _result604 InternalStorageServiceChainAddEdgesResult + var _meta603 thrift.ResponseMeta + _meta603, _err = p.Client_().Call(ctx, "chainAddEdges", &_args602, &_result604) + p.SetLastResponseMeta_(_meta603) + if _err != nil { + return + } + if _ret605 := _result604.GetSuccess(); _ret605 != nil { + return _ret605, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "chainAddEdges failed: unknown result") +} + +// Parameters: +// - Req +func (p *InternalStorageServiceClient) ChainUpdateEdge(ctx context.Context, req *ChainUpdateEdgeRequest) (_r *UpdateResponse, _err error) { + var _args606 InternalStorageServiceChainUpdateEdgeArgs + _args606.Req = req + var _result608 InternalStorageServiceChainUpdateEdgeResult + var _meta607 thrift.ResponseMeta + _meta607, _err = p.Client_().Call(ctx, "chainUpdateEdge", &_args606, &_result608) + p.SetLastResponseMeta_(_meta607) + if _err != nil { + return + } + if _ret609 := _result608.GetSuccess(); _ret609 != nil { + return _ret609, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "chainUpdateEdge failed: unknown result") +} + +// Parameters: +// - Req +func (p *InternalStorageServiceClient) ChainDeleteEdges(ctx context.Context, req *ChainDeleteEdgesRequest) (_r *ExecResponse, _err error) { + var _args610 InternalStorageServiceChainDeleteEdgesArgs + _args610.Req = req + var _result612 InternalStorageServiceChainDeleteEdgesResult + var _meta611 thrift.ResponseMeta + _meta611, _err = p.Client_().Call(ctx, "chainDeleteEdges", &_args610, &_result612) + p.SetLastResponseMeta_(_meta611) + if _err != nil { + return + } + if _ret613 := _result612.GetSuccess(); _ret613 != nil { + return _ret613, nil + } + return nil, thrift.NewTApplicationException(thrift.MISSING_RESULT, "chainDeleteEdges failed: unknown result") +} + +type InternalStorageServiceProcessor struct { + processorMap map[string]thrift.TProcessorFunction + handler InternalStorageService +} + +func (p *InternalStorageServiceProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) { + p.processorMap[key] = processor +} + +func (p *InternalStorageServiceProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) { + processor, ok = p.processorMap[key] + return processor, ok +} + +func (p *InternalStorageServiceProcessor) ProcessorMap() map[string]thrift.TProcessorFunction { + return p.processorMap +} + +func NewInternalStorageServiceProcessor(handler InternalStorageService) *InternalStorageServiceProcessor { + + self614 := &InternalStorageServiceProcessor{handler:handler, processorMap:make(map[string]thrift.TProcessorFunction)} + self614.processorMap["chainAddEdges"] = &internalStorageServiceProcessorChainAddEdges{handler:handler} + self614.processorMap["chainUpdateEdge"] = &internalStorageServiceProcessorChainUpdateEdge{handler:handler} + self614.processorMap["chainDeleteEdges"] = &internalStorageServiceProcessorChainDeleteEdges{handler:handler} +return self614 +} + +func (p *InternalStorageServiceProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + name, _, seqId, err2 := iprot.ReadMessageBegin(ctx) + if err2 != nil { return false, thrift.WrapTException(err2) } + if processor, ok := p.GetProcessorFunction(name); ok { + return processor.Process(ctx, seqId, iprot, oprot) + } + iprot.Skip(ctx, thrift.STRUCT) + iprot.ReadMessageEnd(ctx) + x615 := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function " + name) + oprot.WriteMessageBegin(ctx, name, thrift.EXCEPTION, seqId) + x615.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, x615 + +} + +type internalStorageServiceProcessorChainAddEdges struct { + handler InternalStorageService +} + +func (p *internalStorageServiceProcessorChainAddEdges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err616 error + args := InternalStorageServiceChainAddEdgesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "chainAddEdges", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := InternalStorageServiceChainAddEdgesResult{} + if retval, err2 := p.handler.ChainAddEdges(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc617 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainAddEdges: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "chainAddEdges", thrift.EXCEPTION, seqId); err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if err2 := _exc617.Write(ctx, oprot); _write_err616 == nil && err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err616 == nil && err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err616 == nil && err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if _write_err616 != nil { + return false, thrift.WrapTException(_write_err616) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "chainAddEdges", thrift.REPLY, seqId); err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err616 == nil && err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err616 == nil && err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err616 == nil && err2 != nil { + _write_err616 = thrift.WrapTException(err2) + } + if _write_err616 != nil { + return false, thrift.WrapTException(_write_err616) + } + return true, err +} + +type internalStorageServiceProcessorChainUpdateEdge struct { + handler InternalStorageService +} + +func (p *internalStorageServiceProcessorChainUpdateEdge) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err618 error + args := InternalStorageServiceChainUpdateEdgeArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "chainUpdateEdge", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := InternalStorageServiceChainUpdateEdgeResult{} + if retval, err2 := p.handler.ChainUpdateEdge(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc619 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainUpdateEdge: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "chainUpdateEdge", thrift.EXCEPTION, seqId); err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if err2 := _exc619.Write(ctx, oprot); _write_err618 == nil && err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err618 == nil && err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err618 == nil && err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if _write_err618 != nil { + return false, thrift.WrapTException(_write_err618) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "chainUpdateEdge", thrift.REPLY, seqId); err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err618 == nil && err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err618 == nil && err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err618 == nil && err2 != nil { + _write_err618 = thrift.WrapTException(err2) + } + if _write_err618 != nil { + return false, thrift.WrapTException(_write_err618) + } + return true, err +} + +type internalStorageServiceProcessorChainDeleteEdges struct { + handler InternalStorageService +} + +func (p *internalStorageServiceProcessorChainDeleteEdges) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + var _write_err620 error + args := InternalStorageServiceChainDeleteEdgesArgs{} + if err2 := args.Read(ctx, iprot); err2 != nil { + iprot.ReadMessageEnd(ctx) + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err2.Error()) + oprot.WriteMessageBegin(ctx, "chainDeleteEdges", thrift.EXCEPTION, seqId) + x.Write(ctx, oprot) + oprot.WriteMessageEnd(ctx) + oprot.Flush(ctx) + return false, thrift.WrapTException(err2) + } + iprot.ReadMessageEnd(ctx) + + tickerCancel := func() {} + // Start a goroutine to do server side connectivity check. + if thrift.ServerConnectivityCheckInterval > 0 { + var cancel context.CancelCauseFunc + ctx, cancel = context.WithCancelCause(ctx) + defer cancel(nil) + var tickerCtx context.Context + tickerCtx, tickerCancel = context.WithCancel(context.Background()) + defer tickerCancel() + go func(ctx context.Context, cancel context.CancelCauseFunc) { + ticker := time.NewTicker(thrift.ServerConnectivityCheckInterval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if !iprot.Transport().IsOpen() { + cancel(thrift.ErrAbandonRequest) + return + } + } + } + }(tickerCtx, cancel) + } + + result := InternalStorageServiceChainDeleteEdgesResult{} + if retval, err2 := p.handler.ChainDeleteEdges(ctx, args.Req); err2 != nil { + tickerCancel() + err = thrift.WrapTException(err2) + if errors.Is(err2, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err2) + } + if errors.Is(err2, context.Canceled) { + if err := context.Cause(ctx); errors.Is(err, thrift.ErrAbandonRequest) { + return false, thrift.WrapTException(err) + } + } + _exc621 := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing chainDeleteEdges: " + err2.Error()) + if err2 := oprot.WriteMessageBegin(ctx, "chainDeleteEdges", thrift.EXCEPTION, seqId); err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if err2 := _exc621.Write(ctx, oprot); _write_err620 == nil && err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err620 == nil && err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err620 == nil && err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if _write_err620 != nil { + return false, thrift.WrapTException(_write_err620) + } + return true, err + } else { + result.Success = retval + } + tickerCancel() + if err2 := oprot.WriteMessageBegin(ctx, "chainDeleteEdges", thrift.REPLY, seqId); err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if err2 := result.Write(ctx, oprot); _write_err620 == nil && err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if err2 := oprot.WriteMessageEnd(ctx); _write_err620 == nil && err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if err2 := oprot.Flush(ctx); _write_err620 == nil && err2 != nil { + _write_err620 = thrift.WrapTException(err2) + } + if _write_err620 != nil { + return false, thrift.WrapTException(_write_err620) + } + return true, err +} + + +// HELPER FUNCTIONS AND STRUCTURES + +// Attributes: +// - Req +type InternalStorageServiceChainAddEdgesArgs struct { + Req *ChainAddEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewInternalStorageServiceChainAddEdgesArgs() *InternalStorageServiceChainAddEdgesArgs { + return &InternalStorageServiceChainAddEdgesArgs{} +} + +var InternalStorageServiceChainAddEdgesArgs_Req_DEFAULT *ChainAddEdgesRequest +func (p *InternalStorageServiceChainAddEdgesArgs) GetReq() *ChainAddEdgesRequest { + if !p.IsSetReq() { + return InternalStorageServiceChainAddEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *InternalStorageServiceChainAddEdgesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *InternalStorageServiceChainAddEdgesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *InternalStorageServiceChainAddEdgesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ChainAddEdgesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *InternalStorageServiceChainAddEdgesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainAddEdges_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *InternalStorageServiceChainAddEdgesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *InternalStorageServiceChainAddEdgesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InternalStorageServiceChainAddEdgesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type InternalStorageServiceChainAddEdgesResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewInternalStorageServiceChainAddEdgesResult() *InternalStorageServiceChainAddEdgesResult { + return &InternalStorageServiceChainAddEdgesResult{} +} + +var InternalStorageServiceChainAddEdgesResult_Success_DEFAULT *ExecResponse +func (p *InternalStorageServiceChainAddEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return InternalStorageServiceChainAddEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *InternalStorageServiceChainAddEdgesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *InternalStorageServiceChainAddEdgesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *InternalStorageServiceChainAddEdgesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *InternalStorageServiceChainAddEdgesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainAddEdges_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *InternalStorageServiceChainAddEdgesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *InternalStorageServiceChainAddEdgesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InternalStorageServiceChainAddEdgesResult(%+v)", *p) +} + +// Attributes: +// - Req +type InternalStorageServiceChainUpdateEdgeArgs struct { + Req *ChainUpdateEdgeRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewInternalStorageServiceChainUpdateEdgeArgs() *InternalStorageServiceChainUpdateEdgeArgs { + return &InternalStorageServiceChainUpdateEdgeArgs{} +} + +var InternalStorageServiceChainUpdateEdgeArgs_Req_DEFAULT *ChainUpdateEdgeRequest +func (p *InternalStorageServiceChainUpdateEdgeArgs) GetReq() *ChainUpdateEdgeRequest { + if !p.IsSetReq() { + return InternalStorageServiceChainUpdateEdgeArgs_Req_DEFAULT + } +return p.Req +} +func (p *InternalStorageServiceChainUpdateEdgeArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *InternalStorageServiceChainUpdateEdgeArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *InternalStorageServiceChainUpdateEdgeArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ChainUpdateEdgeRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *InternalStorageServiceChainUpdateEdgeArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainUpdateEdge_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *InternalStorageServiceChainUpdateEdgeArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *InternalStorageServiceChainUpdateEdgeArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InternalStorageServiceChainUpdateEdgeArgs(%+v)", *p) +} + +// Attributes: +// - Success +type InternalStorageServiceChainUpdateEdgeResult struct { + Success *UpdateResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewInternalStorageServiceChainUpdateEdgeResult() *InternalStorageServiceChainUpdateEdgeResult { + return &InternalStorageServiceChainUpdateEdgeResult{} +} + +var InternalStorageServiceChainUpdateEdgeResult_Success_DEFAULT *UpdateResponse +func (p *InternalStorageServiceChainUpdateEdgeResult) GetSuccess() *UpdateResponse { + if !p.IsSetSuccess() { + return InternalStorageServiceChainUpdateEdgeResult_Success_DEFAULT + } +return p.Success +} +func (p *InternalStorageServiceChainUpdateEdgeResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *InternalStorageServiceChainUpdateEdgeResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *InternalStorageServiceChainUpdateEdgeResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &UpdateResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *InternalStorageServiceChainUpdateEdgeResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainUpdateEdge_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *InternalStorageServiceChainUpdateEdgeResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *InternalStorageServiceChainUpdateEdgeResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InternalStorageServiceChainUpdateEdgeResult(%+v)", *p) +} + +// Attributes: +// - Req +type InternalStorageServiceChainDeleteEdgesArgs struct { + Req *ChainDeleteEdgesRequest `thrift:"req,1" db:"req" json:"req"` +} + +func NewInternalStorageServiceChainDeleteEdgesArgs() *InternalStorageServiceChainDeleteEdgesArgs { + return &InternalStorageServiceChainDeleteEdgesArgs{} +} + +var InternalStorageServiceChainDeleteEdgesArgs_Req_DEFAULT *ChainDeleteEdgesRequest +func (p *InternalStorageServiceChainDeleteEdgesArgs) GetReq() *ChainDeleteEdgesRequest { + if !p.IsSetReq() { + return InternalStorageServiceChainDeleteEdgesArgs_Req_DEFAULT + } +return p.Req +} +func (p *InternalStorageServiceChainDeleteEdgesArgs) IsSetReq() bool { + return p.Req != nil +} + +func (p *InternalStorageServiceChainDeleteEdgesArgs) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField1(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *InternalStorageServiceChainDeleteEdgesArgs) ReadField1(ctx context.Context, iprot thrift.TProtocol) error { + p.Req = &ChainDeleteEdgesRequest{} + if err := p.Req.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) + } + return nil +} + +func (p *InternalStorageServiceChainDeleteEdgesArgs) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainDeleteEdges_args"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField1(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *InternalStorageServiceChainDeleteEdgesArgs) writeField1(ctx context.Context, oprot thrift.TProtocol) (err error) { + if err := oprot.WriteFieldBegin(ctx, "req", thrift.STRUCT, 1); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } + if err := p.Req.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } + return err +} + +func (p *InternalStorageServiceChainDeleteEdgesArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InternalStorageServiceChainDeleteEdgesArgs(%+v)", *p) +} + +// Attributes: +// - Success +type InternalStorageServiceChainDeleteEdgesResult struct { + Success *ExecResponse `thrift:"success,0" db:"success" json:"success,omitempty"` +} + +func NewInternalStorageServiceChainDeleteEdgesResult() *InternalStorageServiceChainDeleteEdgesResult { + return &InternalStorageServiceChainDeleteEdgesResult{} +} + +var InternalStorageServiceChainDeleteEdgesResult_Success_DEFAULT *ExecResponse +func (p *InternalStorageServiceChainDeleteEdgesResult) GetSuccess() *ExecResponse { + if !p.IsSetSuccess() { + return InternalStorageServiceChainDeleteEdgesResult_Success_DEFAULT + } +return p.Success +} +func (p *InternalStorageServiceChainDeleteEdgesResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *InternalStorageServiceChainDeleteEdgesResult) Read(ctx context.Context, iprot thrift.TProtocol) error { + if _, err := iprot.ReadStructBegin(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) + } + + + for { + _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin(ctx) + if err != nil { + return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) + } + if fieldTypeId == thrift.STOP { break; } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err := p.ReadField0(ctx, iprot); err != nil { + return err + } + } else { + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + default: + if err := iprot.Skip(ctx, fieldTypeId); err != nil { + return err + } + } + if err := iprot.ReadFieldEnd(ctx); err != nil { + return err + } + } + if err := iprot.ReadStructEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + } + return nil +} + +func (p *InternalStorageServiceChainDeleteEdgesResult) ReadField0(ctx context.Context, iprot thrift.TProtocol) error { + p.Success = &ExecResponse{} + if err := p.Success.Read(ctx, iprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) + } + return nil +} + +func (p *InternalStorageServiceChainDeleteEdgesResult) Write(ctx context.Context, oprot thrift.TProtocol) error { + if err := oprot.WriteStructBegin(ctx, "chainDeleteEdges_result"); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } + if p != nil { + if err := p.writeField0(ctx, oprot); err != nil { return err } + } + if err := oprot.WriteFieldStop(ctx); err != nil { + return thrift.PrependError("write field stop error: ", err) } + if err := oprot.WriteStructEnd(ctx); err != nil { + return thrift.PrependError("write struct stop error: ", err) } + return nil +} + +func (p *InternalStorageServiceChainDeleteEdgesResult) writeField0(ctx context.Context, oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err := oprot.WriteFieldBegin(ctx, "success", thrift.STRUCT, 0); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } + if err := p.Success.Write(ctx, oprot); err != nil { + return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) + } + if err := oprot.WriteFieldEnd(ctx); err != nil { + return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } + } + return err +} + +func (p *InternalStorageServiceChainDeleteEdgesResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("InternalStorageServiceChainDeleteEdgesResult(%+v)", *p) +} + + diff --git a/nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go b/nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go new file mode 100755 index 00000000..9f9d0cc1 --- /dev/null +++ b/nebula/storage/storage_admin_service-remote/storage_admin_service-remote.go @@ -0,0 +1,521 @@ +// Code generated by Thrift Compiler (0.19.0). DO NOT EDIT. + +package main + +import ( + "context" + "flag" + "fmt" + "math" + "net" + "net/url" + "os" + "strconv" + "strings" + thrift "github.com/apache/thrift/lib/go/thrift" + "github.com/vesoft-inc/nebula-go/v3/nebula" + "github.com/vesoft-inc/nebula-go/v3/nebula/meta" + "github.com/vesoft-inc/nebula-go/v3/nebula/storage" +) + +var _ = nebula.GoUnusedProtection__ +var _ = meta.GoUnusedProtection__ +var _ = storage.GoUnusedProtection__ + +func Usage() { + fmt.Fprintln(os.Stderr, "Usage of ", os.Args[0], " [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:") + flag.PrintDefaults() + fmt.Fprintln(os.Stderr, "\nFunctions:") + fmt.Fprintln(os.Stderr, " 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, " DropCPResp dropCheckpoint(DropCPRequest req)") + fmt.Fprintln(os.Stderr, " BlockingSignResp blockingWrites(BlockingSignRequest req)") + fmt.Fprintln(os.Stderr, " GetLeaderPartsResp getLeaderParts(GetLeaderReq req)") + fmt.Fprintln(os.Stderr, " AdminExecResp checkPeers(CheckPeersReq req)") + fmt.Fprintln(os.Stderr, " AddTaskResp addAdminTask(AddTaskRequest req)") + fmt.Fprintln(os.Stderr, " StopTaskResp stopAdminTask(StopTaskRequest req)") + fmt.Fprintln(os.Stderr, " ClearSpaceResp clearSpace(ClearSpaceReq req)") + fmt.Fprintln(os.Stderr) + os.Exit(0) +} + +type httpHeaders map[string]string + +func (h httpHeaders) String() string { + var m map[string]string = h + return fmt.Sprintf("%s", m) +} + +func (h httpHeaders) Set(value string) error { + parts := strings.Split(value, ": ") + if len(parts) != 2 { + return fmt.Errorf("header should be of format 'Key: Value'") + } + h[parts[0]] = parts[1] + return nil +} + +func main() { + flag.Usage = Usage + var host string + var port int + var protocol string + var urlString string + var framed bool + var useHttp bool + headers := make(httpHeaders) + var parsedUrl *url.URL + var trans thrift.TTransport + _ = strconv.Atoi + _ = math.Abs + flag.Usage = Usage + flag.StringVar(&host, "h", "localhost", "Specify host and port") + flag.IntVar(&port, "p", 9090, "Specify port") + flag.StringVar(&protocol, "P", "binary", "Specify the protocol (binary, compact, simplejson, json)") + flag.StringVar(&urlString, "u", "", "Specify the url") + flag.BoolVar(&framed, "framed", false, "Use framed transport") + flag.BoolVar(&useHttp, "http", false, "Use http") + flag.Var(headers, "H", "Headers to set on the http(s) request (e.g. -H \"Key: Value\")") + flag.Parse() + + if len(urlString) > 0 { + var err error + parsedUrl, err = url.Parse(urlString) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + host = parsedUrl.Host + useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == "http" || parsedUrl.Scheme == "https" + } else if useHttp { + _, err := url.Parse(fmt.Sprint("http://", host, ":", port)) + if err != nil { + fmt.Fprintln(os.Stderr, "Error parsing URL: ", err) + flag.Usage() + } + } + + cmd := flag.Arg(0) + var err error + var cfg *thrift.TConfiguration = nil + if useHttp { + trans, err = thrift.NewTHttpClient(parsedUrl.String()) + if len(headers) > 0 { + httptrans := trans.(*thrift.THttpClient) + for key, value := range headers { + httptrans.SetHeader(key, value) + } + } + } else { + portStr := fmt.Sprint(port) + if strings.Contains(host, ":") { + host, portStr, err = net.SplitHostPort(host) + if err != nil { + fmt.Fprintln(os.Stderr, "error with host:", err) + os.Exit(1) + } + } + trans = thrift.NewTSocketConf(net.JoinHostPort(host, portStr), cfg) + if err != nil { + fmt.Fprintln(os.Stderr, "error resolving address:", err) + os.Exit(1) + } + if framed { + trans = thrift.NewTFramedTransportConf(trans, cfg) + } + } + if err != nil { + fmt.Fprintln(os.Stderr, "Error creating transport", err) + os.Exit(1) + } + defer trans.Close() + var protocolFactory thrift.TProtocolFactory + switch protocol { + case "compact": + protocolFactory = thrift.NewTCompactProtocolFactoryConf(cfg) + break + case "simplejson": + protocolFactory = thrift.NewTSimpleJSONProtocolFactoryConf(cfg) + break + case "json": + protocolFactory = thrift.NewTJSONProtocolFactory() + break + case "binary", "": + protocolFactory = thrift.NewTBinaryProtocolFactoryConf(cfg) + break + default: + fmt.Fprintln(os.Stderr, "Invalid protocol specified: ", protocol) + Usage() + os.Exit(1) + } + iprot := protocolFactory.GetProtocol(trans) + oprot := protocolFactory.GetProtocol(trans) + client := storage.NewStorageAdminServiceClient(thrift.NewTStandardClient(iprot, oprot)) + if err := trans.Open(); err != nil { + fmt.Fprintln(os.Stderr, "Error opening socket to ", host, ":", port, " ", err) + os.Exit(1) + } + + switch cmd { + case "transLeader": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "TransLeader requires 1 args") + flag.Usage() + } + arg518 := flag.Arg(1) + mbTrans519 := thrift.NewTMemoryBufferLen(len(arg518)) + defer mbTrans519.Close() + _, err520 := mbTrans519.WriteString(arg518) + if err520 != nil { + Usage() + return + } + factory521 := thrift.NewTJSONProtocolFactory() + jsProt522 := factory521.GetProtocol(mbTrans519) + argvalue0 := storage.NewTransLeaderReq() + err523 := argvalue0.Read(context.Background(), jsProt522) + if err523 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.TransLeader(context.Background(), value0)) + fmt.Print("\n") + break + case "addPart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddPart requires 1 args") + flag.Usage() + } + arg524 := flag.Arg(1) + mbTrans525 := thrift.NewTMemoryBufferLen(len(arg524)) + defer mbTrans525.Close() + _, err526 := mbTrans525.WriteString(arg524) + if err526 != nil { + Usage() + return + } + factory527 := thrift.NewTJSONProtocolFactory() + jsProt528 := factory527.GetProtocol(mbTrans525) + argvalue0 := storage.NewAddPartReq() + err529 := argvalue0.Read(context.Background(), jsProt528) + if err529 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddPart(context.Background(), value0)) + fmt.Print("\n") + break + case "addLearner": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddLearner requires 1 args") + flag.Usage() + } + arg530 := flag.Arg(1) + mbTrans531 := thrift.NewTMemoryBufferLen(len(arg530)) + defer mbTrans531.Close() + _, err532 := mbTrans531.WriteString(arg530) + if err532 != nil { + Usage() + return + } + factory533 := thrift.NewTJSONProtocolFactory() + jsProt534 := factory533.GetProtocol(mbTrans531) + argvalue0 := storage.NewAddLearnerReq() + err535 := argvalue0.Read(context.Background(), jsProt534) + if err535 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddLearner(context.Background(), value0)) + fmt.Print("\n") + break + case "removePart": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "RemovePart requires 1 args") + flag.Usage() + } + arg536 := flag.Arg(1) + mbTrans537 := thrift.NewTMemoryBufferLen(len(arg536)) + defer mbTrans537.Close() + _, err538 := mbTrans537.WriteString(arg536) + if err538 != nil { + Usage() + return + } + factory539 := thrift.NewTJSONProtocolFactory() + jsProt540 := factory539.GetProtocol(mbTrans537) + argvalue0 := storage.NewRemovePartReq() + err541 := argvalue0.Read(context.Background(), jsProt540) + if err541 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.RemovePart(context.Background(), value0)) + fmt.Print("\n") + break + case "memberChange": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "MemberChange requires 1 args") + flag.Usage() + } + arg542 := flag.Arg(1) + mbTrans543 := thrift.NewTMemoryBufferLen(len(arg542)) + defer mbTrans543.Close() + _, err544 := mbTrans543.WriteString(arg542) + if err544 != nil { + Usage() + return + } + factory545 := thrift.NewTJSONProtocolFactory() + jsProt546 := factory545.GetProtocol(mbTrans543) + argvalue0 := storage.NewMemberChangeReq() + err547 := argvalue0.Read(context.Background(), jsProt546) + if err547 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.MemberChange(context.Background(), value0)) + fmt.Print("\n") + break + case "waitingForCatchUpData": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "WaitingForCatchUpData requires 1 args") + flag.Usage() + } + arg548 := flag.Arg(1) + mbTrans549 := thrift.NewTMemoryBufferLen(len(arg548)) + defer mbTrans549.Close() + _, err550 := mbTrans549.WriteString(arg548) + if err550 != nil { + Usage() + return + } + factory551 := thrift.NewTJSONProtocolFactory() + jsProt552 := factory551.GetProtocol(mbTrans549) + argvalue0 := storage.NewCatchUpDataReq() + err553 := argvalue0.Read(context.Background(), jsProt552) + if err553 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.WaitingForCatchUpData(context.Background(), value0)) + fmt.Print("\n") + break + case "createCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CreateCheckpoint requires 1 args") + flag.Usage() + } + arg554 := flag.Arg(1) + mbTrans555 := thrift.NewTMemoryBufferLen(len(arg554)) + defer mbTrans555.Close() + _, err556 := mbTrans555.WriteString(arg554) + if err556 != nil { + Usage() + return + } + factory557 := thrift.NewTJSONProtocolFactory() + jsProt558 := factory557.GetProtocol(mbTrans555) + argvalue0 := storage.NewCreateCPRequest() + err559 := argvalue0.Read(context.Background(), jsProt558) + if err559 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CreateCheckpoint(context.Background(), value0)) + fmt.Print("\n") + break + case "dropCheckpoint": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "DropCheckpoint requires 1 args") + flag.Usage() + } + arg560 := flag.Arg(1) + mbTrans561 := thrift.NewTMemoryBufferLen(len(arg560)) + defer mbTrans561.Close() + _, err562 := mbTrans561.WriteString(arg560) + if err562 != nil { + Usage() + return + } + factory563 := thrift.NewTJSONProtocolFactory() + jsProt564 := factory563.GetProtocol(mbTrans561) + argvalue0 := storage.NewDropCPRequest() + err565 := argvalue0.Read(context.Background(), jsProt564) + if err565 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.DropCheckpoint(context.Background(), value0)) + fmt.Print("\n") + break + case "blockingWrites": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "BlockingWrites requires 1 args") + flag.Usage() + } + arg566 := flag.Arg(1) + mbTrans567 := thrift.NewTMemoryBufferLen(len(arg566)) + defer mbTrans567.Close() + _, err568 := mbTrans567.WriteString(arg566) + if err568 != nil { + Usage() + return + } + factory569 := thrift.NewTJSONProtocolFactory() + jsProt570 := factory569.GetProtocol(mbTrans567) + argvalue0 := storage.NewBlockingSignRequest() + err571 := argvalue0.Read(context.Background(), jsProt570) + if err571 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.BlockingWrites(context.Background(), value0)) + fmt.Print("\n") + break + case "getLeaderParts": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "GetLeaderParts requires 1 args") + flag.Usage() + } + arg572 := flag.Arg(1) + mbTrans573 := thrift.NewTMemoryBufferLen(len(arg572)) + defer mbTrans573.Close() + _, err574 := mbTrans573.WriteString(arg572) + if err574 != nil { + Usage() + return + } + factory575 := thrift.NewTJSONProtocolFactory() + jsProt576 := factory575.GetProtocol(mbTrans573) + argvalue0 := storage.NewGetLeaderReq() + err577 := argvalue0.Read(context.Background(), jsProt576) + if err577 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.GetLeaderParts(context.Background(), value0)) + fmt.Print("\n") + break + case "checkPeers": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "CheckPeers requires 1 args") + flag.Usage() + } + arg578 := flag.Arg(1) + mbTrans579 := thrift.NewTMemoryBufferLen(len(arg578)) + defer mbTrans579.Close() + _, err580 := mbTrans579.WriteString(arg578) + if err580 != nil { + Usage() + return + } + factory581 := thrift.NewTJSONProtocolFactory() + jsProt582 := factory581.GetProtocol(mbTrans579) + argvalue0 := storage.NewCheckPeersReq() + err583 := argvalue0.Read(context.Background(), jsProt582) + if err583 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.CheckPeers(context.Background(), value0)) + fmt.Print("\n") + break + case "addAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "AddAdminTask requires 1 args") + flag.Usage() + } + arg584 := flag.Arg(1) + mbTrans585 := thrift.NewTMemoryBufferLen(len(arg584)) + defer mbTrans585.Close() + _, err586 := mbTrans585.WriteString(arg584) + if err586 != nil { + Usage() + return + } + factory587 := thrift.NewTJSONProtocolFactory() + jsProt588 := factory587.GetProtocol(mbTrans585) + argvalue0 := storage.NewAddTaskRequest() + err589 := argvalue0.Read(context.Background(), jsProt588) + if err589 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.AddAdminTask(context.Background(), value0)) + fmt.Print("\n") + break + case "stopAdminTask": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "StopAdminTask requires 1 args") + flag.Usage() + } + arg590 := flag.Arg(1) + mbTrans591 := thrift.NewTMemoryBufferLen(len(arg590)) + defer mbTrans591.Close() + _, err592 := mbTrans591.WriteString(arg590) + if err592 != nil { + Usage() + return + } + factory593 := thrift.NewTJSONProtocolFactory() + jsProt594 := factory593.GetProtocol(mbTrans591) + argvalue0 := storage.NewStopTaskRequest() + err595 := argvalue0.Read(context.Background(), jsProt594) + if err595 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.StopAdminTask(context.Background(), value0)) + fmt.Print("\n") + break + case "clearSpace": + if flag.NArg() - 1 != 1 { + fmt.Fprintln(os.Stderr, "ClearSpace requires 1 args") + flag.Usage() + } + arg596 := flag.Arg(1) + mbTrans597 := thrift.NewTMemoryBufferLen(len(arg596)) + defer mbTrans597.Close() + _, err598 := mbTrans597.WriteString(arg596) + if err598 != nil { + Usage() + return + } + factory599 := thrift.NewTJSONProtocolFactory() + jsProt600 := factory599.GetProtocol(mbTrans597) + argvalue0 := storage.NewClearSpaceReq() + err601 := argvalue0.Read(context.Background(), jsProt600) + if err601 != nil { + Usage() + return + } + value0 := argvalue0 + fmt.Print(client.ClearSpace(context.Background(), value0)) + fmt.Print("\n") + break + case "": + Usage() + break + default: + fmt.Fprintln(os.Stderr, "Invalid function ", cmd) + } +} diff --git a/nebula/storage/storageadminservice.go b/nebula/storage/storageadminservice.go deleted file mode 100644 index ce4568d2..00000000 --- a/nebula/storage/storageadminservice.go +++ /dev/null @@ -1,5339 +0,0 @@ -// Autogenerated by Thrift Compiler (facebook) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -// @generated - -package storage - -import ( - "bytes" - "context" - "sync" - "fmt" - thrift "github.com/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - meta1 "github.com/vesoft-inc/nebula-go/v3/nebula/meta" - -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = sync.Mutex{} -var _ = bytes.Equal -var _ = context.Background - -var _ = nebula0.GoUnusedProtection__ -var _ = meta1.GoUnusedProtection__ -type 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 *DropCPResp, err error) - // Parameters: - // - Req - BlockingWrites(ctx context.Context, req *BlockingSignRequest) (_r *BlockingSignResp, 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 *AddTaskRequest) (_r *AddTaskResp, err error) - // Parameters: - // - Req - StopAdminTask(ctx context.Context, req *StopTaskRequest) (_r *StopTaskResp, err error) - // Parameters: - // - Req - ClearSpace(ctx context.Context, req *ClearSpaceReq) (_r *ClearSpaceResp, 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 *DropCPResp, err error) - // Parameters: - // - Req - BlockingWrites(req *BlockingSignRequest) (_r *BlockingSignResp, err error) - // Parameters: - // - Req - GetLeaderParts(req *GetLeaderReq) (_r *GetLeaderPartsResp, err error) - // Parameters: - // - Req - CheckPeers(req *CheckPeersReq) (_r *AdminExecResp, err error) - // Parameters: - // - Req - AddAdminTask(req *AddTaskRequest) (_r *AddTaskResp, err error) - // Parameters: - // - Req - StopAdminTask(req *StopTaskRequest) (_r *StopTaskResp, err error) - // Parameters: - // - Req - ClearSpace(req *ClearSpaceReq) (_r *ClearSpaceResp, 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 *DropCPResp, 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 *DropCPResp, 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 *BlockingSignResp, 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 *BlockingSignResp, err error) { - var result StorageAdminServiceBlockingWritesResult - err = p.CC.RecvMsg("blockingWrites", &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 *AddTaskRequest) (_r *AddTaskResp, 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 *AddTaskResp, 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 *StopTaskRequest) (_r *StopTaskResp, 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 *StopTaskResp, err error) { - var result StorageAdminServiceStopAdminTaskResult - err = p.CC.RecvMsg("stopAdminTask", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *StorageAdminServiceClient) ClearSpace(req *ClearSpaceReq) (_r *ClearSpaceResp, err error) { - args := StorageAdminServiceClearSpaceArgs{ - Req : req, - } - err = p.CC.SendMsg("clearSpace", &args, thrift.CALL) - if err != nil { return } - return p.recvClearSpace() -} - - -func (p *StorageAdminServiceClient) recvClearSpace() (value *ClearSpaceResp, err error) { - var result StorageAdminServiceClearSpaceResult - err = p.CC.RecvMsg("clearSpace", &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 *DropCPResp, 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 *DropCPResp, 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 *BlockingSignResp, 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 *BlockingSignResp, err error) { - var result StorageAdminServiceBlockingWritesResult - err = p.CC.RecvMsg("blockingWrites", &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 *AddTaskRequest) (_r *AddTaskResp, 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 *AddTaskResp, 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 *StopTaskRequest) (_r *StopTaskResp, 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 *StopTaskResp, err error) { - var result StorageAdminServiceStopAdminTaskResult - err = p.CC.RecvMsg("stopAdminTask", &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - -// Parameters: -// - Req -func (p *StorageAdminServiceThreadsafeClient) ClearSpace(req *ClearSpaceReq) (_r *ClearSpaceResp, err error) { - p.Mu.Lock() - defer p.Mu.Unlock() - args := StorageAdminServiceClearSpaceArgs{ - Req : req, - } - err = p.CC.SendMsg("clearSpace", &args, thrift.CALL) - if err != nil { return } - return p.recvClearSpace() -} - - -func (p *StorageAdminServiceThreadsafeClient) recvClearSpace() (value *ClearSpaceResp, err error) { - var result StorageAdminServiceClearSpaceResult - err = p.CC.RecvMsg("clearSpace", &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 *DropCPResp, 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 *BlockingSignResp, 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) 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 *AddTaskRequest) (_r *AddTaskResp, 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 *StopTaskRequest) (_r *StopTaskResp, 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) ClearSpace(ctx context.Context, req *ClearSpaceReq) (_r *ClearSpaceResp, err error) { - args := StorageAdminServiceClearSpaceArgs{ - Req : req, - } - var result StorageAdminServiceClearSpaceResult - err = p.RequestChannel.Call(ctx, "clearSpace", &args, &result) - if err != nil { return } - - return result.GetSuccess(), nil -} - - -type StorageAdminServiceProcessor struct { - processorMap map[string]thrift.ProcessorFunctionContext - functionServiceMap map[string]string - handler StorageAdminService -} - -func (p *StorageAdminServiceProcessor) AddToProcessorMap(key string, processor thrift.ProcessorFunctionContext) { - p.processorMap[key] = processor -} - -func (p *StorageAdminServiceProcessor) AddToFunctionServiceMap(key, service string) { - p.functionServiceMap[key] = service -} - -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 (p *StorageAdminServiceProcessor) FunctionServiceMap() map[string]string { - return p.functionServiceMap -} - -func NewStorageAdminServiceProcessor(handler StorageAdminService) *StorageAdminServiceProcessor { - self229 := &StorageAdminServiceProcessor{handler:handler, processorMap:make(map[string]thrift.ProcessorFunctionContext), functionServiceMap:make(map[string]string)} - self229.processorMap["transLeader"] = &storageAdminServiceProcessorTransLeader{handler:handler} - self229.processorMap["addPart"] = &storageAdminServiceProcessorAddPart{handler:handler} - self229.processorMap["addLearner"] = &storageAdminServiceProcessorAddLearner{handler:handler} - self229.processorMap["removePart"] = &storageAdminServiceProcessorRemovePart{handler:handler} - self229.processorMap["memberChange"] = &storageAdminServiceProcessorMemberChange{handler:handler} - self229.processorMap["waitingForCatchUpData"] = &storageAdminServiceProcessorWaitingForCatchUpData{handler:handler} - self229.processorMap["createCheckpoint"] = &storageAdminServiceProcessorCreateCheckpoint{handler:handler} - self229.processorMap["dropCheckpoint"] = &storageAdminServiceProcessorDropCheckpoint{handler:handler} - self229.processorMap["blockingWrites"] = &storageAdminServiceProcessorBlockingWrites{handler:handler} - self229.processorMap["getLeaderParts"] = &storageAdminServiceProcessorGetLeaderParts{handler:handler} - self229.processorMap["checkPeers"] = &storageAdminServiceProcessorCheckPeers{handler:handler} - self229.processorMap["addAdminTask"] = &storageAdminServiceProcessorAddAdminTask{handler:handler} - self229.processorMap["stopAdminTask"] = &storageAdminServiceProcessorStopAdminTask{handler:handler} - self229.processorMap["clearSpace"] = &storageAdminServiceProcessorClearSpace{handler:handler} - self229.functionServiceMap["transLeader"] = "StorageAdminService" - self229.functionServiceMap["addPart"] = "StorageAdminService" - self229.functionServiceMap["addLearner"] = "StorageAdminService" - self229.functionServiceMap["removePart"] = "StorageAdminService" - self229.functionServiceMap["memberChange"] = "StorageAdminService" - self229.functionServiceMap["waitingForCatchUpData"] = "StorageAdminService" - self229.functionServiceMap["createCheckpoint"] = "StorageAdminService" - self229.functionServiceMap["dropCheckpoint"] = "StorageAdminService" - self229.functionServiceMap["blockingWrites"] = "StorageAdminService" - self229.functionServiceMap["getLeaderParts"] = "StorageAdminService" - self229.functionServiceMap["checkPeers"] = "StorageAdminService" - self229.functionServiceMap["addAdminTask"] = "StorageAdminService" - self229.functionServiceMap["stopAdminTask"] = "StorageAdminService" - self229.functionServiceMap["clearSpace"] = "StorageAdminService" - return self229 -} - -type storageAdminServiceProcessorTransLeader struct { - handler StorageAdminService -} - -func (p *StorageAdminServiceTransLeaderResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceAddPartResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceAddLearnerResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceRemovePartResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceMemberChangeResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceWaitingForCatchUpDataResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceCreateCheckpointResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceDropCheckpointResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceBlockingWritesResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 storageAdminServiceProcessorGetLeaderParts struct { - handler StorageAdminService -} - -func (p *StorageAdminServiceGetLeaderPartsResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceCheckPeersResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceAddAdminTaskResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 *StorageAdminServiceStopAdminTaskResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -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 storageAdminServiceProcessorClearSpace struct { - handler StorageAdminService -} - -func (p *StorageAdminServiceClearSpaceResult) Exception() thrift.WritableException { - if p == nil { return nil } - return nil -} - -func (p *storageAdminServiceProcessorClearSpace) Read(iprot thrift.Protocol) (thrift.Struct, thrift.Exception) { - args := StorageAdminServiceClearSpaceArgs{} - if err := args.Read(iprot); err != nil { - return nil, err - } - iprot.ReadMessageEnd() - return &args, nil -} - -func (p *storageAdminServiceProcessorClearSpace) Write(seqId int32, result thrift.WritableStruct, oprot thrift.Protocol) (err thrift.Exception) { - var err2 error - messageType := thrift.REPLY - switch result.(type) { - case thrift.ApplicationException: - messageType = thrift.EXCEPTION - } - if err2 = oprot.WriteMessageBegin("clearSpace", messageType, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(); err == nil && err2 != nil { - err = err2 - } - return err -} - -func (p *storageAdminServiceProcessorClearSpace) RunContext(ctx context.Context, argStruct thrift.Struct) (thrift.WritableStruct, thrift.ApplicationException) { - args := argStruct.(*StorageAdminServiceClearSpaceArgs) - var result StorageAdminServiceClearSpaceResult - if retval, err := p.handler.ClearSpace(ctx, args.Req); err != nil { - switch err.(type) { - default: - x := thrift.NewApplicationException(thrift.INTERNAL_ERROR, "Internal error processing clearSpace: " + 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 -} - -type StorageAdminServiceTransLeaderArgsBuilder struct { - obj *StorageAdminServiceTransLeaderArgs -} - -func NewStorageAdminServiceTransLeaderArgsBuilder() *StorageAdminServiceTransLeaderArgsBuilder{ - return &StorageAdminServiceTransLeaderArgsBuilder{ - obj: NewStorageAdminServiceTransLeaderArgs(), - } -} - -func (p StorageAdminServiceTransLeaderArgsBuilder) Emit() *StorageAdminServiceTransLeaderArgs{ - return &StorageAdminServiceTransLeaderArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceTransLeaderArgsBuilder) Req(req *TransLeaderReq) *StorageAdminServiceTransLeaderArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceTransLeaderArgs) SetReq(req *TransLeaderReq) *StorageAdminServiceTransLeaderArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceTransLeaderResultBuilder struct { - obj *StorageAdminServiceTransLeaderResult -} - -func NewStorageAdminServiceTransLeaderResultBuilder() *StorageAdminServiceTransLeaderResultBuilder{ - return &StorageAdminServiceTransLeaderResultBuilder{ - obj: NewStorageAdminServiceTransLeaderResult(), - } -} - -func (p StorageAdminServiceTransLeaderResultBuilder) Emit() *StorageAdminServiceTransLeaderResult{ - return &StorageAdminServiceTransLeaderResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceTransLeaderResultBuilder) Success(success *AdminExecResp) *StorageAdminServiceTransLeaderResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceTransLeaderResult) SetSuccess(success *AdminExecResp) *StorageAdminServiceTransLeaderResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceAddPartArgsBuilder struct { - obj *StorageAdminServiceAddPartArgs -} - -func NewStorageAdminServiceAddPartArgsBuilder() *StorageAdminServiceAddPartArgsBuilder{ - return &StorageAdminServiceAddPartArgsBuilder{ - obj: NewStorageAdminServiceAddPartArgs(), - } -} - -func (p StorageAdminServiceAddPartArgsBuilder) Emit() *StorageAdminServiceAddPartArgs{ - return &StorageAdminServiceAddPartArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceAddPartArgsBuilder) Req(req *AddPartReq) *StorageAdminServiceAddPartArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceAddPartArgs) SetReq(req *AddPartReq) *StorageAdminServiceAddPartArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceAddPartResultBuilder struct { - obj *StorageAdminServiceAddPartResult -} - -func NewStorageAdminServiceAddPartResultBuilder() *StorageAdminServiceAddPartResultBuilder{ - return &StorageAdminServiceAddPartResultBuilder{ - obj: NewStorageAdminServiceAddPartResult(), - } -} - -func (p StorageAdminServiceAddPartResultBuilder) Emit() *StorageAdminServiceAddPartResult{ - return &StorageAdminServiceAddPartResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceAddPartResultBuilder) Success(success *AdminExecResp) *StorageAdminServiceAddPartResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceAddPartResult) SetSuccess(success *AdminExecResp) *StorageAdminServiceAddPartResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceAddLearnerArgsBuilder struct { - obj *StorageAdminServiceAddLearnerArgs -} - -func NewStorageAdminServiceAddLearnerArgsBuilder() *StorageAdminServiceAddLearnerArgsBuilder{ - return &StorageAdminServiceAddLearnerArgsBuilder{ - obj: NewStorageAdminServiceAddLearnerArgs(), - } -} - -func (p StorageAdminServiceAddLearnerArgsBuilder) Emit() *StorageAdminServiceAddLearnerArgs{ - return &StorageAdminServiceAddLearnerArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceAddLearnerArgsBuilder) Req(req *AddLearnerReq) *StorageAdminServiceAddLearnerArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceAddLearnerArgs) SetReq(req *AddLearnerReq) *StorageAdminServiceAddLearnerArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceAddLearnerResultBuilder struct { - obj *StorageAdminServiceAddLearnerResult -} - -func NewStorageAdminServiceAddLearnerResultBuilder() *StorageAdminServiceAddLearnerResultBuilder{ - return &StorageAdminServiceAddLearnerResultBuilder{ - obj: NewStorageAdminServiceAddLearnerResult(), - } -} - -func (p StorageAdminServiceAddLearnerResultBuilder) Emit() *StorageAdminServiceAddLearnerResult{ - return &StorageAdminServiceAddLearnerResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceAddLearnerResultBuilder) Success(success *AdminExecResp) *StorageAdminServiceAddLearnerResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceAddLearnerResult) SetSuccess(success *AdminExecResp) *StorageAdminServiceAddLearnerResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceRemovePartArgsBuilder struct { - obj *StorageAdminServiceRemovePartArgs -} - -func NewStorageAdminServiceRemovePartArgsBuilder() *StorageAdminServiceRemovePartArgsBuilder{ - return &StorageAdminServiceRemovePartArgsBuilder{ - obj: NewStorageAdminServiceRemovePartArgs(), - } -} - -func (p StorageAdminServiceRemovePartArgsBuilder) Emit() *StorageAdminServiceRemovePartArgs{ - return &StorageAdminServiceRemovePartArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceRemovePartArgsBuilder) Req(req *RemovePartReq) *StorageAdminServiceRemovePartArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceRemovePartArgs) SetReq(req *RemovePartReq) *StorageAdminServiceRemovePartArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceRemovePartResultBuilder struct { - obj *StorageAdminServiceRemovePartResult -} - -func NewStorageAdminServiceRemovePartResultBuilder() *StorageAdminServiceRemovePartResultBuilder{ - return &StorageAdminServiceRemovePartResultBuilder{ - obj: NewStorageAdminServiceRemovePartResult(), - } -} - -func (p StorageAdminServiceRemovePartResultBuilder) Emit() *StorageAdminServiceRemovePartResult{ - return &StorageAdminServiceRemovePartResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceRemovePartResultBuilder) Success(success *AdminExecResp) *StorageAdminServiceRemovePartResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceRemovePartResult) SetSuccess(success *AdminExecResp) *StorageAdminServiceRemovePartResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceMemberChangeArgsBuilder struct { - obj *StorageAdminServiceMemberChangeArgs -} - -func NewStorageAdminServiceMemberChangeArgsBuilder() *StorageAdminServiceMemberChangeArgsBuilder{ - return &StorageAdminServiceMemberChangeArgsBuilder{ - obj: NewStorageAdminServiceMemberChangeArgs(), - } -} - -func (p StorageAdminServiceMemberChangeArgsBuilder) Emit() *StorageAdminServiceMemberChangeArgs{ - return &StorageAdminServiceMemberChangeArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceMemberChangeArgsBuilder) Req(req *MemberChangeReq) *StorageAdminServiceMemberChangeArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceMemberChangeArgs) SetReq(req *MemberChangeReq) *StorageAdminServiceMemberChangeArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceMemberChangeResultBuilder struct { - obj *StorageAdminServiceMemberChangeResult -} - -func NewStorageAdminServiceMemberChangeResultBuilder() *StorageAdminServiceMemberChangeResultBuilder{ - return &StorageAdminServiceMemberChangeResultBuilder{ - obj: NewStorageAdminServiceMemberChangeResult(), - } -} - -func (p StorageAdminServiceMemberChangeResultBuilder) Emit() *StorageAdminServiceMemberChangeResult{ - return &StorageAdminServiceMemberChangeResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceMemberChangeResultBuilder) Success(success *AdminExecResp) *StorageAdminServiceMemberChangeResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceMemberChangeResult) SetSuccess(success *AdminExecResp) *StorageAdminServiceMemberChangeResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceWaitingForCatchUpDataArgsBuilder struct { - obj *StorageAdminServiceWaitingForCatchUpDataArgs -} - -func NewStorageAdminServiceWaitingForCatchUpDataArgsBuilder() *StorageAdminServiceWaitingForCatchUpDataArgsBuilder{ - return &StorageAdminServiceWaitingForCatchUpDataArgsBuilder{ - obj: NewStorageAdminServiceWaitingForCatchUpDataArgs(), - } -} - -func (p StorageAdminServiceWaitingForCatchUpDataArgsBuilder) Emit() *StorageAdminServiceWaitingForCatchUpDataArgs{ - return &StorageAdminServiceWaitingForCatchUpDataArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceWaitingForCatchUpDataArgsBuilder) Req(req *CatchUpDataReq) *StorageAdminServiceWaitingForCatchUpDataArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceWaitingForCatchUpDataArgs) SetReq(req *CatchUpDataReq) *StorageAdminServiceWaitingForCatchUpDataArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceWaitingForCatchUpDataResultBuilder struct { - obj *StorageAdminServiceWaitingForCatchUpDataResult -} - -func NewStorageAdminServiceWaitingForCatchUpDataResultBuilder() *StorageAdminServiceWaitingForCatchUpDataResultBuilder{ - return &StorageAdminServiceWaitingForCatchUpDataResultBuilder{ - obj: NewStorageAdminServiceWaitingForCatchUpDataResult(), - } -} - -func (p StorageAdminServiceWaitingForCatchUpDataResultBuilder) Emit() *StorageAdminServiceWaitingForCatchUpDataResult{ - return &StorageAdminServiceWaitingForCatchUpDataResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceWaitingForCatchUpDataResultBuilder) Success(success *AdminExecResp) *StorageAdminServiceWaitingForCatchUpDataResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceWaitingForCatchUpDataResult) SetSuccess(success *AdminExecResp) *StorageAdminServiceWaitingForCatchUpDataResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceCreateCheckpointArgsBuilder struct { - obj *StorageAdminServiceCreateCheckpointArgs -} - -func NewStorageAdminServiceCreateCheckpointArgsBuilder() *StorageAdminServiceCreateCheckpointArgsBuilder{ - return &StorageAdminServiceCreateCheckpointArgsBuilder{ - obj: NewStorageAdminServiceCreateCheckpointArgs(), - } -} - -func (p StorageAdminServiceCreateCheckpointArgsBuilder) Emit() *StorageAdminServiceCreateCheckpointArgs{ - return &StorageAdminServiceCreateCheckpointArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceCreateCheckpointArgsBuilder) Req(req *CreateCPRequest) *StorageAdminServiceCreateCheckpointArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceCreateCheckpointArgs) SetReq(req *CreateCPRequest) *StorageAdminServiceCreateCheckpointArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceCreateCheckpointResultBuilder struct { - obj *StorageAdminServiceCreateCheckpointResult -} - -func NewStorageAdminServiceCreateCheckpointResultBuilder() *StorageAdminServiceCreateCheckpointResultBuilder{ - return &StorageAdminServiceCreateCheckpointResultBuilder{ - obj: NewStorageAdminServiceCreateCheckpointResult(), - } -} - -func (p StorageAdminServiceCreateCheckpointResultBuilder) Emit() *StorageAdminServiceCreateCheckpointResult{ - return &StorageAdminServiceCreateCheckpointResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceCreateCheckpointResultBuilder) Success(success *CreateCPResp) *StorageAdminServiceCreateCheckpointResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceCreateCheckpointResult) SetSuccess(success *CreateCPResp) *StorageAdminServiceCreateCheckpointResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceDropCheckpointArgsBuilder struct { - obj *StorageAdminServiceDropCheckpointArgs -} - -func NewStorageAdminServiceDropCheckpointArgsBuilder() *StorageAdminServiceDropCheckpointArgsBuilder{ - return &StorageAdminServiceDropCheckpointArgsBuilder{ - obj: NewStorageAdminServiceDropCheckpointArgs(), - } -} - -func (p StorageAdminServiceDropCheckpointArgsBuilder) Emit() *StorageAdminServiceDropCheckpointArgs{ - return &StorageAdminServiceDropCheckpointArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceDropCheckpointArgsBuilder) Req(req *DropCPRequest) *StorageAdminServiceDropCheckpointArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceDropCheckpointArgs) SetReq(req *DropCPRequest) *StorageAdminServiceDropCheckpointArgs { - s.Req = req - return s -} - -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 *DropCPResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewStorageAdminServiceDropCheckpointResult() *StorageAdminServiceDropCheckpointResult { - return &StorageAdminServiceDropCheckpointResult{} -} - -var StorageAdminServiceDropCheckpointResult_Success_DEFAULT *DropCPResp -func (p *StorageAdminServiceDropCheckpointResult) GetSuccess() *DropCPResp { - if !p.IsSetSuccess() { - return StorageAdminServiceDropCheckpointResult_Success_DEFAULT - } -return p.Success -} -func (p *StorageAdminServiceDropCheckpointResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type StorageAdminServiceDropCheckpointResultBuilder struct { - obj *StorageAdminServiceDropCheckpointResult -} - -func NewStorageAdminServiceDropCheckpointResultBuilder() *StorageAdminServiceDropCheckpointResultBuilder{ - return &StorageAdminServiceDropCheckpointResultBuilder{ - obj: NewStorageAdminServiceDropCheckpointResult(), - } -} - -func (p StorageAdminServiceDropCheckpointResultBuilder) Emit() *StorageAdminServiceDropCheckpointResult{ - return &StorageAdminServiceDropCheckpointResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceDropCheckpointResultBuilder) Success(success *DropCPResp) *StorageAdminServiceDropCheckpointResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceDropCheckpointResult) SetSuccess(success *DropCPResp) *StorageAdminServiceDropCheckpointResult { - s.Success = success - return s -} - -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 = NewDropCPResp() - 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 -} - -type StorageAdminServiceBlockingWritesArgsBuilder struct { - obj *StorageAdminServiceBlockingWritesArgs -} - -func NewStorageAdminServiceBlockingWritesArgsBuilder() *StorageAdminServiceBlockingWritesArgsBuilder{ - return &StorageAdminServiceBlockingWritesArgsBuilder{ - obj: NewStorageAdminServiceBlockingWritesArgs(), - } -} - -func (p StorageAdminServiceBlockingWritesArgsBuilder) Emit() *StorageAdminServiceBlockingWritesArgs{ - return &StorageAdminServiceBlockingWritesArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceBlockingWritesArgsBuilder) Req(req *BlockingSignRequest) *StorageAdminServiceBlockingWritesArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceBlockingWritesArgs) SetReq(req *BlockingSignRequest) *StorageAdminServiceBlockingWritesArgs { - s.Req = req - return s -} - -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 *BlockingSignResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewStorageAdminServiceBlockingWritesResult() *StorageAdminServiceBlockingWritesResult { - return &StorageAdminServiceBlockingWritesResult{} -} - -var StorageAdminServiceBlockingWritesResult_Success_DEFAULT *BlockingSignResp -func (p *StorageAdminServiceBlockingWritesResult) GetSuccess() *BlockingSignResp { - if !p.IsSetSuccess() { - return StorageAdminServiceBlockingWritesResult_Success_DEFAULT - } -return p.Success -} -func (p *StorageAdminServiceBlockingWritesResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type StorageAdminServiceBlockingWritesResultBuilder struct { - obj *StorageAdminServiceBlockingWritesResult -} - -func NewStorageAdminServiceBlockingWritesResultBuilder() *StorageAdminServiceBlockingWritesResultBuilder{ - return &StorageAdminServiceBlockingWritesResultBuilder{ - obj: NewStorageAdminServiceBlockingWritesResult(), - } -} - -func (p StorageAdminServiceBlockingWritesResultBuilder) Emit() *StorageAdminServiceBlockingWritesResult{ - return &StorageAdminServiceBlockingWritesResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceBlockingWritesResultBuilder) Success(success *BlockingSignResp) *StorageAdminServiceBlockingWritesResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceBlockingWritesResult) SetSuccess(success *BlockingSignResp) *StorageAdminServiceBlockingWritesResult { - s.Success = success - return s -} - -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 = NewBlockingSignResp() - 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 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 -} - -type StorageAdminServiceGetLeaderPartsArgsBuilder struct { - obj *StorageAdminServiceGetLeaderPartsArgs -} - -func NewStorageAdminServiceGetLeaderPartsArgsBuilder() *StorageAdminServiceGetLeaderPartsArgsBuilder{ - return &StorageAdminServiceGetLeaderPartsArgsBuilder{ - obj: NewStorageAdminServiceGetLeaderPartsArgs(), - } -} - -func (p StorageAdminServiceGetLeaderPartsArgsBuilder) Emit() *StorageAdminServiceGetLeaderPartsArgs{ - return &StorageAdminServiceGetLeaderPartsArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceGetLeaderPartsArgsBuilder) Req(req *GetLeaderReq) *StorageAdminServiceGetLeaderPartsArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceGetLeaderPartsArgs) SetReq(req *GetLeaderReq) *StorageAdminServiceGetLeaderPartsArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceGetLeaderPartsResultBuilder struct { - obj *StorageAdminServiceGetLeaderPartsResult -} - -func NewStorageAdminServiceGetLeaderPartsResultBuilder() *StorageAdminServiceGetLeaderPartsResultBuilder{ - return &StorageAdminServiceGetLeaderPartsResultBuilder{ - obj: NewStorageAdminServiceGetLeaderPartsResult(), - } -} - -func (p StorageAdminServiceGetLeaderPartsResultBuilder) Emit() *StorageAdminServiceGetLeaderPartsResult{ - return &StorageAdminServiceGetLeaderPartsResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceGetLeaderPartsResultBuilder) Success(success *GetLeaderPartsResp) *StorageAdminServiceGetLeaderPartsResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceGetLeaderPartsResult) SetSuccess(success *GetLeaderPartsResp) *StorageAdminServiceGetLeaderPartsResult { - s.Success = success - return s -} - -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 -} - -type StorageAdminServiceCheckPeersArgsBuilder struct { - obj *StorageAdminServiceCheckPeersArgs -} - -func NewStorageAdminServiceCheckPeersArgsBuilder() *StorageAdminServiceCheckPeersArgsBuilder{ - return &StorageAdminServiceCheckPeersArgsBuilder{ - obj: NewStorageAdminServiceCheckPeersArgs(), - } -} - -func (p StorageAdminServiceCheckPeersArgsBuilder) Emit() *StorageAdminServiceCheckPeersArgs{ - return &StorageAdminServiceCheckPeersArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceCheckPeersArgsBuilder) Req(req *CheckPeersReq) *StorageAdminServiceCheckPeersArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceCheckPeersArgs) SetReq(req *CheckPeersReq) *StorageAdminServiceCheckPeersArgs { - s.Req = req - return s -} - -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,optional" 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 -} - -type StorageAdminServiceCheckPeersResultBuilder struct { - obj *StorageAdminServiceCheckPeersResult -} - -func NewStorageAdminServiceCheckPeersResultBuilder() *StorageAdminServiceCheckPeersResultBuilder{ - return &StorageAdminServiceCheckPeersResultBuilder{ - obj: NewStorageAdminServiceCheckPeersResult(), - } -} - -func (p StorageAdminServiceCheckPeersResultBuilder) Emit() *StorageAdminServiceCheckPeersResult{ - return &StorageAdminServiceCheckPeersResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceCheckPeersResultBuilder) Success(success *AdminExecResp) *StorageAdminServiceCheckPeersResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceCheckPeersResult) SetSuccess(success *AdminExecResp) *StorageAdminServiceCheckPeersResult { - s.Success = success - return s -} - -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 *AddTaskRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewStorageAdminServiceAddAdminTaskArgs() *StorageAdminServiceAddAdminTaskArgs { - return &StorageAdminServiceAddAdminTaskArgs{ - Req: NewAddTaskRequest(), - } -} - -var StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT *AddTaskRequest -func (p *StorageAdminServiceAddAdminTaskArgs) GetReq() *AddTaskRequest { - if !p.IsSetReq() { - return StorageAdminServiceAddAdminTaskArgs_Req_DEFAULT - } -return p.Req -} -func (p *StorageAdminServiceAddAdminTaskArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type StorageAdminServiceAddAdminTaskArgsBuilder struct { - obj *StorageAdminServiceAddAdminTaskArgs -} - -func NewStorageAdminServiceAddAdminTaskArgsBuilder() *StorageAdminServiceAddAdminTaskArgsBuilder{ - return &StorageAdminServiceAddAdminTaskArgsBuilder{ - obj: NewStorageAdminServiceAddAdminTaskArgs(), - } -} - -func (p StorageAdminServiceAddAdminTaskArgsBuilder) Emit() *StorageAdminServiceAddAdminTaskArgs{ - return &StorageAdminServiceAddAdminTaskArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceAddAdminTaskArgsBuilder) Req(req *AddTaskRequest) *StorageAdminServiceAddAdminTaskArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceAddAdminTaskArgs) SetReq(req *AddTaskRequest) *StorageAdminServiceAddAdminTaskArgs { - s.Req = req - return s -} - -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 = NewAddTaskRequest() - 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 *AddTaskResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewStorageAdminServiceAddAdminTaskResult() *StorageAdminServiceAddAdminTaskResult { - return &StorageAdminServiceAddAdminTaskResult{} -} - -var StorageAdminServiceAddAdminTaskResult_Success_DEFAULT *AddTaskResp -func (p *StorageAdminServiceAddAdminTaskResult) GetSuccess() *AddTaskResp { - if !p.IsSetSuccess() { - return StorageAdminServiceAddAdminTaskResult_Success_DEFAULT - } -return p.Success -} -func (p *StorageAdminServiceAddAdminTaskResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type StorageAdminServiceAddAdminTaskResultBuilder struct { - obj *StorageAdminServiceAddAdminTaskResult -} - -func NewStorageAdminServiceAddAdminTaskResultBuilder() *StorageAdminServiceAddAdminTaskResultBuilder{ - return &StorageAdminServiceAddAdminTaskResultBuilder{ - obj: NewStorageAdminServiceAddAdminTaskResult(), - } -} - -func (p StorageAdminServiceAddAdminTaskResultBuilder) Emit() *StorageAdminServiceAddAdminTaskResult{ - return &StorageAdminServiceAddAdminTaskResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceAddAdminTaskResultBuilder) Success(success *AddTaskResp) *StorageAdminServiceAddAdminTaskResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceAddAdminTaskResult) SetSuccess(success *AddTaskResp) *StorageAdminServiceAddAdminTaskResult { - s.Success = success - return s -} - -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 = NewAddTaskResp() - 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 *StopTaskRequest `thrift:"req,1" db:"req" json:"req"` -} - -func NewStorageAdminServiceStopAdminTaskArgs() *StorageAdminServiceStopAdminTaskArgs { - return &StorageAdminServiceStopAdminTaskArgs{ - Req: NewStopTaskRequest(), - } -} - -var StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT *StopTaskRequest -func (p *StorageAdminServiceStopAdminTaskArgs) GetReq() *StopTaskRequest { - if !p.IsSetReq() { - return StorageAdminServiceStopAdminTaskArgs_Req_DEFAULT - } -return p.Req -} -func (p *StorageAdminServiceStopAdminTaskArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type StorageAdminServiceStopAdminTaskArgsBuilder struct { - obj *StorageAdminServiceStopAdminTaskArgs -} - -func NewStorageAdminServiceStopAdminTaskArgsBuilder() *StorageAdminServiceStopAdminTaskArgsBuilder{ - return &StorageAdminServiceStopAdminTaskArgsBuilder{ - obj: NewStorageAdminServiceStopAdminTaskArgs(), - } -} - -func (p StorageAdminServiceStopAdminTaskArgsBuilder) Emit() *StorageAdminServiceStopAdminTaskArgs{ - return &StorageAdminServiceStopAdminTaskArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceStopAdminTaskArgsBuilder) Req(req *StopTaskRequest) *StorageAdminServiceStopAdminTaskArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceStopAdminTaskArgs) SetReq(req *StopTaskRequest) *StorageAdminServiceStopAdminTaskArgs { - s.Req = req - return s -} - -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 = NewStopTaskRequest() - 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 *StopTaskResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewStorageAdminServiceStopAdminTaskResult() *StorageAdminServiceStopAdminTaskResult { - return &StorageAdminServiceStopAdminTaskResult{} -} - -var StorageAdminServiceStopAdminTaskResult_Success_DEFAULT *StopTaskResp -func (p *StorageAdminServiceStopAdminTaskResult) GetSuccess() *StopTaskResp { - if !p.IsSetSuccess() { - return StorageAdminServiceStopAdminTaskResult_Success_DEFAULT - } -return p.Success -} -func (p *StorageAdminServiceStopAdminTaskResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type StorageAdminServiceStopAdminTaskResultBuilder struct { - obj *StorageAdminServiceStopAdminTaskResult -} - -func NewStorageAdminServiceStopAdminTaskResultBuilder() *StorageAdminServiceStopAdminTaskResultBuilder{ - return &StorageAdminServiceStopAdminTaskResultBuilder{ - obj: NewStorageAdminServiceStopAdminTaskResult(), - } -} - -func (p StorageAdminServiceStopAdminTaskResultBuilder) Emit() *StorageAdminServiceStopAdminTaskResult{ - return &StorageAdminServiceStopAdminTaskResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceStopAdminTaskResultBuilder) Success(success *StopTaskResp) *StorageAdminServiceStopAdminTaskResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceStopAdminTaskResult) SetSuccess(success *StopTaskResp) *StorageAdminServiceStopAdminTaskResult { - s.Success = success - return s -} - -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 = NewStopTaskResp() - 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 StorageAdminServiceClearSpaceArgs struct { - thrift.IRequest - Req *ClearSpaceReq `thrift:"req,1" db:"req" json:"req"` -} - -func NewStorageAdminServiceClearSpaceArgs() *StorageAdminServiceClearSpaceArgs { - return &StorageAdminServiceClearSpaceArgs{ - Req: NewClearSpaceReq(), - } -} - -var StorageAdminServiceClearSpaceArgs_Req_DEFAULT *ClearSpaceReq -func (p *StorageAdminServiceClearSpaceArgs) GetReq() *ClearSpaceReq { - if !p.IsSetReq() { - return StorageAdminServiceClearSpaceArgs_Req_DEFAULT - } -return p.Req -} -func (p *StorageAdminServiceClearSpaceArgs) IsSetReq() bool { - return p != nil && p.Req != nil -} - -type StorageAdminServiceClearSpaceArgsBuilder struct { - obj *StorageAdminServiceClearSpaceArgs -} - -func NewStorageAdminServiceClearSpaceArgsBuilder() *StorageAdminServiceClearSpaceArgsBuilder{ - return &StorageAdminServiceClearSpaceArgsBuilder{ - obj: NewStorageAdminServiceClearSpaceArgs(), - } -} - -func (p StorageAdminServiceClearSpaceArgsBuilder) Emit() *StorageAdminServiceClearSpaceArgs{ - return &StorageAdminServiceClearSpaceArgs{ - Req: p.obj.Req, - } -} - -func (s *StorageAdminServiceClearSpaceArgsBuilder) Req(req *ClearSpaceReq) *StorageAdminServiceClearSpaceArgsBuilder { - s.obj.Req = req - return s -} - -func (s *StorageAdminServiceClearSpaceArgs) SetReq(req *ClearSpaceReq) *StorageAdminServiceClearSpaceArgs { - s.Req = req - return s -} - -func (p *StorageAdminServiceClearSpaceArgs) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *StorageAdminServiceClearSpaceArgs) ReadField1(iprot thrift.Protocol) error { - p.Req = NewClearSpaceReq() - if err := p.Req.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Req), err) - } - return nil -} - -func (p *StorageAdminServiceClearSpaceArgs) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("clearSpace_args"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *StorageAdminServiceClearSpaceArgs) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:req: ", p), err) } - if err := p.Req.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Req), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:req: ", p), err) } - return err -} - -func (p *StorageAdminServiceClearSpaceArgs) String() string { - if p == nil { - return "" - } - - var reqVal string - if p.Req == nil { - reqVal = "" - } else { - reqVal = fmt.Sprintf("%v", p.Req) - } - return fmt.Sprintf("StorageAdminServiceClearSpaceArgs({Req:%s})", reqVal) -} - -// Attributes: -// - Success -type StorageAdminServiceClearSpaceResult struct { - thrift.IResponse - Success *ClearSpaceResp `thrift:"success,0,optional" db:"success" json:"success,omitempty"` -} - -func NewStorageAdminServiceClearSpaceResult() *StorageAdminServiceClearSpaceResult { - return &StorageAdminServiceClearSpaceResult{} -} - -var StorageAdminServiceClearSpaceResult_Success_DEFAULT *ClearSpaceResp -func (p *StorageAdminServiceClearSpaceResult) GetSuccess() *ClearSpaceResp { - if !p.IsSetSuccess() { - return StorageAdminServiceClearSpaceResult_Success_DEFAULT - } -return p.Success -} -func (p *StorageAdminServiceClearSpaceResult) IsSetSuccess() bool { - return p != nil && p.Success != nil -} - -type StorageAdminServiceClearSpaceResultBuilder struct { - obj *StorageAdminServiceClearSpaceResult -} - -func NewStorageAdminServiceClearSpaceResultBuilder() *StorageAdminServiceClearSpaceResultBuilder{ - return &StorageAdminServiceClearSpaceResultBuilder{ - obj: NewStorageAdminServiceClearSpaceResult(), - } -} - -func (p StorageAdminServiceClearSpaceResultBuilder) Emit() *StorageAdminServiceClearSpaceResult{ - return &StorageAdminServiceClearSpaceResult{ - Success: p.obj.Success, - } -} - -func (s *StorageAdminServiceClearSpaceResultBuilder) Success(success *ClearSpaceResp) *StorageAdminServiceClearSpaceResultBuilder { - s.obj.Success = success - return s -} - -func (s *StorageAdminServiceClearSpaceResult) SetSuccess(success *ClearSpaceResp) *StorageAdminServiceClearSpaceResult { - s.Success = success - return s -} - -func (p *StorageAdminServiceClearSpaceResult) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 0: - if err := p.ReadField0(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *StorageAdminServiceClearSpaceResult) ReadField0(iprot thrift.Protocol) error { - p.Success = NewClearSpaceResp() - if err := p.Success.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Success), err) - } - return nil -} - -func (p *StorageAdminServiceClearSpaceResult) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("clearSpace_result"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField0(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *StorageAdminServiceClearSpaceResult) writeField0(oprot thrift.Protocol) (err error) { - if p.IsSetSuccess() { - if err := oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 0:success: ", p), err) } - if err := p.Success.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Success), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 0:success: ", p), err) } - } - return err -} - -func (p *StorageAdminServiceClearSpaceResult) String() string { - if p == nil { - return "" - } - - var successVal string - if p.Success == nil { - successVal = "" - } else { - successVal = fmt.Sprintf("%v", p.Success) - } - return fmt.Sprintf("StorageAdminServiceClearSpaceResult({Success:%s})", successVal) -} - - diff --git a/nebula/storage/ttypes.go b/nebula/storage/ttypes.go deleted file mode 100644 index 155c6bb7..00000000 --- a/nebula/storage/ttypes.go +++ /dev/null @@ -1,18938 +0,0 @@ -// Autogenerated by Thrift Compiler (facebook) -// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -// @generated - -package storage - -import ( - "bytes" - "context" - "sync" - "fmt" - thrift "github.com/vesoft-inc/fbthrift/thrift/lib/go/thrift" - nebula0 "github.com/vesoft-inc/nebula-go/v3/nebula" - meta1 "github.com/vesoft-inc/nebula-go/v3/nebula/meta" - -) - -// (needed to ensure safety because of naive import list construction.) -var _ = thrift.ZERO -var _ = fmt.Printf -var _ = sync.Mutex{} -var _ = bytes.Equal -var _ = context.Background - -var _ = nebula0.GoUnusedProtection__ -var _ = meta1.GoUnusedProtection__ -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,optional" db:"session_id" json:"session_id,omitempty"` - PlanID *nebula0.ExecutionPlanID `thrift:"plan_id,2,optional" db:"plan_id" json:"plan_id,omitempty"` - ProfileDetail *bool `thrift:"profile_detail,3,optional" 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 -} - -type RequestCommonBuilder struct { - obj *RequestCommon -} - -func NewRequestCommonBuilder() *RequestCommonBuilder{ - return &RequestCommonBuilder{ - obj: NewRequestCommon(), - } -} - -func (p RequestCommonBuilder) Emit() *RequestCommon{ - return &RequestCommon{ - SessionID: p.obj.SessionID, - PlanID: p.obj.PlanID, - ProfileDetail: p.obj.ProfileDetail, - } -} - -func (r *RequestCommonBuilder) SessionID(sessionID *nebula0.SessionID) *RequestCommonBuilder { - r.obj.SessionID = sessionID - return r -} - -func (r *RequestCommonBuilder) PlanID(planID *nebula0.ExecutionPlanID) *RequestCommonBuilder { - r.obj.PlanID = planID - return r -} - -func (r *RequestCommonBuilder) ProfileDetail(profileDetail *bool) *RequestCommonBuilder { - r.obj.ProfileDetail = profileDetail - return r -} - -func (r *RequestCommon) SetSessionID(sessionID *nebula0.SessionID) *RequestCommon { - r.SessionID = sessionID - return r -} - -func (r *RequestCommon) SetPlanID(planID *nebula0.ExecutionPlanID) *RequestCommon { - r.PlanID = planID - return r -} - -func (r *RequestCommon) SetProfileDetail(profileDetail *bool) *RequestCommon { - r.ProfileDetail = profileDetail - return r -} - -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,optional" 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 -} - -type PartitionResult_Builder struct { - obj *PartitionResult_ -} - -func NewPartitionResult_Builder() *PartitionResult_Builder{ - return &PartitionResult_Builder{ - obj: NewPartitionResult_(), - } -} - -func (p PartitionResult_Builder) Emit() *PartitionResult_{ - return &PartitionResult_{ - Code: p.obj.Code, - PartID: p.obj.PartID, - Leader: p.obj.Leader, - } -} - -func (p *PartitionResult_Builder) Code(code nebula0.ErrorCode) *PartitionResult_Builder { - p.obj.Code = code - return p -} - -func (p *PartitionResult_Builder) PartID(partID nebula0.PartitionID) *PartitionResult_Builder { - p.obj.PartID = partID - return p -} - -func (p *PartitionResult_Builder) Leader(leader *nebula0.HostAddr) *PartitionResult_Builder { - p.obj.Leader = leader - return p -} - -func (p *PartitionResult_) SetCode(code nebula0.ErrorCode) *PartitionResult_ { - p.Code = code - return p -} - -func (p *PartitionResult_) SetPartID(partID nebula0.PartitionID) *PartitionResult_ { - p.PartID = partID - return p -} - -func (p *PartitionResult_) SetLeader(leader *nebula0.HostAddr) *PartitionResult_ { - p.Leader = leader - return p -} - -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 int64 `thrift:"latency_in_us,2,required" db:"latency_in_us" json:"latency_in_us"` - LatencyDetailUs map[string]int32 `thrift:"latency_detail_us,3,optional" 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() int64 { - 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 -} - -type ResponseCommonBuilder struct { - obj *ResponseCommon -} - -func NewResponseCommonBuilder() *ResponseCommonBuilder{ - return &ResponseCommonBuilder{ - obj: NewResponseCommon(), - } -} - -func (p ResponseCommonBuilder) Emit() *ResponseCommon{ - return &ResponseCommon{ - FailedParts: p.obj.FailedParts, - LatencyInUs: p.obj.LatencyInUs, - LatencyDetailUs: p.obj.LatencyDetailUs, - } -} - -func (r *ResponseCommonBuilder) FailedParts(failedParts []*PartitionResult_) *ResponseCommonBuilder { - r.obj.FailedParts = failedParts - return r -} - -func (r *ResponseCommonBuilder) LatencyInUs(latencyInUs int64) *ResponseCommonBuilder { - r.obj.LatencyInUs = latencyInUs - return r -} - -func (r *ResponseCommonBuilder) LatencyDetailUs(latencyDetailUs map[string]int32) *ResponseCommonBuilder { - r.obj.LatencyDetailUs = latencyDetailUs - return r -} - -func (r *ResponseCommon) SetFailedParts(failedParts []*PartitionResult_) *ResponseCommon { - r.FailedParts = failedParts - return r -} - -func (r *ResponseCommon) SetLatencyInUs(latencyInUs int64) *ResponseCommon { - r.LatencyInUs = latencyInUs - return r -} - -func (r *ResponseCommon) SetLatencyDetailUs(latencyDetailUs map[string]int32) *ResponseCommon { - r.LatencyDetailUs = latencyDetailUs - return r -} - -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.ReadI64(); 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.I64, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:latency_in_us: ", p), err) } - if err := oprot.WriteI64(int64(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 -} -type StatPropBuilder struct { - obj *StatProp -} - -func NewStatPropBuilder() *StatPropBuilder{ - return &StatPropBuilder{ - obj: NewStatProp(), - } -} - -func (p StatPropBuilder) Emit() *StatProp{ - return &StatProp{ - Alias: p.obj.Alias, - Prop: p.obj.Prop, - Stat: p.obj.Stat, - } -} - -func (s *StatPropBuilder) Alias(alias []byte) *StatPropBuilder { - s.obj.Alias = alias - return s -} - -func (s *StatPropBuilder) Prop(prop []byte) *StatPropBuilder { - s.obj.Prop = prop - return s -} - -func (s *StatPropBuilder) Stat(stat StatType) *StatPropBuilder { - s.obj.Stat = stat - return s -} - -func (s *StatProp) SetAlias(alias []byte) *StatProp { - s.Alias = alias - return s -} - -func (s *StatProp) SetProp(prop []byte) *StatProp { - s.Prop = prop - return s -} - -func (s *StatProp) SetStat(stat StatType) *StatProp { - s.Stat = stat - return s -} - -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 -} -type ExprBuilder struct { - obj *Expr -} - -func NewExprBuilder() *ExprBuilder{ - return &ExprBuilder{ - obj: NewExpr(), - } -} - -func (p ExprBuilder) Emit() *Expr{ - return &Expr{ - Alias: p.obj.Alias, - Expr: p.obj.Expr, - } -} - -func (e *ExprBuilder) Alias(alias []byte) *ExprBuilder { - e.obj.Alias = alias - return e -} - -func (e *ExprBuilder) Expr(expr []byte) *ExprBuilder { - e.obj.Expr = expr - return e -} - -func (e *Expr) SetAlias(alias []byte) *Expr { - e.Alias = alias - return e -} - -func (e *Expr) SetExpr(expr []byte) *Expr { - e.Expr = expr - return e -} - -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 -} -type EdgePropBuilder struct { - obj *EdgeProp -} - -func NewEdgePropBuilder() *EdgePropBuilder{ - return &EdgePropBuilder{ - obj: NewEdgeProp(), - } -} - -func (p EdgePropBuilder) Emit() *EdgeProp{ - return &EdgeProp{ - Type: p.obj.Type, - Props: p.obj.Props, - } -} - -func (e *EdgePropBuilder) Type(type_a1 nebula0.EdgeType) *EdgePropBuilder { - e.obj.Type = type_a1 - return e -} - -func (e *EdgePropBuilder) Props(props [][]byte) *EdgePropBuilder { - e.obj.Props = props - return e -} - -func (e *EdgeProp) SetType(type_a1 nebula0.EdgeType) *EdgeProp { - e.Type = type_a1 - return e -} - -func (e *EdgeProp) SetProps(props [][]byte) *EdgeProp { - e.Props = props - return e -} - -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 -} -type VertexPropBuilder struct { - obj *VertexProp -} - -func NewVertexPropBuilder() *VertexPropBuilder{ - return &VertexPropBuilder{ - obj: NewVertexProp(), - } -} - -func (p VertexPropBuilder) Emit() *VertexProp{ - return &VertexProp{ - Tag: p.obj.Tag, - Props: p.obj.Props, - } -} - -func (v *VertexPropBuilder) Tag(tag nebula0.TagID) *VertexPropBuilder { - v.obj.Tag = tag - return v -} - -func (v *VertexPropBuilder) Props(props [][]byte) *VertexPropBuilder { - v.obj.Props = props - return v -} - -func (v *VertexProp) SetTag(tag nebula0.TagID) *VertexProp { - v.Tag = tag - return v -} - -func (v *VertexProp) SetProps(props [][]byte) *VertexProp { - v.Props = props - return v -} - -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 -} -type OrderByBuilder struct { - obj *OrderBy -} - -func NewOrderByBuilder() *OrderByBuilder{ - return &OrderByBuilder{ - obj: NewOrderBy(), - } -} - -func (p OrderByBuilder) Emit() *OrderBy{ - return &OrderBy{ - Prop: p.obj.Prop, - Direction: p.obj.Direction, - } -} - -func (o *OrderByBuilder) Prop(prop []byte) *OrderByBuilder { - o.obj.Prop = prop - return o -} - -func (o *OrderByBuilder) Direction(direction OrderDirection) *OrderByBuilder { - o.obj.Direction = direction - return o -} - -func (o *OrderBy) SetProp(prop []byte) *OrderBy { - o.Prop = prop - return o -} - -func (o *OrderBy) SetDirection(direction OrderDirection) *OrderBy { - o.Direction = direction - return o -} - -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 -// - TagFilter -type TraverseSpec struct { - EdgeTypes []nebula0.EdgeType `thrift:"edge_types,1" db:"edge_types" json:"edge_types"` - EdgeDirection EdgeDirection `thrift:"edge_direction,2" db:"edge_direction" json:"edge_direction"` - Dedup bool `thrift:"dedup,3" db:"dedup" json:"dedup"` - StatProps []*StatProp `thrift:"stat_props,4,optional" db:"stat_props" json:"stat_props,omitempty"` - VertexProps []*VertexProp `thrift:"vertex_props,5,optional" db:"vertex_props" json:"vertex_props,omitempty"` - EdgeProps []*EdgeProp `thrift:"edge_props,6,optional" db:"edge_props" json:"edge_props,omitempty"` - Expressions []*Expr `thrift:"expressions,7,optional" db:"expressions" json:"expressions,omitempty"` - OrderBy []*OrderBy `thrift:"order_by,8,optional" db:"order_by" json:"order_by,omitempty"` - Random *bool `thrift:"random,9,optional" db:"random" json:"random,omitempty"` - Limit *int64 `thrift:"limit,10,optional" db:"limit" json:"limit,omitempty"` - Filter []byte `thrift:"filter,11,optional" db:"filter" json:"filter,omitempty"` - TagFilter []byte `thrift:"tag_filter,12,optional" db:"tag_filter" json:"tag_filter,omitempty"` -} - -func NewTraverseSpec() *TraverseSpec { - 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 -} -var TraverseSpec_TagFilter_DEFAULT []byte - -func (p *TraverseSpec) GetTagFilter() []byte { - return p.TagFilter -} -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) IsSetTagFilter() bool { - return p != nil && p.TagFilter != nil -} - -type TraverseSpecBuilder struct { - obj *TraverseSpec -} - -func NewTraverseSpecBuilder() *TraverseSpecBuilder{ - return &TraverseSpecBuilder{ - obj: NewTraverseSpec(), - } -} - -func (p TraverseSpecBuilder) Emit() *TraverseSpec{ - return &TraverseSpec{ - EdgeTypes: p.obj.EdgeTypes, - EdgeDirection: p.obj.EdgeDirection, - Dedup: p.obj.Dedup, - StatProps: p.obj.StatProps, - VertexProps: p.obj.VertexProps, - EdgeProps: p.obj.EdgeProps, - Expressions: p.obj.Expressions, - OrderBy: p.obj.OrderBy, - Random: p.obj.Random, - Limit: p.obj.Limit, - Filter: p.obj.Filter, - TagFilter: p.obj.TagFilter, - } -} - -func (t *TraverseSpecBuilder) EdgeTypes(edgeTypes []nebula0.EdgeType) *TraverseSpecBuilder { - t.obj.EdgeTypes = edgeTypes - return t -} - -func (t *TraverseSpecBuilder) EdgeDirection(edgeDirection EdgeDirection) *TraverseSpecBuilder { - t.obj.EdgeDirection = edgeDirection - return t -} - -func (t *TraverseSpecBuilder) Dedup(dedup bool) *TraverseSpecBuilder { - t.obj.Dedup = dedup - return t -} - -func (t *TraverseSpecBuilder) StatProps(statProps []*StatProp) *TraverseSpecBuilder { - t.obj.StatProps = statProps - return t -} - -func (t *TraverseSpecBuilder) VertexProps(vertexProps []*VertexProp) *TraverseSpecBuilder { - t.obj.VertexProps = vertexProps - return t -} - -func (t *TraverseSpecBuilder) EdgeProps(edgeProps []*EdgeProp) *TraverseSpecBuilder { - t.obj.EdgeProps = edgeProps - return t -} - -func (t *TraverseSpecBuilder) Expressions(expressions []*Expr) *TraverseSpecBuilder { - t.obj.Expressions = expressions - return t -} - -func (t *TraverseSpecBuilder) OrderBy(orderBy []*OrderBy) *TraverseSpecBuilder { - t.obj.OrderBy = orderBy - return t -} - -func (t *TraverseSpecBuilder) Random(random *bool) *TraverseSpecBuilder { - t.obj.Random = random - return t -} - -func (t *TraverseSpecBuilder) Limit(limit *int64) *TraverseSpecBuilder { - t.obj.Limit = limit - return t -} - -func (t *TraverseSpecBuilder) Filter(filter []byte) *TraverseSpecBuilder { - t.obj.Filter = filter - return t -} - -func (t *TraverseSpecBuilder) TagFilter(tagFilter []byte) *TraverseSpecBuilder { - t.obj.TagFilter = tagFilter - return t -} - -func (t *TraverseSpec) SetEdgeTypes(edgeTypes []nebula0.EdgeType) *TraverseSpec { - t.EdgeTypes = edgeTypes - return t -} - -func (t *TraverseSpec) SetEdgeDirection(edgeDirection EdgeDirection) *TraverseSpec { - t.EdgeDirection = edgeDirection - return t -} - -func (t *TraverseSpec) SetDedup(dedup bool) *TraverseSpec { - t.Dedup = dedup - return t -} - -func (t *TraverseSpec) SetStatProps(statProps []*StatProp) *TraverseSpec { - t.StatProps = statProps - return t -} - -func (t *TraverseSpec) SetVertexProps(vertexProps []*VertexProp) *TraverseSpec { - t.VertexProps = vertexProps - return t -} - -func (t *TraverseSpec) SetEdgeProps(edgeProps []*EdgeProp) *TraverseSpec { - t.EdgeProps = edgeProps - return t -} - -func (t *TraverseSpec) SetExpressions(expressions []*Expr) *TraverseSpec { - t.Expressions = expressions - return t -} - -func (t *TraverseSpec) SetOrderBy(orderBy []*OrderBy) *TraverseSpec { - t.OrderBy = orderBy - return t -} - -func (t *TraverseSpec) SetRandom(random *bool) *TraverseSpec { - t.Random = random - return t -} - -func (t *TraverseSpec) SetLimit(limit *int64) *TraverseSpec { - t.Limit = limit - return t -} - -func (t *TraverseSpec) SetFilter(filter []byte) *TraverseSpec { - t.Filter = filter - return t -} - -func (t *TraverseSpec) SetTagFilter(tagFilter []byte) *TraverseSpec { - t.TagFilter = tagFilter - return t -} - -func (p *TraverseSpec) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - 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 - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - 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) ReadField12(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 12: ", err) - } else { - p.TagFilter = v - } - return nil -} - -func (p *TraverseSpec) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("TraverseSpec"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } - if err := p.writeField6(oprot); err != nil { return err } - if err := p.writeField7(oprot); err != nil { return err } - if err := p.writeField8(oprot); err != nil { return err } - if err := p.writeField9(oprot); err != nil { return err } - if err := p.writeField10(oprot); err != nil { return err } - if err := p.writeField11(oprot); err != nil { return err } - if err := p.writeField12(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *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) writeField12(oprot thrift.Protocol) (err error) { - if p.IsSetTagFilter() { - if err := oprot.WriteFieldBegin("tag_filter", thrift.STRING, 12); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 12:tag_filter: ", p), err) } - if err := oprot.WriteBinary(p.TagFilter); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.tag_filter (12) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 12:tag_filter: ", p), err) } - } - return err -} - -func (p *TraverseSpec) String() string { - if p == nil { - return "" - } - - 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) - tagFilterVal := fmt.Sprintf("%v", p.TagFilter) - return fmt.Sprintf("TraverseSpec({EdgeTypes:%s EdgeDirection:%s Dedup:%s StatProps:%s VertexProps:%s EdgeProps:%s Expressions:%s OrderBy:%s Random:%s Limit:%s Filter:%s TagFilter:%s})", edgeTypesVal, edgeDirectionVal, dedupVal, statPropsVal, vertexPropsVal, edgePropsVal, expressionsVal, orderByVal, randomVal, limitVal, filterVal, tagFilterVal) -} - -// Attributes: -// - 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.Value `thrift:"parts,3" db:"parts" json:"parts"` - TraverseSpec *TraverseSpec `thrift:"traverse_spec,4" db:"traverse_spec" json:"traverse_spec"` - Common *RequestCommon `thrift:"common,5,optional" db:"common" json:"common,omitempty"` -} - -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.Value { - 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 -} - -type GetNeighborsRequestBuilder struct { - obj *GetNeighborsRequest -} - -func NewGetNeighborsRequestBuilder() *GetNeighborsRequestBuilder{ - return &GetNeighborsRequestBuilder{ - obj: NewGetNeighborsRequest(), - } -} - -func (p GetNeighborsRequestBuilder) Emit() *GetNeighborsRequest{ - return &GetNeighborsRequest{ - SpaceID: p.obj.SpaceID, - ColumnNames: p.obj.ColumnNames, - Parts: p.obj.Parts, - TraverseSpec: p.obj.TraverseSpec, - Common: p.obj.Common, - } -} - -func (g *GetNeighborsRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetNeighborsRequestBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetNeighborsRequestBuilder) ColumnNames(columnNames [][]byte) *GetNeighborsRequestBuilder { - g.obj.ColumnNames = columnNames - return g -} - -func (g *GetNeighborsRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetNeighborsRequestBuilder { - g.obj.Parts = parts - return g -} - -func (g *GetNeighborsRequestBuilder) TraverseSpec(traverseSpec *TraverseSpec) *GetNeighborsRequestBuilder { - g.obj.TraverseSpec = traverseSpec - return g -} - -func (g *GetNeighborsRequestBuilder) Common(common *RequestCommon) *GetNeighborsRequestBuilder { - g.obj.Common = common - return g -} - -func (g *GetNeighborsRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetNeighborsRequest { - g.SpaceID = spaceID - return g -} - -func (g *GetNeighborsRequest) SetColumnNames(columnNames [][]byte) *GetNeighborsRequest { - g.ColumnNames = columnNames - return g -} - -func (g *GetNeighborsRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetNeighborsRequest { - g.Parts = parts - return g -} - -func (g *GetNeighborsRequest) SetTraverseSpec(traverseSpec *TraverseSpec) *GetNeighborsRequest { - g.TraverseSpec = traverseSpec - return g -} - -func (g *GetNeighborsRequest) SetCommon(common *RequestCommon) *GetNeighborsRequest { - g.Common = common - return g -} - -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.Value, size) - p.Parts = tMap - for i := 0; i < size; i ++ { - var _key14 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key14 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.Value, 0, size) - _val15 := tSlice - for i := 0; i < size; i ++ { - _elem16 := nebula0.NewValue() - if err := _elem16.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem16), err) - } - _val15 = append(_val15, _elem16) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key14] = _val15 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *GetNeighborsRequest) ReadField4(iprot thrift.Protocol) error { - p.TraverseSpec = NewTraverseSpec() - if err := p.TraverseSpec.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.TraverseSpec), err) - } - return nil -} - -func (p *GetNeighborsRequest) ReadField5(iprot thrift.Protocol) error { - p.Common = NewRequestCommon() - if err := p.Common.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) - } - return nil -} - -func (p *GetNeighborsRequest) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetNeighborsRequest"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := p.writeField5(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetNeighborsRequest) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("space_id", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_id: ", p), err) } - if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.space_id (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:space_id: ", p), err) } - return err -} - -func (p *GetNeighborsRequest) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("column_names", thrift.LIST, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:column_names: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.ColumnNames)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ColumnNames { - if err := oprot.WriteBinary(v); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:column_names: ", p), err) } - return err -} - -func (p *GetNeighborsRequest) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("parts", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:parts: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.Parts)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Parts { - if err := oprot.WriteI32(int32(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range v { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - } - if err := oprot.WriteMapEnd(); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:parts: ", p), err) } - return err -} - -func (p *GetNeighborsRequest) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("traverse_spec", thrift.STRUCT, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:traverse_spec: ", p), err) } - if err := p.TraverseSpec.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.TraverseSpec), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:traverse_spec: ", p), err) } - return err -} - -func (p *GetNeighborsRequest) writeField5(oprot thrift.Protocol) (err error) { - if p.IsSetCommon() { - if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:common: ", p), err) } - if err := p.Common.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:common: ", p), err) } - } - return err -} - -func (p *GetNeighborsRequest) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - columnNamesVal := fmt.Sprintf("%v", p.ColumnNames) - partsVal := fmt.Sprintf("%v", p.Parts) - var traverseSpecVal string - if p.TraverseSpec == nil { - traverseSpecVal = "" - } else { - traverseSpecVal = fmt.Sprintf("%v", p.TraverseSpec) - } - var commonVal string - if p.Common == nil { - commonVal = "" - } else { - commonVal = fmt.Sprintf("%v", p.Common) - } - return fmt.Sprintf("GetNeighborsRequest({SpaceID:%s ColumnNames:%s Parts:%s TraverseSpec:%s Common:%s})", spaceIDVal, columnNamesVal, partsVal, traverseSpecVal, commonVal) -} - -// Attributes: -// - Result_ -// - Vertices -type GetNeighborsResponse struct { - Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - Vertices *nebula0.DataSet `thrift:"vertices,2,optional" db:"vertices" json:"vertices,omitempty"` -} - -func NewGetNeighborsResponse() *GetNeighborsResponse { - return &GetNeighborsResponse{ - Result_: NewResponseCommon(), - } -} - -var GetNeighborsResponse_Result__DEFAULT *ResponseCommon -func (p *GetNeighborsResponse) GetResult_() *ResponseCommon { - if !p.IsSetResult_() { - return GetNeighborsResponse_Result__DEFAULT - } -return p.Result_ -} -var GetNeighborsResponse_Vertices_DEFAULT *nebula0.DataSet -func (p *GetNeighborsResponse) GetVertices() *nebula0.DataSet { - if !p.IsSetVertices() { - return GetNeighborsResponse_Vertices_DEFAULT - } -return p.Vertices -} -func (p *GetNeighborsResponse) IsSetResult_() bool { - return p != nil && p.Result_ != nil -} - -func (p *GetNeighborsResponse) IsSetVertices() bool { - return p != nil && p.Vertices != nil -} - -type GetNeighborsResponseBuilder struct { - obj *GetNeighborsResponse -} - -func NewGetNeighborsResponseBuilder() *GetNeighborsResponseBuilder{ - return &GetNeighborsResponseBuilder{ - obj: NewGetNeighborsResponse(), - } -} - -func (p GetNeighborsResponseBuilder) Emit() *GetNeighborsResponse{ - return &GetNeighborsResponse{ - Result_: p.obj.Result_, - Vertices: p.obj.Vertices, - } -} - -func (g *GetNeighborsResponseBuilder) Result_(result *ResponseCommon) *GetNeighborsResponseBuilder { - g.obj.Result_ = result - return g -} - -func (g *GetNeighborsResponseBuilder) Vertices(vertices *nebula0.DataSet) *GetNeighborsResponseBuilder { - g.obj.Vertices = vertices - return g -} - -func (g *GetNeighborsResponse) SetResult_(result *ResponseCommon) *GetNeighborsResponse { - g.Result_ = result - return g -} - -func (g *GetNeighborsResponse) SetVertices(vertices *nebula0.DataSet) *GetNeighborsResponse { - g.Vertices = vertices - return g -} - -func (p *GetNeighborsResponse) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - var issetResult_ bool = false; - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - issetResult_ = true - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - if !issetResult_{ - return thrift.NewProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("Required field Result_ is not set")); - } - return nil -} - -func (p *GetNeighborsResponse) ReadField1(iprot thrift.Protocol) error { - p.Result_ = NewResponseCommon() - if err := p.Result_.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) - } - return nil -} - -func (p *GetNeighborsResponse) ReadField2(iprot thrift.Protocol) error { - p.Vertices = nebula0.NewDataSet() - if err := p.Vertices.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Vertices), err) - } - return nil -} - -func (p *GetNeighborsResponse) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetNeighborsResponse"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetNeighborsResponse) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } - if err := p.Result_.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Result_), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:result: ", p), err) } - return err -} - -func (p *GetNeighborsResponse) writeField2(oprot thrift.Protocol) (err error) { - if p.IsSetVertices() { - if err := oprot.WriteFieldBegin("vertices", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:vertices: ", p), err) } - if err := p.Vertices.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Vertices), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:vertices: ", p), err) } - } - return err -} - -func (p *GetNeighborsResponse) String() string { - if p == nil { - return "" - } - - var resultVal string - if p.Result_ == nil { - resultVal = "" - } else { - resultVal = fmt.Sprintf("%v", p.Result_) - } - var verticesVal string - if p.Vertices == nil { - verticesVal = "" - } else { - verticesVal = fmt.Sprintf("%v", p.Vertices) - } - return fmt.Sprintf("GetNeighborsResponse({Result_:%s Vertices:%s})", resultVal, verticesVal) -} - -// Attributes: -// - SpaceID -// - Parts -// - EdgeTypes -// - Common -type GetDstBySrcRequest struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Parts map[nebula0.PartitionID][]*nebula0.Value `thrift:"parts,2" db:"parts" json:"parts"` - EdgeTypes []nebula0.EdgeType `thrift:"edge_types,3" db:"edge_types" json:"edge_types"` - Common *RequestCommon `thrift:"common,4,optional" db:"common" json:"common,omitempty"` -} - -func NewGetDstBySrcRequest() *GetDstBySrcRequest { - return &GetDstBySrcRequest{} -} - - -func (p *GetDstBySrcRequest) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -func (p *GetDstBySrcRequest) GetParts() map[nebula0.PartitionID][]*nebula0.Value { - return p.Parts -} - -func (p *GetDstBySrcRequest) GetEdgeTypes() []nebula0.EdgeType { - return p.EdgeTypes -} -var GetDstBySrcRequest_Common_DEFAULT *RequestCommon -func (p *GetDstBySrcRequest) GetCommon() *RequestCommon { - if !p.IsSetCommon() { - return GetDstBySrcRequest_Common_DEFAULT - } -return p.Common -} -func (p *GetDstBySrcRequest) IsSetCommon() bool { - return p != nil && p.Common != nil -} - -type GetDstBySrcRequestBuilder struct { - obj *GetDstBySrcRequest -} - -func NewGetDstBySrcRequestBuilder() *GetDstBySrcRequestBuilder{ - return &GetDstBySrcRequestBuilder{ - obj: NewGetDstBySrcRequest(), - } -} - -func (p GetDstBySrcRequestBuilder) Emit() *GetDstBySrcRequest{ - return &GetDstBySrcRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - EdgeTypes: p.obj.EdgeTypes, - Common: p.obj.Common, - } -} - -func (g *GetDstBySrcRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetDstBySrcRequestBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetDstBySrcRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetDstBySrcRequestBuilder { - g.obj.Parts = parts - return g -} - -func (g *GetDstBySrcRequestBuilder) EdgeTypes(edgeTypes []nebula0.EdgeType) *GetDstBySrcRequestBuilder { - g.obj.EdgeTypes = edgeTypes - return g -} - -func (g *GetDstBySrcRequestBuilder) Common(common *RequestCommon) *GetDstBySrcRequestBuilder { - g.obj.Common = common - return g -} - -func (g *GetDstBySrcRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetDstBySrcRequest { - g.SpaceID = spaceID - return g -} - -func (g *GetDstBySrcRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.Value) *GetDstBySrcRequest { - g.Parts = parts - return g -} - -func (g *GetDstBySrcRequest) SetEdgeTypes(edgeTypes []nebula0.EdgeType) *GetDstBySrcRequest { - g.EdgeTypes = edgeTypes - return g -} - -func (g *GetDstBySrcRequest) SetCommon(common *RequestCommon) *GetDstBySrcRequest { - g.Common = common - return g -} - -func (p *GetDstBySrcRequest) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - case 4: - if err := p.ReadField4(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GetDstBySrcRequest) 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 *GetDstBySrcRequest) ReadField2(iprot thrift.Protocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.PartitionID][]*nebula0.Value, 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.Value, 0, size) - _val18 := tSlice - for i := 0; i < size; i ++ { - _elem19 := nebula0.NewValue() - 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 *GetDstBySrcRequest) ReadField3(iprot thrift.Protocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]nebula0.EdgeType, 0, size) - p.EdgeTypes = tSlice - for i := 0; i < size; i ++ { - var _elem20 nebula0.EdgeType - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.EdgeType(v) - _elem20 = temp - } - p.EdgeTypes = append(p.EdgeTypes, _elem20) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *GetDstBySrcRequest) ReadField4(iprot thrift.Protocol) error { - p.Common = NewRequestCommon() - if err := p.Common.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) - } - return nil -} - -func (p *GetDstBySrcRequest) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetDstBySrcRequest"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetDstBySrcRequest) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("space_id", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_id: ", p), err) } - if err := oprot.WriteI32(int32(p.SpaceID)); err != nil { - 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 *GetDstBySrcRequest) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("parts", thrift.MAP, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:parts: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.Parts)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - 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 *GetDstBySrcRequest) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("edge_types", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:edge_types: ", p), err) } - if err := oprot.WriteListBegin(thrift.I32, len(p.EdgeTypes)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.EdgeTypes { - if err := oprot.WriteI32(int32(v)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:edge_types: ", p), err) } - return err -} - -func (p *GetDstBySrcRequest) 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 *GetDstBySrcRequest) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - partsVal := fmt.Sprintf("%v", p.Parts) - edgeTypesVal := fmt.Sprintf("%v", p.EdgeTypes) - var commonVal string - if p.Common == nil { - commonVal = "" - } else { - commonVal = fmt.Sprintf("%v", p.Common) - } - return fmt.Sprintf("GetDstBySrcRequest({SpaceID:%s Parts:%s EdgeTypes:%s Common:%s})", spaceIDVal, partsVal, edgeTypesVal, commonVal) -} - -// Attributes: -// - Result_ -// - Dsts -type GetDstBySrcResponse struct { - Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - Dsts *nebula0.DataSet `thrift:"dsts,2,optional" db:"dsts" json:"dsts,omitempty"` -} - -func NewGetDstBySrcResponse() *GetDstBySrcResponse { - return &GetDstBySrcResponse{ - Result_: NewResponseCommon(), - } -} - -var GetDstBySrcResponse_Result__DEFAULT *ResponseCommon -func (p *GetDstBySrcResponse) GetResult_() *ResponseCommon { - if !p.IsSetResult_() { - return GetDstBySrcResponse_Result__DEFAULT - } -return p.Result_ -} -var GetDstBySrcResponse_Dsts_DEFAULT *nebula0.DataSet -func (p *GetDstBySrcResponse) GetDsts() *nebula0.DataSet { - if !p.IsSetDsts() { - return GetDstBySrcResponse_Dsts_DEFAULT - } -return p.Dsts -} -func (p *GetDstBySrcResponse) IsSetResult_() bool { - return p != nil && p.Result_ != nil -} - -func (p *GetDstBySrcResponse) IsSetDsts() bool { - return p != nil && p.Dsts != nil -} - -type GetDstBySrcResponseBuilder struct { - obj *GetDstBySrcResponse -} - -func NewGetDstBySrcResponseBuilder() *GetDstBySrcResponseBuilder{ - return &GetDstBySrcResponseBuilder{ - obj: NewGetDstBySrcResponse(), - } -} - -func (p GetDstBySrcResponseBuilder) Emit() *GetDstBySrcResponse{ - return &GetDstBySrcResponse{ - Result_: p.obj.Result_, - Dsts: p.obj.Dsts, - } -} - -func (g *GetDstBySrcResponseBuilder) Result_(result *ResponseCommon) *GetDstBySrcResponseBuilder { - g.obj.Result_ = result - return g -} - -func (g *GetDstBySrcResponseBuilder) Dsts(dsts *nebula0.DataSet) *GetDstBySrcResponseBuilder { - g.obj.Dsts = dsts - return g -} - -func (g *GetDstBySrcResponse) SetResult_(result *ResponseCommon) *GetDstBySrcResponse { - g.Result_ = result - return g -} - -func (g *GetDstBySrcResponse) SetDsts(dsts *nebula0.DataSet) *GetDstBySrcResponse { - g.Dsts = dsts - return g -} - -func (p *GetDstBySrcResponse) 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 *GetDstBySrcResponse) ReadField1(iprot thrift.Protocol) error { - p.Result_ = NewResponseCommon() - if err := p.Result_.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) - } - return nil -} - -func (p *GetDstBySrcResponse) ReadField2(iprot thrift.Protocol) error { - p.Dsts = nebula0.NewDataSet() - if err := p.Dsts.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Dsts), err) - } - return nil -} - -func (p *GetDstBySrcResponse) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("GetDstBySrcResponse"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *GetDstBySrcResponse) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("result", thrift.STRUCT, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:result: ", p), err) } - if err := p.Result_.Write(oprot); err != nil { - 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 *GetDstBySrcResponse) writeField2(oprot thrift.Protocol) (err error) { - if p.IsSetDsts() { - if err := oprot.WriteFieldBegin("dsts", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:dsts: ", p), err) } - if err := p.Dsts.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Dsts), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:dsts: ", p), err) } - } - return err -} - -func (p *GetDstBySrcResponse) String() string { - if p == nil { - return "" - } - - var resultVal string - if p.Result_ == nil { - resultVal = "" - } else { - resultVal = fmt.Sprintf("%v", p.Result_) - } - var dstsVal string - if p.Dsts == nil { - dstsVal = "" - } else { - dstsVal = fmt.Sprintf("%v", p.Dsts) - } - return fmt.Sprintf("GetDstBySrcResponse({Result_:%s Dsts:%s})", resultVal, dstsVal) -} - -// 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 -} - -type ExecResponseBuilder struct { - obj *ExecResponse -} - -func NewExecResponseBuilder() *ExecResponseBuilder{ - return &ExecResponseBuilder{ - obj: NewExecResponse(), - } -} - -func (p ExecResponseBuilder) Emit() *ExecResponse{ - return &ExecResponse{ - Result_: p.obj.Result_, - } -} - -func (e *ExecResponseBuilder) Result_(result *ResponseCommon) *ExecResponseBuilder { - e.obj.Result_ = result - return e -} - -func (e *ExecResponse) SetResult_(result *ResponseCommon) *ExecResponse { - e.Result_ = result - return e -} - -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,optional" db:"vertex_props" json:"vertex_props,omitempty"` - EdgeProps []*EdgeProp `thrift:"edge_props,4,optional" db:"edge_props" json:"edge_props,omitempty"` - Expressions []*Expr `thrift:"expressions,5,optional" db:"expressions" json:"expressions,omitempty"` - Dedup bool `thrift:"dedup,6" db:"dedup" json:"dedup"` - OrderBy []*OrderBy `thrift:"order_by,7,optional" db:"order_by" json:"order_by,omitempty"` - Limit *int64 `thrift:"limit,8,optional" db:"limit" json:"limit,omitempty"` - Filter []byte `thrift:"filter,9,optional" db:"filter" json:"filter,omitempty"` - Common *RequestCommon `thrift:"common,10,optional" 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 -} - -type GetPropRequestBuilder struct { - obj *GetPropRequest -} - -func NewGetPropRequestBuilder() *GetPropRequestBuilder{ - return &GetPropRequestBuilder{ - obj: NewGetPropRequest(), - } -} - -func (p GetPropRequestBuilder) Emit() *GetPropRequest{ - return &GetPropRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - VertexProps: p.obj.VertexProps, - EdgeProps: p.obj.EdgeProps, - Expressions: p.obj.Expressions, - Dedup: p.obj.Dedup, - OrderBy: p.obj.OrderBy, - Limit: p.obj.Limit, - Filter: p.obj.Filter, - Common: p.obj.Common, - } -} - -func (g *GetPropRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetPropRequestBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetPropRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.Row) *GetPropRequestBuilder { - g.obj.Parts = parts - return g -} - -func (g *GetPropRequestBuilder) VertexProps(vertexProps []*VertexProp) *GetPropRequestBuilder { - g.obj.VertexProps = vertexProps - return g -} - -func (g *GetPropRequestBuilder) EdgeProps(edgeProps []*EdgeProp) *GetPropRequestBuilder { - g.obj.EdgeProps = edgeProps - return g -} - -func (g *GetPropRequestBuilder) Expressions(expressions []*Expr) *GetPropRequestBuilder { - g.obj.Expressions = expressions - return g -} - -func (g *GetPropRequestBuilder) Dedup(dedup bool) *GetPropRequestBuilder { - g.obj.Dedup = dedup - return g -} - -func (g *GetPropRequestBuilder) OrderBy(orderBy []*OrderBy) *GetPropRequestBuilder { - g.obj.OrderBy = orderBy - return g -} - -func (g *GetPropRequestBuilder) Limit(limit *int64) *GetPropRequestBuilder { - g.obj.Limit = limit - return g -} - -func (g *GetPropRequestBuilder) Filter(filter []byte) *GetPropRequestBuilder { - g.obj.Filter = filter - return g -} - -func (g *GetPropRequestBuilder) Common(common *RequestCommon) *GetPropRequestBuilder { - g.obj.Common = common - return g -} - -func (g *GetPropRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetPropRequest { - g.SpaceID = spaceID - return g -} - -func (g *GetPropRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.Row) *GetPropRequest { - g.Parts = parts - return g -} - -func (g *GetPropRequest) SetVertexProps(vertexProps []*VertexProp) *GetPropRequest { - g.VertexProps = vertexProps - return g -} - -func (g *GetPropRequest) SetEdgeProps(edgeProps []*EdgeProp) *GetPropRequest { - g.EdgeProps = edgeProps - return g -} - -func (g *GetPropRequest) SetExpressions(expressions []*Expr) *GetPropRequest { - g.Expressions = expressions - return g -} - -func (g *GetPropRequest) SetDedup(dedup bool) *GetPropRequest { - g.Dedup = dedup - return g -} - -func (g *GetPropRequest) SetOrderBy(orderBy []*OrderBy) *GetPropRequest { - g.OrderBy = orderBy - return g -} - -func (g *GetPropRequest) SetLimit(limit *int64) *GetPropRequest { - g.Limit = limit - return g -} - -func (g *GetPropRequest) SetFilter(filter []byte) *GetPropRequest { - g.Filter = filter - return g -} - -func (g *GetPropRequest) SetCommon(common *RequestCommon) *GetPropRequest { - g.Common = common - return g -} - -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 _key21 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key21 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.Row, 0, size) - _val22 := tSlice - for i := 0; i < size; i ++ { - _elem23 := nebula0.NewRow() - if err := _elem23.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem23), err) - } - _val22 = append(_val22, _elem23) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key21] = _val22 - } - 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 ++ { - _elem24 := NewVertexProp() - if err := _elem24.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem24), err) - } - p.VertexProps = append(p.VertexProps, _elem24) - } - 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 ++ { - _elem25 := NewEdgeProp() - if err := _elem25.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem25), err) - } - p.EdgeProps = append(p.EdgeProps, _elem25) - } - 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 ++ { - _elem26 := NewExpr() - if err := _elem26.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem26), err) - } - p.Expressions = append(p.Expressions, _elem26) - } - 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 ++ { - _elem27 := NewOrderBy() - if err := _elem27.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem27), err) - } - p.OrderBy = append(p.OrderBy, _elem27) - } - 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,optional" 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 -} - -type GetPropResponseBuilder struct { - obj *GetPropResponse -} - -func NewGetPropResponseBuilder() *GetPropResponseBuilder{ - return &GetPropResponseBuilder{ - obj: NewGetPropResponse(), - } -} - -func (p GetPropResponseBuilder) Emit() *GetPropResponse{ - return &GetPropResponse{ - Result_: p.obj.Result_, - Props: p.obj.Props, - } -} - -func (g *GetPropResponseBuilder) Result_(result *ResponseCommon) *GetPropResponseBuilder { - g.obj.Result_ = result - return g -} - -func (g *GetPropResponseBuilder) Props(props *nebula0.DataSet) *GetPropResponseBuilder { - g.obj.Props = props - return g -} - -func (g *GetPropResponse) SetResult_(result *ResponseCommon) *GetPropResponse { - g.Result_ = result - return g -} - -func (g *GetPropResponse) SetProps(props *nebula0.DataSet) *GetPropResponse { - g.Props = props - return g -} - -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 -} -type NewTag_Builder struct { - obj *NewTag_ -} - -func NewNewTag_Builder() *NewTag_Builder{ - return &NewTag_Builder{ - obj: NewNewTag_(), - } -} - -func (p NewTag_Builder) Emit() *NewTag_{ - return &NewTag_{ - TagID: p.obj.TagID, - Props: p.obj.Props, - } -} - -func (n *NewTag_Builder) TagID(tagID nebula0.TagID) *NewTag_Builder { - n.obj.TagID = tagID - return n -} - -func (n *NewTag_Builder) Props(props []*nebula0.Value) *NewTag_Builder { - n.obj.Props = props - return n -} - -func (n *NewTag_) SetTagID(tagID nebula0.TagID) *NewTag_ { - n.TagID = tagID - return n -} - -func (n *NewTag_) SetProps(props []*nebula0.Value) *NewTag_ { - n.Props = props - return n -} - -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 ++ { - _elem28 := nebula0.NewValue() - if err := _elem28.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem28), err) - } - p.Props = append(p.Props, _elem28) - } - 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 -} - -type NewVertex_Builder struct { - obj *NewVertex_ -} - -func NewNewVertex_Builder() *NewVertex_Builder{ - return &NewVertex_Builder{ - obj: NewNewVertex_(), - } -} - -func (p NewVertex_Builder) Emit() *NewVertex_{ - return &NewVertex_{ - Id: p.obj.Id, - Tags: p.obj.Tags, - } -} - -func (n *NewVertex_Builder) Id(id *nebula0.Value) *NewVertex_Builder { - n.obj.Id = id - return n -} - -func (n *NewVertex_Builder) Tags(tags []*NewTag_) *NewVertex_Builder { - n.obj.Tags = tags - return n -} - -func (n *NewVertex_) SetId(id *nebula0.Value) *NewVertex_ { - n.Id = id - return n -} - -func (n *NewVertex_) SetTags(tags []*NewTag_) *NewVertex_ { - n.Tags = tags - return n -} - -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 ++ { - _elem29 := NewNewTag_() - if err := _elem29.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem29), err) - } - p.Tags = append(p.Tags, _elem29) - } - 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 -} - -type EdgeKeyBuilder struct { - obj *EdgeKey -} - -func NewEdgeKeyBuilder() *EdgeKeyBuilder{ - return &EdgeKeyBuilder{ - obj: NewEdgeKey(), - } -} - -func (p EdgeKeyBuilder) Emit() *EdgeKey{ - return &EdgeKey{ - Src: p.obj.Src, - EdgeType: p.obj.EdgeType, - Ranking: p.obj.Ranking, - Dst: p.obj.Dst, - } -} - -func (e *EdgeKeyBuilder) Src(src *nebula0.Value) *EdgeKeyBuilder { - e.obj.Src = src - return e -} - -func (e *EdgeKeyBuilder) EdgeType(edgeType nebula0.EdgeType) *EdgeKeyBuilder { - e.obj.EdgeType = edgeType - return e -} - -func (e *EdgeKeyBuilder) Ranking(ranking nebula0.EdgeRanking) *EdgeKeyBuilder { - e.obj.Ranking = ranking - return e -} - -func (e *EdgeKeyBuilder) Dst(dst *nebula0.Value) *EdgeKeyBuilder { - e.obj.Dst = dst - return e -} - -func (e *EdgeKey) SetSrc(src *nebula0.Value) *EdgeKey { - e.Src = src - return e -} - -func (e *EdgeKey) SetEdgeType(edgeType nebula0.EdgeType) *EdgeKey { - e.EdgeType = edgeType - return e -} - -func (e *EdgeKey) SetRanking(ranking nebula0.EdgeRanking) *EdgeKey { - e.Ranking = ranking - return e -} - -func (e *EdgeKey) SetDst(dst *nebula0.Value) *EdgeKey { - e.Dst = dst - return e -} - -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 -} - -type NewEdge_Builder struct { - obj *NewEdge_ -} - -func NewNewEdge_Builder() *NewEdge_Builder{ - return &NewEdge_Builder{ - obj: NewNewEdge_(), - } -} - -func (p NewEdge_Builder) Emit() *NewEdge_{ - return &NewEdge_{ - Key: p.obj.Key, - Props: p.obj.Props, - } -} - -func (n *NewEdge_Builder) Key(key *EdgeKey) *NewEdge_Builder { - n.obj.Key = key - return n -} - -func (n *NewEdge_Builder) Props(props []*nebula0.Value) *NewEdge_Builder { - n.obj.Props = props - return n -} - -func (n *NewEdge_) SetKey(key *EdgeKey) *NewEdge_ { - n.Key = key - return n -} - -func (n *NewEdge_) SetProps(props []*nebula0.Value) *NewEdge_ { - n.Props = props - return n -} - -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 ++ { - _elem30 := nebula0.NewValue() - if err := _elem30.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem30), err) - } - p.Props = append(p.Props, _elem30) - } - 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 -// - IgnoreExistedIndex -// - Common -type AddVerticesRequest struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Parts map[nebula0.PartitionID][]*NewVertex_ `thrift:"parts,2" db:"parts" json:"parts"` - PropNames map[nebula0.TagID][][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` - IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` - IgnoreExistedIndex bool `thrift:"ignore_existed_index,5" db:"ignore_existed_index" json:"ignore_existed_index"` - Common *RequestCommon `thrift:"common,6,optional" 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 -} - -func (p *AddVerticesRequest) GetIgnoreExistedIndex() bool { - return p.IgnoreExistedIndex -} -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 -} - -type AddVerticesRequestBuilder struct { - obj *AddVerticesRequest -} - -func NewAddVerticesRequestBuilder() *AddVerticesRequestBuilder{ - return &AddVerticesRequestBuilder{ - obj: NewAddVerticesRequest(), - } -} - -func (p AddVerticesRequestBuilder) Emit() *AddVerticesRequest{ - return &AddVerticesRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - PropNames: p.obj.PropNames, - IfNotExists: p.obj.IfNotExists, - IgnoreExistedIndex: p.obj.IgnoreExistedIndex, - Common: p.obj.Common, - } -} - -func (a *AddVerticesRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AddVerticesRequestBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AddVerticesRequestBuilder) Parts(parts map[nebula0.PartitionID][]*NewVertex_) *AddVerticesRequestBuilder { - a.obj.Parts = parts - return a -} - -func (a *AddVerticesRequestBuilder) PropNames(propNames map[nebula0.TagID][][]byte) *AddVerticesRequestBuilder { - a.obj.PropNames = propNames - return a -} - -func (a *AddVerticesRequestBuilder) IfNotExists(ifNotExists bool) *AddVerticesRequestBuilder { - a.obj.IfNotExists = ifNotExists - return a -} - -func (a *AddVerticesRequestBuilder) IgnoreExistedIndex(ignoreExistedIndex bool) *AddVerticesRequestBuilder { - a.obj.IgnoreExistedIndex = ignoreExistedIndex - return a -} - -func (a *AddVerticesRequestBuilder) Common(common *RequestCommon) *AddVerticesRequestBuilder { - a.obj.Common = common - return a -} - -func (a *AddVerticesRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *AddVerticesRequest { - a.SpaceID = spaceID - return a -} - -func (a *AddVerticesRequest) SetParts(parts map[nebula0.PartitionID][]*NewVertex_) *AddVerticesRequest { - a.Parts = parts - return a -} - -func (a *AddVerticesRequest) SetPropNames(propNames map[nebula0.TagID][][]byte) *AddVerticesRequest { - a.PropNames = propNames - return a -} - -func (a *AddVerticesRequest) SetIfNotExists(ifNotExists bool) *AddVerticesRequest { - a.IfNotExists = ifNotExists - return a -} - -func (a *AddVerticesRequest) SetIgnoreExistedIndex(ignoreExistedIndex bool) *AddVerticesRequest { - a.IgnoreExistedIndex = ignoreExistedIndex - return a -} - -func (a *AddVerticesRequest) SetCommon(common *RequestCommon) *AddVerticesRequest { - a.Common = common - return a -} - -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 - } - 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 *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 _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([]*NewVertex_, 0, size) - _val32 := tSlice - for i := 0; i < size; i ++ { - _elem33 := NewNewVertex_() - 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 *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 _key34 nebula0.TagID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.TagID(v) - _key34 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - _val35 := 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 - } - _val35 = append(_val35, _elem36) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.PropNames[_key34] = _val35 - } - 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 { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.IgnoreExistedIndex = v - } - return nil -} - -func (p *AddVerticesRequest) ReadField6(iprot thrift.Protocol) error { - p.Common = NewRequestCommon() - if err := p.Common.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) - } - 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 := 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 *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 err := oprot.WriteFieldBegin("ignore_existed_index", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignore_existed_index: ", p), err) } - if err := oprot.WriteBool(bool(p.IgnoreExistedIndex)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ignore_existed_index (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignore_existed_index: ", p), err) } - return err -} - -func (p *AddVerticesRequest) writeField6(oprot thrift.Protocol) (err error) { - if p.IsSetCommon() { - if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:common: ", p), err) } - if err := p.Common.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6: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) - ignoreExistedIndexVal := fmt.Sprintf("%v", p.IgnoreExistedIndex) - var commonVal string - if p.Common == nil { - commonVal = "" - } else { - commonVal = fmt.Sprintf("%v", p.Common) - } - return fmt.Sprintf("AddVerticesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s IgnoreExistedIndex:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, ignoreExistedIndexVal, commonVal) -} - -// Attributes: -// - SpaceID -// - Parts -// - PropNames -// - IfNotExists -// - IgnoreExistedIndex -// - Common -type AddEdgesRequest struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Parts map[nebula0.PartitionID][]*NewEdge_ `thrift:"parts,2" db:"parts" json:"parts"` - PropNames [][]byte `thrift:"prop_names,3" db:"prop_names" json:"prop_names"` - IfNotExists bool `thrift:"if_not_exists,4" db:"if_not_exists" json:"if_not_exists"` - IgnoreExistedIndex bool `thrift:"ignore_existed_index,5" db:"ignore_existed_index" json:"ignore_existed_index"` - Common *RequestCommon `thrift:"common,6,optional" 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 -} - -func (p *AddEdgesRequest) GetIgnoreExistedIndex() bool { - return p.IgnoreExistedIndex -} -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 -} - -type AddEdgesRequestBuilder struct { - obj *AddEdgesRequest -} - -func NewAddEdgesRequestBuilder() *AddEdgesRequestBuilder{ - return &AddEdgesRequestBuilder{ - obj: NewAddEdgesRequest(), - } -} - -func (p AddEdgesRequestBuilder) Emit() *AddEdgesRequest{ - return &AddEdgesRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - PropNames: p.obj.PropNames, - IfNotExists: p.obj.IfNotExists, - IgnoreExistedIndex: p.obj.IgnoreExistedIndex, - Common: p.obj.Common, - } -} - -func (a *AddEdgesRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AddEdgesRequestBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AddEdgesRequestBuilder) Parts(parts map[nebula0.PartitionID][]*NewEdge_) *AddEdgesRequestBuilder { - a.obj.Parts = parts - return a -} - -func (a *AddEdgesRequestBuilder) PropNames(propNames [][]byte) *AddEdgesRequestBuilder { - a.obj.PropNames = propNames - return a -} - -func (a *AddEdgesRequestBuilder) IfNotExists(ifNotExists bool) *AddEdgesRequestBuilder { - a.obj.IfNotExists = ifNotExists - return a -} - -func (a *AddEdgesRequestBuilder) IgnoreExistedIndex(ignoreExistedIndex bool) *AddEdgesRequestBuilder { - a.obj.IgnoreExistedIndex = ignoreExistedIndex - return a -} - -func (a *AddEdgesRequestBuilder) Common(common *RequestCommon) *AddEdgesRequestBuilder { - a.obj.Common = common - return a -} - -func (a *AddEdgesRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *AddEdgesRequest { - a.SpaceID = spaceID - return a -} - -func (a *AddEdgesRequest) SetParts(parts map[nebula0.PartitionID][]*NewEdge_) *AddEdgesRequest { - a.Parts = parts - return a -} - -func (a *AddEdgesRequest) SetPropNames(propNames [][]byte) *AddEdgesRequest { - a.PropNames = propNames - return a -} - -func (a *AddEdgesRequest) SetIfNotExists(ifNotExists bool) *AddEdgesRequest { - a.IfNotExists = ifNotExists - return a -} - -func (a *AddEdgesRequest) SetIgnoreExistedIndex(ignoreExistedIndex bool) *AddEdgesRequest { - a.IgnoreExistedIndex = ignoreExistedIndex - return a -} - -func (a *AddEdgesRequest) SetCommon(common *RequestCommon) *AddEdgesRequest { - a.Common = common - return a -} - -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 - } - 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 *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 _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([]*NewEdge_, 0, size) - _val38 := tSlice - for i := 0; i < size; i ++ { - _elem39 := NewNewEdge_() - 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 *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 _elem40 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem40 = v - } - p.PropNames = append(p.PropNames, _elem40) - } - 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 { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.IgnoreExistedIndex = v - } - return nil -} - -func (p *AddEdgesRequest) ReadField6(iprot thrift.Protocol) error { - p.Common = NewRequestCommon() - if err := p.Common.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Common), err) - } - 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 := 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 *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 err := oprot.WriteFieldBegin("ignore_existed_index", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:ignore_existed_index: ", p), err) } - if err := oprot.WriteBool(bool(p.IgnoreExistedIndex)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.ignore_existed_index (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:ignore_existed_index: ", p), err) } - return err -} - -func (p *AddEdgesRequest) writeField6(oprot thrift.Protocol) (err error) { - if p.IsSetCommon() { - if err := oprot.WriteFieldBegin("common", thrift.STRUCT, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:common: ", p), err) } - if err := p.Common.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Common), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6: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) - ignoreExistedIndexVal := fmt.Sprintf("%v", p.IgnoreExistedIndex) - var commonVal string - if p.Common == nil { - commonVal = "" - } else { - commonVal = fmt.Sprintf("%v", p.Common) - } - return fmt.Sprintf("AddEdgesRequest({SpaceID:%s Parts:%s PropNames:%s IfNotExists:%s IgnoreExistedIndex:%s Common:%s})", spaceIDVal, partsVal, propNamesVal, ifNotExistsVal, ignoreExistedIndexVal, 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,optional" 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 -} - -type DeleteVerticesRequestBuilder struct { - obj *DeleteVerticesRequest -} - -func NewDeleteVerticesRequestBuilder() *DeleteVerticesRequestBuilder{ - return &DeleteVerticesRequestBuilder{ - obj: NewDeleteVerticesRequest(), - } -} - -func (p DeleteVerticesRequestBuilder) Emit() *DeleteVerticesRequest{ - return &DeleteVerticesRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - Common: p.obj.Common, - } -} - -func (d *DeleteVerticesRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DeleteVerticesRequestBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DeleteVerticesRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.Value) *DeleteVerticesRequestBuilder { - d.obj.Parts = parts - return d -} - -func (d *DeleteVerticesRequestBuilder) Common(common *RequestCommon) *DeleteVerticesRequestBuilder { - d.obj.Common = common - return d -} - -func (d *DeleteVerticesRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *DeleteVerticesRequest { - d.SpaceID = spaceID - return d -} - -func (d *DeleteVerticesRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.Value) *DeleteVerticesRequest { - d.Parts = parts - return d -} - -func (d *DeleteVerticesRequest) SetCommon(common *RequestCommon) *DeleteVerticesRequest { - d.Common = common - return d -} - -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 _key41 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key41 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.Value, 0, size) - _val42 := tSlice - for i := 0; i < size; i ++ { - _elem43 := nebula0.NewValue() - if err := _elem43.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem43), err) - } - _val42 = append(_val42, _elem43) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key41] = _val42 - } - 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,optional" 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 -} - -type DeleteEdgesRequestBuilder struct { - obj *DeleteEdgesRequest -} - -func NewDeleteEdgesRequestBuilder() *DeleteEdgesRequestBuilder{ - return &DeleteEdgesRequestBuilder{ - obj: NewDeleteEdgesRequest(), - } -} - -func (p DeleteEdgesRequestBuilder) Emit() *DeleteEdgesRequest{ - return &DeleteEdgesRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - Common: p.obj.Common, - } -} - -func (d *DeleteEdgesRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DeleteEdgesRequestBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DeleteEdgesRequestBuilder) Parts(parts map[nebula0.PartitionID][]*EdgeKey) *DeleteEdgesRequestBuilder { - d.obj.Parts = parts - return d -} - -func (d *DeleteEdgesRequestBuilder) Common(common *RequestCommon) *DeleteEdgesRequestBuilder { - d.obj.Common = common - return d -} - -func (d *DeleteEdgesRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *DeleteEdgesRequest { - d.SpaceID = spaceID - return d -} - -func (d *DeleteEdgesRequest) SetParts(parts map[nebula0.PartitionID][]*EdgeKey) *DeleteEdgesRequest { - d.Parts = parts - return d -} - -func (d *DeleteEdgesRequest) SetCommon(common *RequestCommon) *DeleteEdgesRequest { - d.Common = common - return d -} - -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 _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([]*EdgeKey, 0, size) - _val45 := tSlice - for i := 0; i < size; i ++ { - _elem46 := NewEdgeKey() - 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 *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 -} - -type DelTagsBuilder struct { - obj *DelTags -} - -func NewDelTagsBuilder() *DelTagsBuilder{ - return &DelTagsBuilder{ - obj: NewDelTags(), - } -} - -func (p DelTagsBuilder) Emit() *DelTags{ - return &DelTags{ - Id: p.obj.Id, - Tags: p.obj.Tags, - } -} - -func (d *DelTagsBuilder) Id(id *nebula0.Value) *DelTagsBuilder { - d.obj.Id = id - return d -} - -func (d *DelTagsBuilder) Tags(tags []nebula0.TagID) *DelTagsBuilder { - d.obj.Tags = tags - return d -} - -func (d *DelTags) SetId(id *nebula0.Value) *DelTags { - d.Id = id - return d -} - -func (d *DelTags) SetTags(tags []nebula0.TagID) *DelTags { - d.Tags = tags - return d -} - -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 _elem47 nebula0.TagID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.TagID(v) - _elem47 = temp - } - p.Tags = append(p.Tags, _elem47) - } - 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,optional" 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 -} - -type DeleteTagsRequestBuilder struct { - obj *DeleteTagsRequest -} - -func NewDeleteTagsRequestBuilder() *DeleteTagsRequestBuilder{ - return &DeleteTagsRequestBuilder{ - obj: NewDeleteTagsRequest(), - } -} - -func (p DeleteTagsRequestBuilder) Emit() *DeleteTagsRequest{ - return &DeleteTagsRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - Common: p.obj.Common, - } -} - -func (d *DeleteTagsRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *DeleteTagsRequestBuilder { - d.obj.SpaceID = spaceID - return d -} - -func (d *DeleteTagsRequestBuilder) Parts(parts map[nebula0.PartitionID][]*DelTags) *DeleteTagsRequestBuilder { - d.obj.Parts = parts - return d -} - -func (d *DeleteTagsRequestBuilder) Common(common *RequestCommon) *DeleteTagsRequestBuilder { - d.obj.Common = common - return d -} - -func (d *DeleteTagsRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *DeleteTagsRequest { - d.SpaceID = spaceID - return d -} - -func (d *DeleteTagsRequest) SetParts(parts map[nebula0.PartitionID][]*DelTags) *DeleteTagsRequest { - d.Parts = parts - return d -} - -func (d *DeleteTagsRequest) SetCommon(common *RequestCommon) *DeleteTagsRequest { - d.Common = common - return d -} - -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 _key48 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key48 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*DelTags, 0, size) - _val49 := tSlice - for i := 0; i < size; i ++ { - _elem50 := NewDelTags() - if err := _elem50.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem50), err) - } - _val49 = append(_val49, _elem50) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key48] = _val49 - } - 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,optional" 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 -} - -type UpdateResponseBuilder struct { - obj *UpdateResponse -} - -func NewUpdateResponseBuilder() *UpdateResponseBuilder{ - return &UpdateResponseBuilder{ - obj: NewUpdateResponse(), - } -} - -func (p UpdateResponseBuilder) Emit() *UpdateResponse{ - return &UpdateResponse{ - Result_: p.obj.Result_, - Props: p.obj.Props, - } -} - -func (u *UpdateResponseBuilder) Result_(result *ResponseCommon) *UpdateResponseBuilder { - u.obj.Result_ = result - return u -} - -func (u *UpdateResponseBuilder) Props(props *nebula0.DataSet) *UpdateResponseBuilder { - u.obj.Props = props - return u -} - -func (u *UpdateResponse) SetResult_(result *ResponseCommon) *UpdateResponse { - u.Result_ = result - return u -} - -func (u *UpdateResponse) SetProps(props *nebula0.DataSet) *UpdateResponse { - u.Props = props - return u -} - -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 -} -type UpdatedPropBuilder struct { - obj *UpdatedProp -} - -func NewUpdatedPropBuilder() *UpdatedPropBuilder{ - return &UpdatedPropBuilder{ - obj: NewUpdatedProp(), - } -} - -func (p UpdatedPropBuilder) Emit() *UpdatedProp{ - return &UpdatedProp{ - Name: p.obj.Name, - Value: p.obj.Value, - } -} - -func (u *UpdatedPropBuilder) Name(name []byte) *UpdatedPropBuilder { - u.obj.Name = name - return u -} - -func (u *UpdatedPropBuilder) Value(value []byte) *UpdatedPropBuilder { - u.obj.Value = value - return u -} - -func (u *UpdatedProp) SetName(name []byte) *UpdatedProp { - u.Name = name - return u -} - -func (u *UpdatedProp) SetValue(value []byte) *UpdatedProp { - u.Value = value - return u -} - -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,optional" db:"insertable" json:"insertable,omitempty"` - ReturnProps [][]byte `thrift:"return_props,7,optional" db:"return_props" json:"return_props,omitempty"` - Condition []byte `thrift:"condition,8,optional" db:"condition" json:"condition,omitempty"` - Common *RequestCommon `thrift:"common,9,optional" 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 -} - -type UpdateVertexRequestBuilder struct { - obj *UpdateVertexRequest -} - -func NewUpdateVertexRequestBuilder() *UpdateVertexRequestBuilder{ - return &UpdateVertexRequestBuilder{ - obj: NewUpdateVertexRequest(), - } -} - -func (p UpdateVertexRequestBuilder) Emit() *UpdateVertexRequest{ - return &UpdateVertexRequest{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - VertexID: p.obj.VertexID, - TagID: p.obj.TagID, - UpdatedProps: p.obj.UpdatedProps, - Insertable: p.obj.Insertable, - ReturnProps: p.obj.ReturnProps, - Condition: p.obj.Condition, - Common: p.obj.Common, - } -} - -func (u *UpdateVertexRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *UpdateVertexRequestBuilder { - u.obj.SpaceID = spaceID - return u -} - -func (u *UpdateVertexRequestBuilder) PartID(partID nebula0.PartitionID) *UpdateVertexRequestBuilder { - u.obj.PartID = partID - return u -} - -func (u *UpdateVertexRequestBuilder) VertexID(vertexID *nebula0.Value) *UpdateVertexRequestBuilder { - u.obj.VertexID = vertexID - return u -} - -func (u *UpdateVertexRequestBuilder) TagID(tagID nebula0.TagID) *UpdateVertexRequestBuilder { - u.obj.TagID = tagID - return u -} - -func (u *UpdateVertexRequestBuilder) UpdatedProps(updatedProps []*UpdatedProp) *UpdateVertexRequestBuilder { - u.obj.UpdatedProps = updatedProps - return u -} - -func (u *UpdateVertexRequestBuilder) Insertable(insertable bool) *UpdateVertexRequestBuilder { - u.obj.Insertable = insertable - return u -} - -func (u *UpdateVertexRequestBuilder) ReturnProps(returnProps [][]byte) *UpdateVertexRequestBuilder { - u.obj.ReturnProps = returnProps - return u -} - -func (u *UpdateVertexRequestBuilder) Condition(condition []byte) *UpdateVertexRequestBuilder { - u.obj.Condition = condition - return u -} - -func (u *UpdateVertexRequestBuilder) Common(common *RequestCommon) *UpdateVertexRequestBuilder { - u.obj.Common = common - return u -} - -func (u *UpdateVertexRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *UpdateVertexRequest { - u.SpaceID = spaceID - return u -} - -func (u *UpdateVertexRequest) SetPartID(partID nebula0.PartitionID) *UpdateVertexRequest { - u.PartID = partID - return u -} - -func (u *UpdateVertexRequest) SetVertexID(vertexID *nebula0.Value) *UpdateVertexRequest { - u.VertexID = vertexID - return u -} - -func (u *UpdateVertexRequest) SetTagID(tagID nebula0.TagID) *UpdateVertexRequest { - u.TagID = tagID - return u -} - -func (u *UpdateVertexRequest) SetUpdatedProps(updatedProps []*UpdatedProp) *UpdateVertexRequest { - u.UpdatedProps = updatedProps - return u -} - -func (u *UpdateVertexRequest) SetInsertable(insertable bool) *UpdateVertexRequest { - u.Insertable = insertable - return u -} - -func (u *UpdateVertexRequest) SetReturnProps(returnProps [][]byte) *UpdateVertexRequest { - u.ReturnProps = returnProps - return u -} - -func (u *UpdateVertexRequest) SetCondition(condition []byte) *UpdateVertexRequest { - u.Condition = condition - return u -} - -func (u *UpdateVertexRequest) SetCommon(common *RequestCommon) *UpdateVertexRequest { - u.Common = common - return u -} - -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 ++ { - _elem51 := NewUpdatedProp() - if err := _elem51.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem51), err) - } - p.UpdatedProps = append(p.UpdatedProps, _elem51) - } - 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 _elem52 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem52 = v - } - p.ReturnProps = append(p.ReturnProps, _elem52) - } - 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,optional" db:"insertable" json:"insertable,omitempty"` - ReturnProps [][]byte `thrift:"return_props,6,optional" db:"return_props" json:"return_props,omitempty"` - Condition []byte `thrift:"condition,7,optional" db:"condition" json:"condition,omitempty"` - Common *RequestCommon `thrift:"common,8,optional" 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 -} - -type UpdateEdgeRequestBuilder struct { - obj *UpdateEdgeRequest -} - -func NewUpdateEdgeRequestBuilder() *UpdateEdgeRequestBuilder{ - return &UpdateEdgeRequestBuilder{ - obj: NewUpdateEdgeRequest(), - } -} - -func (p UpdateEdgeRequestBuilder) Emit() *UpdateEdgeRequest{ - return &UpdateEdgeRequest{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - EdgeKey: p.obj.EdgeKey, - UpdatedProps: p.obj.UpdatedProps, - Insertable: p.obj.Insertable, - ReturnProps: p.obj.ReturnProps, - Condition: p.obj.Condition, - Common: p.obj.Common, - } -} - -func (u *UpdateEdgeRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *UpdateEdgeRequestBuilder { - u.obj.SpaceID = spaceID - return u -} - -func (u *UpdateEdgeRequestBuilder) PartID(partID nebula0.PartitionID) *UpdateEdgeRequestBuilder { - u.obj.PartID = partID - return u -} - -func (u *UpdateEdgeRequestBuilder) EdgeKey(edgeKey *EdgeKey) *UpdateEdgeRequestBuilder { - u.obj.EdgeKey = edgeKey - return u -} - -func (u *UpdateEdgeRequestBuilder) UpdatedProps(updatedProps []*UpdatedProp) *UpdateEdgeRequestBuilder { - u.obj.UpdatedProps = updatedProps - return u -} - -func (u *UpdateEdgeRequestBuilder) Insertable(insertable bool) *UpdateEdgeRequestBuilder { - u.obj.Insertable = insertable - return u -} - -func (u *UpdateEdgeRequestBuilder) ReturnProps(returnProps [][]byte) *UpdateEdgeRequestBuilder { - u.obj.ReturnProps = returnProps - return u -} - -func (u *UpdateEdgeRequestBuilder) Condition(condition []byte) *UpdateEdgeRequestBuilder { - u.obj.Condition = condition - return u -} - -func (u *UpdateEdgeRequestBuilder) Common(common *RequestCommon) *UpdateEdgeRequestBuilder { - u.obj.Common = common - return u -} - -func (u *UpdateEdgeRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *UpdateEdgeRequest { - u.SpaceID = spaceID - return u -} - -func (u *UpdateEdgeRequest) SetPartID(partID nebula0.PartitionID) *UpdateEdgeRequest { - u.PartID = partID - return u -} - -func (u *UpdateEdgeRequest) SetEdgeKey(edgeKey *EdgeKey) *UpdateEdgeRequest { - u.EdgeKey = edgeKey - return u -} - -func (u *UpdateEdgeRequest) SetUpdatedProps(updatedProps []*UpdatedProp) *UpdateEdgeRequest { - u.UpdatedProps = updatedProps - return u -} - -func (u *UpdateEdgeRequest) SetInsertable(insertable bool) *UpdateEdgeRequest { - u.Insertable = insertable - return u -} - -func (u *UpdateEdgeRequest) SetReturnProps(returnProps [][]byte) *UpdateEdgeRequest { - u.ReturnProps = returnProps - return u -} - -func (u *UpdateEdgeRequest) SetCondition(condition []byte) *UpdateEdgeRequest { - u.Condition = condition - return u -} - -func (u *UpdateEdgeRequest) SetCommon(common *RequestCommon) *UpdateEdgeRequest { - u.Common = common - return u -} - -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 ++ { - _elem53 := NewUpdatedProp() - if err := _elem53.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem53), err) - } - p.UpdatedProps = append(p.UpdatedProps, _elem53) - } - 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 _elem54 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem54 = v - } - p.ReturnProps = append(p.ReturnProps, _elem54) - } - 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,optional" 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 -} - -type GetUUIDReqBuilder struct { - obj *GetUUIDReq -} - -func NewGetUUIDReqBuilder() *GetUUIDReqBuilder{ - return &GetUUIDReqBuilder{ - obj: NewGetUUIDReq(), - } -} - -func (p GetUUIDReqBuilder) Emit() *GetUUIDReq{ - return &GetUUIDReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - Name: p.obj.Name, - Common: p.obj.Common, - } -} - -func (g *GetUUIDReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *GetUUIDReqBuilder { - g.obj.SpaceID = spaceID - return g -} - -func (g *GetUUIDReqBuilder) PartID(partID nebula0.PartitionID) *GetUUIDReqBuilder { - g.obj.PartID = partID - return g -} - -func (g *GetUUIDReqBuilder) Name(name []byte) *GetUUIDReqBuilder { - g.obj.Name = name - return g -} - -func (g *GetUUIDReqBuilder) Common(common *RequestCommon) *GetUUIDReqBuilder { - g.obj.Common = common - return g -} - -func (g *GetUUIDReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *GetUUIDReq { - g.SpaceID = spaceID - return g -} - -func (g *GetUUIDReq) SetPartID(partID nebula0.PartitionID) *GetUUIDReq { - g.PartID = partID - return g -} - -func (g *GetUUIDReq) SetName(name []byte) *GetUUIDReq { - g.Name = name - return g -} - -func (g *GetUUIDReq) SetCommon(common *RequestCommon) *GetUUIDReq { - g.Common = common - return g -} - -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 -} - -type GetUUIDRespBuilder struct { - obj *GetUUIDResp -} - -func NewGetUUIDRespBuilder() *GetUUIDRespBuilder{ - return &GetUUIDRespBuilder{ - obj: NewGetUUIDResp(), - } -} - -func (p GetUUIDRespBuilder) Emit() *GetUUIDResp{ - return &GetUUIDResp{ - Result_: p.obj.Result_, - Id: p.obj.Id, - } -} - -func (g *GetUUIDRespBuilder) Result_(result *ResponseCommon) *GetUUIDRespBuilder { - g.obj.Result_ = result - return g -} - -func (g *GetUUIDRespBuilder) Id(id *nebula0.Value) *GetUUIDRespBuilder { - g.obj.Id = id - return g -} - -func (g *GetUUIDResp) SetResult_(result *ResponseCommon) *GetUUIDResp { - g.Result_ = result - return g -} - -func (g *GetUUIDResp) SetId(id *nebula0.Value) *GetUUIDResp { - g.Id = id - return g -} - -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 -// - StatData -type LookupIndexResp struct { - Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - Data *nebula0.DataSet `thrift:"data,2,optional" db:"data" json:"data,omitempty"` - StatData *nebula0.DataSet `thrift:"stat_data,3,optional" db:"stat_data" json:"stat_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 -} -var LookupIndexResp_StatData_DEFAULT *nebula0.DataSet -func (p *LookupIndexResp) GetStatData() *nebula0.DataSet { - if !p.IsSetStatData() { - return LookupIndexResp_StatData_DEFAULT - } -return p.StatData -} -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) IsSetStatData() bool { - return p != nil && p.StatData != nil -} - -type LookupIndexRespBuilder struct { - obj *LookupIndexResp -} - -func NewLookupIndexRespBuilder() *LookupIndexRespBuilder{ - return &LookupIndexRespBuilder{ - obj: NewLookupIndexResp(), - } -} - -func (p LookupIndexRespBuilder) Emit() *LookupIndexResp{ - return &LookupIndexResp{ - Result_: p.obj.Result_, - Data: p.obj.Data, - StatData: p.obj.StatData, - } -} - -func (l *LookupIndexRespBuilder) Result_(result *ResponseCommon) *LookupIndexRespBuilder { - l.obj.Result_ = result - return l -} - -func (l *LookupIndexRespBuilder) Data(data *nebula0.DataSet) *LookupIndexRespBuilder { - l.obj.Data = data - return l -} - -func (l *LookupIndexRespBuilder) StatData(statData *nebula0.DataSet) *LookupIndexRespBuilder { - l.obj.StatData = statData - return l -} - -func (l *LookupIndexResp) SetResult_(result *ResponseCommon) *LookupIndexResp { - l.Result_ = result - return l -} - -func (l *LookupIndexResp) SetData(data *nebula0.DataSet) *LookupIndexResp { - l.Data = data - return l -} - -func (l *LookupIndexResp) SetStatData(statData *nebula0.DataSet) *LookupIndexResp { - l.StatData = statData - return l -} - -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 - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := 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) ReadField3(iprot thrift.Protocol) error { - p.StatData = nebula0.NewDataSet() - if err := p.StatData.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.StatData), 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 := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.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) writeField3(oprot thrift.Protocol) (err error) { - if p.IsSetStatData() { - if err := oprot.WriteFieldBegin("stat_data", thrift.STRUCT, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:stat_data: ", p), err) } - if err := p.StatData.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.StatData), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:stat_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) - } - var statDataVal string - if p.StatData == nil { - statDataVal = "" - } else { - statDataVal = fmt.Sprintf("%v", p.StatData) - } - return fmt.Sprintf("LookupIndexResp({Result_:%s Data:%s StatData:%s})", resultVal, dataVal, statDataVal) -} - -// Attributes: -// - ColumnName -// - ScanType -// - BeginValue -// - EndValue -// - IncludeBegin -// - IncludeEnd -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"` - IncludeBegin bool `thrift:"include_begin,5" db:"include_begin" json:"include_begin"` - IncludeEnd bool `thrift:"include_end,6" db:"include_end" json:"include_end"` -} - -func NewIndexColumnHint() *IndexColumnHint { - return &IndexColumnHint{ - IncludeBegin: true, - } -} - - -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) GetIncludeBegin() bool { - return p.IncludeBegin -} - -func (p *IndexColumnHint) GetIncludeEnd() bool { - return p.IncludeEnd -} -func (p *IndexColumnHint) IsSetBeginValue() bool { - return p != nil && p.BeginValue != nil -} - -func (p *IndexColumnHint) IsSetEndValue() bool { - return p != nil && p.EndValue != nil -} - -type IndexColumnHintBuilder struct { - obj *IndexColumnHint -} - -func NewIndexColumnHintBuilder() *IndexColumnHintBuilder{ - return &IndexColumnHintBuilder{ - obj: NewIndexColumnHint(), - } -} - -func (p IndexColumnHintBuilder) Emit() *IndexColumnHint{ - return &IndexColumnHint{ - ColumnName: p.obj.ColumnName, - ScanType: p.obj.ScanType, - BeginValue: p.obj.BeginValue, - EndValue: p.obj.EndValue, - IncludeBegin: p.obj.IncludeBegin, - IncludeEnd: p.obj.IncludeEnd, - } -} - -func (i *IndexColumnHintBuilder) ColumnName(columnName []byte) *IndexColumnHintBuilder { - i.obj.ColumnName = columnName - return i -} - -func (i *IndexColumnHintBuilder) ScanType(scanType ScanType) *IndexColumnHintBuilder { - i.obj.ScanType = scanType - return i -} - -func (i *IndexColumnHintBuilder) BeginValue(beginValue *nebula0.Value) *IndexColumnHintBuilder { - i.obj.BeginValue = beginValue - return i -} - -func (i *IndexColumnHintBuilder) EndValue(endValue *nebula0.Value) *IndexColumnHintBuilder { - i.obj.EndValue = endValue - return i -} - -func (i *IndexColumnHintBuilder) IncludeBegin(includeBegin bool) *IndexColumnHintBuilder { - i.obj.IncludeBegin = includeBegin - return i -} - -func (i *IndexColumnHintBuilder) IncludeEnd(includeEnd bool) *IndexColumnHintBuilder { - i.obj.IncludeEnd = includeEnd - return i -} - -func (i *IndexColumnHint) SetColumnName(columnName []byte) *IndexColumnHint { - i.ColumnName = columnName - return i -} - -func (i *IndexColumnHint) SetScanType(scanType ScanType) *IndexColumnHint { - i.ScanType = scanType - return i -} - -func (i *IndexColumnHint) SetBeginValue(beginValue *nebula0.Value) *IndexColumnHint { - i.BeginValue = beginValue - return i -} - -func (i *IndexColumnHint) SetEndValue(endValue *nebula0.Value) *IndexColumnHint { - i.EndValue = endValue - return i -} - -func (i *IndexColumnHint) SetIncludeBegin(includeBegin bool) *IndexColumnHint { - i.IncludeBegin = includeBegin - return i -} - -func (i *IndexColumnHint) SetIncludeEnd(includeEnd bool) *IndexColumnHint { - i.IncludeEnd = includeEnd - return i -} - -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 - } - 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 *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) ReadField5(iprot thrift.Protocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 5: ", err) - } else { - p.IncludeBegin = v - } - return nil -} - -func (p *IndexColumnHint) ReadField6(iprot thrift.Protocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 6: ", err) - } else { - p.IncludeEnd = v - } - 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 := 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 *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) writeField5(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("include_begin", thrift.BOOL, 5); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 5:include_begin: ", p), err) } - if err := oprot.WriteBool(bool(p.IncludeBegin)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.include_begin (5) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 5:include_begin: ", p), err) } - return err -} - -func (p *IndexColumnHint) writeField6(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("include_end", thrift.BOOL, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:include_end: ", p), err) } - if err := oprot.WriteBool(bool(p.IncludeEnd)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.include_end (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:include_end: ", 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) - } - includeBeginVal := fmt.Sprintf("%v", p.IncludeBegin) - includeEndVal := fmt.Sprintf("%v", p.IncludeEnd) - return fmt.Sprintf("IndexColumnHint({ColumnName:%s ScanType:%s BeginValue:%s EndValue:%s IncludeBegin:%s IncludeEnd:%s})", columnNameVal, scanTypeVal, beginValueVal, endValueVal, includeBeginVal, includeEndVal) -} - -// 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 -} -type IndexQueryContextBuilder struct { - obj *IndexQueryContext -} - -func NewIndexQueryContextBuilder() *IndexQueryContextBuilder{ - return &IndexQueryContextBuilder{ - obj: NewIndexQueryContext(), - } -} - -func (p IndexQueryContextBuilder) Emit() *IndexQueryContext{ - return &IndexQueryContext{ - IndexID: p.obj.IndexID, - Filter: p.obj.Filter, - ColumnHints: p.obj.ColumnHints, - } -} - -func (i *IndexQueryContextBuilder) IndexID(indexID nebula0.IndexID) *IndexQueryContextBuilder { - i.obj.IndexID = indexID - return i -} - -func (i *IndexQueryContextBuilder) Filter(filter []byte) *IndexQueryContextBuilder { - i.obj.Filter = filter - return i -} - -func (i *IndexQueryContextBuilder) ColumnHints(columnHints []*IndexColumnHint) *IndexQueryContextBuilder { - i.obj.ColumnHints = columnHints - return i -} - -func (i *IndexQueryContext) SetIndexID(indexID nebula0.IndexID) *IndexQueryContext { - i.IndexID = indexID - return i -} - -func (i *IndexQueryContext) SetFilter(filter []byte) *IndexQueryContext { - i.Filter = filter - return i -} - -func (i *IndexQueryContext) SetColumnHints(columnHints []*IndexColumnHint) *IndexQueryContext { - i.ColumnHints = columnHints - return i -} - -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 ++ { - _elem55 := NewIndexColumnHint() - if err := _elem55.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem55), err) - } - p.ColumnHints = append(p.ColumnHints, _elem55) - } - 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 -} - -type IndexSpecBuilder struct { - obj *IndexSpec -} - -func NewIndexSpecBuilder() *IndexSpecBuilder{ - return &IndexSpecBuilder{ - obj: NewIndexSpec(), - } -} - -func (p IndexSpecBuilder) Emit() *IndexSpec{ - return &IndexSpec{ - Contexts: p.obj.Contexts, - SchemaID: p.obj.SchemaID, - } -} - -func (i *IndexSpecBuilder) Contexts(contexts []*IndexQueryContext) *IndexSpecBuilder { - i.obj.Contexts = contexts - return i -} - -func (i *IndexSpecBuilder) SchemaID(schemaID *nebula0.SchemaID) *IndexSpecBuilder { - i.obj.SchemaID = schemaID - return i -} - -func (i *IndexSpec) SetContexts(contexts []*IndexQueryContext) *IndexSpec { - i.Contexts = contexts - return i -} - -func (i *IndexSpec) SetSchemaID(schemaID *nebula0.SchemaID) *IndexSpec { - i.SchemaID = schemaID - return i -} - -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 ++ { - _elem56 := NewIndexQueryContext() - if err := _elem56.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem56), err) - } - p.Contexts = append(p.Contexts, _elem56) - } - 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 -// - OrderBy -// - StatColumns -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,optional" db:"return_columns" json:"return_columns,omitempty"` - Common *RequestCommon `thrift:"common,5,optional" db:"common" json:"common,omitempty"` - Limit *int64 `thrift:"limit,6,optional" db:"limit" json:"limit,omitempty"` - OrderBy []*OrderBy `thrift:"order_by,7,optional" db:"order_by" json:"order_by,omitempty"` - StatColumns []*StatProp `thrift:"stat_columns,8,optional" db:"stat_columns" json:"stat_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 -} -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 -} -var LookupIndexRequest_OrderBy_DEFAULT []*OrderBy - -func (p *LookupIndexRequest) GetOrderBy() []*OrderBy { - return p.OrderBy -} -var LookupIndexRequest_StatColumns_DEFAULT []*StatProp - -func (p *LookupIndexRequest) GetStatColumns() []*StatProp { - return p.StatColumns -} -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) IsSetOrderBy() bool { - return p != nil && p.OrderBy != nil -} - -func (p *LookupIndexRequest) IsSetStatColumns() bool { - return p != nil && p.StatColumns != nil -} - -type LookupIndexRequestBuilder struct { - obj *LookupIndexRequest -} - -func NewLookupIndexRequestBuilder() *LookupIndexRequestBuilder{ - return &LookupIndexRequestBuilder{ - obj: NewLookupIndexRequest(), - } -} - -func (p LookupIndexRequestBuilder) Emit() *LookupIndexRequest{ - return &LookupIndexRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - Indices: p.obj.Indices, - ReturnColumns: p.obj.ReturnColumns, - Common: p.obj.Common, - Limit: p.obj.Limit, - OrderBy: p.obj.OrderBy, - StatColumns: p.obj.StatColumns, - } -} - -func (l *LookupIndexRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *LookupIndexRequestBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *LookupIndexRequestBuilder) Parts(parts []nebula0.PartitionID) *LookupIndexRequestBuilder { - l.obj.Parts = parts - return l -} - -func (l *LookupIndexRequestBuilder) Indices(indices *IndexSpec) *LookupIndexRequestBuilder { - l.obj.Indices = indices - return l -} - -func (l *LookupIndexRequestBuilder) ReturnColumns(returnColumns [][]byte) *LookupIndexRequestBuilder { - l.obj.ReturnColumns = returnColumns - return l -} - -func (l *LookupIndexRequestBuilder) Common(common *RequestCommon) *LookupIndexRequestBuilder { - l.obj.Common = common - return l -} - -func (l *LookupIndexRequestBuilder) Limit(limit *int64) *LookupIndexRequestBuilder { - l.obj.Limit = limit - return l -} - -func (l *LookupIndexRequestBuilder) OrderBy(orderBy []*OrderBy) *LookupIndexRequestBuilder { - l.obj.OrderBy = orderBy - return l -} - -func (l *LookupIndexRequestBuilder) StatColumns(statColumns []*StatProp) *LookupIndexRequestBuilder { - l.obj.StatColumns = statColumns - return l -} - -func (l *LookupIndexRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *LookupIndexRequest { - l.SpaceID = spaceID - return l -} - -func (l *LookupIndexRequest) SetParts(parts []nebula0.PartitionID) *LookupIndexRequest { - l.Parts = parts - return l -} - -func (l *LookupIndexRequest) SetIndices(indices *IndexSpec) *LookupIndexRequest { - l.Indices = indices - return l -} - -func (l *LookupIndexRequest) SetReturnColumns(returnColumns [][]byte) *LookupIndexRequest { - l.ReturnColumns = returnColumns - return l -} - -func (l *LookupIndexRequest) SetCommon(common *RequestCommon) *LookupIndexRequest { - l.Common = common - return l -} - -func (l *LookupIndexRequest) SetLimit(limit *int64) *LookupIndexRequest { - l.Limit = limit - return l -} - -func (l *LookupIndexRequest) SetOrderBy(orderBy []*OrderBy) *LookupIndexRequest { - l.OrderBy = orderBy - return l -} - -func (l *LookupIndexRequest) SetStatColumns(statColumns []*StatProp) *LookupIndexRequest { - l.StatColumns = statColumns - return l -} - -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 - } - 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 !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 _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 *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 _elem58 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem58 = v - } - p.ReturnColumns = append(p.ReturnColumns, _elem58) - } - 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) 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 ++ { - _elem59 := NewOrderBy() - if err := _elem59.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem59), err) - } - p.OrderBy = append(p.OrderBy, _elem59) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *LookupIndexRequest) ReadField8(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.StatColumns = tSlice - for i := 0; i < size; i ++ { - _elem60 := NewStatProp() - if err := _elem60.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem60), err) - } - p.StatColumns = append(p.StatColumns, _elem60) - } - 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 := 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 *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) 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 *LookupIndexRequest) writeField8(oprot thrift.Protocol) (err error) { - if p.IsSetStatColumns() { - if err := oprot.WriteFieldBegin("stat_columns", thrift.LIST, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:stat_columns: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.StatColumns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.StatColumns { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - 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:stat_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) - 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) - } - orderByVal := fmt.Sprintf("%v", p.OrderBy) - statColumnsVal := fmt.Sprintf("%v", p.StatColumns) - return fmt.Sprintf("LookupIndexRequest({SpaceID:%s Parts:%s Indices:%s ReturnColumns:%s Common:%s Limit:%s OrderBy:%s StatColumns:%s})", spaceIDVal, partsVal, indicesVal, returnColumnsVal, commonVal, limitVal, orderByVal, statColumnsVal) -} - -// 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,optional" 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 -} - -type LookupAndTraverseRequestBuilder struct { - obj *LookupAndTraverseRequest -} - -func NewLookupAndTraverseRequestBuilder() *LookupAndTraverseRequestBuilder{ - return &LookupAndTraverseRequestBuilder{ - obj: NewLookupAndTraverseRequest(), - } -} - -func (p LookupAndTraverseRequestBuilder) Emit() *LookupAndTraverseRequest{ - return &LookupAndTraverseRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - Indices: p.obj.Indices, - TraverseSpec: p.obj.TraverseSpec, - Common: p.obj.Common, - } -} - -func (l *LookupAndTraverseRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *LookupAndTraverseRequestBuilder { - l.obj.SpaceID = spaceID - return l -} - -func (l *LookupAndTraverseRequestBuilder) Parts(parts []nebula0.PartitionID) *LookupAndTraverseRequestBuilder { - l.obj.Parts = parts - return l -} - -func (l *LookupAndTraverseRequestBuilder) Indices(indices *IndexSpec) *LookupAndTraverseRequestBuilder { - l.obj.Indices = indices - return l -} - -func (l *LookupAndTraverseRequestBuilder) TraverseSpec(traverseSpec *TraverseSpec) *LookupAndTraverseRequestBuilder { - l.obj.TraverseSpec = traverseSpec - return l -} - -func (l *LookupAndTraverseRequestBuilder) Common(common *RequestCommon) *LookupAndTraverseRequestBuilder { - l.obj.Common = common - return l -} - -func (l *LookupAndTraverseRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *LookupAndTraverseRequest { - l.SpaceID = spaceID - return l -} - -func (l *LookupAndTraverseRequest) SetParts(parts []nebula0.PartitionID) *LookupAndTraverseRequest { - l.Parts = parts - return l -} - -func (l *LookupAndTraverseRequest) SetIndices(indices *IndexSpec) *LookupAndTraverseRequest { - l.Indices = indices - return l -} - -func (l *LookupAndTraverseRequest) SetTraverseSpec(traverseSpec *TraverseSpec) *LookupAndTraverseRequest { - l.TraverseSpec = traverseSpec - return l -} - -func (l *LookupAndTraverseRequest) SetCommon(common *RequestCommon) *LookupAndTraverseRequest { - l.Common = common - return l -} - -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 _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 - } - p.Parts = append(p.Parts, _elem61) - } - 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: -// - NextCursor -type ScanCursor struct { - NextCursor []byte `thrift:"next_cursor,1,optional" db:"next_cursor" json:"next_cursor,omitempty"` -} - -func NewScanCursor() *ScanCursor { - return &ScanCursor{} -} - -var ScanCursor_NextCursor_DEFAULT []byte - -func (p *ScanCursor) GetNextCursor() []byte { - return p.NextCursor -} -func (p *ScanCursor) IsSetNextCursor() bool { - return p != nil && p.NextCursor != nil -} - -type ScanCursorBuilder struct { - obj *ScanCursor -} - -func NewScanCursorBuilder() *ScanCursorBuilder{ - return &ScanCursorBuilder{ - obj: NewScanCursor(), - } -} - -func (p ScanCursorBuilder) Emit() *ScanCursor{ - return &ScanCursor{ - NextCursor: p.obj.NextCursor, - } -} - -func (s *ScanCursorBuilder) NextCursor(nextCursor []byte) *ScanCursorBuilder { - s.obj.NextCursor = nextCursor - return s -} - -func (s *ScanCursor) SetNextCursor(nextCursor []byte) *ScanCursor { - s.NextCursor = nextCursor - return s -} - -func (p *ScanCursor) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ScanCursor) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.NextCursor = v - } - return nil -} - -func (p *ScanCursor) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ScanCursor"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ScanCursor) writeField1(oprot thrift.Protocol) (err error) { - if p.IsSetNextCursor() { - if err := oprot.WriteFieldBegin("next_cursor", thrift.STRING, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:next_cursor: ", p), err) } - if err := oprot.WriteBinary(p.NextCursor); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.next_cursor (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:next_cursor: ", p), err) } - } - return err -} - -func (p *ScanCursor) String() string { - if p == nil { - return "" - } - - nextCursorVal := fmt.Sprintf("%v", p.NextCursor) - return fmt.Sprintf("ScanCursor({NextCursor:%s})", nextCursorVal) -} - -// Attributes: -// - SpaceID -// - Parts -// - ReturnColumns -// - Limit -// - StartTime -// - EndTime -// - Filter -// - OnlyLatestVersion -// - EnableReadFromFollower -// - Common -type ScanVertexRequest struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Parts map[nebula0.PartitionID]*ScanCursor `thrift:"parts,2" db:"parts" json:"parts"` - ReturnColumns []*VertexProp `thrift:"return_columns,3" db:"return_columns" json:"return_columns"` - Limit int64 `thrift:"limit,4" db:"limit" json:"limit"` - StartTime *int64 `thrift:"start_time,5,optional" db:"start_time" json:"start_time,omitempty"` - EndTime *int64 `thrift:"end_time,6,optional" db:"end_time" json:"end_time,omitempty"` - Filter []byte `thrift:"filter,7,optional" db:"filter" json:"filter,omitempty"` - OnlyLatestVersion bool `thrift:"only_latest_version,8" db:"only_latest_version" json:"only_latest_version"` - EnableReadFromFollower bool `thrift:"enable_read_from_follower,9" db:"enable_read_from_follower" json:"enable_read_from_follower"` - Common *RequestCommon `thrift:"common,10,optional" db:"common" json:"common,omitempty"` -} - -func NewScanVertexRequest() *ScanVertexRequest { - return &ScanVertexRequest{ - EnableReadFromFollower: true, - } -} - - -func (p *ScanVertexRequest) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -func (p *ScanVertexRequest) GetParts() map[nebula0.PartitionID]*ScanCursor { - return p.Parts -} - -func (p *ScanVertexRequest) GetReturnColumns() []*VertexProp { - 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) 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 -} - -type ScanVertexRequestBuilder struct { - obj *ScanVertexRequest -} - -func NewScanVertexRequestBuilder() *ScanVertexRequestBuilder{ - return &ScanVertexRequestBuilder{ - obj: NewScanVertexRequest(), - } -} - -func (p ScanVertexRequestBuilder) Emit() *ScanVertexRequest{ - return &ScanVertexRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - ReturnColumns: p.obj.ReturnColumns, - Limit: p.obj.Limit, - StartTime: p.obj.StartTime, - EndTime: p.obj.EndTime, - Filter: p.obj.Filter, - OnlyLatestVersion: p.obj.OnlyLatestVersion, - EnableReadFromFollower: p.obj.EnableReadFromFollower, - Common: p.obj.Common, - } -} - -func (s *ScanVertexRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ScanVertexRequestBuilder { - s.obj.SpaceID = spaceID - return s -} - -func (s *ScanVertexRequestBuilder) Parts(parts map[nebula0.PartitionID]*ScanCursor) *ScanVertexRequestBuilder { - s.obj.Parts = parts - return s -} - -func (s *ScanVertexRequestBuilder) ReturnColumns(returnColumns []*VertexProp) *ScanVertexRequestBuilder { - s.obj.ReturnColumns = returnColumns - return s -} - -func (s *ScanVertexRequestBuilder) Limit(limit int64) *ScanVertexRequestBuilder { - s.obj.Limit = limit - return s -} - -func (s *ScanVertexRequestBuilder) StartTime(startTime *int64) *ScanVertexRequestBuilder { - s.obj.StartTime = startTime - return s -} - -func (s *ScanVertexRequestBuilder) EndTime(endTime *int64) *ScanVertexRequestBuilder { - s.obj.EndTime = endTime - return s -} - -func (s *ScanVertexRequestBuilder) Filter(filter []byte) *ScanVertexRequestBuilder { - s.obj.Filter = filter - return s -} - -func (s *ScanVertexRequestBuilder) OnlyLatestVersion(onlyLatestVersion bool) *ScanVertexRequestBuilder { - s.obj.OnlyLatestVersion = onlyLatestVersion - return s -} - -func (s *ScanVertexRequestBuilder) EnableReadFromFollower(enableReadFromFollower bool) *ScanVertexRequestBuilder { - s.obj.EnableReadFromFollower = enableReadFromFollower - return s -} - -func (s *ScanVertexRequestBuilder) Common(common *RequestCommon) *ScanVertexRequestBuilder { - s.obj.Common = common - return s -} - -func (s *ScanVertexRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *ScanVertexRequest { - s.SpaceID = spaceID - return s -} - -func (s *ScanVertexRequest) SetParts(parts map[nebula0.PartitionID]*ScanCursor) *ScanVertexRequest { - s.Parts = parts - return s -} - -func (s *ScanVertexRequest) SetReturnColumns(returnColumns []*VertexProp) *ScanVertexRequest { - s.ReturnColumns = returnColumns - return s -} - -func (s *ScanVertexRequest) SetLimit(limit int64) *ScanVertexRequest { - s.Limit = limit - return s -} - -func (s *ScanVertexRequest) SetStartTime(startTime *int64) *ScanVertexRequest { - s.StartTime = startTime - return s -} - -func (s *ScanVertexRequest) SetEndTime(endTime *int64) *ScanVertexRequest { - s.EndTime = endTime - return s -} - -func (s *ScanVertexRequest) SetFilter(filter []byte) *ScanVertexRequest { - s.Filter = filter - return s -} - -func (s *ScanVertexRequest) SetOnlyLatestVersion(onlyLatestVersion bool) *ScanVertexRequest { - s.OnlyLatestVersion = onlyLatestVersion - return s -} - -func (s *ScanVertexRequest) SetEnableReadFromFollower(enableReadFromFollower bool) *ScanVertexRequest { - s.EnableReadFromFollower = enableReadFromFollower - return s -} - -func (s *ScanVertexRequest) SetCommon(common *RequestCommon) *ScanVertexRequest { - s.Common = common - return s -} - -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 { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.PartitionID]*ScanCursor, size) - p.Parts = tMap - for i := 0; i < size; i ++ { - var _key62 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key62 = temp - } - _val63 := NewScanCursor() - if err := _val63.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val63), err) - } - p.Parts[_key62] = _val63 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *ScanVertexRequest) 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.ReturnColumns = tSlice - for i := 0; i < size; i ++ { - _elem64 := NewVertexProp() - if err := _elem64.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem64), err) - } - p.ReturnColumns = append(p.ReturnColumns, _elem64) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *ScanVertexRequest) ReadField4(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.Limit = v - } - 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.StartTime = &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.EndTime = &v - } - return nil -} - -func (p *ScanVertexRequest) ReadField7(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 7: ", err) - } else { - p.Filter = v - } - return nil -} - -func (p *ScanVertexRequest) ReadField8(iprot thrift.Protocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 8: ", err) - } else { - p.OnlyLatestVersion = 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.EnableReadFromFollower = v - } - return nil -} - -func (p *ScanVertexRequest) 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 *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("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.STRUCT, 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 := 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:parts: ", p), err) } - return err -} - -func (p *ScanVertexRequest) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("return_columns", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_columns: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ReturnColumns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ReturnColumns { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_columns: ", p), err) } - return err -} - -func (p *ScanVertexRequest) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("limit", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:limit: ", p), err) } - if err := oprot.WriteI64(int64(p.Limit)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.limit (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:limit: ", p), err) } - return err -} - -func (p *ScanVertexRequest) writeField5(oprot thrift.Protocol) (err error) { - if p.IsSetStartTime() { - 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 *ScanVertexRequest) writeField6(oprot thrift.Protocol) (err error) { - if p.IsSetEndTime() { - if err := oprot.WriteFieldBegin("end_time", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:end_time: ", p), err) } - if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.end_time (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:end_time: ", p), err) } - } - return err -} - -func (p *ScanVertexRequest) writeField7(oprot thrift.Protocol) (err error) { - if p.IsSetFilter() { - if err := oprot.WriteFieldBegin("filter", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:filter: ", p), err) } - if err := oprot.WriteBinary(p.Filter); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.filter (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:filter: ", p), err) } - } - return err -} - -func (p *ScanVertexRequest) writeField8(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:only_latest_version: ", p), err) } - if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:only_latest_version: ", p), err) } - return err -} - -func (p *ScanVertexRequest) writeField9(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9: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 (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:enable_read_from_follower: ", p), err) } - return err -} - -func (p *ScanVertexRequest) 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 *ScanVertexRequest) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - partsVal := fmt.Sprintf("%v", p.Parts) - 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 Parts:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s Common:%s})", spaceIDVal, partsVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal, commonVal) -} - -// Attributes: -// - SpaceID -// - Parts -// - ReturnColumns -// - Limit -// - StartTime -// - EndTime -// - Filter -// - OnlyLatestVersion -// - EnableReadFromFollower -// - Common -type ScanEdgeRequest struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Parts map[nebula0.PartitionID]*ScanCursor `thrift:"parts,2" db:"parts" json:"parts"` - ReturnColumns []*EdgeProp `thrift:"return_columns,3" db:"return_columns" json:"return_columns"` - Limit int64 `thrift:"limit,4" db:"limit" json:"limit"` - StartTime *int64 `thrift:"start_time,5,optional" db:"start_time" json:"start_time,omitempty"` - EndTime *int64 `thrift:"end_time,6,optional" db:"end_time" json:"end_time,omitempty"` - Filter []byte `thrift:"filter,7,optional" db:"filter" json:"filter,omitempty"` - OnlyLatestVersion bool `thrift:"only_latest_version,8" db:"only_latest_version" json:"only_latest_version"` - EnableReadFromFollower bool `thrift:"enable_read_from_follower,9" db:"enable_read_from_follower" json:"enable_read_from_follower"` - Common *RequestCommon `thrift:"common,10,optional" db:"common" json:"common,omitempty"` -} - -func NewScanEdgeRequest() *ScanEdgeRequest { - return &ScanEdgeRequest{ - EnableReadFromFollower: true, - } -} - - -func (p *ScanEdgeRequest) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -func (p *ScanEdgeRequest) GetParts() map[nebula0.PartitionID]*ScanCursor { - return p.Parts -} - -func (p *ScanEdgeRequest) GetReturnColumns() []*EdgeProp { - 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) 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 -} - -type ScanEdgeRequestBuilder struct { - obj *ScanEdgeRequest -} - -func NewScanEdgeRequestBuilder() *ScanEdgeRequestBuilder{ - return &ScanEdgeRequestBuilder{ - obj: NewScanEdgeRequest(), - } -} - -func (p ScanEdgeRequestBuilder) Emit() *ScanEdgeRequest{ - return &ScanEdgeRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - ReturnColumns: p.obj.ReturnColumns, - Limit: p.obj.Limit, - StartTime: p.obj.StartTime, - EndTime: p.obj.EndTime, - Filter: p.obj.Filter, - OnlyLatestVersion: p.obj.OnlyLatestVersion, - EnableReadFromFollower: p.obj.EnableReadFromFollower, - Common: p.obj.Common, - } -} - -func (s *ScanEdgeRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ScanEdgeRequestBuilder { - s.obj.SpaceID = spaceID - return s -} - -func (s *ScanEdgeRequestBuilder) Parts(parts map[nebula0.PartitionID]*ScanCursor) *ScanEdgeRequestBuilder { - s.obj.Parts = parts - return s -} - -func (s *ScanEdgeRequestBuilder) ReturnColumns(returnColumns []*EdgeProp) *ScanEdgeRequestBuilder { - s.obj.ReturnColumns = returnColumns - return s -} - -func (s *ScanEdgeRequestBuilder) Limit(limit int64) *ScanEdgeRequestBuilder { - s.obj.Limit = limit - return s -} - -func (s *ScanEdgeRequestBuilder) StartTime(startTime *int64) *ScanEdgeRequestBuilder { - s.obj.StartTime = startTime - return s -} - -func (s *ScanEdgeRequestBuilder) EndTime(endTime *int64) *ScanEdgeRequestBuilder { - s.obj.EndTime = endTime - return s -} - -func (s *ScanEdgeRequestBuilder) Filter(filter []byte) *ScanEdgeRequestBuilder { - s.obj.Filter = filter - return s -} - -func (s *ScanEdgeRequestBuilder) OnlyLatestVersion(onlyLatestVersion bool) *ScanEdgeRequestBuilder { - s.obj.OnlyLatestVersion = onlyLatestVersion - return s -} - -func (s *ScanEdgeRequestBuilder) EnableReadFromFollower(enableReadFromFollower bool) *ScanEdgeRequestBuilder { - s.obj.EnableReadFromFollower = enableReadFromFollower - return s -} - -func (s *ScanEdgeRequestBuilder) Common(common *RequestCommon) *ScanEdgeRequestBuilder { - s.obj.Common = common - return s -} - -func (s *ScanEdgeRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *ScanEdgeRequest { - s.SpaceID = spaceID - return s -} - -func (s *ScanEdgeRequest) SetParts(parts map[nebula0.PartitionID]*ScanCursor) *ScanEdgeRequest { - s.Parts = parts - return s -} - -func (s *ScanEdgeRequest) SetReturnColumns(returnColumns []*EdgeProp) *ScanEdgeRequest { - s.ReturnColumns = returnColumns - return s -} - -func (s *ScanEdgeRequest) SetLimit(limit int64) *ScanEdgeRequest { - s.Limit = limit - return s -} - -func (s *ScanEdgeRequest) SetStartTime(startTime *int64) *ScanEdgeRequest { - s.StartTime = startTime - return s -} - -func (s *ScanEdgeRequest) SetEndTime(endTime *int64) *ScanEdgeRequest { - s.EndTime = endTime - return s -} - -func (s *ScanEdgeRequest) SetFilter(filter []byte) *ScanEdgeRequest { - s.Filter = filter - return s -} - -func (s *ScanEdgeRequest) SetOnlyLatestVersion(onlyLatestVersion bool) *ScanEdgeRequest { - s.OnlyLatestVersion = onlyLatestVersion - return s -} - -func (s *ScanEdgeRequest) SetEnableReadFromFollower(enableReadFromFollower bool) *ScanEdgeRequest { - s.EnableReadFromFollower = enableReadFromFollower - return s -} - -func (s *ScanEdgeRequest) SetCommon(common *RequestCommon) *ScanEdgeRequest { - s.Common = common - return s -} - -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 { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.PartitionID]*ScanCursor, 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 - } - _val66 := NewScanCursor() - if err := _val66.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val66), err) - } - p.Parts[_key65] = _val66 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *ScanEdgeRequest) ReadField3(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.ReturnColumns = tSlice - for i := 0; i < size; i ++ { - _elem67 := NewEdgeProp() - if err := _elem67.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem67), err) - } - p.ReturnColumns = append(p.ReturnColumns, _elem67) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - return nil -} - -func (p *ScanEdgeRequest) ReadField4(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.Limit = v - } - 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.StartTime = &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.EndTime = &v - } - return nil -} - -func (p *ScanEdgeRequest) ReadField7(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 7: ", err) - } else { - p.Filter = v - } - return nil -} - -func (p *ScanEdgeRequest) ReadField8(iprot thrift.Protocol) error { - if v, err := iprot.ReadBool(); err != nil { - return thrift.PrependError("error reading field 8: ", err) - } else { - p.OnlyLatestVersion = 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.EnableReadFromFollower = v - } - return nil -} - -func (p *ScanEdgeRequest) 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 *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("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.STRUCT, 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 := 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:parts: ", p), err) } - return err -} - -func (p *ScanEdgeRequest) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("return_columns", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:return_columns: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ReturnColumns)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.ReturnColumns { - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteListEnd(); err != nil { - return thrift.PrependError("error writing list end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:return_columns: ", p), err) } - return err -} - -func (p *ScanEdgeRequest) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("limit", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:limit: ", p), err) } - if err := oprot.WriteI64(int64(p.Limit)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.limit (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:limit: ", p), err) } - return err -} - -func (p *ScanEdgeRequest) writeField5(oprot thrift.Protocol) (err error) { - if p.IsSetStartTime() { - 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 *ScanEdgeRequest) writeField6(oprot thrift.Protocol) (err error) { - if p.IsSetEndTime() { - if err := oprot.WriteFieldBegin("end_time", thrift.I64, 6); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 6:end_time: ", p), err) } - if err := oprot.WriteI64(int64(*p.EndTime)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.end_time (6) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 6:end_time: ", p), err) } - } - return err -} - -func (p *ScanEdgeRequest) writeField7(oprot thrift.Protocol) (err error) { - if p.IsSetFilter() { - if err := oprot.WriteFieldBegin("filter", thrift.STRING, 7); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 7:filter: ", p), err) } - if err := oprot.WriteBinary(p.Filter); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.filter (7) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 7:filter: ", p), err) } - } - return err -} - -func (p *ScanEdgeRequest) writeField8(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("only_latest_version", thrift.BOOL, 8); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 8:only_latest_version: ", p), err) } - if err := oprot.WriteBool(bool(p.OnlyLatestVersion)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.only_latest_version (8) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 8:only_latest_version: ", p), err) } - return err -} - -func (p *ScanEdgeRequest) writeField9(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("enable_read_from_follower", thrift.BOOL, 9); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 9: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 (9) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 9:enable_read_from_follower: ", p), err) } - return err -} - -func (p *ScanEdgeRequest) 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 *ScanEdgeRequest) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - partsVal := fmt.Sprintf("%v", p.Parts) - 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 Parts:%s ReturnColumns:%s Limit:%s StartTime:%s EndTime:%s Filter:%s OnlyLatestVersion:%s EnableReadFromFollower:%s Common:%s})", spaceIDVal, partsVal, returnColumnsVal, limitVal, startTimeVal, endTimeVal, filterVal, onlyLatestVersionVal, enableReadFromFollowerVal, commonVal) -} - -// Attributes: -// - Result_ -// - Props -// - Cursors -type ScanResponse struct { - Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - Props *nebula0.DataSet `thrift:"props,2,optional" db:"props" json:"props,omitempty"` - Cursors map[nebula0.PartitionID]*ScanCursor `thrift:"cursors,3" db:"cursors" json:"cursors"` -} - -func NewScanResponse() *ScanResponse { - return &ScanResponse{ - Result_: NewResponseCommon(), - } -} - -var ScanResponse_Result__DEFAULT *ResponseCommon -func (p *ScanResponse) GetResult_() *ResponseCommon { - if !p.IsSetResult_() { - return ScanResponse_Result__DEFAULT - } -return p.Result_ -} -var ScanResponse_Props_DEFAULT *nebula0.DataSet -func (p *ScanResponse) GetProps() *nebula0.DataSet { - if !p.IsSetProps() { - return ScanResponse_Props_DEFAULT - } -return p.Props -} - -func (p *ScanResponse) GetCursors() map[nebula0.PartitionID]*ScanCursor { - return p.Cursors -} -func (p *ScanResponse) IsSetResult_() bool { - return p != nil && p.Result_ != nil -} - -func (p *ScanResponse) IsSetProps() bool { - return p != nil && p.Props != nil -} - -type ScanResponseBuilder struct { - obj *ScanResponse -} - -func NewScanResponseBuilder() *ScanResponseBuilder{ - return &ScanResponseBuilder{ - obj: NewScanResponse(), - } -} - -func (p ScanResponseBuilder) Emit() *ScanResponse{ - return &ScanResponse{ - Result_: p.obj.Result_, - Props: p.obj.Props, - Cursors: p.obj.Cursors, - } -} - -func (s *ScanResponseBuilder) Result_(result *ResponseCommon) *ScanResponseBuilder { - s.obj.Result_ = result - return s -} - -func (s *ScanResponseBuilder) Props(props *nebula0.DataSet) *ScanResponseBuilder { - s.obj.Props = props - return s -} - -func (s *ScanResponseBuilder) Cursors(cursors map[nebula0.PartitionID]*ScanCursor) *ScanResponseBuilder { - s.obj.Cursors = cursors - return s -} - -func (s *ScanResponse) SetResult_(result *ResponseCommon) *ScanResponse { - s.Result_ = result - return s -} - -func (s *ScanResponse) SetProps(props *nebula0.DataSet) *ScanResponse { - s.Props = props - return s -} - -func (s *ScanResponse) SetCursors(cursors map[nebula0.PartitionID]*ScanCursor) *ScanResponse { - s.Cursors = cursors - return s -} - -func (p *ScanResponse) 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 *ScanResponse) ReadField1(iprot thrift.Protocol) error { - p.Result_ = NewResponseCommon() - if err := p.Result_.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Result_), err) - } - return nil -} - -func (p *ScanResponse) ReadField2(iprot thrift.Protocol) error { - p.Props = nebula0.NewDataSet() - if err := p.Props.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.Props), err) - } - return nil -} - -func (p *ScanResponse) ReadField3(iprot thrift.Protocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return thrift.PrependError("error reading map begin: ", err) - } - tMap := make(map[nebula0.PartitionID]*ScanCursor, size) - p.Cursors = tMap - for i := 0; i < size; i ++ { - var _key68 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key68 = temp - } - _val69 := NewScanCursor() - if err := _val69.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _val69), err) - } - p.Cursors[_key68] = _val69 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *ScanResponse) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ScanResponse"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ScanResponse) writeField1(oprot thrift.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 *ScanResponse) writeField2(oprot thrift.Protocol) (err error) { - if p.IsSetProps() { - if err := oprot.WriteFieldBegin("props", thrift.STRUCT, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:props: ", p), err) } - if err := p.Props.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.Props), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:props: ", p), err) } - } - return err -} - -func (p *ScanResponse) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("cursors", thrift.MAP, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:cursors: ", p), err) } - if err := oprot.WriteMapBegin(thrift.I32, thrift.STRUCT, len(p.Cursors)); err != nil { - return thrift.PrependError("error writing map begin: ", err) - } - for k, v := range p.Cursors { - if err := oprot.WriteI32(int32(k)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T. (0) field write error: ", p), err) } - if err := v.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", v), err) - } - } - if err := oprot.WriteMapEnd(); err != nil { - return thrift.PrependError("error writing map end: ", err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:cursors: ", p), err) } - return err -} - -func (p *ScanResponse) 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) - } - cursorsVal := fmt.Sprintf("%v", p.Cursors) - return fmt.Sprintf("ScanResponse({Result_:%s Props:%s Cursors:%s})", resultVal, propsVal, cursorsVal) -} - -// Attributes: -// - SpaceID -// - Parts -// - TaskSpecificParas -type TaskPara struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Parts []nebula0.PartitionID `thrift:"parts,2,optional" db:"parts" json:"parts,omitempty"` - TaskSpecificParas [][]byte `thrift:"task_specific_paras,3,optional" db:"task_specific_paras" json:"task_specific_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_TaskSpecificParas_DEFAULT [][]byte - -func (p *TaskPara) GetTaskSpecificParas() [][]byte { - return p.TaskSpecificParas -} -func (p *TaskPara) IsSetParts() bool { - return p != nil && p.Parts != nil -} - -func (p *TaskPara) IsSetTaskSpecificParas() bool { - return p != nil && p.TaskSpecificParas != nil -} - -type TaskParaBuilder struct { - obj *TaskPara -} - -func NewTaskParaBuilder() *TaskParaBuilder{ - return &TaskParaBuilder{ - obj: NewTaskPara(), - } -} - -func (p TaskParaBuilder) Emit() *TaskPara{ - return &TaskPara{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - TaskSpecificParas: p.obj.TaskSpecificParas, - } -} - -func (t *TaskParaBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *TaskParaBuilder { - t.obj.SpaceID = spaceID - return t -} - -func (t *TaskParaBuilder) Parts(parts []nebula0.PartitionID) *TaskParaBuilder { - t.obj.Parts = parts - return t -} - -func (t *TaskParaBuilder) TaskSpecificParas(taskSpecificParas [][]byte) *TaskParaBuilder { - t.obj.TaskSpecificParas = taskSpecificParas - return t -} - -func (t *TaskPara) SetSpaceID(spaceID nebula0.GraphSpaceID) *TaskPara { - t.SpaceID = spaceID - return t -} - -func (t *TaskPara) SetParts(parts []nebula0.PartitionID) *TaskPara { - t.Parts = parts - return t -} - -func (t *TaskPara) SetTaskSpecificParas(taskSpecificParas [][]byte) *TaskPara { - t.TaskSpecificParas = taskSpecificParas - return t -} - -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 _elem70 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem70 = temp - } - p.Parts = append(p.Parts, _elem70) - } - 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.TaskSpecificParas = 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 - } - p.TaskSpecificParas = append(p.TaskSpecificParas, _elem71) - } - 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.IsSetTaskSpecificParas() { - if err := oprot.WriteFieldBegin("task_specific_paras", thrift.LIST, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:task_specific_paras: ", p), err) } - if err := oprot.WriteListBegin(thrift.STRING, len(p.TaskSpecificParas)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.TaskSpecificParas { - 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_specific_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) - taskSpecificParasVal := fmt.Sprintf("%v", p.TaskSpecificParas) - return fmt.Sprintf("TaskPara({SpaceID:%s Parts:%s TaskSpecificParas:%s})", spaceIDVal, partsVal, taskSpecificParasVal) -} - -// 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 -} -type KVGetRequestBuilder struct { - obj *KVGetRequest -} - -func NewKVGetRequestBuilder() *KVGetRequestBuilder{ - return &KVGetRequestBuilder{ - obj: NewKVGetRequest(), - } -} - -func (p KVGetRequestBuilder) Emit() *KVGetRequest{ - return &KVGetRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - ReturnPartly: p.obj.ReturnPartly, - } -} - -func (k *KVGetRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *KVGetRequestBuilder { - k.obj.SpaceID = spaceID - return k -} - -func (k *KVGetRequestBuilder) Parts(parts map[nebula0.PartitionID][][]byte) *KVGetRequestBuilder { - k.obj.Parts = parts - return k -} - -func (k *KVGetRequestBuilder) ReturnPartly(returnPartly bool) *KVGetRequestBuilder { - k.obj.ReturnPartly = returnPartly - return k -} - -func (k *KVGetRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *KVGetRequest { - k.SpaceID = spaceID - return k -} - -func (k *KVGetRequest) SetParts(parts map[nebula0.PartitionID][][]byte) *KVGetRequest { - k.Parts = parts - return k -} - -func (k *KVGetRequest) SetReturnPartly(returnPartly bool) *KVGetRequest { - k.ReturnPartly = returnPartly - return k -} - -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 _key72 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key72 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - _val73 := 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 - } - _val73 = append(_val73, _elem74) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key72] = _val73 - } - 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 -} - -type KVGetResponseBuilder struct { - obj *KVGetResponse -} - -func NewKVGetResponseBuilder() *KVGetResponseBuilder{ - return &KVGetResponseBuilder{ - obj: NewKVGetResponse(), - } -} - -func (p KVGetResponseBuilder) Emit() *KVGetResponse{ - return &KVGetResponse{ - Result_: p.obj.Result_, - KeyValues: p.obj.KeyValues, - } -} - -func (k *KVGetResponseBuilder) Result_(result *ResponseCommon) *KVGetResponseBuilder { - k.obj.Result_ = result - return k -} - -func (k *KVGetResponseBuilder) KeyValues(keyValues map[string][]byte) *KVGetResponseBuilder { - k.obj.KeyValues = keyValues - return k -} - -func (k *KVGetResponse) SetResult_(result *ResponseCommon) *KVGetResponse { - k.Result_ = result - return k -} - -func (k *KVGetResponse) SetKeyValues(keyValues map[string][]byte) *KVGetResponse { - k.KeyValues = keyValues - return k -} - -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 _key75 string - if v, err := iprot.ReadString(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _key75 = v - } - var _val76 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _val76 = v - } - p.KeyValues[_key75] = _val76 - } - 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 -} -type KVPutRequestBuilder struct { - obj *KVPutRequest -} - -func NewKVPutRequestBuilder() *KVPutRequestBuilder{ - return &KVPutRequestBuilder{ - obj: NewKVPutRequest(), - } -} - -func (p KVPutRequestBuilder) Emit() *KVPutRequest{ - return &KVPutRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - } -} - -func (k *KVPutRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *KVPutRequestBuilder { - k.obj.SpaceID = spaceID - return k -} - -func (k *KVPutRequestBuilder) Parts(parts map[nebula0.PartitionID][]*nebula0.KeyValue) *KVPutRequestBuilder { - k.obj.Parts = parts - return k -} - -func (k *KVPutRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *KVPutRequest { - k.SpaceID = spaceID - return k -} - -func (k *KVPutRequest) SetParts(parts map[nebula0.PartitionID][]*nebula0.KeyValue) *KVPutRequest { - k.Parts = parts - return k -} - -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 _key77 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key77 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*nebula0.KeyValue, 0, size) - _val78 := tSlice - for i := 0; i < size; i ++ { - _elem79 := nebula0.NewKeyValue() - if err := _elem79.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem79), err) - } - _val78 = append(_val78, _elem79) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key77] = _val78 - } - 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 -} -type KVRemoveRequestBuilder struct { - obj *KVRemoveRequest -} - -func NewKVRemoveRequestBuilder() *KVRemoveRequestBuilder{ - return &KVRemoveRequestBuilder{ - obj: NewKVRemoveRequest(), - } -} - -func (p KVRemoveRequestBuilder) Emit() *KVRemoveRequest{ - return &KVRemoveRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - } -} - -func (k *KVRemoveRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *KVRemoveRequestBuilder { - k.obj.SpaceID = spaceID - return k -} - -func (k *KVRemoveRequestBuilder) Parts(parts map[nebula0.PartitionID][][]byte) *KVRemoveRequestBuilder { - k.obj.Parts = parts - return k -} - -func (k *KVRemoveRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *KVRemoveRequest { - k.SpaceID = spaceID - return k -} - -func (k *KVRemoveRequest) SetParts(parts map[nebula0.PartitionID][][]byte) *KVRemoveRequest { - k.Parts = parts - return k -} - -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 _key80 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key80 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([][]byte, 0, size) - _val81 := tSlice - for i := 0; i < size; i ++ { - var _elem82 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem82 = v - } - _val81 = append(_val81, _elem82) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key80] = _val81 - } - 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: -// - Result_ -// - Stats -type AdminExecResp struct { - Result_ *ResponseCommon `thrift:"result,1,required" db:"result" json:"result"` - Stats *meta1.StatsItem `thrift:"stats,2,optional" 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 -} - -type AdminExecRespBuilder struct { - obj *AdminExecResp -} - -func NewAdminExecRespBuilder() *AdminExecRespBuilder{ - return &AdminExecRespBuilder{ - obj: NewAdminExecResp(), - } -} - -func (p AdminExecRespBuilder) Emit() *AdminExecResp{ - return &AdminExecResp{ - Result_: p.obj.Result_, - Stats: p.obj.Stats, - } -} - -func (a *AdminExecRespBuilder) Result_(result *ResponseCommon) *AdminExecRespBuilder { - a.obj.Result_ = result - return a -} - -func (a *AdminExecRespBuilder) Stats(stats *meta1.StatsItem) *AdminExecRespBuilder { - a.obj.Stats = stats - return a -} - -func (a *AdminExecResp) SetResult_(result *ResponseCommon) *AdminExecResp { - a.Result_ = result - return a -} - -func (a *AdminExecResp) SetStats(stats *meta1.StatsItem) *AdminExecResp { - a.Stats = stats - return a -} - -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 -} - -type TransLeaderReqBuilder struct { - obj *TransLeaderReq -} - -func NewTransLeaderReqBuilder() *TransLeaderReqBuilder{ - return &TransLeaderReqBuilder{ - obj: NewTransLeaderReq(), - } -} - -func (p TransLeaderReqBuilder) Emit() *TransLeaderReq{ - return &TransLeaderReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - NewLeader_: p.obj.NewLeader_, - } -} - -func (t *TransLeaderReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *TransLeaderReqBuilder { - t.obj.SpaceID = spaceID - return t -} - -func (t *TransLeaderReqBuilder) PartID(partID nebula0.PartitionID) *TransLeaderReqBuilder { - t.obj.PartID = partID - return t -} - -func (t *TransLeaderReqBuilder) NewLeader_(newLeader *nebula0.HostAddr) *TransLeaderReqBuilder { - t.obj.NewLeader_ = newLeader - return t -} - -func (t *TransLeaderReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *TransLeaderReq { - t.SpaceID = spaceID - return t -} - -func (t *TransLeaderReq) SetPartID(partID nebula0.PartitionID) *TransLeaderReq { - t.PartID = partID - return t -} - -func (t *TransLeaderReq) SetNewLeader_(newLeader *nebula0.HostAddr) *TransLeaderReq { - t.NewLeader_ = newLeader - return t -} - -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 -} -type AddPartReqBuilder struct { - obj *AddPartReq -} - -func NewAddPartReqBuilder() *AddPartReqBuilder{ - return &AddPartReqBuilder{ - obj: NewAddPartReq(), - } -} - -func (p AddPartReqBuilder) Emit() *AddPartReq{ - return &AddPartReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - AsLearner: p.obj.AsLearner, - Peers: p.obj.Peers, - } -} - -func (a *AddPartReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AddPartReqBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AddPartReqBuilder) PartID(partID nebula0.PartitionID) *AddPartReqBuilder { - a.obj.PartID = partID - return a -} - -func (a *AddPartReqBuilder) AsLearner(asLearner bool) *AddPartReqBuilder { - a.obj.AsLearner = asLearner - return a -} - -func (a *AddPartReqBuilder) Peers(peers []*nebula0.HostAddr) *AddPartReqBuilder { - a.obj.Peers = peers - return a -} - -func (a *AddPartReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *AddPartReq { - a.SpaceID = spaceID - return a -} - -func (a *AddPartReq) SetPartID(partID nebula0.PartitionID) *AddPartReq { - a.PartID = partID - return a -} - -func (a *AddPartReq) SetAsLearner(asLearner bool) *AddPartReq { - a.AsLearner = asLearner - return a -} - -func (a *AddPartReq) SetPeers(peers []*nebula0.HostAddr) *AddPartReq { - a.Peers = peers - return a -} - -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 ++ { - _elem83 := nebula0.NewHostAddr() - if err := _elem83.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem83), err) - } - p.Peers = append(p.Peers, _elem83) - } - 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 -} - -type AddLearnerReqBuilder struct { - obj *AddLearnerReq -} - -func NewAddLearnerReqBuilder() *AddLearnerReqBuilder{ - return &AddLearnerReqBuilder{ - obj: NewAddLearnerReq(), - } -} - -func (p AddLearnerReqBuilder) Emit() *AddLearnerReq{ - return &AddLearnerReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - Learner: p.obj.Learner, - } -} - -func (a *AddLearnerReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *AddLearnerReqBuilder { - a.obj.SpaceID = spaceID - return a -} - -func (a *AddLearnerReqBuilder) PartID(partID nebula0.PartitionID) *AddLearnerReqBuilder { - a.obj.PartID = partID - return a -} - -func (a *AddLearnerReqBuilder) Learner(learner *nebula0.HostAddr) *AddLearnerReqBuilder { - a.obj.Learner = learner - return a -} - -func (a *AddLearnerReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *AddLearnerReq { - a.SpaceID = spaceID - return a -} - -func (a *AddLearnerReq) SetPartID(partID nebula0.PartitionID) *AddLearnerReq { - a.PartID = partID - return a -} - -func (a *AddLearnerReq) SetLearner(learner *nebula0.HostAddr) *AddLearnerReq { - a.Learner = learner - return a -} - -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 -} -type RemovePartReqBuilder struct { - obj *RemovePartReq -} - -func NewRemovePartReqBuilder() *RemovePartReqBuilder{ - return &RemovePartReqBuilder{ - obj: NewRemovePartReq(), - } -} - -func (p RemovePartReqBuilder) Emit() *RemovePartReq{ - return &RemovePartReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - } -} - -func (r *RemovePartReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *RemovePartReqBuilder { - r.obj.SpaceID = spaceID - return r -} - -func (r *RemovePartReqBuilder) PartID(partID nebula0.PartitionID) *RemovePartReqBuilder { - r.obj.PartID = partID - return r -} - -func (r *RemovePartReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *RemovePartReq { - r.SpaceID = spaceID - return r -} - -func (r *RemovePartReq) SetPartID(partID nebula0.PartitionID) *RemovePartReq { - r.PartID = partID - return r -} - -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 -} - -type MemberChangeReqBuilder struct { - obj *MemberChangeReq -} - -func NewMemberChangeReqBuilder() *MemberChangeReqBuilder{ - return &MemberChangeReqBuilder{ - obj: NewMemberChangeReq(), - } -} - -func (p MemberChangeReqBuilder) Emit() *MemberChangeReq{ - return &MemberChangeReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - Peer: p.obj.Peer, - Add: p.obj.Add, - } -} - -func (m *MemberChangeReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *MemberChangeReqBuilder { - m.obj.SpaceID = spaceID - return m -} - -func (m *MemberChangeReqBuilder) PartID(partID nebula0.PartitionID) *MemberChangeReqBuilder { - m.obj.PartID = partID - return m -} - -func (m *MemberChangeReqBuilder) Peer(peer *nebula0.HostAddr) *MemberChangeReqBuilder { - m.obj.Peer = peer - return m -} - -func (m *MemberChangeReqBuilder) Add(add bool) *MemberChangeReqBuilder { - m.obj.Add = add - return m -} - -func (m *MemberChangeReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *MemberChangeReq { - m.SpaceID = spaceID - return m -} - -func (m *MemberChangeReq) SetPartID(partID nebula0.PartitionID) *MemberChangeReq { - m.PartID = partID - return m -} - -func (m *MemberChangeReq) SetPeer(peer *nebula0.HostAddr) *MemberChangeReq { - m.Peer = peer - return m -} - -func (m *MemberChangeReq) SetAdd(add bool) *MemberChangeReq { - m.Add = add - return m -} - -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 -} - -type CatchUpDataReqBuilder struct { - obj *CatchUpDataReq -} - -func NewCatchUpDataReqBuilder() *CatchUpDataReqBuilder{ - return &CatchUpDataReqBuilder{ - obj: NewCatchUpDataReq(), - } -} - -func (p CatchUpDataReqBuilder) Emit() *CatchUpDataReq{ - return &CatchUpDataReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - Target: p.obj.Target, - } -} - -func (c *CatchUpDataReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *CatchUpDataReqBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *CatchUpDataReqBuilder) PartID(partID nebula0.PartitionID) *CatchUpDataReqBuilder { - c.obj.PartID = partID - return c -} - -func (c *CatchUpDataReqBuilder) Target(target *nebula0.HostAddr) *CatchUpDataReqBuilder { - c.obj.Target = target - return c -} - -func (c *CatchUpDataReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *CatchUpDataReq { - c.SpaceID = spaceID - return c -} - -func (c *CatchUpDataReq) SetPartID(partID nebula0.PartitionID) *CatchUpDataReq { - c.PartID = partID - return c -} - -func (c *CatchUpDataReq) SetTarget(target *nebula0.HostAddr) *CatchUpDataReq { - c.Target = target - return c -} - -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{} -} - -type GetLeaderReqBuilder struct { - obj *GetLeaderReq -} - -func NewGetLeaderReqBuilder() *GetLeaderReqBuilder{ - return &GetLeaderReqBuilder{ - obj: NewGetLeaderReq(), - } -} - -func (p GetLeaderReqBuilder) Emit() *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: -// - SpaceIds -// - Name -type CreateCPRequest struct { - SpaceIds []nebula0.GraphSpaceID `thrift:"space_ids,1" db:"space_ids" json:"space_ids"` - Name []byte `thrift:"name,2" db:"name" json:"name"` -} - -func NewCreateCPRequest() *CreateCPRequest { - return &CreateCPRequest{} -} - - -func (p *CreateCPRequest) GetSpaceIds() []nebula0.GraphSpaceID { - return p.SpaceIds -} - -func (p *CreateCPRequest) GetName() []byte { - return p.Name -} -type CreateCPRequestBuilder struct { - obj *CreateCPRequest -} - -func NewCreateCPRequestBuilder() *CreateCPRequestBuilder{ - return &CreateCPRequestBuilder{ - obj: NewCreateCPRequest(), - } -} - -func (p CreateCPRequestBuilder) Emit() *CreateCPRequest{ - return &CreateCPRequest{ - SpaceIds: p.obj.SpaceIds, - Name: p.obj.Name, - } -} - -func (c *CreateCPRequestBuilder) SpaceIds(spaceIds []nebula0.GraphSpaceID) *CreateCPRequestBuilder { - c.obj.SpaceIds = spaceIds - return c -} - -func (c *CreateCPRequestBuilder) Name(name []byte) *CreateCPRequestBuilder { - c.obj.Name = name - return c -} - -func (c *CreateCPRequest) SetSpaceIds(spaceIds []nebula0.GraphSpaceID) *CreateCPRequest { - c.SpaceIds = spaceIds - return c -} - -func (c *CreateCPRequest) SetName(name []byte) *CreateCPRequest { - c.Name = name - return c -} - -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 { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]nebula0.GraphSpaceID, 0, size) - p.SpaceIds = tSlice - for i := 0; i < size; i ++ { - var _elem84 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _elem84 = temp - } - p.SpaceIds = append(p.SpaceIds, _elem84) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - 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_ids", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_ids: ", p), err) } - if err := oprot.WriteListBegin(thrift.I32, len(p.SpaceIds)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.SpaceIds { - 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:space_ids: ", 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 "" - } - - spaceIdsVal := fmt.Sprintf("%v", p.SpaceIds) - nameVal := fmt.Sprintf("%v", p.Name) - return fmt.Sprintf("CreateCPRequest({SpaceIds:%s Name:%s})", spaceIdsVal, nameVal) -} - -// Attributes: -// - Code -// - Info -type CreateCPResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - Info []*nebula0.CheckpointInfo `thrift:"info,2" db:"info" json:"info"` -} - -func NewCreateCPResp() *CreateCPResp { - return &CreateCPResp{} -} - - -func (p *CreateCPResp) GetCode() nebula0.ErrorCode { - return p.Code -} - -func (p *CreateCPResp) GetInfo() []*nebula0.CheckpointInfo { - return p.Info -} -type CreateCPRespBuilder struct { - obj *CreateCPResp -} - -func NewCreateCPRespBuilder() *CreateCPRespBuilder{ - return &CreateCPRespBuilder{ - obj: NewCreateCPResp(), - } -} - -func (p CreateCPRespBuilder) Emit() *CreateCPResp{ - return &CreateCPResp{ - Code: p.obj.Code, - Info: p.obj.Info, - } -} - -func (c *CreateCPRespBuilder) Code(code nebula0.ErrorCode) *CreateCPRespBuilder { - c.obj.Code = code - return c -} - -func (c *CreateCPRespBuilder) Info(info []*nebula0.CheckpointInfo) *CreateCPRespBuilder { - c.obj.Info = info - return c -} - -func (c *CreateCPResp) SetCode(code nebula0.ErrorCode) *CreateCPResp { - c.Code = code - return c -} - -func (c *CreateCPResp) SetInfo(info []*nebula0.CheckpointInfo) *CreateCPResp { - c.Info = info - return c -} - -func (p *CreateCPResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *CreateCPResp) 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 *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 ++ { - _elem85 := nebula0.NewCheckpointInfo() - if err := _elem85.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem85), err) - } - p.Info = append(p.Info, _elem85) - } - 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("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 *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 "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - infoVal := fmt.Sprintf("%v", p.Info) - return fmt.Sprintf("CreateCPResp({Code:%s Info:%s})", codeVal, infoVal) -} - -// Attributes: -// - SpaceIds -// - Name -type DropCPRequest struct { - SpaceIds []nebula0.GraphSpaceID `thrift:"space_ids,1" db:"space_ids" json:"space_ids"` - Name []byte `thrift:"name,2" db:"name" json:"name"` -} - -func NewDropCPRequest() *DropCPRequest { - return &DropCPRequest{} -} - - -func (p *DropCPRequest) GetSpaceIds() []nebula0.GraphSpaceID { - return p.SpaceIds -} - -func (p *DropCPRequest) GetName() []byte { - return p.Name -} -type DropCPRequestBuilder struct { - obj *DropCPRequest -} - -func NewDropCPRequestBuilder() *DropCPRequestBuilder{ - return &DropCPRequestBuilder{ - obj: NewDropCPRequest(), - } -} - -func (p DropCPRequestBuilder) Emit() *DropCPRequest{ - return &DropCPRequest{ - SpaceIds: p.obj.SpaceIds, - Name: p.obj.Name, - } -} - -func (d *DropCPRequestBuilder) SpaceIds(spaceIds []nebula0.GraphSpaceID) *DropCPRequestBuilder { - d.obj.SpaceIds = spaceIds - return d -} - -func (d *DropCPRequestBuilder) Name(name []byte) *DropCPRequestBuilder { - d.obj.Name = name - return d -} - -func (d *DropCPRequest) SetSpaceIds(spaceIds []nebula0.GraphSpaceID) *DropCPRequest { - d.SpaceIds = spaceIds - return d -} - -func (d *DropCPRequest) SetName(name []byte) *DropCPRequest { - d.Name = name - return d -} - -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 { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]nebula0.GraphSpaceID, 0, size) - p.SpaceIds = tSlice - for i := 0; i < size; i ++ { - var _elem86 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _elem86 = temp - } - p.SpaceIds = append(p.SpaceIds, _elem86) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - 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_ids", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_ids: ", p), err) } - if err := oprot.WriteListBegin(thrift.I32, len(p.SpaceIds)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.SpaceIds { - 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:space_ids: ", 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 "" - } - - spaceIdsVal := fmt.Sprintf("%v", p.SpaceIds) - nameVal := fmt.Sprintf("%v", p.Name) - return fmt.Sprintf("DropCPRequest({SpaceIds:%s Name:%s})", spaceIdsVal, nameVal) -} - -// Attributes: -// - Code -type DropCPResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` -} - -func NewDropCPResp() *DropCPResp { - return &DropCPResp{} -} - - -func (p *DropCPResp) GetCode() nebula0.ErrorCode { - return p.Code -} -type DropCPRespBuilder struct { - obj *DropCPResp -} - -func NewDropCPRespBuilder() *DropCPRespBuilder{ - return &DropCPRespBuilder{ - obj: NewDropCPResp(), - } -} - -func (p DropCPRespBuilder) Emit() *DropCPResp{ - return &DropCPResp{ - Code: p.obj.Code, - } -} - -func (d *DropCPRespBuilder) Code(code nebula0.ErrorCode) *DropCPRespBuilder { - d.obj.Code = code - return d -} - -func (d *DropCPResp) SetCode(code nebula0.ErrorCode) *DropCPResp { - d.Code = code - return d -} - -func (p *DropCPResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *DropCPResp) 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 *DropCPResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("DropCPResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *DropCPResp) 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 *DropCPResp) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - return fmt.Sprintf("DropCPResp({Code:%s})", codeVal) -} - -// Attributes: -// - SpaceIds -// - Sign -type BlockingSignRequest struct { - SpaceIds []nebula0.GraphSpaceID `thrift:"space_ids,1" db:"space_ids" json:"space_ids"` - Sign EngineSignType `thrift:"sign,2,required" db:"sign" json:"sign"` -} - -func NewBlockingSignRequest() *BlockingSignRequest { - return &BlockingSignRequest{} -} - - -func (p *BlockingSignRequest) GetSpaceIds() []nebula0.GraphSpaceID { - return p.SpaceIds -} - -func (p *BlockingSignRequest) GetSign() EngineSignType { - return p.Sign -} -type BlockingSignRequestBuilder struct { - obj *BlockingSignRequest -} - -func NewBlockingSignRequestBuilder() *BlockingSignRequestBuilder{ - return &BlockingSignRequestBuilder{ - obj: NewBlockingSignRequest(), - } -} - -func (p BlockingSignRequestBuilder) Emit() *BlockingSignRequest{ - return &BlockingSignRequest{ - SpaceIds: p.obj.SpaceIds, - Sign: p.obj.Sign, - } -} - -func (b *BlockingSignRequestBuilder) SpaceIds(spaceIds []nebula0.GraphSpaceID) *BlockingSignRequestBuilder { - b.obj.SpaceIds = spaceIds - return b -} - -func (b *BlockingSignRequestBuilder) Sign(sign EngineSignType) *BlockingSignRequestBuilder { - b.obj.Sign = sign - return b -} - -func (b *BlockingSignRequest) SetSpaceIds(spaceIds []nebula0.GraphSpaceID) *BlockingSignRequest { - b.SpaceIds = spaceIds - return b -} - -func (b *BlockingSignRequest) SetSign(sign EngineSignType) *BlockingSignRequest { - b.Sign = sign - return b -} - -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 { - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]nebula0.GraphSpaceID, 0, size) - p.SpaceIds = tSlice - for i := 0; i < size; i ++ { - var _elem87 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _elem87 = temp - } - p.SpaceIds = append(p.SpaceIds, _elem87) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - 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_ids", thrift.LIST, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:space_ids: ", p), err) } - if err := oprot.WriteListBegin(thrift.I32, len(p.SpaceIds)); err != nil { - return thrift.PrependError("error writing list begin: ", err) - } - for _, v := range p.SpaceIds { - 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:space_ids: ", 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 "" - } - - spaceIdsVal := fmt.Sprintf("%v", p.SpaceIds) - signVal := fmt.Sprintf("%v", p.Sign) - return fmt.Sprintf("BlockingSignRequest({SpaceIds:%s Sign:%s})", spaceIdsVal, signVal) -} - -// Attributes: -// - Code -type BlockingSignResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` -} - -func NewBlockingSignResp() *BlockingSignResp { - return &BlockingSignResp{} -} - - -func (p *BlockingSignResp) GetCode() nebula0.ErrorCode { - return p.Code -} -type BlockingSignRespBuilder struct { - obj *BlockingSignResp -} - -func NewBlockingSignRespBuilder() *BlockingSignRespBuilder{ - return &BlockingSignRespBuilder{ - obj: NewBlockingSignResp(), - } -} - -func (p BlockingSignRespBuilder) Emit() *BlockingSignResp{ - return &BlockingSignResp{ - Code: p.obj.Code, - } -} - -func (b *BlockingSignRespBuilder) Code(code nebula0.ErrorCode) *BlockingSignRespBuilder { - b.obj.Code = code - return b -} - -func (b *BlockingSignResp) SetCode(code nebula0.ErrorCode) *BlockingSignResp { - b.Code = code - return b -} - -func (p *BlockingSignResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *BlockingSignResp) 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 *BlockingSignResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("BlockingSignResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *BlockingSignResp) 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 *BlockingSignResp) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - return fmt.Sprintf("BlockingSignResp({Code:%s})", codeVal) -} - -// Attributes: -// - Code -// - LeaderParts -type GetLeaderPartsResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` - LeaderParts map[nebula0.GraphSpaceID][]nebula0.PartitionID `thrift:"leader_parts,2" db:"leader_parts" json:"leader_parts"` -} - -func NewGetLeaderPartsResp() *GetLeaderPartsResp { - return &GetLeaderPartsResp{} -} - - -func (p *GetLeaderPartsResp) GetCode() nebula0.ErrorCode { - return p.Code -} - -func (p *GetLeaderPartsResp) GetLeaderParts() map[nebula0.GraphSpaceID][]nebula0.PartitionID { - return p.LeaderParts -} -type GetLeaderPartsRespBuilder struct { - obj *GetLeaderPartsResp -} - -func NewGetLeaderPartsRespBuilder() *GetLeaderPartsRespBuilder{ - return &GetLeaderPartsRespBuilder{ - obj: NewGetLeaderPartsResp(), - } -} - -func (p GetLeaderPartsRespBuilder) Emit() *GetLeaderPartsResp{ - return &GetLeaderPartsResp{ - Code: p.obj.Code, - LeaderParts: p.obj.LeaderParts, - } -} - -func (g *GetLeaderPartsRespBuilder) Code(code nebula0.ErrorCode) *GetLeaderPartsRespBuilder { - g.obj.Code = code - return g -} - -func (g *GetLeaderPartsRespBuilder) LeaderParts(leaderParts map[nebula0.GraphSpaceID][]nebula0.PartitionID) *GetLeaderPartsRespBuilder { - g.obj.LeaderParts = leaderParts - return g -} - -func (g *GetLeaderPartsResp) SetCode(code nebula0.ErrorCode) *GetLeaderPartsResp { - g.Code = code - return g -} - -func (g *GetLeaderPartsResp) SetLeaderParts(leaderParts map[nebula0.GraphSpaceID][]nebula0.PartitionID) *GetLeaderPartsResp { - g.LeaderParts = leaderParts - return g -} - -func (p *GetLeaderPartsResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *GetLeaderPartsResp) 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 *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 _key88 nebula0.GraphSpaceID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.GraphSpaceID(v) - _key88 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]nebula0.PartitionID, 0, size) - _val89 := tSlice - for i := 0; i < size; i ++ { - var _elem90 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem90 = temp - } - _val89 = append(_val89, _elem90) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.LeaderParts[_key88] = _val89 - } - 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("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 *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 "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - leaderPartsVal := fmt.Sprintf("%v", p.LeaderParts) - return fmt.Sprintf("GetLeaderPartsResp({Code:%s LeaderParts:%s})", codeVal, 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 -} -type CheckPeersReqBuilder struct { - obj *CheckPeersReq -} - -func NewCheckPeersReqBuilder() *CheckPeersReqBuilder{ - return &CheckPeersReqBuilder{ - obj: NewCheckPeersReq(), - } -} - -func (p CheckPeersReqBuilder) Emit() *CheckPeersReq{ - return &CheckPeersReq{ - SpaceID: p.obj.SpaceID, - PartID: p.obj.PartID, - Peers: p.obj.Peers, - } -} - -func (c *CheckPeersReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *CheckPeersReqBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *CheckPeersReqBuilder) PartID(partID nebula0.PartitionID) *CheckPeersReqBuilder { - c.obj.PartID = partID - return c -} - -func (c *CheckPeersReqBuilder) Peers(peers []*nebula0.HostAddr) *CheckPeersReqBuilder { - c.obj.Peers = peers - return c -} - -func (c *CheckPeersReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *CheckPeersReq { - c.SpaceID = spaceID - return c -} - -func (c *CheckPeersReq) SetPartID(partID nebula0.PartitionID) *CheckPeersReq { - c.PartID = partID - return c -} - -func (c *CheckPeersReq) SetPeers(peers []*nebula0.HostAddr) *CheckPeersReq { - c.Peers = peers - return c -} - -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 ++ { - _elem91 := nebula0.NewHostAddr() - if err := _elem91.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem91), err) - } - p.Peers = append(p.Peers, _elem91) - } - 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 -} -type RebuildIndexRequestBuilder struct { - obj *RebuildIndexRequest -} - -func NewRebuildIndexRequestBuilder() *RebuildIndexRequestBuilder{ - return &RebuildIndexRequestBuilder{ - obj: NewRebuildIndexRequest(), - } -} - -func (p RebuildIndexRequestBuilder) Emit() *RebuildIndexRequest{ - return &RebuildIndexRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - IndexID: p.obj.IndexID, - } -} - -func (r *RebuildIndexRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *RebuildIndexRequestBuilder { - r.obj.SpaceID = spaceID - return r -} - -func (r *RebuildIndexRequestBuilder) Parts(parts []nebula0.PartitionID) *RebuildIndexRequestBuilder { - r.obj.Parts = parts - return r -} - -func (r *RebuildIndexRequestBuilder) IndexID(indexID nebula0.IndexID) *RebuildIndexRequestBuilder { - r.obj.IndexID = indexID - return r -} - -func (r *RebuildIndexRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *RebuildIndexRequest { - r.SpaceID = spaceID - return r -} - -func (r *RebuildIndexRequest) SetParts(parts []nebula0.PartitionID) *RebuildIndexRequest { - r.Parts = parts - return r -} - -func (r *RebuildIndexRequest) SetIndexID(indexID nebula0.IndexID) *RebuildIndexRequest { - r.IndexID = indexID - return r -} - -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 _elem92 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem92 = temp - } - p.Parts = append(p.Parts, _elem92) - } - 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_ -// - 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 -} - -type ListClusterInfoRespBuilder struct { - obj *ListClusterInfoResp -} - -func NewListClusterInfoRespBuilder() *ListClusterInfoRespBuilder{ - return &ListClusterInfoRespBuilder{ - obj: NewListClusterInfoResp(), - } -} - -func (p ListClusterInfoRespBuilder) Emit() *ListClusterInfoResp{ - return &ListClusterInfoResp{ - Result_: p.obj.Result_, - Dir: p.obj.Dir, - } -} - -func (l *ListClusterInfoRespBuilder) Result_(result *ResponseCommon) *ListClusterInfoRespBuilder { - l.obj.Result_ = result - return l -} - -func (l *ListClusterInfoRespBuilder) Dir(dir *nebula0.DirInfo) *ListClusterInfoRespBuilder { - l.obj.Dir = dir - return l -} - -func (l *ListClusterInfoResp) SetResult_(result *ResponseCommon) *ListClusterInfoResp { - l.Result_ = result - return l -} - -func (l *ListClusterInfoResp) SetDir(dir *nebula0.DirInfo) *ListClusterInfoResp { - l.Dir = dir - return l -} - -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{} -} - -type ListClusterInfoReqBuilder struct { - obj *ListClusterInfoReq -} - -func NewListClusterInfoReqBuilder() *ListClusterInfoReqBuilder{ - return &ListClusterInfoReqBuilder{ - obj: NewListClusterInfoReq(), - } -} - -func (p ListClusterInfoReqBuilder) Emit() *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: -// - JobType -// - JobID -// - TaskID -// - Para -type AddTaskRequest struct { - JobType meta1.JobType `thrift:"job_type,1" db:"job_type" json:"job_type"` - 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"` -} - -func NewAddTaskRequest() *AddTaskRequest { - return &AddTaskRequest{ - Para: NewTaskPara(), - } -} - - -func (p *AddTaskRequest) GetJobType() meta1.JobType { - return p.JobType -} - -func (p *AddTaskRequest) GetJobID() int32 { - return p.JobID -} - -func (p *AddTaskRequest) GetTaskID() int32 { - return p.TaskID -} -var AddTaskRequest_Para_DEFAULT *TaskPara -func (p *AddTaskRequest) GetPara() *TaskPara { - if !p.IsSetPara() { - return AddTaskRequest_Para_DEFAULT - } -return p.Para -} -func (p *AddTaskRequest) IsSetPara() bool { - return p != nil && p.Para != nil -} - -type AddTaskRequestBuilder struct { - obj *AddTaskRequest -} - -func NewAddTaskRequestBuilder() *AddTaskRequestBuilder{ - return &AddTaskRequestBuilder{ - obj: NewAddTaskRequest(), - } -} - -func (p AddTaskRequestBuilder) Emit() *AddTaskRequest{ - return &AddTaskRequest{ - JobType: p.obj.JobType, - JobID: p.obj.JobID, - TaskID: p.obj.TaskID, - Para: p.obj.Para, - } -} - -func (a *AddTaskRequestBuilder) JobType(jobType meta1.JobType) *AddTaskRequestBuilder { - a.obj.JobType = jobType - return a -} - -func (a *AddTaskRequestBuilder) JobID(jobID int32) *AddTaskRequestBuilder { - a.obj.JobID = jobID - return a -} - -func (a *AddTaskRequestBuilder) TaskID(taskID int32) *AddTaskRequestBuilder { - a.obj.TaskID = taskID - return a -} - -func (a *AddTaskRequestBuilder) Para(para *TaskPara) *AddTaskRequestBuilder { - a.obj.Para = para - return a -} - -func (a *AddTaskRequest) SetJobType(jobType meta1.JobType) *AddTaskRequest { - a.JobType = jobType - return a -} - -func (a *AddTaskRequest) SetJobID(jobID int32) *AddTaskRequest { - a.JobID = jobID - return a -} - -func (a *AddTaskRequest) SetTaskID(taskID int32) *AddTaskRequest { - a.TaskID = taskID - return a -} - -func (a *AddTaskRequest) SetPara(para *TaskPara) *AddTaskRequest { - a.Para = para - return a -} - -func (p *AddTaskRequest) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - 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 *AddTaskRequest) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := meta1.JobType(v) - p.JobType = temp - } - return nil -} - -func (p *AddTaskRequest) 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 *AddTaskRequest) 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 *AddTaskRequest) 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 *AddTaskRequest) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AddTaskRequest"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *AddTaskRequest) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("job_type", thrift.I32, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:job_type: ", p), err) } - if err := oprot.WriteI32(int32(p.JobType)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.job_type (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:job_type: ", p), err) } - return err -} - -func (p *AddTaskRequest) 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 *AddTaskRequest) 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 *AddTaskRequest) 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 *AddTaskRequest) String() string { - if p == nil { - return "" - } - - jobTypeVal := fmt.Sprintf("%v", p.JobType) - 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) - } - return fmt.Sprintf("AddTaskRequest({JobType:%s JobID:%s TaskID:%s Para:%s})", jobTypeVal, jobIDVal, taskIDVal, paraVal) -} - -// Attributes: -// - Code -type AddTaskResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` -} - -func NewAddTaskResp() *AddTaskResp { - return &AddTaskResp{} -} - - -func (p *AddTaskResp) GetCode() nebula0.ErrorCode { - return p.Code -} -type AddTaskRespBuilder struct { - obj *AddTaskResp -} - -func NewAddTaskRespBuilder() *AddTaskRespBuilder{ - return &AddTaskRespBuilder{ - obj: NewAddTaskResp(), - } -} - -func (p AddTaskRespBuilder) Emit() *AddTaskResp{ - return &AddTaskResp{ - Code: p.obj.Code, - } -} - -func (a *AddTaskRespBuilder) Code(code nebula0.ErrorCode) *AddTaskRespBuilder { - a.obj.Code = code - return a -} - -func (a *AddTaskResp) SetCode(code nebula0.ErrorCode) *AddTaskResp { - a.Code = code - return a -} - -func (p *AddTaskResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *AddTaskResp) 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 *AddTaskResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("AddTaskResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *AddTaskResp) 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 *AddTaskResp) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - return fmt.Sprintf("AddTaskResp({Code:%s})", codeVal) -} - -// Attributes: -// - JobID -// - TaskID -type StopTaskRequest 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 NewStopTaskRequest() *StopTaskRequest { - return &StopTaskRequest{} -} - - -func (p *StopTaskRequest) GetJobID() int32 { - return p.JobID -} - -func (p *StopTaskRequest) GetTaskID() int32 { - return p.TaskID -} -type StopTaskRequestBuilder struct { - obj *StopTaskRequest -} - -func NewStopTaskRequestBuilder() *StopTaskRequestBuilder{ - return &StopTaskRequestBuilder{ - obj: NewStopTaskRequest(), - } -} - -func (p StopTaskRequestBuilder) Emit() *StopTaskRequest{ - return &StopTaskRequest{ - JobID: p.obj.JobID, - TaskID: p.obj.TaskID, - } -} - -func (s *StopTaskRequestBuilder) JobID(jobID int32) *StopTaskRequestBuilder { - s.obj.JobID = jobID - return s -} - -func (s *StopTaskRequestBuilder) TaskID(taskID int32) *StopTaskRequestBuilder { - s.obj.TaskID = taskID - return s -} - -func (s *StopTaskRequest) SetJobID(jobID int32) *StopTaskRequest { - s.JobID = jobID - return s -} - -func (s *StopTaskRequest) SetTaskID(taskID int32) *StopTaskRequest { - s.TaskID = taskID - return s -} - -func (p *StopTaskRequest) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *StopTaskRequest) 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 *StopTaskRequest) 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 *StopTaskRequest) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("StopTaskRequest"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *StopTaskRequest) 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 *StopTaskRequest) 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 *StopTaskRequest) String() string { - if p == nil { - return "" - } - - jobIDVal := fmt.Sprintf("%v", p.JobID) - taskIDVal := fmt.Sprintf("%v", p.TaskID) - return fmt.Sprintf("StopTaskRequest({JobID:%s TaskID:%s})", jobIDVal, taskIDVal) -} - -// Attributes: -// - Code -type StopTaskResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` -} - -func NewStopTaskResp() *StopTaskResp { - return &StopTaskResp{} -} - - -func (p *StopTaskResp) GetCode() nebula0.ErrorCode { - return p.Code -} -type StopTaskRespBuilder struct { - obj *StopTaskResp -} - -func NewStopTaskRespBuilder() *StopTaskRespBuilder{ - return &StopTaskRespBuilder{ - obj: NewStopTaskResp(), - } -} - -func (p StopTaskRespBuilder) Emit() *StopTaskResp{ - return &StopTaskResp{ - Code: p.obj.Code, - } -} - -func (s *StopTaskRespBuilder) Code(code nebula0.ErrorCode) *StopTaskRespBuilder { - s.obj.Code = code - return s -} - -func (s *StopTaskResp) SetCode(code nebula0.ErrorCode) *StopTaskResp { - s.Code = code - return s -} - -func (p *StopTaskResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *StopTaskResp) 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 *StopTaskResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("StopTaskResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *StopTaskResp) 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 *StopTaskResp) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - return fmt.Sprintf("StopTaskResp({Code:%s})", codeVal) -} - -// Attributes: -// - SpaceID -type ClearSpaceReq struct { - SpaceID nebula0.GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` -} - -func NewClearSpaceReq() *ClearSpaceReq { - return &ClearSpaceReq{} -} - - -func (p *ClearSpaceReq) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} -type ClearSpaceReqBuilder struct { - obj *ClearSpaceReq -} - -func NewClearSpaceReqBuilder() *ClearSpaceReqBuilder{ - return &ClearSpaceReqBuilder{ - obj: NewClearSpaceReq(), - } -} - -func (p ClearSpaceReqBuilder) Emit() *ClearSpaceReq{ - return &ClearSpaceReq{ - SpaceID: p.obj.SpaceID, - } -} - -func (c *ClearSpaceReqBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ClearSpaceReqBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *ClearSpaceReq) SetSpaceID(spaceID nebula0.GraphSpaceID) *ClearSpaceReq { - c.SpaceID = spaceID - return c -} - -func (p *ClearSpaceReq) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ClearSpaceReq) 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 *ClearSpaceReq) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ClearSpaceReq"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ClearSpaceReq) 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 *ClearSpaceReq) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - return fmt.Sprintf("ClearSpaceReq({SpaceID:%s})", spaceIDVal) -} - -// Attributes: -// - Code -type ClearSpaceResp struct { - Code nebula0.ErrorCode `thrift:"code,1" db:"code" json:"code"` -} - -func NewClearSpaceResp() *ClearSpaceResp { - return &ClearSpaceResp{} -} - - -func (p *ClearSpaceResp) GetCode() nebula0.ErrorCode { - return p.Code -} -type ClearSpaceRespBuilder struct { - obj *ClearSpaceResp -} - -func NewClearSpaceRespBuilder() *ClearSpaceRespBuilder{ - return &ClearSpaceRespBuilder{ - obj: NewClearSpaceResp(), - } -} - -func (p ClearSpaceRespBuilder) Emit() *ClearSpaceResp{ - return &ClearSpaceResp{ - Code: p.obj.Code, - } -} - -func (c *ClearSpaceRespBuilder) Code(code nebula0.ErrorCode) *ClearSpaceRespBuilder { - c.obj.Code = code - return c -} - -func (c *ClearSpaceResp) SetCode(code nebula0.ErrorCode) *ClearSpaceResp { - c.Code = code - return c -} - -func (p *ClearSpaceResp) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *ClearSpaceResp) 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 *ClearSpaceResp) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ClearSpaceResp"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *ClearSpaceResp) 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 *ClearSpaceResp) String() string { - if p == nil { - return "" - } - - codeVal := fmt.Sprintf("%v", p.Code) - return fmt.Sprintf("ClearSpaceResp({Code:%s})", codeVal) -} - -// 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,optional" 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 -} - -type ChainAddEdgesRequestBuilder struct { - obj *ChainAddEdgesRequest -} - -func NewChainAddEdgesRequestBuilder() *ChainAddEdgesRequestBuilder{ - return &ChainAddEdgesRequestBuilder{ - obj: NewChainAddEdgesRequest(), - } -} - -func (p ChainAddEdgesRequestBuilder) Emit() *ChainAddEdgesRequest{ - return &ChainAddEdgesRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - PropNames: p.obj.PropNames, - IfNotExists: p.obj.IfNotExists, - Term: p.obj.Term, - EdgeVersion: p.obj.EdgeVersion, - } -} - -func (c *ChainAddEdgesRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ChainAddEdgesRequestBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *ChainAddEdgesRequestBuilder) Parts(parts map[nebula0.PartitionID][]*NewEdge_) *ChainAddEdgesRequestBuilder { - c.obj.Parts = parts - return c -} - -func (c *ChainAddEdgesRequestBuilder) PropNames(propNames [][]byte) *ChainAddEdgesRequestBuilder { - c.obj.PropNames = propNames - return c -} - -func (c *ChainAddEdgesRequestBuilder) IfNotExists(ifNotExists bool) *ChainAddEdgesRequestBuilder { - c.obj.IfNotExists = ifNotExists - return c -} - -func (c *ChainAddEdgesRequestBuilder) Term(term int64) *ChainAddEdgesRequestBuilder { - c.obj.Term = term - return c -} - -func (c *ChainAddEdgesRequestBuilder) EdgeVersion(edgeVersion *int64) *ChainAddEdgesRequestBuilder { - c.obj.EdgeVersion = edgeVersion - return c -} - -func (c *ChainAddEdgesRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *ChainAddEdgesRequest { - c.SpaceID = spaceID - return c -} - -func (c *ChainAddEdgesRequest) SetParts(parts map[nebula0.PartitionID][]*NewEdge_) *ChainAddEdgesRequest { - c.Parts = parts - return c -} - -func (c *ChainAddEdgesRequest) SetPropNames(propNames [][]byte) *ChainAddEdgesRequest { - c.PropNames = propNames - return c -} - -func (c *ChainAddEdgesRequest) SetIfNotExists(ifNotExists bool) *ChainAddEdgesRequest { - c.IfNotExists = ifNotExists - return c -} - -func (c *ChainAddEdgesRequest) SetTerm(term int64) *ChainAddEdgesRequest { - c.Term = term - return c -} - -func (c *ChainAddEdgesRequest) SetEdgeVersion(edgeVersion *int64) *ChainAddEdgesRequest { - c.EdgeVersion = edgeVersion - return c -} - -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 _key93 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key93 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*NewEdge_, 0, size) - _val94 := tSlice - for i := 0; i < size; i ++ { - _elem95 := NewNewEdge_() - if err := _elem95.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem95), err) - } - _val94 = append(_val94, _elem95) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key93] = _val94 - } - 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 _elem96 []byte - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - _elem96 = v - } - p.PropNames = append(p.PropNames, _elem96) - } - 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,optional" 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 -} - -type ChainUpdateEdgeRequestBuilder struct { - obj *ChainUpdateEdgeRequest -} - -func NewChainUpdateEdgeRequestBuilder() *ChainUpdateEdgeRequestBuilder{ - return &ChainUpdateEdgeRequestBuilder{ - obj: NewChainUpdateEdgeRequest(), - } -} - -func (p ChainUpdateEdgeRequestBuilder) Emit() *ChainUpdateEdgeRequest{ - return &ChainUpdateEdgeRequest{ - UpdateEdgeRequest: p.obj.UpdateEdgeRequest, - Term: p.obj.Term, - EdgeVersion: p.obj.EdgeVersion, - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - } -} - -func (c *ChainUpdateEdgeRequestBuilder) UpdateEdgeRequest(updateEdgeRequest *UpdateEdgeRequest) *ChainUpdateEdgeRequestBuilder { - c.obj.UpdateEdgeRequest = updateEdgeRequest - return c -} - -func (c *ChainUpdateEdgeRequestBuilder) Term(term int64) *ChainUpdateEdgeRequestBuilder { - c.obj.Term = term - return c -} - -func (c *ChainUpdateEdgeRequestBuilder) EdgeVersion(edgeVersion *int64) *ChainUpdateEdgeRequestBuilder { - c.obj.EdgeVersion = edgeVersion - return c -} - -func (c *ChainUpdateEdgeRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ChainUpdateEdgeRequestBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *ChainUpdateEdgeRequestBuilder) Parts(parts []nebula0.PartitionID) *ChainUpdateEdgeRequestBuilder { - c.obj.Parts = parts - return c -} - -func (c *ChainUpdateEdgeRequest) SetUpdateEdgeRequest(updateEdgeRequest *UpdateEdgeRequest) *ChainUpdateEdgeRequest { - c.UpdateEdgeRequest = updateEdgeRequest - return c -} - -func (c *ChainUpdateEdgeRequest) SetTerm(term int64) *ChainUpdateEdgeRequest { - c.Term = term - return c -} - -func (c *ChainUpdateEdgeRequest) SetEdgeVersion(edgeVersion *int64) *ChainUpdateEdgeRequest { - c.EdgeVersion = edgeVersion - return c -} - -func (c *ChainUpdateEdgeRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *ChainUpdateEdgeRequest { - c.SpaceID = spaceID - return c -} - -func (c *ChainUpdateEdgeRequest) SetParts(parts []nebula0.PartitionID) *ChainUpdateEdgeRequest { - c.Parts = parts - return c -} - -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 _elem97 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _elem97 = temp - } - p.Parts = append(p.Parts, _elem97) - } - 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) -} - -// Attributes: -// - SpaceID -// - Parts -// - TxnID -// - Term -type ChainDeleteEdgesRequest 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"` - TxnID []byte `thrift:"txn_id,3" db:"txn_id" json:"txn_id"` - Term int64 `thrift:"term,4" db:"term" json:"term"` -} - -func NewChainDeleteEdgesRequest() *ChainDeleteEdgesRequest { - return &ChainDeleteEdgesRequest{} -} - - -func (p *ChainDeleteEdgesRequest) GetSpaceID() nebula0.GraphSpaceID { - return p.SpaceID -} - -func (p *ChainDeleteEdgesRequest) GetParts() map[nebula0.PartitionID][]*EdgeKey { - return p.Parts -} - -func (p *ChainDeleteEdgesRequest) GetTxnID() []byte { - return p.TxnID -} - -func (p *ChainDeleteEdgesRequest) GetTerm() int64 { - return p.Term -} -type ChainDeleteEdgesRequestBuilder struct { - obj *ChainDeleteEdgesRequest -} - -func NewChainDeleteEdgesRequestBuilder() *ChainDeleteEdgesRequestBuilder{ - return &ChainDeleteEdgesRequestBuilder{ - obj: NewChainDeleteEdgesRequest(), - } -} - -func (p ChainDeleteEdgesRequestBuilder) Emit() *ChainDeleteEdgesRequest{ - return &ChainDeleteEdgesRequest{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - TxnID: p.obj.TxnID, - Term: p.obj.Term, - } -} - -func (c *ChainDeleteEdgesRequestBuilder) SpaceID(spaceID nebula0.GraphSpaceID) *ChainDeleteEdgesRequestBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *ChainDeleteEdgesRequestBuilder) Parts(parts map[nebula0.PartitionID][]*EdgeKey) *ChainDeleteEdgesRequestBuilder { - c.obj.Parts = parts - return c -} - -func (c *ChainDeleteEdgesRequestBuilder) TxnID(txnID []byte) *ChainDeleteEdgesRequestBuilder { - c.obj.TxnID = txnID - return c -} - -func (c *ChainDeleteEdgesRequestBuilder) Term(term int64) *ChainDeleteEdgesRequestBuilder { - c.obj.Term = term - return c -} - -func (c *ChainDeleteEdgesRequest) SetSpaceID(spaceID nebula0.GraphSpaceID) *ChainDeleteEdgesRequest { - c.SpaceID = spaceID - return c -} - -func (c *ChainDeleteEdgesRequest) SetParts(parts map[nebula0.PartitionID][]*EdgeKey) *ChainDeleteEdgesRequest { - c.Parts = parts - return c -} - -func (c *ChainDeleteEdgesRequest) SetTxnID(txnID []byte) *ChainDeleteEdgesRequest { - c.TxnID = txnID - return c -} - -func (c *ChainDeleteEdgesRequest) SetTerm(term int64) *ChainDeleteEdgesRequest { - c.Term = term - return c -} - -func (p *ChainDeleteEdgesRequest) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - 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 *ChainDeleteEdgesRequest) 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 *ChainDeleteEdgesRequest) 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 _key98 nebula0.PartitionID - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 0: ", err) - } else { - temp := nebula0.PartitionID(v) - _key98 = temp - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return thrift.PrependError("error reading list begin: ", err) - } - tSlice := make([]*EdgeKey, 0, size) - _val99 := tSlice - for i := 0; i < size; i ++ { - _elem100 := NewEdgeKey() - if err := _elem100.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", _elem100), err) - } - _val99 = append(_val99, _elem100) - } - if err := iprot.ReadListEnd(); err != nil { - return thrift.PrependError("error reading list end: ", err) - } - p.Parts[_key98] = _val99 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *ChainDeleteEdgesRequest) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.TxnID = v - } - return nil -} - -func (p *ChainDeleteEdgesRequest) ReadField4(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.Term = v - } - return nil -} - -func (p *ChainDeleteEdgesRequest) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("ChainDeleteEdgesRequest"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); 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 *ChainDeleteEdgesRequest) 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 *ChainDeleteEdgesRequest) 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 *ChainDeleteEdgesRequest) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("txn_id", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:txn_id: ", p), err) } - if err := oprot.WriteBinary(p.TxnID); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.txn_id (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:txn_id: ", p), err) } - return err -} - -func (p *ChainDeleteEdgesRequest) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("term", thrift.I64, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:term: ", p), err) } - if err := oprot.WriteI64(int64(p.Term)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.term (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:term: ", p), err) } - return err -} - -func (p *ChainDeleteEdgesRequest) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - partsVal := fmt.Sprintf("%v", p.Parts) - txnIDVal := fmt.Sprintf("%v", p.TxnID) - termVal := fmt.Sprintf("%v", p.Term) - return fmt.Sprintf("ChainDeleteEdgesRequest({SpaceID:%s Parts:%s TxnID:%s Term:%s})", spaceIDVal, partsVal, txnIDVal, termVal) -} - diff --git a/nebula/ttypes.go b/nebula/ttypes.go deleted file mode 100644 index 622c6fec..00000000 --- a/nebula/ttypes.go +++ /dev/null @@ -1,7243 +0,0 @@ -// 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/vesoft-inc/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 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_DURATION PropertyType = 23 - 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_DURATION: "DURATION", - 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, - "DURATION": PropertyType_DURATION, - "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", - "DURATION", - "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_DURATION, - 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 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_MACHINE_NOT_FOUND ErrorCode = -13 - ErrorCode_E_ZONE_NOT_FOUND ErrorCode = -14 - ErrorCode_E_LISTENER_NOT_FOUND ErrorCode = -15 - ErrorCode_E_PART_NOT_FOUND ErrorCode = -16 - ErrorCode_E_KEY_NOT_FOUND ErrorCode = -17 - ErrorCode_E_USER_NOT_FOUND ErrorCode = -18 - ErrorCode_E_STATS_NOT_FOUND ErrorCode = -19 - ErrorCode_E_SERVICE_NOT_FOUND ErrorCode = -20 - 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_ZONE_NOT_ENOUGH ErrorCode = -2011 - ErrorCode_E_ZONE_IS_EMPTY ErrorCode = -2012 - ErrorCode_E_SCHEMA_NAME_EXISTS ErrorCode = -2013 - ErrorCode_E_RELATED_INDEX_EXISTS ErrorCode = -2014 - ErrorCode_E_RELATED_SPACE_EXISTS ErrorCode = -2015 - ErrorCode_E_STORE_FAILURE ErrorCode = -2021 - ErrorCode_E_STORE_SEGMENT_ILLEGAL ErrorCode = -2022 - ErrorCode_E_BAD_BALANCE_PLAN ErrorCode = -2023 - ErrorCode_E_BALANCED ErrorCode = -2024 - ErrorCode_E_NO_RUNNING_BALANCE_PLAN ErrorCode = -2025 - ErrorCode_E_NO_VALID_HOST ErrorCode = -2026 - ErrorCode_E_CORRUPTED_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_JOB_NEED_RECOVER ErrorCode = -2051 - ErrorCode_E_JOB_ALREADY_FINISH ErrorCode = -2052 - ErrorCode_E_JOB_SUBMITTED ErrorCode = -2053 - ErrorCode_E_JOB_NOT_STOPPABLE ErrorCode = -2054 - ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE ErrorCode = -2055 - ErrorCode_E_INVALID_JOB ErrorCode = -2065 - ErrorCode_E_BACKUP_BUILDING_INDEX ErrorCode = -2066 - ErrorCode_E_BACKUP_SPACE_NOT_FOUND ErrorCode = -2067 - 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_LIST_CLUSTER_NO_AGENT_FAILURE ErrorCode = -2072 - ErrorCode_E_QUERY_NOT_FOUND ErrorCode = -2073 - ErrorCode_E_AGENT_HB_FAILUE ErrorCode = -2074 - 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_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_ID_FAILED ErrorCode = -3062 - ErrorCode_E_RAFT_UNKNOWN_PART ErrorCode = -3500 - ErrorCode_E_RAFT_LOG_GAP ErrorCode = -3501 - ErrorCode_E_RAFT_LOG_STALE ErrorCode = -3502 - ErrorCode_E_RAFT_TERM_OUT_OF_DATE ErrorCode = -3503 - ErrorCode_E_RAFT_UNKNOWN_APPEND_LOG ErrorCode = -3504 - ErrorCode_E_RAFT_WAITING_SNAPSHOT ErrorCode = -3511 - ErrorCode_E_RAFT_SENDING_SNAPSHOT ErrorCode = -3512 - ErrorCode_E_RAFT_INVALID_PEER ErrorCode = -3513 - ErrorCode_E_RAFT_NOT_READY ErrorCode = -3514 - ErrorCode_E_RAFT_STOPPED ErrorCode = -3515 - ErrorCode_E_RAFT_BAD_ROLE ErrorCode = -3516 - ErrorCode_E_RAFT_WAL_FAIL ErrorCode = -3521 - ErrorCode_E_RAFT_HOST_STOPPED ErrorCode = -3522 - ErrorCode_E_RAFT_TOO_MANY_REQUESTS ErrorCode = -3523 - ErrorCode_E_RAFT_PERSIST_SNAPSHOT_FAILED ErrorCode = -3524 - ErrorCode_E_RAFT_RPC_EXCEPTION ErrorCode = -3525 - ErrorCode_E_RAFT_NO_WAL_FOUND ErrorCode = -3526 - ErrorCode_E_RAFT_HOST_PAUSED ErrorCode = -3527 - ErrorCode_E_RAFT_WRITE_BLOCKED ErrorCode = -3528 - ErrorCode_E_RAFT_BUFFER_OVERFLOW ErrorCode = -3529 - ErrorCode_E_RAFT_ATOMIC_OP_FAILED ErrorCode = -3530 - ErrorCode_E_LEADER_LEASE_FAILED ErrorCode = -3531 - 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_MACHINE_NOT_FOUND: "E_MACHINE_NOT_FOUND", - ErrorCode_E_ZONE_NOT_FOUND: "E_ZONE_NOT_FOUND", - ErrorCode_E_LISTENER_NOT_FOUND: "E_LISTENER_NOT_FOUND", - ErrorCode_E_PART_NOT_FOUND: "E_PART_NOT_FOUND", - 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_SERVICE_NOT_FOUND: "E_SERVICE_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_ZONE_NOT_ENOUGH: "E_ZONE_NOT_ENOUGH", - ErrorCode_E_ZONE_IS_EMPTY: "E_ZONE_IS_EMPTY", - ErrorCode_E_SCHEMA_NAME_EXISTS: "E_SCHEMA_NAME_EXISTS", - ErrorCode_E_RELATED_INDEX_EXISTS: "E_RELATED_INDEX_EXISTS", - ErrorCode_E_RELATED_SPACE_EXISTS: "E_RELATED_SPACE_EXISTS", - ErrorCode_E_STORE_FAILURE: "E_STORE_FAILURE", - ErrorCode_E_STORE_SEGMENT_ILLEGAL: "E_STORE_SEGMENT_ILLEGAL", - ErrorCode_E_BAD_BALANCE_PLAN: "E_BAD_BALANCE_PLAN", - 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_CORRUPTED_BALANCE_PLAN: "E_CORRUPTED_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_JOB_NEED_RECOVER: "E_JOB_NEED_RECOVER", - ErrorCode_E_JOB_ALREADY_FINISH: "E_JOB_ALREADY_FINISH", - ErrorCode_E_JOB_SUBMITTED: "E_JOB_SUBMITTED", - ErrorCode_E_JOB_NOT_STOPPABLE: "E_JOB_NOT_STOPPABLE", - ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE: "E_JOB_HAS_NO_TARGET_STORAGE", - ErrorCode_E_INVALID_JOB: "E_INVALID_JOB", - ErrorCode_E_BACKUP_BUILDING_INDEX: "E_BACKUP_BUILDING_INDEX", - ErrorCode_E_BACKUP_SPACE_NOT_FOUND: "E_BACKUP_SPACE_NOT_FOUND", - 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_LIST_CLUSTER_NO_AGENT_FAILURE: "E_LIST_CLUSTER_NO_AGENT_FAILURE", - ErrorCode_E_QUERY_NOT_FOUND: "E_QUERY_NOT_FOUND", - ErrorCode_E_AGENT_HB_FAILUE: "E_AGENT_HB_FAILUE", - 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_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_ID_FAILED: "E_ID_FAILED", - ErrorCode_E_RAFT_UNKNOWN_PART: "E_RAFT_UNKNOWN_PART", - ErrorCode_E_RAFT_LOG_GAP: "E_RAFT_LOG_GAP", - ErrorCode_E_RAFT_LOG_STALE: "E_RAFT_LOG_STALE", - ErrorCode_E_RAFT_TERM_OUT_OF_DATE: "E_RAFT_TERM_OUT_OF_DATE", - ErrorCode_E_RAFT_UNKNOWN_APPEND_LOG: "E_RAFT_UNKNOWN_APPEND_LOG", - ErrorCode_E_RAFT_WAITING_SNAPSHOT: "E_RAFT_WAITING_SNAPSHOT", - ErrorCode_E_RAFT_SENDING_SNAPSHOT: "E_RAFT_SENDING_SNAPSHOT", - ErrorCode_E_RAFT_INVALID_PEER: "E_RAFT_INVALID_PEER", - ErrorCode_E_RAFT_NOT_READY: "E_RAFT_NOT_READY", - ErrorCode_E_RAFT_STOPPED: "E_RAFT_STOPPED", - ErrorCode_E_RAFT_BAD_ROLE: "E_RAFT_BAD_ROLE", - ErrorCode_E_RAFT_WAL_FAIL: "E_RAFT_WAL_FAIL", - ErrorCode_E_RAFT_HOST_STOPPED: "E_RAFT_HOST_STOPPED", - ErrorCode_E_RAFT_TOO_MANY_REQUESTS: "E_RAFT_TOO_MANY_REQUESTS", - ErrorCode_E_RAFT_PERSIST_SNAPSHOT_FAILED: "E_RAFT_PERSIST_SNAPSHOT_FAILED", - ErrorCode_E_RAFT_RPC_EXCEPTION: "E_RAFT_RPC_EXCEPTION", - ErrorCode_E_RAFT_NO_WAL_FOUND: "E_RAFT_NO_WAL_FOUND", - ErrorCode_E_RAFT_HOST_PAUSED: "E_RAFT_HOST_PAUSED", - ErrorCode_E_RAFT_WRITE_BLOCKED: "E_RAFT_WRITE_BLOCKED", - ErrorCode_E_RAFT_BUFFER_OVERFLOW: "E_RAFT_BUFFER_OVERFLOW", - ErrorCode_E_RAFT_ATOMIC_OP_FAILED: "E_RAFT_ATOMIC_OP_FAILED", - ErrorCode_E_LEADER_LEASE_FAILED: "E_LEADER_LEASE_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_MACHINE_NOT_FOUND": ErrorCode_E_MACHINE_NOT_FOUND, - "E_ZONE_NOT_FOUND": ErrorCode_E_ZONE_NOT_FOUND, - "E_LISTENER_NOT_FOUND": ErrorCode_E_LISTENER_NOT_FOUND, - "E_PART_NOT_FOUND": ErrorCode_E_PART_NOT_FOUND, - "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_SERVICE_NOT_FOUND": ErrorCode_E_SERVICE_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_ZONE_NOT_ENOUGH": ErrorCode_E_ZONE_NOT_ENOUGH, - "E_ZONE_IS_EMPTY": ErrorCode_E_ZONE_IS_EMPTY, - "E_SCHEMA_NAME_EXISTS": ErrorCode_E_SCHEMA_NAME_EXISTS, - "E_RELATED_INDEX_EXISTS": ErrorCode_E_RELATED_INDEX_EXISTS, - "E_RELATED_SPACE_EXISTS": ErrorCode_E_RELATED_SPACE_EXISTS, - "E_STORE_FAILURE": ErrorCode_E_STORE_FAILURE, - "E_STORE_SEGMENT_ILLEGAL": ErrorCode_E_STORE_SEGMENT_ILLEGAL, - "E_BAD_BALANCE_PLAN": ErrorCode_E_BAD_BALANCE_PLAN, - "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_CORRUPTED_BALANCE_PLAN": ErrorCode_E_CORRUPTED_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_JOB_NEED_RECOVER": ErrorCode_E_JOB_NEED_RECOVER, - "E_JOB_ALREADY_FINISH": ErrorCode_E_JOB_ALREADY_FINISH, - "E_JOB_SUBMITTED": ErrorCode_E_JOB_SUBMITTED, - "E_JOB_NOT_STOPPABLE": ErrorCode_E_JOB_NOT_STOPPABLE, - "E_JOB_HAS_NO_TARGET_STORAGE": ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE, - "E_INVALID_JOB": ErrorCode_E_INVALID_JOB, - "E_BACKUP_BUILDING_INDEX": ErrorCode_E_BACKUP_BUILDING_INDEX, - "E_BACKUP_SPACE_NOT_FOUND": ErrorCode_E_BACKUP_SPACE_NOT_FOUND, - "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_LIST_CLUSTER_NO_AGENT_FAILURE": ErrorCode_E_LIST_CLUSTER_NO_AGENT_FAILURE, - "E_QUERY_NOT_FOUND": ErrorCode_E_QUERY_NOT_FOUND, - "E_AGENT_HB_FAILUE": ErrorCode_E_AGENT_HB_FAILUE, - "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_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_ID_FAILED": ErrorCode_E_ID_FAILED, - "E_RAFT_UNKNOWN_PART": ErrorCode_E_RAFT_UNKNOWN_PART, - "E_RAFT_LOG_GAP": ErrorCode_E_RAFT_LOG_GAP, - "E_RAFT_LOG_STALE": ErrorCode_E_RAFT_LOG_STALE, - "E_RAFT_TERM_OUT_OF_DATE": ErrorCode_E_RAFT_TERM_OUT_OF_DATE, - "E_RAFT_UNKNOWN_APPEND_LOG": ErrorCode_E_RAFT_UNKNOWN_APPEND_LOG, - "E_RAFT_WAITING_SNAPSHOT": ErrorCode_E_RAFT_WAITING_SNAPSHOT, - "E_RAFT_SENDING_SNAPSHOT": ErrorCode_E_RAFT_SENDING_SNAPSHOT, - "E_RAFT_INVALID_PEER": ErrorCode_E_RAFT_INVALID_PEER, - "E_RAFT_NOT_READY": ErrorCode_E_RAFT_NOT_READY, - "E_RAFT_STOPPED": ErrorCode_E_RAFT_STOPPED, - "E_RAFT_BAD_ROLE": ErrorCode_E_RAFT_BAD_ROLE, - "E_RAFT_WAL_FAIL": ErrorCode_E_RAFT_WAL_FAIL, - "E_RAFT_HOST_STOPPED": ErrorCode_E_RAFT_HOST_STOPPED, - "E_RAFT_TOO_MANY_REQUESTS": ErrorCode_E_RAFT_TOO_MANY_REQUESTS, - "E_RAFT_PERSIST_SNAPSHOT_FAILED": ErrorCode_E_RAFT_PERSIST_SNAPSHOT_FAILED, - "E_RAFT_RPC_EXCEPTION": ErrorCode_E_RAFT_RPC_EXCEPTION, - "E_RAFT_NO_WAL_FOUND": ErrorCode_E_RAFT_NO_WAL_FOUND, - "E_RAFT_HOST_PAUSED": ErrorCode_E_RAFT_HOST_PAUSED, - "E_RAFT_WRITE_BLOCKED": ErrorCode_E_RAFT_WRITE_BLOCKED, - "E_RAFT_BUFFER_OVERFLOW": ErrorCode_E_RAFT_BUFFER_OVERFLOW, - "E_RAFT_ATOMIC_OP_FAILED": ErrorCode_E_RAFT_ATOMIC_OP_FAILED, - "E_LEADER_LEASE_FAILED": ErrorCode_E_LEADER_LEASE_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_MACHINE_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_SERVICE_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_ZONE_NOT_ENOUGH", - "E_ZONE_IS_EMPTY", - "E_SCHEMA_NAME_EXISTS", - "E_RELATED_INDEX_EXISTS", - "E_RELATED_SPACE_EXISTS", - "E_STORE_FAILURE", - "E_STORE_SEGMENT_ILLEGAL", - "E_BAD_BALANCE_PLAN", - "E_BALANCED", - "E_NO_RUNNING_BALANCE_PLAN", - "E_NO_VALID_HOST", - "E_CORRUPTED_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_JOB_NEED_RECOVER", - "E_JOB_ALREADY_FINISH", - "E_JOB_SUBMITTED", - "E_JOB_NOT_STOPPABLE", - "E_JOB_HAS_NO_TARGET_STORAGE", - "E_INVALID_JOB", - "E_BACKUP_BUILDING_INDEX", - "E_BACKUP_SPACE_NOT_FOUND", - "E_RESTORE_FAILURE", - "E_SESSION_NOT_FOUND", - "E_LIST_CLUSTER_FAILURE", - "E_LIST_CLUSTER_GET_ABS_PATH_FAILURE", - "E_LIST_CLUSTER_NO_AGENT_FAILURE", - "E_QUERY_NOT_FOUND", - "E_AGENT_HB_FAILUE", - "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_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_ID_FAILED", - "E_RAFT_UNKNOWN_PART", - "E_RAFT_LOG_GAP", - "E_RAFT_LOG_STALE", - "E_RAFT_TERM_OUT_OF_DATE", - "E_RAFT_UNKNOWN_APPEND_LOG", - "E_RAFT_WAITING_SNAPSHOT", - "E_RAFT_SENDING_SNAPSHOT", - "E_RAFT_INVALID_PEER", - "E_RAFT_NOT_READY", - "E_RAFT_STOPPED", - "E_RAFT_BAD_ROLE", - "E_RAFT_WAL_FAIL", - "E_RAFT_HOST_STOPPED", - "E_RAFT_TOO_MANY_REQUESTS", - "E_RAFT_PERSIST_SNAPSHOT_FAILED", - "E_RAFT_RPC_EXCEPTION", - "E_RAFT_NO_WAL_FOUND", - "E_RAFT_HOST_PAUSED", - "E_RAFT_WRITE_BLOCKED", - "E_RAFT_BUFFER_OVERFLOW", - "E_RAFT_ATOMIC_OP_FAILED", - "E_LEADER_LEASE_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_MACHINE_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_SERVICE_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_ZONE_NOT_ENOUGH, - ErrorCode_E_ZONE_IS_EMPTY, - ErrorCode_E_SCHEMA_NAME_EXISTS, - ErrorCode_E_RELATED_INDEX_EXISTS, - ErrorCode_E_RELATED_SPACE_EXISTS, - ErrorCode_E_STORE_FAILURE, - ErrorCode_E_STORE_SEGMENT_ILLEGAL, - ErrorCode_E_BAD_BALANCE_PLAN, - ErrorCode_E_BALANCED, - ErrorCode_E_NO_RUNNING_BALANCE_PLAN, - ErrorCode_E_NO_VALID_HOST, - ErrorCode_E_CORRUPTED_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_JOB_NEED_RECOVER, - ErrorCode_E_JOB_ALREADY_FINISH, - ErrorCode_E_JOB_SUBMITTED, - ErrorCode_E_JOB_NOT_STOPPABLE, - ErrorCode_E_JOB_HAS_NO_TARGET_STORAGE, - ErrorCode_E_INVALID_JOB, - ErrorCode_E_BACKUP_BUILDING_INDEX, - ErrorCode_E_BACKUP_SPACE_NOT_FOUND, - ErrorCode_E_RESTORE_FAILURE, - ErrorCode_E_SESSION_NOT_FOUND, - ErrorCode_E_LIST_CLUSTER_FAILURE, - ErrorCode_E_LIST_CLUSTER_GET_ABS_PATH_FAILURE, - ErrorCode_E_LIST_CLUSTER_NO_AGENT_FAILURE, - ErrorCode_E_QUERY_NOT_FOUND, - ErrorCode_E_AGENT_HB_FAILUE, - 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_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_ID_FAILED, - ErrorCode_E_RAFT_UNKNOWN_PART, - ErrorCode_E_RAFT_LOG_GAP, - ErrorCode_E_RAFT_LOG_STALE, - ErrorCode_E_RAFT_TERM_OUT_OF_DATE, - ErrorCode_E_RAFT_UNKNOWN_APPEND_LOG, - ErrorCode_E_RAFT_WAITING_SNAPSHOT, - ErrorCode_E_RAFT_SENDING_SNAPSHOT, - ErrorCode_E_RAFT_INVALID_PEER, - ErrorCode_E_RAFT_NOT_READY, - ErrorCode_E_RAFT_STOPPED, - ErrorCode_E_RAFT_BAD_ROLE, - ErrorCode_E_RAFT_WAL_FAIL, - ErrorCode_E_RAFT_HOST_STOPPED, - ErrorCode_E_RAFT_TOO_MANY_REQUESTS, - ErrorCode_E_RAFT_PERSIST_SNAPSHOT_FAILED, - ErrorCode_E_RAFT_RPC_EXCEPTION, - ErrorCode_E_RAFT_NO_WAL_FOUND, - ErrorCode_E_RAFT_HOST_PAUSED, - ErrorCode_E_RAFT_WRITE_BLOCKED, - ErrorCode_E_RAFT_BUFFER_OVERFLOW, - ErrorCode_E_RAFT_ATOMIC_OP_FAILED, - ErrorCode_E_LEADER_LEASE_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 ClusterID = int64 - -func ClusterIDPtr(v ClusterID) *ClusterID { 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,optional" db:"tag_id" json:"tag_id,omitempty"` - EdgeType *EdgeType `thrift:"edge_type,2,optional" 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 -} - -type SchemaIDBuilder struct { - obj *SchemaID -} - -func NewSchemaIDBuilder() *SchemaIDBuilder{ - return &SchemaIDBuilder{ - obj: NewSchemaID(), - } -} - -func (p SchemaIDBuilder) Emit() *SchemaID{ - return &SchemaID{ - TagID: p.obj.TagID, - EdgeType: p.obj.EdgeType, - } -} - -func (s *SchemaIDBuilder) TagID(tagID *TagID) *SchemaIDBuilder { - s.obj.TagID = tagID - return s -} - -func (s *SchemaIDBuilder) EdgeType(edgeType *EdgeType) *SchemaIDBuilder { - s.obj.EdgeType = edgeType - return s -} - -func (s *SchemaID) SetTagID(tagID *TagID) *SchemaID { - s.TagID = tagID - return s -} - -func (s *SchemaID) SetEdgeType(edgeType *EdgeType) *SchemaID { - s.EdgeType = edgeType - return s -} - -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 -} -type DateBuilder struct { - obj *Date -} - -func NewDateBuilder() *DateBuilder{ - return &DateBuilder{ - obj: NewDate(), - } -} - -func (p DateBuilder) Emit() *Date{ - return &Date{ - Year: p.obj.Year, - Month: p.obj.Month, - Day: p.obj.Day, - } -} - -func (d *DateBuilder) Year(year int16) *DateBuilder { - d.obj.Year = year - return d -} - -func (d *DateBuilder) Month(month int8) *DateBuilder { - d.obj.Month = month - return d -} - -func (d *DateBuilder) Day(day int8) *DateBuilder { - d.obj.Day = day - return d -} - -func (d *Date) SetYear(year int16) *Date { - d.Year = year - return d -} - -func (d *Date) SetMonth(month int8) *Date { - d.Month = month - return d -} - -func (d *Date) SetDay(day int8) *Date { - d.Day = day - return d -} - -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 -} -type TimeBuilder struct { - obj *Time -} - -func NewTimeBuilder() *TimeBuilder{ - return &TimeBuilder{ - obj: NewTime(), - } -} - -func (p TimeBuilder) Emit() *Time{ - return &Time{ - Hour: p.obj.Hour, - Minute: p.obj.Minute, - Sec: p.obj.Sec, - Microsec: p.obj.Microsec, - } -} - -func (t *TimeBuilder) Hour(hour int8) *TimeBuilder { - t.obj.Hour = hour - return t -} - -func (t *TimeBuilder) Minute(minute int8) *TimeBuilder { - t.obj.Minute = minute - return t -} - -func (t *TimeBuilder) Sec(sec int8) *TimeBuilder { - t.obj.Sec = sec - return t -} - -func (t *TimeBuilder) Microsec(microsec int32) *TimeBuilder { - t.obj.Microsec = microsec - return t -} - -func (t *Time) SetHour(hour int8) *Time { - t.Hour = hour - return t -} - -func (t *Time) SetMinute(minute int8) *Time { - t.Minute = minute - return t -} - -func (t *Time) SetSec(sec int8) *Time { - t.Sec = sec - return t -} - -func (t *Time) SetMicrosec(microsec int32) *Time { - t.Microsec = microsec - return t -} - -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 -} -type DateTimeBuilder struct { - obj *DateTime -} - -func NewDateTimeBuilder() *DateTimeBuilder{ - return &DateTimeBuilder{ - obj: NewDateTime(), - } -} - -func (p DateTimeBuilder) Emit() *DateTime{ - return &DateTime{ - Year: p.obj.Year, - Month: p.obj.Month, - Day: p.obj.Day, - Hour: p.obj.Hour, - Minute: p.obj.Minute, - Sec: p.obj.Sec, - Microsec: p.obj.Microsec, - } -} - -func (d *DateTimeBuilder) Year(year int16) *DateTimeBuilder { - d.obj.Year = year - return d -} - -func (d *DateTimeBuilder) Month(month int8) *DateTimeBuilder { - d.obj.Month = month - return d -} - -func (d *DateTimeBuilder) Day(day int8) *DateTimeBuilder { - d.obj.Day = day - return d -} - -func (d *DateTimeBuilder) Hour(hour int8) *DateTimeBuilder { - d.obj.Hour = hour - return d -} - -func (d *DateTimeBuilder) Minute(minute int8) *DateTimeBuilder { - d.obj.Minute = minute - return d -} - -func (d *DateTimeBuilder) Sec(sec int8) *DateTimeBuilder { - d.obj.Sec = sec - return d -} - -func (d *DateTimeBuilder) Microsec(microsec int32) *DateTimeBuilder { - d.obj.Microsec = microsec - return d -} - -func (d *DateTime) SetYear(year int16) *DateTime { - d.Year = year - return d -} - -func (d *DateTime) SetMonth(month int8) *DateTime { - d.Month = month - return d -} - -func (d *DateTime) SetDay(day int8) *DateTime { - d.Day = day - return d -} - -func (d *DateTime) SetHour(hour int8) *DateTime { - d.Hour = hour - return d -} - -func (d *DateTime) SetMinute(minute int8) *DateTime { - d.Minute = minute - return d -} - -func (d *DateTime) SetSec(sec int8) *DateTime { - d.Sec = sec - return d -} - -func (d *DateTime) SetMicrosec(microsec int32) *DateTime { - d.Microsec = microsec - return d -} - -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 -// - DuVal -type Value struct { - NVal *NullType `thrift:"nVal,1,optional" db:"nVal" json:"nVal,omitempty"` - BVal *bool `thrift:"bVal,2,optional" db:"bVal" json:"bVal,omitempty"` - IVal *int64 `thrift:"iVal,3,optional" db:"iVal" json:"iVal,omitempty"` - FVal *float64 `thrift:"fVal,4,optional" db:"fVal" json:"fVal,omitempty"` - SVal []byte `thrift:"sVal,5,optional" db:"sVal" json:"sVal,omitempty"` - DVal *Date `thrift:"dVal,6,optional" db:"dVal" json:"dVal,omitempty"` - TVal *Time `thrift:"tVal,7,optional" db:"tVal" json:"tVal,omitempty"` - DtVal *DateTime `thrift:"dtVal,8,optional" db:"dtVal" json:"dtVal,omitempty"` - VVal *Vertex `thrift:"vVal,9,optional" db:"vVal" json:"vVal,omitempty"` - EVal *Edge `thrift:"eVal,10,optional" db:"eVal" json:"eVal,omitempty"` - PVal *Path `thrift:"pVal,11,optional" db:"pVal" json:"pVal,omitempty"` - LVal *NList `thrift:"lVal,12,optional" db:"lVal" json:"lVal,omitempty"` - MVal *NMap `thrift:"mVal,13,optional" db:"mVal" json:"mVal,omitempty"` - UVal *NSet `thrift:"uVal,14,optional" db:"uVal" json:"uVal,omitempty"` - GVal *DataSet `thrift:"gVal,15,optional" db:"gVal" json:"gVal,omitempty"` - GgVal *Geography `thrift:"ggVal,16,optional" db:"ggVal" json:"ggVal,omitempty"` - DuVal *Duration `thrift:"duVal,17,optional" db:"duVal" json:"duVal,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 -} -var Value_DuVal_DEFAULT *Duration -func (p *Value) GetDuVal() *Duration { - if !p.IsSetDuVal() { - return Value_DuVal_DEFAULT - } -return p.DuVal -} -func (p *Value) CountSetFieldsValue() int { - count := 0 - if (p.IsSetNVal()) { - 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++ - } - if (p.IsSetDuVal()) { - 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) IsSetDuVal() bool { - return p != nil && p.DuVal != nil -} - -type ValueBuilder struct { - obj *Value -} - -func NewValueBuilder() *ValueBuilder{ - return &ValueBuilder{ - obj: NewValue(), - } -} - -func (p ValueBuilder) Emit() *Value{ - return &Value{ - NVal: p.obj.NVal, - BVal: p.obj.BVal, - IVal: p.obj.IVal, - FVal: p.obj.FVal, - SVal: p.obj.SVal, - DVal: p.obj.DVal, - TVal: p.obj.TVal, - DtVal: p.obj.DtVal, - VVal: p.obj.VVal, - EVal: p.obj.EVal, - PVal: p.obj.PVal, - LVal: p.obj.LVal, - MVal: p.obj.MVal, - UVal: p.obj.UVal, - GVal: p.obj.GVal, - GgVal: p.obj.GgVal, - DuVal: p.obj.DuVal, - } -} - -func (v *ValueBuilder) NVal(nVal *NullType) *ValueBuilder { - v.obj.NVal = nVal - return v -} - -func (v *ValueBuilder) BVal(bVal *bool) *ValueBuilder { - v.obj.BVal = bVal - return v -} - -func (v *ValueBuilder) IVal(iVal *int64) *ValueBuilder { - v.obj.IVal = iVal - return v -} - -func (v *ValueBuilder) FVal(fVal *float64) *ValueBuilder { - v.obj.FVal = fVal - return v -} - -func (v *ValueBuilder) SVal(sVal []byte) *ValueBuilder { - v.obj.SVal = sVal - return v -} - -func (v *ValueBuilder) DVal(dVal *Date) *ValueBuilder { - v.obj.DVal = dVal - return v -} - -func (v *ValueBuilder) TVal(tVal *Time) *ValueBuilder { - v.obj.TVal = tVal - return v -} - -func (v *ValueBuilder) DtVal(dtVal *DateTime) *ValueBuilder { - v.obj.DtVal = dtVal - return v -} - -func (v *ValueBuilder) VVal(vVal *Vertex) *ValueBuilder { - v.obj.VVal = vVal - return v -} - -func (v *ValueBuilder) EVal(eVal *Edge) *ValueBuilder { - v.obj.EVal = eVal - return v -} - -func (v *ValueBuilder) PVal(pVal *Path) *ValueBuilder { - v.obj.PVal = pVal - return v -} - -func (v *ValueBuilder) LVal(lVal *NList) *ValueBuilder { - v.obj.LVal = lVal - return v -} - -func (v *ValueBuilder) MVal(mVal *NMap) *ValueBuilder { - v.obj.MVal = mVal - return v -} - -func (v *ValueBuilder) UVal(uVal *NSet) *ValueBuilder { - v.obj.UVal = uVal - return v -} - -func (v *ValueBuilder) GVal(gVal *DataSet) *ValueBuilder { - v.obj.GVal = gVal - return v -} - -func (v *ValueBuilder) GgVal(ggVal *Geography) *ValueBuilder { - v.obj.GgVal = ggVal - return v -} - -func (v *ValueBuilder) DuVal(duVal *Duration) *ValueBuilder { - v.obj.DuVal = duVal - return v -} - -func (v *Value) SetNVal(nVal *NullType) *Value { - v.NVal = nVal - return v -} - -func (v *Value) SetBVal(bVal *bool) *Value { - v.BVal = bVal - return v -} - -func (v *Value) SetIVal(iVal *int64) *Value { - v.IVal = iVal - return v -} - -func (v *Value) SetFVal(fVal *float64) *Value { - v.FVal = fVal - return v -} - -func (v *Value) SetSVal(sVal []byte) *Value { - v.SVal = sVal - return v -} - -func (v *Value) SetDVal(dVal *Date) *Value { - v.DVal = dVal - return v -} - -func (v *Value) SetTVal(tVal *Time) *Value { - v.TVal = tVal - return v -} - -func (v *Value) SetDtVal(dtVal *DateTime) *Value { - v.DtVal = dtVal - return v -} - -func (v *Value) SetVVal(vVal *Vertex) *Value { - v.VVal = vVal - return v -} - -func (v *Value) SetEVal(eVal *Edge) *Value { - v.EVal = eVal - return v -} - -func (v *Value) SetPVal(pVal *Path) *Value { - v.PVal = pVal - return v -} - -func (v *Value) SetLVal(lVal *NList) *Value { - v.LVal = lVal - return v -} - -func (v *Value) SetMVal(mVal *NMap) *Value { - v.MVal = mVal - return v -} - -func (v *Value) SetUVal(uVal *NSet) *Value { - v.UVal = uVal - return v -} - -func (v *Value) SetGVal(gVal *DataSet) *Value { - v.GVal = gVal - return v -} - -func (v *Value) SetGgVal(ggVal *Geography) *Value { - v.GgVal = ggVal - return v -} - -func (v *Value) SetDuVal(duVal *Duration) *Value { - v.DuVal = duVal - return v -} - -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 - } - case 17: - if err := p.ReadField17(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - 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) ReadField17(iprot thrift.Protocol) error { - p.DuVal = NewDuration() - if err := p.DuVal.Read(iprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error reading struct: ", p.DuVal), err) - } - return nil -} - -func (p *Value) Write(oprot thrift.Protocol) error { - if c := p.CountSetFieldsValue(); c > 1 { - return fmt.Errorf("%T write union: no more than one field must be set (%d set).", p, c) - } - 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 := p.writeField17(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - 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) writeField17(oprot thrift.Protocol) (err error) { - if p.IsSetDuVal() { - if err := oprot.WriteFieldBegin("duVal", thrift.STRUCT, 17); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 17:duVal: ", p), err) } - if err := p.DuVal.Write(oprot); err != nil { - return thrift.PrependError(fmt.Sprintf("%T error writing struct: ", p.DuVal), err) - } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 17:duVal: ", p), err) } - } - return err -} - -func (p *Value) String() string { - if p == nil { - return "" - } - - 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) - } - var duValVal string - if p.DuVal == nil { - duValVal = "" - } else { - duValVal = fmt.Sprintf("%v", p.DuVal) - } - return fmt.Sprintf("Value({NVal:%s BVal:%s IVal:%s FVal:%s SVal:%s DVal:%s TVal:%s DtVal:%s VVal:%s EVal:%s PVal:%s LVal:%s MVal:%s UVal:%s GVal:%s GgVal:%s DuVal:%s})", nValVal, bValVal, iValVal, fValVal, sValVal, dValVal, tValVal, dtValVal, vValVal, eValVal, pValVal, lValVal, mValVal, uValVal, gValVal, ggValVal, duValVal) -} - -// Attributes: -// - 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 -} -type NListBuilder struct { - obj *NList -} - -func NewNListBuilder() *NListBuilder{ - return &NListBuilder{ - obj: NewNList(), - } -} - -func (p NListBuilder) Emit() *NList{ - return &NList{ - Values: p.obj.Values, - } -} - -func (n *NListBuilder) Values(values []*Value) *NListBuilder { - n.obj.Values = values - return n -} - -func (n *NList) SetValues(values []*Value) *NList { - n.Values = values - return n -} - -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 -} -type NMapBuilder struct { - obj *NMap -} - -func NewNMapBuilder() *NMapBuilder{ - return &NMapBuilder{ - obj: NewNMap(), - } -} - -func (p NMapBuilder) Emit() *NMap{ - return &NMap{ - Kvs: p.obj.Kvs, - } -} - -func (n *NMapBuilder) Kvs(kvs map[string]*Value) *NMapBuilder { - n.obj.Kvs = kvs - return n -} - -func (n *NMap) SetKvs(kvs map[string]*Value) *NMap { - n.Kvs = kvs - return n -} - -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 -} -type NSetBuilder struct { - obj *NSet -} - -func NewNSetBuilder() *NSetBuilder{ - return &NSetBuilder{ - obj: NewNSet(), - } -} - -func (p NSetBuilder) Emit() *NSet{ - return &NSet{ - Values: p.obj.Values, - } -} - -func (n *NSetBuilder) Values(values []*Value) *NSetBuilder { - n.obj.Values = values - return n -} - -func (n *NSet) SetValues(values []*Value) *NSet { - n.Values = values - return n -} - -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 -} -type RowBuilder struct { - obj *Row -} - -func NewRowBuilder() *RowBuilder{ - return &RowBuilder{ - obj: NewRow(), - } -} - -func (p RowBuilder) Emit() *Row{ - return &Row{ - Values: p.obj.Values, - } -} - -func (r *RowBuilder) Values(values []*Value) *RowBuilder { - r.obj.Values = values - return r -} - -func (r *Row) SetValues(values []*Value) *Row { - r.Values = values - return r -} - -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 -} -type DataSetBuilder struct { - obj *DataSet -} - -func NewDataSetBuilder() *DataSetBuilder{ - return &DataSetBuilder{ - obj: NewDataSet(), - } -} - -func (p DataSetBuilder) Emit() *DataSet{ - return &DataSet{ - ColumnNames: p.obj.ColumnNames, - Rows: p.obj.Rows, - } -} - -func (d *DataSetBuilder) ColumnNames(columnNames [][]byte) *DataSetBuilder { - d.obj.ColumnNames = columnNames - return d -} - -func (d *DataSetBuilder) Rows(rows []*Row) *DataSetBuilder { - d.obj.Rows = rows - return d -} - -func (d *DataSet) SetColumnNames(columnNames [][]byte) *DataSet { - d.ColumnNames = columnNames - return d -} - -func (d *DataSet) SetRows(rows []*Row) *DataSet { - d.Rows = rows - return d -} - -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 -} -type CoordinateBuilder struct { - obj *Coordinate -} - -func NewCoordinateBuilder() *CoordinateBuilder{ - return &CoordinateBuilder{ - obj: NewCoordinate(), - } -} - -func (p CoordinateBuilder) Emit() *Coordinate{ - return &Coordinate{ - X: p.obj.X, - Y: p.obj.Y, - } -} - -func (c *CoordinateBuilder) X(x float64) *CoordinateBuilder { - c.obj.X = x - return c -} - -func (c *CoordinateBuilder) Y(y float64) *CoordinateBuilder { - c.obj.Y = y - return c -} - -func (c *Coordinate) SetX(x float64) *Coordinate { - c.X = x - return c -} - -func (c *Coordinate) SetY(y float64) *Coordinate { - c.Y = y - return c -} - -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 -} - -type PointBuilder struct { - obj *Point -} - -func NewPointBuilder() *PointBuilder{ - return &PointBuilder{ - obj: NewPoint(), - } -} - -func (p PointBuilder) Emit() *Point{ - return &Point{ - Coord: p.obj.Coord, - } -} - -func (p *PointBuilder) Coord(coord *Coordinate) *PointBuilder { - p.obj.Coord = coord - return p -} - -func (p *Point) SetCoord(coord *Coordinate) *Point { - p.Coord = coord - return p -} - -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 -} -type LineStringBuilder struct { - obj *LineString -} - -func NewLineStringBuilder() *LineStringBuilder{ - return &LineStringBuilder{ - obj: NewLineString(), - } -} - -func (p LineStringBuilder) Emit() *LineString{ - return &LineString{ - CoordList: p.obj.CoordList, - } -} - -func (l *LineStringBuilder) CoordList(coordList []*Coordinate) *LineStringBuilder { - l.obj.CoordList = coordList - return l -} - -func (l *LineString) SetCoordList(coordList []*Coordinate) *LineString { - l.CoordList = coordList - return l -} - -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 -} -type PolygonBuilder struct { - obj *Polygon -} - -func NewPolygonBuilder() *PolygonBuilder{ - return &PolygonBuilder{ - obj: NewPolygon(), - } -} - -func (p PolygonBuilder) Emit() *Polygon{ - return &Polygon{ - CoordListList: p.obj.CoordListList, - } -} - -func (p *PolygonBuilder) CoordListList(coordListList [][]*Coordinate) *PolygonBuilder { - p.obj.CoordListList = coordListList - return p -} - -func (p *Polygon) SetCoordListList(coordListList [][]*Coordinate) *Polygon { - p.CoordListList = coordListList - return p -} - -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,optional" db:"ptVal" json:"ptVal,omitempty"` - LsVal *LineString `thrift:"lsVal,2,optional" db:"lsVal" json:"lsVal,omitempty"` - PgVal *Polygon `thrift:"pgVal,3,optional" 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 -} - -type GeographyBuilder struct { - obj *Geography -} - -func NewGeographyBuilder() *GeographyBuilder{ - return &GeographyBuilder{ - obj: NewGeography(), - } -} - -func (p GeographyBuilder) Emit() *Geography{ - return &Geography{ - PtVal: p.obj.PtVal, - LsVal: p.obj.LsVal, - PgVal: p.obj.PgVal, - } -} - -func (g *GeographyBuilder) PtVal(ptVal *Point) *GeographyBuilder { - g.obj.PtVal = ptVal - return g -} - -func (g *GeographyBuilder) LsVal(lsVal *LineString) *GeographyBuilder { - g.obj.LsVal = lsVal - return g -} - -func (g *GeographyBuilder) PgVal(pgVal *Polygon) *GeographyBuilder { - g.obj.PgVal = pgVal - return g -} - -func (g *Geography) SetPtVal(ptVal *Point) *Geography { - g.PtVal = ptVal - return g -} - -func (g *Geography) SetLsVal(lsVal *LineString) *Geography { - g.LsVal = lsVal - return g -} - -func (g *Geography) SetPgVal(pgVal *Polygon) *Geography { - g.PgVal = pgVal - return g -} - -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 -} -type TagBuilder struct { - obj *Tag -} - -func NewTagBuilder() *TagBuilder{ - return &TagBuilder{ - obj: NewTag(), - } -} - -func (p TagBuilder) Emit() *Tag{ - return &Tag{ - Name: p.obj.Name, - Props: p.obj.Props, - } -} - -func (t *TagBuilder) Name(name []byte) *TagBuilder { - t.obj.Name = name - return t -} - -func (t *TagBuilder) Props(props map[string]*Value) *TagBuilder { - t.obj.Props = props - return t -} - -func (t *Tag) SetName(name []byte) *Tag { - t.Name = name - return t -} - -func (t *Tag) SetProps(props map[string]*Value) *Tag { - t.Props = props - return t -} - -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 -} - -type VertexBuilder struct { - obj *Vertex -} - -func NewVertexBuilder() *VertexBuilder{ - return &VertexBuilder{ - obj: NewVertex(), - } -} - -func (p VertexBuilder) Emit() *Vertex{ - return &Vertex{ - Vid: p.obj.Vid, - Tags: p.obj.Tags, - } -} - -func (v *VertexBuilder) Vid(vid *Value) *VertexBuilder { - v.obj.Vid = vid - return v -} - -func (v *VertexBuilder) Tags(tags []*Tag) *VertexBuilder { - v.obj.Tags = tags - return v -} - -func (v *Vertex) SetVid(vid *Value) *Vertex { - v.Vid = vid - return v -} - -func (v *Vertex) SetTags(tags []*Tag) *Vertex { - v.Tags = tags - return v -} - -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 -} - -type EdgeBuilder struct { - obj *Edge -} - -func NewEdgeBuilder() *EdgeBuilder{ - return &EdgeBuilder{ - obj: NewEdge(), - } -} - -func (p EdgeBuilder) Emit() *Edge{ - return &Edge{ - Src: p.obj.Src, - Dst: p.obj.Dst, - Type: p.obj.Type, - Name: p.obj.Name, - Ranking: p.obj.Ranking, - Props: p.obj.Props, - } -} - -func (e *EdgeBuilder) Src(src *Value) *EdgeBuilder { - e.obj.Src = src - return e -} - -func (e *EdgeBuilder) Dst(dst *Value) *EdgeBuilder { - e.obj.Dst = dst - return e -} - -func (e *EdgeBuilder) Type(type_a1 EdgeType) *EdgeBuilder { - e.obj.Type = type_a1 - return e -} - -func (e *EdgeBuilder) Name(name []byte) *EdgeBuilder { - e.obj.Name = name - return e -} - -func (e *EdgeBuilder) Ranking(ranking EdgeRanking) *EdgeBuilder { - e.obj.Ranking = ranking - return e -} - -func (e *EdgeBuilder) Props(props map[string]*Value) *EdgeBuilder { - e.obj.Props = props - return e -} - -func (e *Edge) SetSrc(src *Value) *Edge { - e.Src = src - return e -} - -func (e *Edge) SetDst(dst *Value) *Edge { - e.Dst = dst - return e -} - -func (e *Edge) SetType(type_a1 EdgeType) *Edge { - e.Type = type_a1 - return e -} - -func (e *Edge) SetName(name []byte) *Edge { - e.Name = name - return e -} - -func (e *Edge) SetRanking(ranking EdgeRanking) *Edge { - e.Ranking = ranking - return e -} - -func (e *Edge) SetProps(props map[string]*Value) *Edge { - e.Props = props - return e -} - -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 -} - -type StepBuilder struct { - obj *Step -} - -func NewStepBuilder() *StepBuilder{ - return &StepBuilder{ - obj: NewStep(), - } -} - -func (p StepBuilder) Emit() *Step{ - return &Step{ - Dst: p.obj.Dst, - Type: p.obj.Type, - Name: p.obj.Name, - Ranking: p.obj.Ranking, - Props: p.obj.Props, - } -} - -func (s *StepBuilder) Dst(dst *Vertex) *StepBuilder { - s.obj.Dst = dst - return s -} - -func (s *StepBuilder) Type(type_a1 EdgeType) *StepBuilder { - s.obj.Type = type_a1 - return s -} - -func (s *StepBuilder) Name(name []byte) *StepBuilder { - s.obj.Name = name - return s -} - -func (s *StepBuilder) Ranking(ranking EdgeRanking) *StepBuilder { - s.obj.Ranking = ranking - return s -} - -func (s *StepBuilder) Props(props map[string]*Value) *StepBuilder { - s.obj.Props = props - return s -} - -func (s *Step) SetDst(dst *Vertex) *Step { - s.Dst = dst - return s -} - -func (s *Step) SetType(type_a1 EdgeType) *Step { - s.Type = type_a1 - return s -} - -func (s *Step) SetName(name []byte) *Step { - s.Name = name - return s -} - -func (s *Step) SetRanking(ranking EdgeRanking) *Step { - s.Ranking = ranking - return s -} - -func (s *Step) SetProps(props map[string]*Value) *Step { - s.Props = props - return s -} - -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 -} - -type PathBuilder struct { - obj *Path -} - -func NewPathBuilder() *PathBuilder{ - return &PathBuilder{ - obj: NewPath(), - } -} - -func (p PathBuilder) Emit() *Path{ - return &Path{ - Src: p.obj.Src, - Steps: p.obj.Steps, - } -} - -func (p *PathBuilder) Src(src *Vertex) *PathBuilder { - p.obj.Src = src - return p -} - -func (p *PathBuilder) Steps(steps []*Step) *PathBuilder { - p.obj.Steps = steps - return p -} - -func (p *Path) SetSrc(src *Vertex) *Path { - p.Src = src - return p -} - -func (p *Path) SetSteps(steps []*Step) *Path { - p.Steps = steps - return p -} - -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 -} -type HostAddrBuilder struct { - obj *HostAddr -} - -func NewHostAddrBuilder() *HostAddrBuilder{ - return &HostAddrBuilder{ - obj: NewHostAddr(), - } -} - -func (p HostAddrBuilder) Emit() *HostAddr{ - return &HostAddr{ - Host: p.obj.Host, - Port: p.obj.Port, - } -} - -func (h *HostAddrBuilder) Host(host string) *HostAddrBuilder { - h.obj.Host = host - return h -} - -func (h *HostAddrBuilder) Port(port Port) *HostAddrBuilder { - h.obj.Port = port - return h -} - -func (h *HostAddr) SetHost(host string) *HostAddr { - h.Host = host - return h -} - -func (h *HostAddr) SetPort(port Port) *HostAddr { - h.Port = port - return h -} - -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 -} -type KeyValueBuilder struct { - obj *KeyValue -} - -func NewKeyValueBuilder() *KeyValueBuilder{ - return &KeyValueBuilder{ - obj: NewKeyValue(), - } -} - -func (p KeyValueBuilder) Emit() *KeyValue{ - return &KeyValue{ - Key: p.obj.Key, - Value: p.obj.Value, - } -} - -func (k *KeyValueBuilder) Key(key []byte) *KeyValueBuilder { - k.obj.Key = key - return k -} - -func (k *KeyValueBuilder) Value(value []byte) *KeyValueBuilder { - k.obj.Value = value - return k -} - -func (k *KeyValue) SetKey(key []byte) *KeyValue { - k.Key = key - return k -} - -func (k *KeyValue) SetValue(value []byte) *KeyValue { - k.Value = value - return k -} - -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: -// - Seconds -// - Microseconds -// - Months -type Duration struct { - Seconds int64 `thrift:"seconds,1" db:"seconds" json:"seconds"` - Microseconds int32 `thrift:"microseconds,2" db:"microseconds" json:"microseconds"` - Months int32 `thrift:"months,3" db:"months" json:"months"` -} - -func NewDuration() *Duration { - return &Duration{} -} - - -func (p *Duration) GetSeconds() int64 { - return p.Seconds -} - -func (p *Duration) GetMicroseconds() int32 { - return p.Microseconds -} - -func (p *Duration) GetMonths() int32 { - return p.Months -} -type DurationBuilder struct { - obj *Duration -} - -func NewDurationBuilder() *DurationBuilder{ - return &DurationBuilder{ - obj: NewDuration(), - } -} - -func (p DurationBuilder) Emit() *Duration{ - return &Duration{ - Seconds: p.obj.Seconds, - Microseconds: p.obj.Microseconds, - Months: p.obj.Months, - } -} - -func (d *DurationBuilder) Seconds(seconds int64) *DurationBuilder { - d.obj.Seconds = seconds - return d -} - -func (d *DurationBuilder) Microseconds(microseconds int32) *DurationBuilder { - d.obj.Microseconds = microseconds - return d -} - -func (d *DurationBuilder) Months(months int32) *DurationBuilder { - d.obj.Months = months - return d -} - -func (d *Duration) SetSeconds(seconds int64) *Duration { - d.Seconds = seconds - return d -} - -func (d *Duration) SetMicroseconds(microseconds int32) *Duration { - d.Microseconds = microseconds - return d -} - -func (d *Duration) SetMonths(months int32) *Duration { - d.Months = months - return d -} - -func (p *Duration) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *Duration) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - p.Seconds = v - } - return nil -} - -func (p *Duration) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.Microseconds = v - } - return nil -} - -func (p *Duration) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.Months = v - } - return nil -} - -func (p *Duration) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("Duration"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *Duration) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("seconds", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:seconds: ", p), err) } - if err := oprot.WriteI64(int64(p.Seconds)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.seconds (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:seconds: ", p), err) } - return err -} - -func (p *Duration) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("microseconds", thrift.I32, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:microseconds: ", p), err) } - if err := oprot.WriteI32(int32(p.Microseconds)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.microseconds (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:microseconds: ", p), err) } - return err -} - -func (p *Duration) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("months", thrift.I32, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:months: ", p), err) } - if err := oprot.WriteI32(int32(p.Months)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.months (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:months: ", p), err) } - return err -} - -func (p *Duration) String() string { - if p == nil { - return "" - } - - secondsVal := fmt.Sprintf("%v", p.Seconds) - microsecondsVal := fmt.Sprintf("%v", p.Microseconds) - monthsVal := fmt.Sprintf("%v", p.Months) - return fmt.Sprintf("Duration({Seconds:%s Microseconds:%s Months:%s})", secondsVal, microsecondsVal, monthsVal) -} - -// Attributes: -// - LogID -// - TermID -// - CommitLogID -// - CheckpointPath -type LogInfo struct { - LogID LogID `thrift:"log_id,1" db:"log_id" json:"log_id"` - TermID TermID `thrift:"term_id,2" db:"term_id" json:"term_id"` - CommitLogID LogID `thrift:"commit_log_id,3" db:"commit_log_id" json:"commit_log_id"` - CheckpointPath []byte `thrift:"checkpoint_path,4" db:"checkpoint_path" json:"checkpoint_path"` -} - -func NewLogInfo() *LogInfo { - return &LogInfo{} -} - - -func (p *LogInfo) GetLogID() LogID { - return p.LogID -} - -func (p *LogInfo) GetTermID() TermID { - return p.TermID -} - -func (p *LogInfo) GetCommitLogID() LogID { - return p.CommitLogID -} - -func (p *LogInfo) GetCheckpointPath() []byte { - return p.CheckpointPath -} -type LogInfoBuilder struct { - obj *LogInfo -} - -func NewLogInfoBuilder() *LogInfoBuilder{ - return &LogInfoBuilder{ - obj: NewLogInfo(), - } -} - -func (p LogInfoBuilder) Emit() *LogInfo{ - return &LogInfo{ - LogID: p.obj.LogID, - TermID: p.obj.TermID, - CommitLogID: p.obj.CommitLogID, - CheckpointPath: p.obj.CheckpointPath, - } -} - -func (l *LogInfoBuilder) LogID(logID LogID) *LogInfoBuilder { - l.obj.LogID = logID - return l -} - -func (l *LogInfoBuilder) TermID(termID TermID) *LogInfoBuilder { - l.obj.TermID = termID - return l -} - -func (l *LogInfoBuilder) CommitLogID(commitLogID LogID) *LogInfoBuilder { - l.obj.CommitLogID = commitLogID - return l -} - -func (l *LogInfoBuilder) CheckpointPath(checkpointPath []byte) *LogInfoBuilder { - l.obj.CheckpointPath = checkpointPath - return l -} - -func (l *LogInfo) SetLogID(logID LogID) *LogInfo { - l.LogID = logID - return l -} - -func (l *LogInfo) SetTermID(termID TermID) *LogInfo { - l.TermID = termID - return l -} - -func (l *LogInfo) SetCommitLogID(commitLogID LogID) *LogInfo { - l.CommitLogID = commitLogID - return l -} - -func (l *LogInfo) SetCheckpointPath(checkpointPath []byte) *LogInfo { - l.CheckpointPath = checkpointPath - return l -} - -func (p *LogInfo) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - 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 *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) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - temp := LogID(v) - p.CommitLogID = temp - } - return nil -} - -func (p *LogInfo) ReadField4(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 4: ", err) - } else { - p.CheckpointPath = v - } - return nil -} - -func (p *LogInfo) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("LogInfo"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := p.writeField3(oprot); err != nil { return err } - if err := p.writeField4(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - 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) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("commit_log_id", thrift.I64, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:commit_log_id: ", p), err) } - if err := oprot.WriteI64(int64(p.CommitLogID)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.commit_log_id (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:commit_log_id: ", p), err) } - return err -} - -func (p *LogInfo) writeField4(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("checkpoint_path", thrift.STRING, 4); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 4:checkpoint_path: ", p), err) } - if err := oprot.WriteBinary(p.CheckpointPath); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.checkpoint_path (4) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 4:checkpoint_path: ", p), err) } - return err -} - -func (p *LogInfo) String() string { - if p == nil { - return "" - } - - logIDVal := fmt.Sprintf("%v", p.LogID) - termIDVal := fmt.Sprintf("%v", p.TermID) - commitLogIDVal := fmt.Sprintf("%v", p.CommitLogID) - checkpointPathVal := fmt.Sprintf("%v", p.CheckpointPath) - return fmt.Sprintf("LogInfo({LogID:%s TermID:%s CommitLogID:%s CheckpointPath:%s})", logIDVal, termIDVal, commitLogIDVal, checkpointPathVal) -} - -// Attributes: -// - 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 -} -type DirInfoBuilder struct { - obj *DirInfo -} - -func NewDirInfoBuilder() *DirInfoBuilder{ - return &DirInfoBuilder{ - obj: NewDirInfo(), - } -} - -func (p DirInfoBuilder) Emit() *DirInfo{ - return &DirInfo{ - Root: p.obj.Root, - Data: p.obj.Data, - } -} - -func (d *DirInfoBuilder) Root(root []byte) *DirInfoBuilder { - d.obj.Root = root - return d -} - -func (d *DirInfoBuilder) Data(data [][]byte) *DirInfoBuilder { - d.obj.Data = data - return d -} - -func (d *DirInfo) SetRoot(root []byte) *DirInfo { - d.Root = root - return d -} - -func (d *DirInfo) SetData(data [][]byte) *DirInfo { - d.Data = data - return d -} - -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: -// - SpaceID -// - Parts -// - DataPath -type CheckpointInfo struct { - SpaceID GraphSpaceID `thrift:"space_id,1" db:"space_id" json:"space_id"` - Parts map[PartitionID]*LogInfo `thrift:"parts,2" db:"parts" json:"parts"` - DataPath []byte `thrift:"data_path,3" db:"data_path" json:"data_path"` -} - -func NewCheckpointInfo() *CheckpointInfo { - return &CheckpointInfo{} -} - - -func (p *CheckpointInfo) GetSpaceID() GraphSpaceID { - return p.SpaceID -} - -func (p *CheckpointInfo) GetParts() map[PartitionID]*LogInfo { - return p.Parts -} - -func (p *CheckpointInfo) GetDataPath() []byte { - return p.DataPath -} -type CheckpointInfoBuilder struct { - obj *CheckpointInfo -} - -func NewCheckpointInfoBuilder() *CheckpointInfoBuilder{ - return &CheckpointInfoBuilder{ - obj: NewCheckpointInfo(), - } -} - -func (p CheckpointInfoBuilder) Emit() *CheckpointInfo{ - return &CheckpointInfo{ - SpaceID: p.obj.SpaceID, - Parts: p.obj.Parts, - DataPath: p.obj.DataPath, - } -} - -func (c *CheckpointInfoBuilder) SpaceID(spaceID GraphSpaceID) *CheckpointInfoBuilder { - c.obj.SpaceID = spaceID - return c -} - -func (c *CheckpointInfoBuilder) Parts(parts map[PartitionID]*LogInfo) *CheckpointInfoBuilder { - c.obj.Parts = parts - return c -} - -func (c *CheckpointInfoBuilder) DataPath(dataPath []byte) *CheckpointInfoBuilder { - c.obj.DataPath = dataPath - return c -} - -func (c *CheckpointInfo) SetSpaceID(spaceID GraphSpaceID) *CheckpointInfo { - c.SpaceID = spaceID - return c -} - -func (c *CheckpointInfo) SetParts(parts map[PartitionID]*LogInfo) *CheckpointInfo { - c.Parts = parts - return c -} - -func (c *CheckpointInfo) SetDataPath(dataPath []byte) *CheckpointInfo { - c.DataPath = dataPath - return c -} - -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 - } - case 3: - if err := p.ReadField3(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - 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 { - if v, err := iprot.ReadI32(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := GraphSpaceID(v) - p.SpaceID = temp - } - return nil -} - -func (p *CheckpointInfo) ReadField2(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.Parts = 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.Parts[_key19] = _val20 - } - if err := iprot.ReadMapEnd(); err != nil { - return thrift.PrependError("error reading map end: ", err) - } - return nil -} - -func (p *CheckpointInfo) ReadField3(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 3: ", err) - } else { - p.DataPath = 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 := p.writeField3(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.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("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 *CheckpointInfo) 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.STRUCT, 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 := 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:parts: ", p), err) } - return err -} - -func (p *CheckpointInfo) writeField3(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("data_path", thrift.STRING, 3); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 3:data_path: ", p), err) } - if err := oprot.WriteBinary(p.DataPath); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.data_path (3) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 3:data_path: ", p), err) } - return err -} - -func (p *CheckpointInfo) String() string { - if p == nil { - return "" - } - - spaceIDVal := fmt.Sprintf("%v", p.SpaceID) - partsVal := fmt.Sprintf("%v", p.Parts) - dataPathVal := fmt.Sprintf("%v", p.DataPath) - return fmt.Sprintf("CheckpointInfo({SpaceID:%s Parts:%s DataPath:%s})", spaceIDVal, partsVal, dataPathVal) -} - -// Attributes: -// - Cluster -// - LogStr -type LogEntry struct { - Cluster ClusterID `thrift:"cluster,1" db:"cluster" json:"cluster"` - LogStr []byte `thrift:"log_str,2" db:"log_str" json:"log_str"` -} - -func NewLogEntry() *LogEntry { - return &LogEntry{} -} - - -func (p *LogEntry) GetCluster() ClusterID { - return p.Cluster -} - -func (p *LogEntry) GetLogStr() []byte { - return p.LogStr -} -type LogEntryBuilder struct { - obj *LogEntry -} - -func NewLogEntryBuilder() *LogEntryBuilder{ - return &LogEntryBuilder{ - obj: NewLogEntry(), - } -} - -func (p LogEntryBuilder) Emit() *LogEntry{ - return &LogEntry{ - Cluster: p.obj.Cluster, - LogStr: p.obj.LogStr, - } -} - -func (l *LogEntryBuilder) Cluster(cluster ClusterID) *LogEntryBuilder { - l.obj.Cluster = cluster - return l -} - -func (l *LogEntryBuilder) LogStr(logStr []byte) *LogEntryBuilder { - l.obj.LogStr = logStr - return l -} - -func (l *LogEntry) SetCluster(cluster ClusterID) *LogEntry { - l.Cluster = cluster - return l -} - -func (l *LogEntry) SetLogStr(logStr []byte) *LogEntry { - l.LogStr = logStr - return l -} - -func (p *LogEntry) Read(iprot thrift.Protocol) error { - if _, err := iprot.ReadStructBegin(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read error: ", p), err) - } - - - for { - _, fieldTypeId, fieldId, err := iprot.ReadFieldBegin() - if err != nil { - return thrift.PrependError(fmt.Sprintf("%T field %d read error: ", p, fieldId), err) - } - if fieldTypeId == thrift.STOP { break; } - switch fieldId { - case 1: - if err := p.ReadField1(iprot); err != nil { - return err - } - case 2: - if err := p.ReadField2(iprot); err != nil { - return err - } - default: - if err := iprot.Skip(fieldTypeId); err != nil { - return err - } - } - if err := iprot.ReadFieldEnd(); err != nil { - return err - } - } - if err := iprot.ReadStructEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) - } - return nil -} - -func (p *LogEntry) ReadField1(iprot thrift.Protocol) error { - if v, err := iprot.ReadI64(); err != nil { - return thrift.PrependError("error reading field 1: ", err) - } else { - temp := ClusterID(v) - p.Cluster = temp - } - return nil -} - -func (p *LogEntry) ReadField2(iprot thrift.Protocol) error { - if v, err := iprot.ReadBinary(); err != nil { - return thrift.PrependError("error reading field 2: ", err) - } else { - p.LogStr = v - } - return nil -} - -func (p *LogEntry) Write(oprot thrift.Protocol) error { - if err := oprot.WriteStructBegin("LogEntry"); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) } - if err := p.writeField1(oprot); err != nil { return err } - if err := p.writeField2(oprot); err != nil { return err } - if err := oprot.WriteFieldStop(); err != nil { - return thrift.PrependError("write field stop error: ", err) } - if err := oprot.WriteStructEnd(); err != nil { - return thrift.PrependError("write struct stop error: ", err) } - return nil -} - -func (p *LogEntry) writeField1(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("cluster", thrift.I64, 1); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 1:cluster: ", p), err) } - if err := oprot.WriteI64(int64(p.Cluster)); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.cluster (1) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 1:cluster: ", p), err) } - return err -} - -func (p *LogEntry) writeField2(oprot thrift.Protocol) (err error) { - if err := oprot.WriteFieldBegin("log_str", thrift.STRING, 2); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field begin error 2:log_str: ", p), err) } - if err := oprot.WriteBinary(p.LogStr); err != nil { - return thrift.PrependError(fmt.Sprintf("%T.log_str (2) field write error: ", p), err) } - if err := oprot.WriteFieldEnd(); err != nil { - return thrift.PrependError(fmt.Sprintf("%T write field end error 2:log_str: ", p), err) } - return err -} - -func (p *LogEntry) String() string { - if p == nil { - return "" - } - - clusterVal := fmt.Sprintf("%v", p.Cluster) - logStrVal := fmt.Sprintf("%v", p.LogStr) - return fmt.Sprintf("LogEntry({Cluster:%s LogStr:%s})", clusterVal, logStrVal) -} - diff --git a/result_set.go b/result_set.go index 88334985..cabd47cb 100644 --- a/result_set.go +++ b/result_set.go @@ -1187,7 +1187,7 @@ func prettyFormatJsonString(value []byte) string { } func name(planNodeDesc *graph.PlanNodeDescription) string { - return fmt.Sprintf("%s_%d", planNodeDesc.GetName(), planNodeDesc.GetId()) + return fmt.Sprintf("%s_%d", planNodeDesc.GetName(), planNodeDesc.GetID()) } func condEdgeLabel(condNode *graph.PlanNodeDescription, doBranch bool) string { @@ -1244,7 +1244,7 @@ func findBranchEndNode(p *graph.PlanDescription, condNodeId int64, isDoBranch bo if node.IsSetBranchInfo() { bInfo := node.GetBranchInfo() if bInfo.GetConditionNodeID() == condNodeId && bInfo.GetIsDoBranch() == isDoBranch { - return node.GetId() + return node.GetID() } } } @@ -1259,7 +1259,7 @@ func findFirstStartNodeFrom(p *graph.PlanDescription, nodeId int64) int64 { if strings.ToLower(string(node.GetName())) != "start" { return -1 } - return node.GetId() + return node.GetID() } node = nodeById(p, deps[0]) } @@ -1279,12 +1279,12 @@ func (res ResultSet) MakeDotGraph() string { builder.WriteString(conditionalNodeString(planNodeName)) dep := nodeById(p, planNodeDesc.GetDependencies()[0]) // then branch - thenNodeId := findBranchEndNode(p, planNodeDesc.GetId(), true) + thenNodeId := findBranchEndNode(p, planNodeDesc.GetID(), true) builder.WriteString(edgeString(name(nodeById(p, thenNodeId)), name(dep))) thenStartId := findFirstStartNodeFrom(p, thenNodeId) builder.WriteString(conditionalEdgeString(name(planNodeDesc), name(nodeById(p, thenStartId)), "Y")) // else branch - elseNodeId := findBranchEndNode(p, planNodeDesc.GetId(), false) + elseNodeId := findBranchEndNode(p, planNodeDesc.GetID(), false) builder.WriteString(edgeString(name(nodeById(p, elseNodeId)), name(dep))) elseStartId := findFirstStartNodeFrom(p, elseNodeId) builder.WriteString(conditionalEdgeString(name(planNodeDesc), name(nodeById(p, elseStartId)), "N")) @@ -1294,7 +1294,7 @@ func (res ResultSet) MakeDotGraph() string { builder.WriteString(conditionalNodeString(planNodeName)) dep := nodeById(p, planNodeDesc.GetDependencies()[0]) // do branch - doNodeId := findBranchEndNode(p, planNodeDesc.GetId(), true) + doNodeId := findBranchEndNode(p, planNodeDesc.GetID(), true) builder.WriteString(edgeString(name(nodeById(p, doNodeId)), name(planNodeDesc))) doStartId := findFirstStartNodeFrom(p, doNodeId) builder.WriteString(conditionalEdgeString(name(planNodeDesc), name(nodeById(p, doStartId)), "Do")) @@ -1419,7 +1419,7 @@ func (res ResultSet) MakePlanByRow() [][]interface{} { var rows [][]interface{} for _, planNodeDesc := range planNodeDescs { var row []interface{} - row = append(row, planNodeDesc.GetId(), string(planNodeDesc.GetName())) + row = append(row, planNodeDesc.GetID(), string(planNodeDesc.GetName())) if planNodeDesc.IsSetDependencies() { var deps []string @@ -1450,7 +1450,7 @@ func (res ResultSet) MakePlanByTck() [][]interface{} { var rows [][]interface{} for _, planNodeDesc := range planNodeDescs { var row []interface{} - row = append(row, planNodeDesc.GetId(), string(planNodeDesc.GetName())) + row = append(row, planNodeDesc.GetID(), string(planNodeDesc.GetName())) if planNodeDesc.IsSetDependencies() { var deps []string diff --git a/result_set_test.go b/result_set_test.go index aaccd155..3de3be3c 100644 --- a/result_set_test.go +++ b/result_set_test.go @@ -641,7 +641,7 @@ func TestResultSet(t *testing.T) { PlanNodeDescs: []*graph.PlanNodeDescription{ { Name: []byte("Project"), - Id: 0, + ID: 0, OutputVar: []byte("__Project_0"), Description: []*graph.Pair{}, Profiles: []*graph.ProfilingStats{}, @@ -649,7 +649,7 @@ func TestResultSet(t *testing.T) { Dependencies: []int64{2}}, { Name: []byte("Start"), - Id: 2, + ID: 2, OutputVar: []byte("__Start_2"), Description: []*graph.Pair{}, Profiles: []*graph.ProfilingStats{}, diff --git a/schema_manager.go b/schema_manager.go index 359b6a59..3eb66cf8 100644 --- a/schema_manager.go +++ b/schema_manager.go @@ -9,6 +9,7 @@ package nebula_go import ( + "context" "fmt" "log" "strings" @@ -41,16 +42,16 @@ func (mgr *SchemaManager) WithVerbose(verbose bool) *SchemaManager { // Notice: // We won't change the field type because it has // unexpected behavior for the data. -func (mgr *SchemaManager) ApplyTag(tag LabelSchema) (*ResultSet, error) { +func (mgr *SchemaManager) ApplyTag(ctx context.Context, tag LabelSchema) (*ResultSet, error) { // 1. Make sure the tag exists - fields, err := mgr.pool.DescTag(tag.Name) + fields, err := mgr.pool.DescTag(ctx, tag.Name) if err != nil { // If the tag does not exist, create it if strings.Contains(err.Error(), ErrorTagNotFound) { if mgr.verbose { log.Printf("ApplyTag: create the not existing tag. name=%s\n", tag.Name) } - return mgr.pool.CreateTag(tag) + return mgr.pool.CreateTag(ctx, tag) } return nil, err } @@ -83,7 +84,7 @@ func (mgr *SchemaManager) ApplyTag(tag LabelSchema) (*ResultSet, error) { if mgr.verbose { log.Printf("ApplyTag: add the not existing fields. name=%s queries=%s\n", tag.Name, queries) } - _, err = mgr.pool.ExecuteAndCheck(queries) + _, err = mgr.pool.ExecuteAndCheck(ctx, queries) if err != nil { return nil, err } @@ -112,14 +113,14 @@ func (mgr *SchemaManager) ApplyTag(tag LabelSchema) (*ResultSet, error) { if mgr.verbose { log.Printf("ApplyTag: remove the not expected fields. name=%s queries=%s\n", tag.Name, queries) } - _, err := mgr.pool.ExecuteAndCheck(queries) + _, err := mgr.pool.ExecuteAndCheck(ctx, queries) if err != nil { return nil, err } } // 4. Check if the TTL is set as expected. - ttlCol, ttlDuration, err := mgr.pool.GetTagTTL(tag.Name) + ttlCol, ttlDuration, err := mgr.pool.GetTagTTL(ctx, tag.Name) if err != nil { return nil, err } @@ -136,7 +137,7 @@ func (mgr *SchemaManager) ApplyTag(tag LabelSchema) (*ResultSet, error) { ) } - _, err = mgr.pool.AddTagTTL(tag.Name, tag.TTLCol, tag.TTLDuration) + _, err = mgr.pool.AddTagTTL(ctx, tag.Name, tag.TTLCol, tag.TTLDuration) if err != nil { return nil, err } @@ -158,16 +159,16 @@ func (mgr *SchemaManager) ApplyTag(tag LabelSchema) (*ResultSet, error) { // Notice: // We won't change the field type because it has // unexpected behavior for the data. -func (mgr *SchemaManager) ApplyEdge(edge LabelSchema) (*ResultSet, error) { +func (mgr *SchemaManager) ApplyEdge(ctx context.Context, edge LabelSchema) (*ResultSet, error) { // 1. Make sure the edge exists - fields, err := mgr.pool.DescEdge(edge.Name) + fields, err := mgr.pool.DescEdge(ctx, edge.Name) if err != nil { // If the edge does not exist, create it if strings.Contains(err.Error(), ErrorEdgeNotFound) { if mgr.verbose { log.Printf("ApplyEdge: create the not existing edge. name=%s\n", edge.Name) } - return mgr.pool.CreateEdge(edge) + return mgr.pool.CreateEdge(ctx, edge) } return nil, err } @@ -200,7 +201,7 @@ func (mgr *SchemaManager) ApplyEdge(edge LabelSchema) (*ResultSet, error) { if mgr.verbose { log.Printf("ApplyEdge: add the not existing fields. name=%s queries=%s\n", edge.Name, queries) } - _, err := mgr.pool.ExecuteAndCheck(queries) + _, err := mgr.pool.ExecuteAndCheck(ctx, queries) if err != nil { return nil, err } @@ -229,14 +230,14 @@ func (mgr *SchemaManager) ApplyEdge(edge LabelSchema) (*ResultSet, error) { if mgr.verbose { log.Printf("ApplyEdge: remove the not expected fields. name=%s queries=%s\n", edge.Name, queries) } - _, err := mgr.pool.ExecuteAndCheck(queries) + _, err := mgr.pool.ExecuteAndCheck(ctx, queries) if err != nil { return nil, err } } // 4. Check if the TTL is set as expected. - ttlCol, ttlDuration, err := mgr.pool.GetEdgeTTL(edge.Name) + ttlCol, ttlDuration, err := mgr.pool.GetEdgeTTL(ctx, edge.Name) if err != nil { return nil, err } @@ -253,7 +254,7 @@ func (mgr *SchemaManager) ApplyEdge(edge LabelSchema) (*ResultSet, error) { ) } - _, err = mgr.pool.AddEdgeTTL(edge.Name, edge.TTLCol, edge.TTLDuration) + _, err = mgr.pool.AddEdgeTTL(ctx, edge.Name, edge.TTLCol, edge.TTLDuration) if err != nil { return nil, err } diff --git a/schema_manager_test.go b/schema_manager_test.go index b7ac4cf8..c2956920 100644 --- a/schema_manager_test.go +++ b/schema_manager_test.go @@ -12,18 +12,21 @@ package nebula_go import ( + "context" "testing" "github.com/stretchr/testify/assert" ) func TestSchemaManagerApplyTag(t *testing.T) { + ctx := context.Background() + spaceName := "test_space_apply_tag" - err := prepareSpace(spaceName) + err := prepareSpace(ctx, spaceName) if err != nil { t.Fatal(err) } - defer dropSpace(spaceName) + defer dropSpace(ctx, spaceName) hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -39,15 +42,15 @@ func TestSchemaManagerApplyTag(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) schemaManager := NewSchemaManager(sessionPool).WithVerbose(true) - spaces, err := sessionPool.ShowSpaces() + spaces, err := sessionPool.ShowSpaces(ctx) if err != nil { t.Fatal(err) } @@ -68,17 +71,17 @@ func TestSchemaManagerApplyTag(t *testing.T) { }, }, } - _, err = schemaManager.ApplyTag(tagSchema) + _, err = schemaManager.ApplyTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - tags, err := sessionPool.ShowTags() + tags, err := sessionPool.ShowTags(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(tags)) assert.Equal(t, "account", tags[0].Name) - labels, err := sessionPool.DescTag("account") + labels, err := sessionPool.DescTag(ctx, "account") if err != nil { t.Fatal(err) } @@ -106,17 +109,17 @@ func TestSchemaManagerApplyTag(t *testing.T) { }, }, } - _, err = schemaManager.ApplyTag(tagSchema) + _, err = schemaManager.ApplyTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - tags, err = sessionPool.ShowTags() + tags, err = sessionPool.ShowTags(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(tags)) assert.Equal(t, "account", tags[0].Name) - labels, err = sessionPool.DescTag("account") + labels, err = sessionPool.DescTag(ctx, "account") if err != nil { t.Fatal(err) } @@ -142,17 +145,17 @@ func TestSchemaManagerApplyTag(t *testing.T) { }, }, } - _, err = schemaManager.ApplyTag(tagSchema) + _, err = schemaManager.ApplyTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - tags, err = sessionPool.ShowTags() + tags, err = sessionPool.ShowTags(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(tags)) assert.Equal(t, "account", tags[0].Name) - labels, err = sessionPool.DescTag("account") + labels, err = sessionPool.DescTag(ctx, "account") if err != nil { t.Fatal(err) } @@ -164,12 +167,14 @@ func TestSchemaManagerApplyTag(t *testing.T) { } func TestSchemaManagerApplyEdge(t *testing.T) { + ctx := context.Background() + spaceName := "test_space_apply_edge" - err := prepareSpace(spaceName) + err := prepareSpace(ctx, spaceName) if err != nil { t.Fatal(err) } - defer dropSpace(spaceName) + defer dropSpace(ctx, spaceName) hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -185,15 +190,15 @@ func TestSchemaManagerApplyEdge(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) schemaManager := NewSchemaManager(sessionPool).WithVerbose(true) - spaces, err := sessionPool.ShowSpaces() + spaces, err := sessionPool.ShowSpaces(ctx) if err != nil { t.Fatal(err) } @@ -214,17 +219,17 @@ func TestSchemaManagerApplyEdge(t *testing.T) { }, }, } - _, err = schemaManager.ApplyEdge(edgeSchema) + _, err = schemaManager.ApplyEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - edges, err := sessionPool.ShowEdges() + edges, err := sessionPool.ShowEdges(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(edges)) assert.Equal(t, "account_email", edges[0].Name) - labels, err := sessionPool.DescEdge("account_email") + labels, err := sessionPool.DescEdge(ctx, "account_email") if err != nil { t.Fatal(err) } @@ -247,17 +252,17 @@ func TestSchemaManagerApplyEdge(t *testing.T) { }, }, } - _, err = schemaManager.ApplyEdge(edgeSchema) + _, err = schemaManager.ApplyEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - edges, err = sessionPool.ShowEdges() + edges, err = sessionPool.ShowEdges(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(edges)) assert.Equal(t, "account_email", edges[0].Name) - labels, err = sessionPool.DescEdge("account_email") + labels, err = sessionPool.DescEdge(ctx, "account_email") if err != nil { t.Fatal(err) } @@ -277,17 +282,17 @@ func TestSchemaManagerApplyEdge(t *testing.T) { }, }, } - _, err = schemaManager.ApplyEdge(edgeSchema) + _, err = schemaManager.ApplyEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - edges, err = sessionPool.ShowEdges() + edges, err = sessionPool.ShowEdges(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(edges)) assert.Equal(t, "account_email", edges[0].Name) - labels, err = sessionPool.DescEdge("account_email") + labels, err = sessionPool.DescEdge(ctx, "account_email") if err != nil { t.Fatal(err) } @@ -297,12 +302,14 @@ func TestSchemaManagerApplyEdge(t *testing.T) { } func TestSchemaManagerApplyTagWithTTL(t *testing.T) { + ctx := context.Background() + spaceName := "test_space_apply_tag_with_ttl" - err := prepareSpace(spaceName) + err := prepareSpace(ctx, spaceName) if err != nil { t.Fatal(err) } - defer dropSpace(spaceName) + defer dropSpace(ctx, spaceName) hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -318,15 +325,15 @@ func TestSchemaManagerApplyTagWithTTL(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) schemaManager := NewSchemaManager(sessionPool).WithVerbose(true) - spaces, err := sessionPool.ShowSpaces() + spaces, err := sessionPool.ShowSpaces(ctx) if err != nil { t.Fatal(err) } @@ -354,21 +361,21 @@ func TestSchemaManagerApplyTagWithTTL(t *testing.T) { TTLDuration: 100, TTLCol: "created_at", } - _, err = schemaManager.ApplyTag(tagSchema) + _, err = schemaManager.ApplyTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - tags, err := sessionPool.ShowTags() + tags, err := sessionPool.ShowTags(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(tags)) - labels, err := sessionPool.DescTag("user") + labels, err := sessionPool.DescTag(ctx, "user") if err != nil { t.Fatal(err) } assert.Equal(t, 2, len(labels)) - ttlCol, ttlDuration, err := sessionPool.GetTagTTL("user") + ttlCol, ttlDuration, err := sessionPool.GetTagTTL(ctx, "user") if err != nil { t.Fatal(err) } @@ -378,16 +385,16 @@ func TestSchemaManagerApplyTagWithTTL(t *testing.T) { // update ttl tagSchema.TTLDuration = 300 - _, err = schemaManager.ApplyTag(tagSchema) + _, err = schemaManager.ApplyTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - labels, err = sessionPool.DescTag("user") + labels, err = sessionPool.DescTag(ctx, "user") if err != nil { t.Fatal(err) } assert.Equal(t, 2, len(labels)) - ttlCol, ttlDuration, err = sessionPool.GetTagTTL("user") + ttlCol, ttlDuration, err = sessionPool.GetTagTTL(ctx, "user") if err != nil { t.Fatal(err) } @@ -398,16 +405,16 @@ func TestSchemaManagerApplyTagWithTTL(t *testing.T) { tagSchema.TTLDuration = 0 tagSchema.TTLCol = "" - _, err = schemaManager.ApplyTag(tagSchema) + _, err = schemaManager.ApplyTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - labels, err = sessionPool.DescTag("user") + labels, err = sessionPool.DescTag(ctx, "user") if err != nil { t.Fatal(err) } assert.Equal(t, 2, len(labels)) - ttlCol, ttlDuration, err = sessionPool.GetTagTTL("user") + ttlCol, ttlDuration, err = sessionPool.GetTagTTL(ctx, "user") if err != nil { t.Fatal(err) } @@ -416,12 +423,14 @@ func TestSchemaManagerApplyTagWithTTL(t *testing.T) { } func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { + ctx := context.Background() + spaceName := "test_space_apply_edge_with_ttl" - err := prepareSpace(spaceName) + err := prepareSpace(ctx, spaceName) if err != nil { t.Fatal(err) } - defer dropSpace(spaceName) + defer dropSpace(ctx, spaceName) hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -437,15 +446,15 @@ func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) schemaManager := NewSchemaManager(sessionPool).WithVerbose(true) - spaces, err := sessionPool.ShowSpaces() + spaces, err := sessionPool.ShowSpaces(ctx) if err != nil { t.Fatal(err) } @@ -468,21 +477,21 @@ func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { TTLDuration: 100, TTLCol: "created_at", } - _, err = schemaManager.ApplyEdge(edgeSchema) + _, err = schemaManager.ApplyEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - edges, err := sessionPool.ShowEdges() + edges, err := sessionPool.ShowEdges(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(edges)) - labels, err := sessionPool.DescEdge("friend") + labels, err := sessionPool.DescEdge(ctx, "friend") if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(labels)) - ttlCol, ttlDuration, err := sessionPool.GetEdgeTTL("friend") + ttlCol, ttlDuration, err := sessionPool.GetEdgeTTL(ctx, "friend") if err != nil { t.Fatal(err) } @@ -492,16 +501,16 @@ func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { // update ttl edgeSchema.TTLDuration = 300 - _, err = schemaManager.ApplyEdge(edgeSchema) + _, err = schemaManager.ApplyEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - labels, err = sessionPool.DescEdge("friend") + labels, err = sessionPool.DescEdge(ctx, "friend") if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(labels)) - ttlCol, ttlDuration, err = sessionPool.GetEdgeTTL("friend") + ttlCol, ttlDuration, err = sessionPool.GetEdgeTTL(ctx, "friend") if err != nil { t.Fatal(err) } @@ -512,16 +521,16 @@ func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { edgeSchema.TTLDuration = 0 edgeSchema.TTLCol = "" - _, err = schemaManager.ApplyEdge(edgeSchema) + _, err = schemaManager.ApplyEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - labels, err = sessionPool.DescEdge("friend") + labels, err = sessionPool.DescEdge(ctx, "friend") if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(labels)) - ttlCol, ttlDuration, err = sessionPool.GetEdgeTTL("friend") + ttlCol, ttlDuration, err = sessionPool.GetEdgeTTL(ctx, "friend") if err != nil { t.Fatal(err) } diff --git a/session.go b/session.go index 2b3047db..569658d6 100644 --- a/session.go +++ b/session.go @@ -9,6 +9,7 @@ package nebula_go import ( + "context" "fmt" "sync" @@ -30,8 +31,8 @@ type Session struct { timezoneInfo } -func (session *Session) reconnectWithExecuteErr(err error) error { - if _err := session.reConnect(); _err != nil { +func (session *Session) reconnectWithExecuteErr(ctx context.Context, err error) error { + if _err := session.reConnect(ctx); _err != nil { return fmt.Errorf("failed to reconnect, %s", _err.Error()) } session.log.Info(fmt.Sprintf("Successfully reconnect to host: %s, port: %d", @@ -39,12 +40,12 @@ func (session *Session) reconnectWithExecuteErr(err error) error { return nil } -func (session *Session) executeWithReconnect(f func() (interface{}, error)) (interface{}, error) { +func (session *Session) executeWithReconnect(ctx context.Context, f func() (interface{}, error)) (interface{}, error) { resp, err := f() if err == nil { return resp, nil } - if err2 := session.reconnectWithExecuteErr(err); err2 != nil { + if err2 := session.reconnectWithExecuteErr(ctx, err); err2 != nil { return nil, err2 } // Execute with the new connection @@ -52,7 +53,7 @@ func (session *Session) executeWithReconnect(f func() (interface{}, error)) (int } // ExecuteWithParameter returns the result of the given query as a ResultSet -func (session *Session) ExecuteWithParameter(stmt string, params map[string]interface{}) (*ResultSet, error) { +func (session *Session) ExecuteWithParameter(ctx context.Context, stmt string, params map[string]interface{}) (*ResultSet, error) { session.mu.Lock() defer session.mu.Unlock() paramsMap, err := parseParams(params) @@ -61,18 +62,18 @@ func (session *Session) ExecuteWithParameter(stmt string, params map[string]inte } fn := func() (*graph.ExecutionResponse, error) { - return session.connection.executeWithParameter(session.sessionID, stmt, paramsMap) + return session.connection.executeWithParameter(ctx, session.sessionID, stmt, paramsMap) } - return session.tryExecuteLocked(fn) + return session.tryExecuteLocked(ctx, fn) } // Execute returns the result of the given query as a ResultSet -func (session *Session) Execute(stmt string) (*ResultSet, error) { - return session.ExecuteWithParameter(stmt, map[string]interface{}{}) +func (session *Session) Execute(ctx context.Context, stmt string) (*ResultSet, error) { + return session.ExecuteWithParameter(ctx, stmt, map[string]interface{}{}) } -func (session *Session) tryExecuteLocked(fn func() (*graph.ExecutionResponse, error)) (*ResultSet, error) { +func (session *Session) tryExecuteLocked(ctx context.Context, fn func() (*graph.ExecutionResponse, error)) (*ResultSet, error) { if session.connection == nil { return nil, fmt.Errorf("failed to execute: Session has been released") } @@ -87,18 +88,18 @@ func (session *Session) tryExecuteLocked(fn func() (*graph.ExecutionResponse, er } return resSet, nil } - resp, err := session.executeWithReconnect(execFunc) + resp, err := session.executeWithReconnect(ctx, execFunc) if err != nil { return nil, err } return resp.(*ResultSet), err } -func (session *Session) ExecuteWithTimeout(stmt string, timeoutMs int64) (*ResultSet, error) { - return session.ExecuteWithParameterTimeout(stmt, map[string]interface{}{}, timeoutMs) +func (session *Session) ExecuteWithTimeout(ctx context.Context, stmt string, timeoutMs int64) (*ResultSet, error) { + return session.ExecuteWithParameterTimeout(ctx, stmt, map[string]interface{}{}, timeoutMs) } -func (session *Session) ExecuteWithParameterTimeout(stmt string, params map[string]interface{}, timeoutMs int64) (*ResultSet, error) { +func (session *Session) ExecuteWithParameterTimeout(ctx context.Context, stmt string, params map[string]interface{}, timeoutMs int64) (*ResultSet, error) { session.mu.Lock() defer session.mu.Unlock() if timeoutMs <= 0 { @@ -110,9 +111,9 @@ func (session *Session) ExecuteWithParameterTimeout(stmt string, params map[stri } fn := func() (*graph.ExecutionResponse, error) { - return session.connection.executeWithParameterTimeout(session.sessionID, stmt, paramsMap, timeoutMs) + return session.connection.executeWithParameterTimeout(ctx, session.sessionID, stmt, paramsMap, timeoutMs) } - return session.tryExecuteLocked(fn) + return session.tryExecuteLocked(ctx, fn) } // ExecuteJson returns the result of the given query as a json string @@ -175,14 +176,14 @@ func (session *Session) ExecuteWithParameterTimeout(stmt string, params map[stri // } // ] // } -func (session *Session) ExecuteJson(stmt string) ([]byte, error) { - return session.ExecuteJsonWithParameter(stmt, map[string]interface{}{}) +func (session *Session) ExecuteJson(ctx context.Context, stmt string) ([]byte, error) { + return session.ExecuteJsonWithParameter(ctx, stmt, map[string]interface{}{}) } // ExecuteJson returns the result of the given query as a json string // Date and Datetime will be returned in UTC // The result is a JSON string in the same format as ExecuteJson() -func (session *Session) ExecuteJsonWithParameter(stmt string, params map[string]interface{}) ([]byte, error) { +func (session *Session) ExecuteJsonWithParameter(ctx context.Context, stmt string, params map[string]interface{}) ([]byte, error) { session.mu.Lock() defer session.mu.Unlock() if session.connection == nil { @@ -198,21 +199,21 @@ func (session *Session) ExecuteJsonWithParameter(stmt string, params map[string] paramsMap[k] = nv } execFunc := func() (interface{}, error) { - resp, err := session.connection.ExecuteJsonWithParameter(session.sessionID, stmt, paramsMap) + resp, err := session.connection.ExecuteJsonWithParameter(ctx, session.sessionID, stmt, paramsMap) if err != nil { return nil, err } return resp, nil } - resp, err := session.executeWithReconnect(execFunc) + resp, err := session.executeWithReconnect(ctx, execFunc) if err != nil { return nil, err } return resp.([]byte), err } -func (session *Session) ExecuteAndCheck(stmt string) (*ResultSet, error) { - rs, err := session.Execute(stmt) +func (session *Session) ExecuteAndCheck(ctx context.Context, stmt string) (*ResultSet, error) { + rs, err := session.Execute(ctx, stmt) if err != nil { return nil, err } @@ -234,7 +235,7 @@ type SpaceConf struct { Comment string } -func (session *Session) CreateSpace(conf SpaceConf) (*ResultSet, error) { +func (session *Session) CreateSpace(ctx context.Context, conf SpaceConf) (*ResultSet, error) { if conf.Partition == 0 { conf.Partition = 100 } @@ -268,11 +269,11 @@ func (session *Session) CreateSpace(conf SpaceConf) (*ResultSet, error) { q += fmt.Sprintf(` COMMENT = "%s"`, conf.Comment) } - return session.ExecuteAndCheck(q + ";") + return session.ExecuteAndCheck(ctx, q+";") } -func (session *Session) ShowSpaces() ([]SpaceName, error) { - rs, err := session.ExecuteAndCheck("SHOW SPACES;") +func (session *Session) ShowSpaces(ctx context.Context) ([]SpaceName, error) { + rs, err := session.ExecuteAndCheck(ctx, "SHOW SPACES;") if err != nil { return nil, err } @@ -283,8 +284,8 @@ func (session *Session) ShowSpaces() ([]SpaceName, error) { return names, nil } -func (session *Session) reConnect() error { - newConnection, err := session.connPool.getIdleConn() +func (session *Session) reConnect(ctx context.Context) error { + newConnection, err := session.connPool.getIdleConn(ctx) if err != nil { err = fmt.Errorf(err.Error()) return err @@ -298,7 +299,7 @@ func (session *Session) reConnect() error { // Release logs out and releases connection hold by session. // The connection will be added into the activeConnectionQueue of the connection pool // so that it could be reused. -func (session *Session) Release() { +func (session *Session) Release(ctx context.Context) { if session == nil { return } @@ -308,7 +309,7 @@ func (session *Session) Release() { session.log.Warn("Session has been released") return } - if err := session.connection.signOut(session.sessionID); err != nil { + if err := session.connection.signOut(ctx, session.sessionID); err != nil { session.log.Warn(fmt.Sprintf("Sign out failed, %s", err.Error())) } @@ -328,12 +329,12 @@ func IsError(resp *graph.ExecutionResponse) bool { } // Ping checks if the session is valid -func (session *Session) Ping() error { +func (session *Session) Ping(ctx context.Context) error { if session.connection == nil { return fmt.Errorf("failed to ping: Session has been released") } // send ping request - resp, err := session.Execute(`RETURN "NEBULA GO PING"`) + resp, err := session.Execute(ctx, `RETURN "NEBULA GO PING"`) // check connection level error if err != nil { return fmt.Errorf("session ping failed, %s" + err.Error()) @@ -414,15 +415,15 @@ func value2Nvalue(any interface{}) (value *nebula.Value, err error) { } else if v, ok := any.(nebula.Value); ok { value = &v } else if v, ok := any.(nebula.Date); ok { - value.SetDVal(&v) + value.DVal = &v } else if v, ok := any.(nebula.DateTime); ok { - value.SetDtVal(&v) + value.DtVal = &v } else if v, ok := any.(nebula.Duration); ok { - value.SetDuVal(&v) + value.DuVal = &v } else if v, ok := any.(nebula.Time); ok { - value.SetTVal(&v) + value.TVal = &v } else if v, ok := any.(nebula.Geography); ok { - value.SetGgVal(&v) + value.GgVal = &v } else { // unsupported other Value type, use this function carefully err = fmt.Errorf("only support convert boolean/float/int/string/map/list to nebula.Value but %T", any) diff --git a/session_pool.go b/session_pool.go index 7ba45f9a..f8c5d8d0 100644 --- a/session_pool.go +++ b/session_pool.go @@ -10,6 +10,7 @@ package nebula_go import ( "container/list" + "context" "fmt" "strconv" "sync" @@ -59,7 +60,7 @@ type pureSession struct { // NewSessionPool creates a new session pool with the given configs. // There must be an existing SPACE in the DB. -func NewSessionPool(conf SessionPoolConf, log Logger) (*SessionPool, error) { +func NewSessionPool(ctx context.Context, conf SessionPoolConf, log Logger) (*SessionPool, error) { // check the config conf.checkBasicFields(log) @@ -69,24 +70,24 @@ func NewSessionPool(conf SessionPoolConf, log Logger) (*SessionPool, error) { } // init the pool - if err := newSessionPool.init(); err != nil { + if err := newSessionPool.init(ctx); err != nil { return nil, fmt.Errorf("failed to create a new session pool, %s", err.Error()) } - newSessionPool.startCleaner() + newSessionPool.startCleaner(ctx) return newSessionPool, nil } // init initializes the session pool. -func (pool *SessionPool) init() error { +func (pool *SessionPool) init(ctx context.Context) error { // check the hosts status - if err := checkAddresses(pool.conf.timeOut, pool.conf.serviceAddrs, pool.conf.sslConfig, + if err := checkAddresses(ctx, pool.conf.timeOut, pool.conf.serviceAddrs, pool.conf.sslConfig, pool.conf.useHTTP2, pool.conf.httpHeader, pool.conf.handshakeKey); err != nil { return fmt.Errorf("failed to initialize the session pool, %s", err.Error()) } // create sessions to fulfill the min pool size for i := 0; i < pool.conf.minSize; i++ { - session, err := pool.newSession() + session, err := pool.newSession(ctx) if err != nil { return fmt.Errorf("failed to initialize the session pool, %s", err.Error()) } @@ -98,7 +99,7 @@ func (pool *SessionPool) init() error { return nil } -func (pool *SessionPool) executeFn(execFunc func(s *pureSession) (*ResultSet, error)) (*ResultSet, error) { +func (pool *SessionPool) executeFn(ctx context.Context, execFunc func(s *pureSession) (*ResultSet, error)) (*ResultSet, error) { // Check if the pool is closed if pool.closed { return nil, fmt.Errorf("failed to execute: Session pool has been closed") @@ -111,7 +112,7 @@ func (pool *SessionPool) executeFn(execFunc func(s *pureSession) (*ResultSet, er } // if there's no idle session, create a new one if session == nil { - session, err = pool.newSession() + session, err = pool.newSession(ctx) if err != nil { return nil, err } @@ -120,9 +121,9 @@ func (pool *SessionPool) executeFn(execFunc func(s *pureSession) (*ResultSet, er pool.removeSessionFromIdle(session) pool.addSessionToActive(session) } - rs, err := pool.executeWithRetry(session, execFunc, pool.conf.retryGetSessionTimes) + rs, err := pool.executeWithRetry(ctx, session, execFunc, pool.conf.retryGetSessionTimes) if err != nil { - session.close() + session.close(ctx) pool.removeSessionFromActive(session) return nil, err } @@ -130,10 +131,10 @@ func (pool *SessionPool) executeFn(execFunc func(s *pureSession) (*ResultSet, er // if the space was changed after the execution of the given query, // change it back to the default space specified in the pool config if rs.GetSpaceName() != "" && rs.GetSpaceName() != pool.conf.spaceName { - err := session.setSessionSpaceToDefault() + err := session.setSessionSpaceToDefault(ctx) if err != nil { pool.log.Warn(err.Error()) - session.close() + session.close(ctx) pool.removeSessionFromActive(session) return nil, err } @@ -152,42 +153,42 @@ func (pool *SessionPool) executeFn(execFunc func(s *pureSession) (*ResultSet, er // 2. If the query contains statements like "USE ", the space will be set to the // one in the pool config after the execution of the query. // 3. The query should not change the user password nor drop a user. -func (pool *SessionPool) Execute(stmt string) (*ResultSet, error) { - return pool.ExecuteWithParameter(stmt, map[string]interface{}{}) +func (pool *SessionPool) Execute(ctx context.Context, stmt string) (*ResultSet, error) { + return pool.ExecuteWithParameter(ctx, stmt, map[string]interface{}{}) } // ExecuteWithParameter returns the result of the given query as a ResultSet -func (pool *SessionPool) ExecuteWithParameter(stmt string, params map[string]interface{}) (*ResultSet, error) { +func (pool *SessionPool) ExecuteWithParameter(ctx context.Context, stmt string, params map[string]interface{}) (*ResultSet, error) { // Execute the query execFunc := func(s *pureSession) (*ResultSet, error) { - rs, err := s.executeWithParameter(stmt, params) + rs, err := s.executeWithParameter(ctx, stmt, params) if err != nil { return nil, err } return rs, nil } - return pool.executeFn(execFunc) + return pool.executeFn(ctx, execFunc) } -func (pool *SessionPool) ExecuteWithTimeout(stmt string, timeoutMs int64) (*ResultSet, error) { - return pool.ExecuteWithParameterTimeout(stmt, map[string]interface{}{}, timeoutMs) +func (pool *SessionPool) ExecuteWithTimeout(ctx context.Context, stmt string, timeoutMs int64) (*ResultSet, error) { + return pool.ExecuteWithParameterTimeout(ctx, stmt, map[string]interface{}{}, timeoutMs) } // ExecuteWithParameter returns the result of the given query as a ResultSet -func (pool *SessionPool) ExecuteWithParameterTimeout(stmt string, params map[string]interface{}, timeoutMs int64) (*ResultSet, error) { +func (pool *SessionPool) ExecuteWithParameterTimeout(ctx context.Context, stmt string, params map[string]interface{}, timeoutMs int64) (*ResultSet, error) { // Execute the query if timeoutMs <= 0 { return nil, fmt.Errorf("timeout should be a positive number") } execFunc := func(s *pureSession) (*ResultSet, error) { - rs, err := s.executeWithParameterTimeout(stmt, params, timeoutMs) + rs, err := s.executeWithParameterTimeout(ctx, stmt, params, timeoutMs) if err != nil { return nil, err } return rs, nil } - return pool.executeFn(execFunc) + return pool.executeFn(ctx, execFunc) } // ExecuteJson returns the result of the given query as a json string @@ -263,7 +264,7 @@ func (pool *SessionPool) ExecuteJsonWithParameter(stmt string, params map[string } // Close logs out all sessions and closes bonded connection. -func (pool *SessionPool) Close() { +func (pool *SessionPool) Close(ctx context.Context) { pool.rwLock.Lock() defer pool.rwLock.Unlock() @@ -274,12 +275,12 @@ func (pool *SessionPool) Close() { // iterate all sessions for i := 0; i < idleLen; i++ { session := pool.idleSessions.Front().Value.(*pureSession) - session.close() + session.close(ctx) pool.idleSessions.Remove(pool.idleSessions.Front()) } for i := 0; i < activeLen; i++ { session := pool.activeSessions.Front().Value.(*pureSession) - session.close() + session.close(ctx) pool.activeSessions.Remove(pool.activeSessions.Front()) } @@ -296,8 +297,8 @@ func (pool *SessionPool) GetTotalSessionCount() int { return pool.activeSessions.Len() + pool.idleSessions.Len() } -func (pool *SessionPool) ExecuteAndCheck(q string) (*ResultSet, error) { - rs, err := pool.Execute(q) +func (pool *SessionPool) ExecuteAndCheck(ctx context.Context, q string) (*ResultSet, error) { + rs, err := pool.Execute(ctx, q) if err != nil { return nil, err } @@ -310,8 +311,8 @@ func (pool *SessionPool) ExecuteAndCheck(q string) (*ResultSet, error) { return rs, nil } -func (pool *SessionPool) ShowSpaces() ([]SpaceName, error) { - rs, err := pool.ExecuteAndCheck("SHOW SPACES;") +func (pool *SessionPool) ShowSpaces(ctx context.Context) ([]SpaceName, error) { + rs, err := pool.ExecuteAndCheck(ctx, "SHOW SPACES;") if err != nil { return nil, err } @@ -322,8 +323,8 @@ func (pool *SessionPool) ShowSpaces() ([]SpaceName, error) { return names, nil } -func (pool *SessionPool) ShowTags() ([]LabelName, error) { - rs, err := pool.ExecuteAndCheck("SHOW TAGS;") +func (pool *SessionPool) ShowTags(ctx context.Context) ([]LabelName, error) { + rs, err := pool.ExecuteAndCheck(ctx, "SHOW TAGS;") if err != nil { return nil, err } @@ -334,18 +335,18 @@ func (pool *SessionPool) ShowTags() ([]LabelName, error) { return names, nil } -func (pool *SessionPool) CreateTag(tag LabelSchema) (*ResultSet, error) { +func (pool *SessionPool) CreateTag(ctx context.Context, tag LabelSchema) (*ResultSet, error) { q := tag.BuildCreateTagQL() - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return rs, err } return rs, nil } -func (pool *SessionPool) AddTagTTL(tagName string, colName string, duration uint) (*ResultSet, error) { +func (pool *SessionPool) AddTagTTL(ctx context.Context, tagName string, colName string, duration uint) (*ResultSet, error) { q := fmt.Sprintf(`ALTER TAG %s TTL_DURATION = %d, TTL_COL = "%s";`, tagName, duration, colName) - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return nil, err } @@ -353,9 +354,9 @@ func (pool *SessionPool) AddTagTTL(tagName string, colName string, duration uint return rs, nil } -func (pool *SessionPool) GetTagTTL(tagName string) (string, uint, error) { +func (pool *SessionPool) GetTagTTL(ctx context.Context, tagName string) (string, uint, error) { q := fmt.Sprintf("SHOW CREATE TAG %s;", tagName) - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return "", 0, err } @@ -365,9 +366,9 @@ func (pool *SessionPool) GetTagTTL(tagName string) (string, uint, error) { return parseTTL(s) } -func (pool *SessionPool) DescTag(tagName string) ([]Label, error) { +func (pool *SessionPool) DescTag(ctx context.Context, tagName string) ([]Label, error) { q := fmt.Sprintf("DESC TAG %s;", tagName) - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return nil, err } @@ -378,8 +379,8 @@ func (pool *SessionPool) DescTag(tagName string) ([]Label, error) { return fields, nil } -func (pool *SessionPool) ShowEdges() ([]LabelName, error) { - rs, err := pool.ExecuteAndCheck("SHOW EDGES;") +func (pool *SessionPool) ShowEdges(ctx context.Context) ([]LabelName, error) { + rs, err := pool.ExecuteAndCheck(ctx, "SHOW EDGES;") if err != nil { return nil, err } @@ -390,18 +391,18 @@ func (pool *SessionPool) ShowEdges() ([]LabelName, error) { return names, nil } -func (pool *SessionPool) CreateEdge(edge LabelSchema) (*ResultSet, error) { +func (pool *SessionPool) CreateEdge(ctx context.Context, edge LabelSchema) (*ResultSet, error) { q := edge.BuildCreateEdgeQL() - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return rs, err } return rs, nil } -func (pool *SessionPool) AddEdgeTTL(tagName string, colName string, duration uint) (*ResultSet, error) { +func (pool *SessionPool) AddEdgeTTL(ctx context.Context, tagName string, colName string, duration uint) (*ResultSet, error) { q := fmt.Sprintf(`ALTER EDGE %s TTL_DURATION = %d, TTL_COL = "%s";`, tagName, duration, colName) - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return nil, err } @@ -409,9 +410,9 @@ func (pool *SessionPool) AddEdgeTTL(tagName string, colName string, duration uin return rs, nil } -func (pool *SessionPool) GetEdgeTTL(edgeName string) (string, uint, error) { +func (pool *SessionPool) GetEdgeTTL(ctx context.Context, edgeName string) (string, uint, error) { q := fmt.Sprintf("SHOW CREATE EDGE %s;", edgeName) - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return "", 0, err } @@ -421,9 +422,9 @@ func (pool *SessionPool) GetEdgeTTL(edgeName string) (string, uint, error) { return parseTTL(s) } -func (pool *SessionPool) DescEdge(edgeName string) ([]Label, error) { +func (pool *SessionPool) DescEdge(ctx context.Context, edgeName string) ([]Label, error) { q := fmt.Sprintf("DESC EDGE %s;", edgeName) - rs, err := pool.ExecuteAndCheck(q) + rs, err := pool.ExecuteAndCheck(ctx, q) if err != nil { return nil, err } @@ -436,7 +437,7 @@ func (pool *SessionPool) DescEdge(edgeName string) ([]Label, error) { // newSession creates a new session and returns it. // `use ` will be executed so that the new session will be in the default space. -func (pool *SessionPool) newSession() (*pureSession, error) { +func (pool *SessionPool) newSession(ctx context.Context) (*pureSession, error) { graphAddr := pool.getNextAddr() cn := connection{ severAddress: graphAddr, @@ -448,13 +449,13 @@ func (pool *SessionPool) newSession() (*pureSession, error) { } // open a new connection - if err := cn.open(cn.severAddress, pool.conf.timeOut, pool.conf.sslConfig, + if err := cn.open(ctx, cn.severAddress, pool.conf.timeOut, pool.conf.sslConfig, pool.conf.useHTTP2, pool.conf.httpHeader, pool.conf.handshakeKey); err != nil { return nil, fmt.Errorf("failed to create a net.Conn-backed Transport,: %s", err.Error()) } // authenticate with username and password to get a new session - authResp, err := cn.authenticate(pool.conf.username, pool.conf.password) + authResp, err := cn.authenticate(ctx, pool.conf.username, pool.conf.password) if err != nil { return nil, fmt.Errorf("failed to create a new session: %s", err.Error()) } @@ -463,7 +464,7 @@ func (pool *SessionPool) newSession() (*pureSession, error) { if authResp.GetErrorCode() != 0 { if authResp.GetErrorCode() == nebula.ErrorCode_E_BAD_USERNAME_PASSWORD || authResp.GetErrorCode() == nebula.ErrorCode_E_USER_NOT_FOUND { - pool.Close() + pool.Close(ctx) return nil, fmt.Errorf( "failed to authenticate the user, error code: %d, error message: %s, the pool has been closed", authResp.ErrorCode, authResp.ErrorMsg) @@ -485,13 +486,13 @@ func (pool *SessionPool) newSession() (*pureSession, error) { // Switch to the default space stmt := fmt.Sprintf("USE %s", pool.conf.spaceName) - useSpaceRs, err := newSession.execute(stmt) + useSpaceRs, err := newSession.execute(ctx, stmt) if err != nil { return nil, err } if useSpaceRs.GetErrorCode() != ErrorCode_SUCCEEDED { - newSession.close() + newSession.close(ctx) return nil, fmt.Errorf("failed to use space %s: %s", pool.conf.spaceName, useSpaceRs.GetErrorMsg()) } @@ -533,6 +534,7 @@ func (pool *SessionPool) getSessionFromIdle() (*pureSession, error) { // 2. connection is invalid. // and then change the original session to the new one. func (pool *SessionPool) executeWithRetry( + ctx context.Context, session *pureSession, f func(*pureSession) (*ResultSet, error), retry int) (*ResultSet, error) { @@ -546,16 +548,16 @@ func (pool *SessionPool) executeWithRetry( } // If the session is invalid, close it first - session.close() + session.close(ctx) // get a new session for i := 0; i < retry; i++ { pool.log.Info("retry to get sessions") - newSession, err := pool.newSession() + newSession, err := pool.newSession(ctx) if err != nil { return nil, err } - pingErr := newSession.ping() + pingErr := newSession.ping(ctx) if pingErr != nil { pool.log.Error("failed to ping the session, error: " + pingErr.Error()) continue @@ -570,14 +572,14 @@ func (pool *SessionPool) executeWithRetry( } // startCleaner starts sessionCleaner if idleTime > 0. -func (pool *SessionPool) startCleaner() { +func (pool *SessionPool) startCleaner(ctx context.Context) { if pool.conf.idleTime > 0 && pool.cleanerChan == nil { pool.cleanerChan = make(chan struct{}, 1) - go pool.sessionCleaner() + go pool.sessionCleaner(ctx) } } -func (pool *SessionPool) sessionCleaner() { +func (pool *SessionPool) sessionCleaner(ctx context.Context) { const minInterval = time.Minute d := pool.conf.idleTime @@ -601,7 +603,7 @@ func (pool *SessionPool) sessionCleaner() { closing := pool.timeoutSessionList() //release expired session from the pool for _, session := range closing { - session.close() + session.close(ctx) } t.Reset(d) } @@ -702,9 +704,9 @@ func (pool *SessionPool) returnSession(session *pureSession) { session.returnedAt = time.Now() } -func (pool *SessionPool) setSessionSpaceToDefault(session *pureSession) error { +func (pool *SessionPool) setSessionSpaceToDefault(ctx context.Context, session *pureSession) error { stmt := fmt.Sprintf("USE %s", pool.conf.spaceName) - rs, err := session.execute(stmt) + rs, err := session.execute(ctx, stmt) if err != nil { return err } @@ -716,14 +718,14 @@ func (pool *SessionPool) setSessionSpaceToDefault(session *pureSession) error { // and remove the session from the pool because it is malformed. pool.log.Warn(fmt.Sprintf("failed to reset the space of the session: errorCode: %d, errorMsg: %s, session removed", rs.GetErrorCode(), rs.GetErrorMsg())) - session.close() + session.close(ctx) pool.removeSessionFromActive(session) return fmt.Errorf("failed to reset the space of the session: errorCode: %d, errorMsg: %s", rs.GetErrorCode(), rs.GetErrorMsg()) } -func (session *pureSession) execute(stmt string) (*ResultSet, error) { - return session.executeWithParameter(stmt, nil) +func (session *pureSession) execute(ctx context.Context, stmt string) (*ResultSet, error) { + return session.executeWithParameter(ctx, stmt, nil) } func (session *pureSession) executeFn(fn func() (*graph.ExecutionResponse, error)) (*ResultSet, error) { @@ -741,29 +743,29 @@ func (session *pureSession) executeFn(fn func() (*graph.ExecutionResponse, error return rs, nil } -func (session *pureSession) executeWithParameter(stmt string, params map[string]interface{}) (*ResultSet, error) { +func (session *pureSession) executeWithParameter(ctx context.Context, stmt string, params map[string]interface{}) (*ResultSet, error) { paramsMap, err := parseParams(params) if err != nil { return nil, err } fn := func() (*graph.ExecutionResponse, error) { - return session.connection.executeWithParameter(session.sessionID, stmt, paramsMap) + return session.connection.executeWithParameter(ctx, session.sessionID, stmt, paramsMap) } return session.executeFn(fn) } -func (session *pureSession) executeWithParameterTimeout(stmt string, params map[string]interface{}, timeout int64) (*ResultSet, error) { +func (session *pureSession) executeWithParameterTimeout(ctx context.Context, stmt string, params map[string]interface{}, timeout int64) (*ResultSet, error) { paramsMap, err := parseParams(params) if err != nil { return nil, err } fn := func() (*graph.ExecutionResponse, error) { - return session.connection.executeWithParameterTimeout(session.sessionID, stmt, paramsMap, timeout) + return session.connection.executeWithParameterTimeout(ctx, session.sessionID, stmt, paramsMap, timeout) } return session.executeFn(fn) } -func (session *pureSession) close() { +func (session *pureSession) close(ctx context.Context) { defer func() { if err := recover(); err != nil { return @@ -771,19 +773,19 @@ func (session *pureSession) close() { }() if session.connection != nil { // ignore signout error - _ = session.connection.signOut(session.sessionID) + _ = session.connection.signOut(ctx, session.sessionID) session.connection.close() session.connection = nil } } // Ping checks if the session is valid -func (session *pureSession) ping() error { +func (session *pureSession) ping(ctx context.Context) error { if session.connection == nil { return fmt.Errorf("failed to ping: Session has been released") } // send ping request - rs, err := session.execute(`RETURN "NEBULA GO PING"`) + rs, err := session.execute(ctx, `RETURN "NEBULA GO PING"`) // check connection level error if err != nil { return fmt.Errorf("session ping failed, %s" + err.Error()) @@ -795,9 +797,9 @@ func (session *pureSession) ping() error { return nil } -func (session *pureSession) setSessionSpaceToDefault() error { +func (session *pureSession) setSessionSpaceToDefault(ctx context.Context) error { stmt := fmt.Sprintf("USE %s", session.spaceName) - rs, err := session.execute(stmt) + rs, err := session.execute(ctx, stmt) if err != nil { return err } diff --git a/session_pool_test.go b/session_pool_test.go index 2a18f716..3d1c9b04 100644 --- a/session_pool_test.go +++ b/session_pool_test.go @@ -56,8 +56,10 @@ func TestSessionPoolInvalidConfig(t *testing.T) { } func TestSessionPoolServerCheck(t *testing.T) { - prepareSpace("client_test") - defer dropSpace("client_test") + ctx := context.Background() + + prepareSpace(ctx, "client_test") + defer dropSpace(ctx, "client_test") hostAddress := HostAddress{Host: address, Port: port} testcases := []struct { conf *SessionPoolConf @@ -116,7 +118,7 @@ func TestSessionPoolServerCheck(t *testing.T) { }, } for _, tc := range testcases { - _, err := NewSessionPool(*tc.conf, DefaultLogger{}) + _, err := NewSessionPool(ctx, *tc.conf, DefaultLogger{}) if err == nil { t.Fatal("should return error") } @@ -126,8 +128,10 @@ func TestSessionPoolServerCheck(t *testing.T) { } func TestSessionPoolInvalidHandshakeKey(t *testing.T) { - prepareSpace("client_test") - defer dropSpace("client_test") + ctx := context.Background() + + prepareSpace(ctx, "client_test") + defer dropSpace(ctx, "client_test") hostAddress := HostAddress{Host: address, Port: port} // wrong handshakeKey info @@ -141,15 +145,17 @@ func TestSessionPoolInvalidHandshakeKey(t *testing.T) { versionConfig.minSize = 1 // create session pool - _, err = NewSessionPool(*versionConfig, DefaultLogger{}) + _, err = NewSessionPool(ctx, *versionConfig, DefaultLogger{}) if err != nil { assert.Contains(t, err.Error(), "incompatible handshakeKey between client and server") } } func TestSessionPoolBasic(t *testing.T) { - prepareSpace("client_test") - defer dropSpace("client_test") + ctx := context.Background() + + prepareSpace(ctx, "client_test") + defer dropSpace(ctx, "client_test") hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -162,14 +168,14 @@ func TestSessionPoolBasic(t *testing.T) { } // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) // execute query - resultSet, err := sessionPool.Execute("RETURN 1") + resultSet, err := sessionPool.Execute(ctx, "RETURN 1") if err != nil { t.Fatal(err) } @@ -181,11 +187,13 @@ func TestSessionPoolBasic(t *testing.T) { } func TestSessionPoolMultiThreadGetSession(t *testing.T) { - err := prepareSpace("client_test") + ctx := context.Background() + + err := prepareSpace(ctx, "client_test") if err != nil { t.Fatal(err) } - defer dropSpace("client_test") + defer dropSpace(ctx, "client_test") hostList := poolAddress config, err := NewSessionPoolConf( @@ -199,11 +207,11 @@ func TestSessionPoolMultiThreadGetSession(t *testing.T) { config.maxSize = 333 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) var wg sync.WaitGroup rsCh := make(chan *ResultSet, sessionPool.conf.maxSize) @@ -214,7 +222,7 @@ func TestSessionPoolMultiThreadGetSession(t *testing.T) { for i := 0; i < sessionPool.conf.maxSize; i++ { go func(sessCh chan<- *ResultSet, wg *sync.WaitGroup) { defer wg.Done() - rs, err := sessionPool.Execute("yield 1") + rs, err := sessionPool.Execute(ctx, "yield 1") if err != nil { t.Errorf("fail to execute query, %s", err.Error()) } @@ -242,11 +250,13 @@ func TestSessionPoolMultiThreadGetSession(t *testing.T) { } func TestSessionPoolMultiThreadExecute(t *testing.T) { - err := prepareSpace("client_test") + ctx := context.Background() + + err := prepareSpace(ctx, "client_test") if err != nil { t.Fatal(err) } - defer dropSpace("client_test") + defer dropSpace(ctx, "client_test") hostList := poolAddress config, err := NewSessionPoolConf( @@ -260,11 +270,11 @@ func TestSessionPoolMultiThreadExecute(t *testing.T) { config.maxSize = 300 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) var wg sync.WaitGroup wg.Add(sessionPool.conf.maxSize) @@ -274,7 +284,7 @@ func TestSessionPoolMultiThreadExecute(t *testing.T) { for i := 0; i < sessionPool.conf.maxSize; i++ { go func(respCh chan<- *ResultSet, wg *sync.WaitGroup) { defer wg.Done() - resp, err := sessionPool.Execute("SHOW HOSTS") + resp, err := sessionPool.Execute(ctx, "SHOW HOSTS") if err != nil { t.Errorf(err.Error()) } @@ -308,17 +318,19 @@ func TestSessionPoolMultiThreadExecute(t *testing.T) { // This test is used to test if the space bond to session is the same as the space in the session pool config after executing // a query contains `USE ` statement. func TestSessionPoolSpaceChange(t *testing.T) { - err := prepareSpace("test_space_1") + ctx := context.Background() + + err := prepareSpace(ctx, "test_space_1") if err != nil { t.Fatal(err) } - defer dropSpace("test_space_1") + defer dropSpace(ctx, "test_space_1") - err = prepareSpace("test_space_2") + err = prepareSpace(ctx, "test_space_2") if err != nil { t.Fatal(err) } - defer dropSpace("test_space_2") + defer dropSpace(ctx, "test_space_2") hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -334,14 +346,14 @@ func TestSessionPoolSpaceChange(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) // execute query in test_space_2 - resultSet, err := sessionPool.Execute("USE test_space_2; SHOW HOSTS;") + resultSet, err := sessionPool.Execute(ctx, "USE test_space_2; SHOW HOSTS;") if err != nil { t.Fatal(err) } @@ -349,7 +361,7 @@ func TestSessionPoolSpaceChange(t *testing.T) { resultSet.GetErrorCode(), resultSet.GetErrorMsg())) // this query should be executed in test_space_1 - resultSet, err = sessionPool.Execute("SHOW HOSTS;") + resultSet, err = sessionPool.Execute(ctx, "SHOW HOSTS;") if err != nil { t.Fatal(err) } @@ -359,12 +371,14 @@ func TestSessionPoolSpaceChange(t *testing.T) { } func TestSessionPoolCreateTagAndEdge(t *testing.T) { + ctx := context.Background() + spaceName := "test_space_schema" - err := prepareSpace(spaceName) + err := prepareSpace(ctx, spaceName) if err != nil { t.Fatal(err) } - defer dropSpace(spaceName) + defer dropSpace(ctx, spaceName) hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -380,13 +394,13 @@ func TestSessionPoolCreateTagAndEdge(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) - spaces, err := sessionPool.ShowSpaces() + spaces, err := sessionPool.ShowSpaces(ctx) if err != nil { t.Fatal(err) } @@ -416,18 +430,18 @@ func TestSessionPoolCreateTagAndEdge(t *testing.T) { }, } - _, err = sessionPool.CreateTag(tagSchema) + _, err = sessionPool.CreateTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - tags, err := sessionPool.ShowTags() + tags, err := sessionPool.ShowTags(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(tags)) assert.Equal(t, "account", tags[0].Name) - labels, err := sessionPool.DescTag("account") + labels, err := sessionPool.DescTag(ctx, "account") if err != nil { t.Fatal(err) } @@ -449,18 +463,18 @@ func TestSessionPoolCreateTagAndEdge(t *testing.T) { }, } - _, err = sessionPool.CreateEdge(edgeSchema) + _, err = sessionPool.CreateEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - edges, err := sessionPool.ShowEdges() + edges, err := sessionPool.ShowEdges(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(edges)) assert.Equal(t, "account_email", edges[0].Name) - labels, err = sessionPool.DescEdge("account_email") + labels, err = sessionPool.DescEdge(ctx, "account_email") if err != nil { t.Fatal(err) } @@ -470,12 +484,14 @@ func TestSessionPoolCreateTagAndEdge(t *testing.T) { } func TestSessionPoolCreateTagAndEdgeWithTTL(t *testing.T) { + ctx := context.Background() + spaceName := "test_space_schema_ttl" - err := prepareSpace(spaceName) + err := prepareSpace(ctx, spaceName) if err != nil { t.Fatal(err) } - defer dropSpace(spaceName) + defer dropSpace(ctx, spaceName) hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -491,13 +507,13 @@ func TestSessionPoolCreateTagAndEdgeWithTTL(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) - spaces, err := sessionPool.ShowSpaces() + spaces, err := sessionPool.ShowSpaces(ctx) if err != nil { t.Fatal(err) } @@ -525,18 +541,18 @@ func TestSessionPoolCreateTagAndEdgeWithTTL(t *testing.T) { TTLDuration: 5, } - _, err = sessionPool.CreateTag(tagSchema) + _, err = sessionPool.CreateTag(ctx, tagSchema) if err != nil { t.Fatal(err) } - tags, err := sessionPool.ShowTags() + tags, err := sessionPool.ShowTags(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(tags)) assert.Equal(t, "user", tags[0].Name) - labels, err := sessionPool.DescTag("user") + labels, err := sessionPool.DescTag(ctx, "user") if err != nil { t.Fatal(err) } @@ -546,7 +562,7 @@ func TestSessionPoolCreateTagAndEdgeWithTTL(t *testing.T) { assert.Equal(t, "created_at", labels[1].Field) assert.Equal(t, "int64", labels[1].Type) - col, duration, err := sessionPool.GetTagTTL("user") + col, duration, err := sessionPool.GetTagTTL(ctx, "user") if err != nil { t.Fatal(err) } @@ -566,18 +582,18 @@ func TestSessionPoolCreateTagAndEdgeWithTTL(t *testing.T) { TTLDuration: 5, } - _, err = sessionPool.CreateEdge(edgeSchema) + _, err = sessionPool.CreateEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } - edges, err := sessionPool.ShowEdges() + edges, err := sessionPool.ShowEdges(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(edges)) assert.Equal(t, "friend", edges[0].Name) - labels, err = sessionPool.DescEdge("friend") + labels, err = sessionPool.DescEdge(ctx, "friend") if err != nil { t.Fatal(err) } @@ -585,7 +601,7 @@ func TestSessionPoolCreateTagAndEdgeWithTTL(t *testing.T) { assert.Equal(t, "created_at", labels[0].Field) assert.Equal(t, "int64", labels[0].Type) - col, duration, err = sessionPool.GetEdgeTTL("friend") + col, duration, err = sessionPool.GetEdgeTTL(ctx, "friend") if err != nil { t.Fatal(err) } @@ -594,12 +610,14 @@ func TestSessionPoolCreateTagAndEdgeWithTTL(t *testing.T) { } func TestSessionPoolAddTTL(t *testing.T) { + ctx := context.Background() + spaceName := "test_space_ttl" - err := prepareSpace(spaceName) + err := prepareSpace(ctx, spaceName) if err != nil { t.Fatal(err) } - defer dropSpace(spaceName) + defer dropSpace(ctx, spaceName) hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -615,13 +633,13 @@ func TestSessionPoolAddTTL(t *testing.T) { config.maxSize = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) - spaces, err := sessionPool.ShowSpaces() + spaces, err := sessionPool.ShowSpaces(ctx) if err != nil { t.Fatal(err) } @@ -643,24 +661,24 @@ func TestSessionPoolAddTTL(t *testing.T) { }, } - _, err = sessionPool.CreateTag(tagSchema) + _, err = sessionPool.CreateTag(ctx, tagSchema) if err != nil { t.Fatal(err) } // Add TTL to tag - _, err = sessionPool.AddTagTTL("user", "created_at", 5) + _, err = sessionPool.AddTagTTL(ctx, "user", "created_at", 5) if err != nil { t.Fatal(err) } - tags, err := sessionPool.ShowTags() + tags, err := sessionPool.ShowTags(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(tags)) assert.Equal(t, "user", tags[0].Name) - labels, err := sessionPool.DescTag("user") + labels, err := sessionPool.DescTag(ctx, "user") if err != nil { t.Fatal(err) } @@ -679,24 +697,24 @@ func TestSessionPoolAddTTL(t *testing.T) { }, } - _, err = sessionPool.CreateEdge(edgeSchema) + _, err = sessionPool.CreateEdge(ctx, edgeSchema) if err != nil { t.Fatal(err) } // Add TTL to edge - _, err = sessionPool.AddEdgeTTL("friend", "created_at", 3) + _, err = sessionPool.AddEdgeTTL(ctx, "friend", "created_at", 3) if err != nil { t.Fatal(err) } - edges, err := sessionPool.ShowEdges() + edges, err := sessionPool.ShowEdges(ctx) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(edges)) assert.Equal(t, "friend", edges[0].Name) - labels, err = sessionPool.DescEdge("friend") + labels, err = sessionPool.DescEdge(ctx, "friend") if err != nil { t.Fatal(err) } @@ -710,30 +728,30 @@ func TestSessionPoolAddTTL(t *testing.T) { now := time.Now().Unix() // Insert vertices and edges q := fmt.Sprintf(`INSERT VERTEX user(created_at) VALUES "test1":(%d);`, now) - _, err = sessionPool.ExecuteAndCheck(q) + _, err = sessionPool.ExecuteAndCheck(ctx, q) if err != nil { t.Fatal(err) } q = fmt.Sprintf(`INSERT VERTEX user(created_at) VALUES "test2":(%d);`, now) - _, err = sessionPool.ExecuteAndCheck(q) + _, err = sessionPool.ExecuteAndCheck(ctx, q) if err != nil { t.Fatal(err) } q = fmt.Sprintf(`INSERT EDGE friend(created_at) VALUES "test1" -> "test2":(%d);`, now) - _, err = sessionPool.ExecuteAndCheck(q) + _, err = sessionPool.ExecuteAndCheck(ctx, q) if err != nil { t.Fatal(err) } - rs, err := sessionPool.ExecuteAndCheck(`FETCH PROP ON friend "test1" -> "test2" YIELD edge AS e;`) + rs, err := sessionPool.ExecuteAndCheck(ctx, `FETCH PROP ON friend "test1" -> "test2" YIELD edge AS e;`) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(rs.GetRows())) // Sleep for 5 seconds to wait for the tag to be expired time.Sleep(5 * time.Second) - rs, err = sessionPool.ExecuteAndCheck(`FETCH PROP ON friend "test1" -> "test2" YIELD edge AS e;`) + rs, err = sessionPool.ExecuteAndCheck(ctx, `FETCH PROP ON friend "test1" -> "test2" YIELD edge AS e;`) if err != nil { t.Fatal(err) } @@ -741,11 +759,13 @@ func TestSessionPoolAddTTL(t *testing.T) { } func TestIdleSessionCleaner(t *testing.T) { - err := prepareSpace("client_test") + ctx := context.Background() + + err := prepareSpace(ctx, "client_test") if err != nil { t.Fatal(err) } - defer dropSpace("client_test") + defer dropSpace(ctx, "client_test") hostAddress := HostAddress{Host: address, Port: port} idleTimeoutConfig, err := NewSessionPoolConf( @@ -762,11 +782,11 @@ func TestIdleSessionCleaner(t *testing.T) { idleTimeoutConfig.maxSize = 100 // create session pool - sessionPool, err := NewSessionPool(*idleTimeoutConfig, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *idleTimeoutConfig, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) assert.Equal(t, 5, sessionPool.activeSessions.Len()+sessionPool.idleSessions.Len(), "Total number of sessions should be 5") @@ -777,7 +797,7 @@ func TestIdleSessionCleaner(t *testing.T) { for i := 0; i < sessionPool.conf.maxSize; i++ { go func(wg *sync.WaitGroup) { defer wg.Done() - _, err := sessionPool.Execute("RETURN 1") + _, err := sessionPool.Execute(ctx, "RETURN 1") if err != nil { t.Errorf(err.Error()) } @@ -799,11 +819,13 @@ func TestIdleSessionCleaner(t *testing.T) { } func TestRetryGetSession(t *testing.T) { - err := prepareSpace("client_test") + ctx := context.Background() + + err := prepareSpace(ctx, "client_test") if err != nil { t.Fatal(err) } - defer dropSpace("client_test") + defer dropSpace(ctx, "client_test") hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -819,14 +841,14 @@ func TestRetryGetSession(t *testing.T) { config.retryGetSessionTimes = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) // kill all sessions in the cluster - resultSet, err := sessionPool.Execute("SHOW SESSIONS | KILL SESSIONS $-.SessionId") + resultSet, err := sessionPool.Execute(ctx, "SHOW SESSIONS | KILL SESSIONS $-.SessionId") if err != nil { t.Fatal(err) } @@ -834,7 +856,7 @@ func TestRetryGetSession(t *testing.T) { resultSet.GetErrorCode(), resultSet.GetErrorMsg())) // execute query, it should retry to get session - resultSet, err = sessionPool.Execute("SHOW HOSTS;") + resultSet, err = sessionPool.Execute(ctx, "SHOW HOSTS;") if err != nil { t.Fatal(err) } @@ -843,11 +865,13 @@ func TestRetryGetSession(t *testing.T) { } func BenchmarkConcurrency(b *testing.B) { - err := prepareSpace("client_test") + ctx := context.Background() + + err := prepareSpace(ctx, "client_test") if err != nil { b.Fatal(err) } - defer dropSpace("client_test") + defer dropSpace(ctx, "client_test") // create session pool config hostAddress := HostAddress{Host: address, Port: port} @@ -863,11 +887,11 @@ func BenchmarkConcurrency(b *testing.B) { } // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { b.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) concurrencyLevels := []int{5, 10, 100, 1000} for _, clients := range concurrencyLevels { @@ -877,7 +901,7 @@ func BenchmarkConcurrency(b *testing.B) { for n := 0; n < clients; n++ { wg.Add(1) go func() { - _, err := sessionPool.Execute("SHOW HOSTS;") + _, err := sessionPool.Execute(ctx, "SHOW HOSTS;") if err != nil { b.Errorf(err.Error()) } @@ -893,11 +917,13 @@ func BenchmarkConcurrency(b *testing.B) { // retry when return the error code *ErrorCode_E_SESSION_INVALID* func TestSessionPoolRetry(t *testing.T) { - err := prepareSpace("client_test") + ctx := context.Background() + + err := prepareSpace(ctx, "client_test") if err != nil { t.Fatal(err) } - defer dropSpace("client_test") + defer dropSpace(ctx, "client_test") hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -913,11 +939,11 @@ func TestSessionPoolRetry(t *testing.T) { config.retryGetSessionTimes = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() + defer sessionPool.Close(ctx) testcaes := []struct { name string retryFn func(*pureSession) (*ResultSet, error) @@ -965,13 +991,13 @@ func TestSessionPoolRetry(t *testing.T) { }, } for _, tc := range testcaes { - session, err := sessionPool.newSession() + session, err := sessionPool.newSession(ctx) if err != nil { t.Fatal(err) } original := session.sessionID conn := session.connection - _, _ = sessionPool.executeWithRetry(session, tc.retryFn, 2) + _, _ = sessionPool.executeWithRetry(ctx, session, tc.retryFn, 2) if tc.retry { assert.NotEqual(t, original, session.sessionID, fmt.Sprintf("test case: %s", tc.name)) assert.NotEqual(t, conn, nil, fmt.Sprintf("test case: %s", tc.name)) @@ -982,11 +1008,13 @@ func TestSessionPoolRetry(t *testing.T) { } func TestSessionPoolClose(t *testing.T) { - err := prepareSpace("client_test") + ctx := context.Background() + + err := prepareSpace(ctx, "client_test") if err != nil { t.Fatal(err) } - defer dropSpace("client_test") + defer dropSpace(ctx, "client_test") hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( @@ -1002,21 +1030,23 @@ func TestSessionPoolClose(t *testing.T) { config.retryGetSessionTimes = 1 // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - sessionPool.Close() + sessionPool.Close(ctx) assert.Equal(t, 0, sessionPool.activeSessions.Len(), "Total number of active connections should be 0") assert.Equal(t, 0, sessionPool.idleSessions.Len(), "Total number of active connections should be 0") - _, err = sessionPool.Execute("SHOW HOSTS;") + _, err = sessionPool.Execute(ctx, "SHOW HOSTS;") assert.Equal(t, err.Error(), "failed to execute: Session pool has been closed", "session pool should be closed") } // TestSessionPoolGetSessionTimeout tests the scenario that if all requests are timeout, // the session pool should return timeout error, not reach the pool size limit. func TestQueryTimeout(t *testing.T) { + ctx := context.Background() + hostAddress := HostAddress{Host: address, Port: port} config, err := NewSessionPoolConf( "root", @@ -1031,13 +1061,13 @@ func TestQueryTimeout(t *testing.T) { config.retryGetSessionTimes = 1 config.timeOut = 100 * time.Millisecond // create session pool - sessionPool, err := NewSessionPool(*config, DefaultLogger{}) + sessionPool, err := NewSessionPool(ctx, *config, DefaultLogger{}) if err != nil { t.Fatal(err) } - defer sessionPool.Close() - createTestDataSchema(t, sessionPool) - loadTestData(t, sessionPool) + defer sessionPool.Close(ctx) + createTestDataSchema(ctx, t, sessionPool) + loadTestData(ctx, t, sessionPool) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) errCh := make(chan error, 1) defer cancel() @@ -1051,7 +1081,7 @@ func TestQueryTimeout(t *testing.T) { case <-ctx.Done(): return default: - _, err := sessionPool.Execute(`go 2000 step from "Bob" over like yield tags($$)`) + _, err := sessionPool.Execute(ctx, `go 2000 step from "Bob" over like yield tags($$)`) if err == nil { errCh <- fmt.Errorf("should return error") return diff --git a/session_test.go b/session_test.go index f61dffa8..ff58c71a 100644 --- a/session_test.go +++ b/session_test.go @@ -17,9 +17,11 @@ import ( ) func TestSession_Execute(t *testing.T) { + ctx := context.Background() + config := GetDefaultConf() host := HostAddress{address, port} - pool, err := NewConnectionPool([]HostAddress{host}, config, DefaultLogger{}) + pool, err := NewConnectionPool(ctx, []HostAddress{host}, config, DefaultLogger{}) if err != nil { t.Fatal(err) } @@ -27,7 +29,7 @@ func TestSession_Execute(t *testing.T) { f := func(s *Session) { time.Sleep(10 * time.Microsecond) - reps, err := s.Execute("yield 1") + reps, err := s.Execute(ctx, "yield 1") if err != nil { errCh <- err } @@ -36,7 +38,7 @@ func TestSession_Execute(t *testing.T) { } // test Ping() - err = s.Ping() + err = s.Ping(ctx) if err != nil { errCh <- err } @@ -44,7 +46,7 @@ func TestSession_Execute(t *testing.T) { ctx, cancel := context.WithTimeout(context.TODO(), 300*time.Millisecond) defer cancel() go func(ctx context.Context) { - sess, err := pool.GetSession("root", "nebula") + sess, err := pool.GetSession(ctx, "root", "nebula") if err != nil { errCh <- err } @@ -58,7 +60,7 @@ func TestSession_Execute(t *testing.T) { } }(ctx) go func(ctx context.Context) { - sess, err := pool.GetSession("root", "nebula") + sess, err := pool.GetSession(ctx, "root", "nebula") if err != nil { errCh <- err } @@ -83,22 +85,24 @@ func TestSession_Execute(t *testing.T) { } func TestSession_Recover(t *testing.T) { + ctx := context.Background() + query := "show hosts" config := GetDefaultConf() host := HostAddress{address, port} - pool, err := NewConnectionPool([]HostAddress{host}, config, DefaultLogger{}) + pool, err := NewConnectionPool(ctx, []HostAddress{host}, config, DefaultLogger{}) if err != nil { t.Fatal(err) } - sess, err := pool.GetSession("root", "nebula") + sess, err := pool.GetSession(ctx, "root", "nebula") if err != nil { t.Fatal(err) } assert.Equal(t, 1, pool.getActiveConnCount()+pool.getIdleConnCount()) go func() { for { - _, _ = sess.Execute(query) + _, _ = sess.Execute(ctx, query) } }() stopContainer(t, "nebula-docker-compose_graphd0_1") @@ -111,7 +115,7 @@ func TestSession_Recover(t *testing.T) { <-time.After(3 * time.Second) startContainer(t, "nebula-docker-compose_graphd0_1") <-time.After(3 * time.Second) - _, err = sess.Execute(query) + _, err = sess.Execute(ctx, query) if err != nil { t.Fatal(err) } @@ -119,14 +123,16 @@ func TestSession_Recover(t *testing.T) { } func TestSession_CreateSpace_ShowSpaces(t *testing.T) { + ctx := context.Background() + config := GetDefaultConf() host := HostAddress{address, port} - pool, err := NewConnectionPool([]HostAddress{host}, config, DefaultLogger{}) + pool, err := NewConnectionPool(ctx, []HostAddress{host}, config, DefaultLogger{}) if err != nil { t.Fatal(err) } - sess, err := pool.GetSession("root", "nebula") + sess, err := pool.GetSession(ctx, "root", "nebula") if err != nil { t.Fatal(err) } @@ -140,19 +146,19 @@ func TestSession_CreateSpace_ShowSpaces(t *testing.T) { VidType: "FIXED_STRING(12)", } - _, err = sess.CreateSpace(conf) + _, err = sess.CreateSpace(ctx, conf) if err != nil { t.Fatal(err) } conf.IgnoreIfExists = true // Create again should work - _, err = sess.CreateSpace(conf) + _, err = sess.CreateSpace(ctx, conf) if err != nil { t.Fatal(err) } - spaceNames, err := sess.ShowSpaces() + spaceNames, err := sess.ShowSpaces(ctx) if err != nil { t.Fatal(err) } diff --git a/ssl_connection_test.go b/ssl_connection_test.go index 35abad40..8a2dfaa7 100644 --- a/ssl_connection_test.go +++ b/ssl_connection_test.go @@ -12,12 +12,15 @@ package nebula_go import ( + "context" "os" "testing" "time" ) func TestSslConnection(t *testing.T) { + ctx := context.Background() + // skip test when ssl_test is not set to true skipSsl(t) @@ -44,7 +47,7 @@ func TestSslConnection(t *testing.T) { sslConfig.InsecureSkipVerify = false // Initialize connection pool - pool, err := NewSslConnectionPool(hostList, testPoolConfig, sslConfig, nebulaLog) + pool, err := NewSslConnectionPool(ctx, hostList, testPoolConfig, sslConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -52,28 +55,28 @@ func TestSslConnection(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) } - defer session.Release() + defer session.Release(ctx) // Execute a query - resp, err := tryToExecute(session, "SHOW HOSTS;") + resp, err := tryToExecute(ctx, session, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "show hosts", resp) // Create a new space - resp, err = tryToExecute(session, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") + resp, err = tryToExecute(ctx, session, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "create space", resp) - resp, err = tryToExecute(session, "DROP SPACE client_test;") + resp, err = tryToExecute(ctx, session, "DROP SPACE client_test;") if err != nil { t.Fatalf(err.Error()) return @@ -83,6 +86,8 @@ func TestSslConnection(t *testing.T) { // TODO: generate certificate with hostName info and disable InsecureSkipVerify func TestSslConnectionSelfSigned(t *testing.T) { + ctx := context.Background() + // skip test when ssl_test is not set to true skipSslSelfSigned(t) @@ -109,7 +114,7 @@ func TestSslConnectionSelfSigned(t *testing.T) { sslConfig.InsecureSkipVerify = false // Initialize connection pool - pool, err := NewSslConnectionPool(hostList, testPoolConfig, sslConfig, nebulaLog) + pool, err := NewSslConnectionPool(ctx, hostList, testPoolConfig, sslConfig, nebulaLog) if err != nil { t.Fatalf("fail to initialize the connection pool, host: %s, port: %d, %s", address, port, err.Error()) } @@ -117,28 +122,28 @@ func TestSslConnectionSelfSigned(t *testing.T) { defer pool.Close() // Create session - session, err := pool.GetSession(username, password) + session, err := pool.GetSession(ctx, username, password) if err != nil { t.Fatalf("fail to create a new session from connection pool, username: %s, password: %s, %s", username, password, err.Error()) } - defer session.Release() + defer session.Release(ctx) // Execute a query - resp, err := tryToExecute(session, "SHOW HOSTS;") + resp, err := tryToExecute(ctx, session, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "show hosts", resp) // Create a new space - resp, err = tryToExecute(session, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") + resp, err = tryToExecute(ctx, session, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "create space", resp) - resp, err = tryToExecute(session, "DROP SPACE client_test;") + resp, err = tryToExecute(ctx, session, "DROP SPACE client_test;") if err != nil { t.Fatalf(err.Error()) return diff --git a/ssl_sessionpool_test.go b/ssl_sessionpool_test.go index 87197f6f..70bbad72 100644 --- a/ssl_sessionpool_test.go +++ b/ssl_sessionpool_test.go @@ -12,11 +12,14 @@ package nebula_go import ( + "context" "testing" "time" ) func TestSslSessionPool(t *testing.T) { + ctx := context.Background() + skipSsl(t) hostAddress := HostAddress{Host: address, Port: port} @@ -46,26 +49,26 @@ func TestSslSessionPool(t *testing.T) { if err != nil { t.Fatal(err) } - pool, err := NewSessionPool(*conf, nebulaLog) + pool, err := NewSessionPool(ctx, *conf, nebulaLog) if err != nil { t.Fatal(err) } - defer pool.Close() - resp, err := pool.Execute("SHOW HOSTS;") + defer pool.Close(ctx) + resp, err := pool.Execute(ctx, "SHOW HOSTS;") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "show hosts", resp) // Create a new space - resp, err = pool.Execute("CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") + resp, err = pool.Execute(ctx, "CREATE SPACE client_test(partition_num=1024, replica_factor=1, vid_type = FIXED_STRING(30));") if err != nil { t.Fatalf(err.Error()) return } checkResultSet(t, "create space", resp) - resp, err = pool.Execute("DROP SPACE client_test;") + resp, err = pool.Execute(ctx, "DROP SPACE client_test;") if err != nil { t.Fatalf(err.Error()) return diff --git a/thriftfiles/common.thrift b/thriftfiles/common.thrift new file mode 100644 index 00000000..a60263f9 --- /dev/null +++ b/thriftfiles/common.thrift @@ -0,0 +1,547 @@ +/* vim: ft=proto + * Copyright (c) 2018 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + + +namespace go nebula + + +/* + * + * Note: In order to support multiple languages, all strings + * have to be defined as **binary** in the thrift file + * + */ + +const binary (cpp.type = "char const *") version = "3.0.0" + +typedef i64 (cpp.type = "nebula::ClusterID") ClusterID +typedef i32 (cpp.type = "nebula::GraphSpaceID") GraphSpaceID +typedef i32 (cpp.type = "nebula::PartitionID") PartitionID +typedef i32 (cpp.type = "nebula::TagID") TagID +typedef i32 (cpp.type = "nebula::EdgeType") EdgeType +typedef i64 (cpp.type = "nebula::EdgeRanking") EdgeRanking +typedef i64 (cpp.type = "nebula::LogID") LogID +typedef i64 (cpp.type = "nebula::TermID") TermID + +typedef i64 (cpp.type = "nebula::Timestamp") Timestamp + +typedef i32 (cpp.type = "nebula::IndexID") IndexID + +typedef i32 (cpp.type = "nebula::Port") Port + +typedef i64 (cpp.type = "nebula::SessionID") SessionID + +typedef i64 (cpp.type = "nebula::ExecutionPlanID") ExecutionPlanID + +union SchemaID { + 1: TagID tag_id, + 2: EdgeType edge_type, +} + +// !! Struct Date has a shadow data type defined in the Date.h +// So any change here needs to be reflected to the shadow type there +struct Date { + 1: i16 year; // Calendar year, such as 2019 + 2: byte month; // Calendar month: 1 - 12 + 3: byte day; // Calendar day: 1 -31 +} (cpp.type = "nebula::Date") + +// !! Struct Time has a shadow data type defined in the Date.h +// So any change here needs to be reflected to the shadow type there +struct Time { + 1: byte hour; // Hour: 0 - 23 + 2: byte minute; // Minute: 0 - 59 + 3: byte sec; // Second: 0 - 59 + 4: i32 microsec; // Micro-second: 0 - 999,999 +} (cpp.type = "nebula::Time") + +// !! Struct DateTime has a shadow data type defined in the Date.h +// So any change here needs to be reflected to the shadow type there +struct DateTime { + 1: i16 year; + 2: byte month; + 3: byte day; + 4: byte hour; // Hour: 0 - 23 + 5: byte minute; // Minute: 0 - 59 + 6: byte sec; // Second: 0 - 59 + 7: i32 microsec; // Micro-second: 0 - 999,999 +} (cpp.type = "nebula::DateTime") + +enum NullType { + __NULL__ = 0, + NaN = 1, + BAD_DATA = 2, + BAD_TYPE = 3, + ERR_OVERFLOW = 4, + UNKNOWN_PROP = 5, + DIV_BY_ZERO = 6, + OUT_OF_RANGE = 7, +} (cpp.enum_strict, cpp.type = "nebula::NullType") + + +// The type to hold any supported values during the query +union Value { + 1: NullType nVal; + 2: bool bVal; + 3: i64 iVal; + 4: double fVal; + 5: binary sVal; + 6: Date dVal; + 7: Time tVal; + 8: DateTime dtVal; + 9: Vertex vVal (cpp.ref_type = "unique"); + 10: Edge eVal (cpp.ref_type = "unique"); + 11: Path pVal (cpp.ref_type = "unique"); + 12: NList lVal (cpp.ref_type = "unique"); + 13: NMap mVal (cpp.ref_type = "unique"); + 14: NSet uVal (cpp.ref_type = "unique"); + 15: DataSet gVal (cpp.ref_type = "unique"); + 16: Geography ggVal (cpp.ref_type = "unique"); + 17: Duration duVal (cpp.ref_type = "unique"); +} (cpp.type = "nebula::Value") + + +// Ordered list +struct NList { + 1: list values; +} (cpp.type = "nebula::List") + + +// Unordered key/values pairs +struct NMap { + 1: map (cpp.template = "std::unordered_map") kvs; +} (cpp.type = "nebula::Map") + + +// Unordered and unique values +struct NSet { + 1: set (cpp.template = "std::unordered_set") values; +} (cpp.type = "nebula::Set") + + +struct Row { + 1: list values; +} (cpp.type = "nebula::Row") + + +struct DataSet { + 1: list column_names; // Column names + 2: list rows; +} (cpp.type = "nebula::DataSet") + +struct Coordinate { + 1: double x; + 2: double y; +} (cpp.type = "nebula::Coordinate") + +struct Point { + 1: Coordinate coord; +} (cpp.type = "nebula::Point") + +struct LineString { + 1: list coordList; +} (cpp.type = "nebula::LineString") + +struct Polygon { + 1: list> coordListList; +} (cpp.type = "nebula::Polygon") + +union Geography { + 1: Point ptVal (cpp.ref_type = "unique"); + 2: LineString lsVal (cpp.ref_type = "unique"); + 3: Polygon pgVal (cpp.ref_type = "unique"); +} (cpp.type = "nebula::Geography") + + +struct Tag { + 1: binary name, + // List of + 2: map (cpp.template = "std::unordered_map") props, +} (cpp.type = "nebula::Tag") + + +struct Vertex { + 1: Value vid, + 2: list tags, +} (cpp.type = "nebula::Vertex") + + +struct Edge { + 1: Value src, + 2: Value dst, + 3: EdgeType type, + 4: binary name, + 5: EdgeRanking ranking, + // List of + 6: map (cpp.template = "std::unordered_map") props, +} (cpp.type = "nebula::Edge") + + +struct Step { + 1: Vertex dst, + 2: EdgeType type, + 3: binary name, + 4: EdgeRanking ranking, + 5: map (cpp.template = "std::unordered_map") props, +} (cpp.type = "nebula::Step") + + +// Special type to support path during the query +struct Path { + 1: Vertex src, + 2: list steps; +} (cpp.type = "nebula::Path") + + +struct HostAddr { + // Host could be a valid IPv4 or IPv6 address, or a valid domain name + 1: string host, + 2: Port port, +} (cpp.type = "nebula::HostAddr") + + +struct KeyValue { + 1: binary key, + 2: binary value, +} (cpp.type = "nebula::KeyValue") + +// !! Struct Duration has a shadow data type defined in the Duration.h +// So any change here needs to be reflected to the shadow type there +struct Duration { + 1: i64 seconds; + 2: i32 microseconds; + 3: i32 months; +} (cpp.type = "nebula::Duration") + +struct LogInfo { + 1: LogID log_id, + 2: TermID term_id, + 3: LogID commit_log_id, + // storage part checkpoint directory name + 4: binary checkpoint_path, +} + +struct DirInfo { + // Installation directory for nebula + 1: binary root, + // nebula's data directory + 2: list data, +} + +struct CheckpointInfo { + 1: GraphSpaceID space_id, + // Only part of the leader + 2: map (cpp.template = "std::unordered_map") parts, + // The datapath corresponding to the current checkpointInfo + 3: binary data_path, +} + +// used for drainer +struct LogEntry { + 1: ClusterID cluster; + 2: binary log_str; +} + +// These are all data types supported in the graph properties +enum PropertyType { + UNKNOWN = 0, + + // Simple types + BOOL = 1, + INT64 = 2, // This is the same as INT in v1 + VID = 3, // Deprecated, only supported by v1 + FLOAT = 4, + DOUBLE = 5, + STRING = 6, + // String with fixed length. If the string content is shorter + // than the given length, '\0' will be padded to the end + FIXED_STRING = 7, // New in v2 + INT8 = 8, // New in v2 + INT16 = 9, // New in v2 + INT32 = 10, // New in v2 + + // Date time + TIMESTAMP = 21, + DURATION = 23, + DATE = 24, + DATETIME = 25, + TIME = 26, + + // Geo spatial + GEOGRAPHY = 31, +} (cpp.enum_strict) + +/* + * ErrorCode for graphd, metad, storaged,raftd + * -1xxx for graphd + * -2xxx for metad + * -3xxx for storaged + */ +enum ErrorCode { + // for common code + SUCCEEDED = 0, + + E_DISCONNECTED = -1, // Lost connection + E_FAIL_TO_CONNECT = -2, // Unable to establish connection + E_RPC_FAILURE = -3, // RPC failure + E_LEADER_CHANGED = -4, // Raft leader has been changed + + // only unify metad and storaged error code + E_SPACE_NOT_FOUND = -5, // Graph space does not exist + E_TAG_NOT_FOUND = -6, // Tag does not exist + E_EDGE_NOT_FOUND = -7, // Edge type does not exist + E_INDEX_NOT_FOUND = -8, // Index does not exist + E_EDGE_PROP_NOT_FOUND = -9, // Edge type property does not exist + E_TAG_PROP_NOT_FOUND = -10, // Tag property does not exist + E_ROLE_NOT_FOUND = -11, // The current role does not exist + E_CONFIG_NOT_FOUND = -12, // The current configuration does not exist + E_MACHINE_NOT_FOUND = -13, // The current host does not exist + E_ZONE_NOT_FOUND = -14, // The zone does not exist + E_LISTENER_NOT_FOUND = -15, // Listener does not exist + E_PART_NOT_FOUND = -16, // The current partition does not exist + E_KEY_NOT_FOUND = -17, // Key does not exist + E_USER_NOT_FOUND = -18, // User does not exist + E_STATS_NOT_FOUND = -19, // Statistics do not exist + E_SERVICE_NOT_FOUND = -20, // No current service found + E_DRAINER_NOT_FOUND = -21, // Drainer does not exist[only ent] + E_DRAINER_CLIENT_NOT_FOUND = -22, // Drainer client does not exist[only ent] + E_PART_STOPPED = -23, // The current partition has already been stopped[only ent] + + // backup failed + E_BACKUP_FAILED = -24, // Backup failed + E_BACKUP_EMPTY_TABLE = -25, // The backed-up table is empty + E_BACKUP_TABLE_FAILED = -26, // Table backup failure + E_PARTIAL_RESULT = -27, // MultiGet could not get all data + E_REBUILD_INDEX_FAILED = -28, // Index rebuild failed + E_INVALID_PASSWORD = -29, // Password is invalid + E_FAILED_GET_ABS_PATH = -30, // Unable to get absolute path + E_LISTENER_PROGRESS_FAILED = -31, // Get listener sync progress failed[only ent] + E_SYNC_LISTENER_NOT_FOUND = -32, // Sync Listener does not exist[only ent] + E_DRAINER_PROGRESS_FAILED = -33, // Get drainer sync progress failed[only ent] + + E_PART_DISABLED = -34, // [only ent] + E_PART_ALREADY_STARTED = -35, // [only ent] + E_PART_ALREADY_STOPPED = -36, // [only ent] + + // 1xxx for graphd + E_BAD_USERNAME_PASSWORD = -1001, // Authentication failed + E_SESSION_INVALID = -1002, // Invalid session + E_SESSION_TIMEOUT = -1003, // Session timeout + E_SYNTAX_ERROR = -1004, // Syntax error + E_EXECUTION_ERROR = -1005, // Execution error + E_STATEMENT_EMPTY = -1006, // Statement is empty + + E_BAD_PERMISSION = -1008, // Wrong permission + E_SEMANTIC_ERROR = -1009, // Semantic error + E_TOO_MANY_CONNECTIONS = -1010, // Maximum number of connections exceeded + E_PARTIAL_SUCCEEDED = -1011, // Access to storage failed (only some requests succeeded) + + // 2xxx for metad + E_NO_HOSTS = -2001, // Host does not exist + E_EXISTED = -2002, // Host already exists + E_INVALID_HOST = -2003, // Invalid host + E_UNSUPPORTED = -2004, // The current command, statement, or function is not supported + E_NOT_DROP = -2005, // Not allowed to drop + E_BALANCER_RUNNING = -2006, // The balancer is running + E_CONFIG_IMMUTABLE = -2007, // Configuration items cannot be changed + E_CONFLICT = -2008, // Parameters conflict with meta data + E_INVALID_PARM = -2009, // Invalid parameter + E_WRONGCLUSTER = -2010, // Wrong cluster + E_ZONE_NOT_ENOUGH = -2011, // Host is not enough + E_ZONE_IS_EMPTY = -2012, // Host does not exist + E_LISTENER_CONFLICT = -2013, // Listener conflicts[only ent] + E_SCHEMA_NAME_EXISTS = -2014, // Schema name already exists + E_RELATED_INDEX_EXISTS = -2015, // There are still indexes related to tag or edge, cannot drop it + E_RELATED_SPACE_EXISTS = -2016, // There are still some space on the host, cannot drop it + E_RELATED_FULLTEXT_INDEX_EXISTS = -2017, // There are still fulltext index on tag/edge + E_HISTORY_CONFLICT = -2018, // Existed before (e.g., schema) + + E_STORE_FAILURE = -2021, // Failed to store data + E_STORE_SEGMENT_ILLEGAL = -2022, // Illegal storage segment + E_BAD_BALANCE_PLAN = -2023, // Invalid data balancing plan + E_BALANCED = -2024, // The cluster is already in the data balancing status + E_NO_RUNNING_BALANCE_PLAN = -2025, // There is no running data balancing plan + E_NO_VALID_HOST = -2026, // Lack of valid hosts + E_CORRUPTED_BALANCE_PLAN = -2027, // A data balancing plan that has been corrupted + E_NO_INVALID_BALANCE_PLAN = -2028, // No invalid balance plan + E_NO_VALID_DRAINER = -2029, // Lack of valid drainers[only ent] + + + // Authentication Failure + E_IMPROPER_ROLE = -2030, // Failed to recover user role + E_INVALID_PARTITION_NUM = -2031, // Number of invalid partitions + E_INVALID_REPLICA_FACTOR = -2032, // Invalid replica factor + E_INVALID_CHARSET = -2033, // Invalid character set + E_INVALID_COLLATE = -2034, // Invalid character sorting rules + E_CHARSET_COLLATE_NOT_MATCH = -2035, // Character set and character sorting rule mismatch + E_PRIVILEGE_ALL_TAG_EDGE_SETTLED = -2036, // drop all tag/edge before do some grant/revoke[only ent] + E_PRIVILEGE_NOT_EXIST = -2037, // remove un-exist privilege[only ent] + E_PRIVILEGE_NEED_BASIC_ROLE = -2038, // only basic role support tag/edge privilege[only ent] + E_PRIVILEGE_ACTION_INVALID = -2039, // only add and drop now.[only ent] + + // Admin Failure + E_SNAPSHOT_FAILURE = -2040, // Failed to generate a snapshot + E_SNAPSHOT_RUNNING_JOBS = -2056, // Failed to generate a snapshot because encounter running jobs + E_SNAPSHOT_NOT_FOUND = -2057, // Snapshot not found when try to drop it + E_BLOCK_WRITE_FAILURE = -2041, // Failed to write block data + E_REBUILD_INDEX_FAILURE = -2042, + E_INDEX_WITH_TTL = -2043, + E_ADD_JOB_FAILURE = -2044, // Failed to add new task + E_STOP_JOB_FAILURE = -2045, // Failed to stop task + E_SAVE_JOB_FAILURE = -2046, // Failed to save task information + E_BALANCER_FAILURE = -2047, // Data balancing failed + E_JOB_NOT_FINISHED = -2048, // The current task has not been completed + E_TASK_REPORT_OUT_DATE = -2049, // Task report failed + E_JOB_NOT_IN_SPACE = -2050, // The current task is not in the graph space + E_JOB_NEED_RECOVER = -2051, // The current task needs to be resumed + E_JOB_ALREADY_FINISH = -2052, // The job status has already been failed or finished + E_JOB_SUBMITTED = -2053, // Job default status. + E_JOB_NOT_STOPPABLE = -2054, // The given job do not support stop + E_JOB_HAS_NO_TARGET_STORAGE = -2055, // The leader distribution has not been reported, so can't send task to storage + E_INVALID_JOB = -2065, // Invalid task + + // Backup Failure + E_BACKUP_RUNNING_JOBS = -2066, // Backup terminated (some data modification jobs running) + E_BACKUP_SPACE_NOT_FOUND = -2067, // Graph space does not exist at the time of backup + + // RESTORE Failure + E_RESTORE_FAILURE = -2068, // Backup recovery failed + + E_SESSION_NOT_FOUND = -2069, // Session does not exist + + // ListClusterInfo Failure + E_LIST_CLUSTER_FAILURE = -2070, // Failed to get cluster information + E_LIST_CLUSTER_GET_ABS_PATH_FAILURE = -2071, // Failed to get absolute path when getting cluster information + E_LIST_CLUSTER_NO_AGENT_FAILURE = -2072, // Unable to get an agent when getting cluster information + + E_QUERY_NOT_FOUND = -2073, // Query not found + E_AGENT_HB_FAILUE = -2074, // Failed to receive heartbeat from agent + + E_INVALID_VARIABLE = -2080, // [only ent] + E_VARIABLE_TYPE_VALUE_MISMATCH = -2081, // [only ent] + E_HOST_CAN_NOT_BE_ADDED = -2082, // the host can not be added for it's not a storage host + + E_ACCESS_ES_FAILURE = -2090, // Failed to access elasticsearch + + E_GRAPH_MEMORY_EXCEEDED = -2600, // Graph memory exceeded + + // 3xxx for storaged + E_CONSENSUS_ERROR = -3001, // Consensus cannot be reached during an election + E_KEY_HAS_EXISTS = -3002, // Key already exists + E_DATA_TYPE_MISMATCH = -3003, // Data type mismatch + E_INVALID_FIELD_VALUE = -3004, // Invalid field value + E_INVALID_OPERATION = -3005, // Invalid operation + E_NOT_NULLABLE = -3006, // Current value is not allowed to be empty + E_FIELD_UNSET = -3007, // Field value must be set if the field value is NOT NULL or has no default value + E_OUT_OF_RANGE = -3008, // The value is out of the range of the current type + E_DATA_CONFLICT_ERROR = -3010, // Data conflict, for index write without toss. + + E_WRITE_STALLED = -3011, // Writes are delayed + + // meta failures + E_IMPROPER_DATA_TYPE = -3021, // Incorrect data type + E_INVALID_SPACEVIDLEN = -3022, // Invalid VID length + + // Invalid request + E_INVALID_FILTER = -3031, // Invalid filter + E_INVALID_UPDATER = -3032, // Invalid field update + E_INVALID_STORE = -3033, // Invalid KV storage + E_INVALID_PEER = -3034, // Peer invalid + E_RETRY_EXHAUSTED = -3035, // Out of retries + E_TRANSFER_LEADER_FAILED = -3036, // Leader change failed + E_INVALID_STAT_TYPE = -3037, // Invalid stat type + E_INVALID_VID = -3038, // VID is invalid + E_NO_TRANSFORMED = -3039, + + // meta client failed + E_LOAD_META_FAILED = -3040, // Failed to load meta information + + // checkpoint failed + E_FAILED_TO_CHECKPOINT = -3041, // Failed to generate checkpoint + E_CHECKPOINT_BLOCKED = -3042, // Generating checkpoint is blocked + + // Filter out + E_FILTER_OUT = -3043, // Data is filtered + E_INVALID_DATA = -3044, // Invalid data + + E_MUTATE_EDGE_CONFLICT = -3045, // Concurrent write conflicts on the same edge + E_MUTATE_TAG_CONFLICT = -3046, // Concurrent write conflict on the same vertex + + // transaction + E_OUTDATED_LOCK = -3047, // Lock is invalid + + // task manager failed + E_INVALID_TASK_PARA = -3051, // Invalid task parameter + E_USER_CANCEL = -3052, // The user canceled the task + E_TASK_EXECUTION_FAILED = -3053, // Task execution failed + E_PLAN_IS_KILLED = -3060, // Execution plan was cleared + + // toss + E_NO_TERM = -3070, // The heartbeat process was not completed when the request was received + E_OUTDATED_TERM = -3071, // Out-of-date heartbeat received from the old leader (the new leader has been elected) + E_OUTDATED_EDGE = -3072, + E_WRITE_WRITE_CONFLICT = -3073, // Concurrent write conflicts with later requests + + E_CLIENT_SERVER_INCOMPATIBLE = -3061, // Client and server versions are not compatible + E_ID_FAILED = -3062, // Failed to get ID serial number + + // 35xx for storaged raft + E_RAFT_UNKNOWN_PART = -3500, // Unknown partition + + // Raft consensus errors + E_RAFT_LOG_GAP = -3501, // Raft logs lag behind + E_RAFT_LOG_STALE = -3502, // Raft logs are out of date + E_RAFT_TERM_OUT_OF_DATE = -3503, // Heartbeat messages are out of date + E_RAFT_UNKNOWN_APPEND_LOG = -3504, // Unknown additional logs + + // Raft state errors + E_RAFT_WAITING_SNAPSHOT = -3511, // Waiting for the snapshot to complete + E_RAFT_SENDING_SNAPSHOT = -3512, // There was an error sending the snapshot + E_RAFT_INVALID_PEER = -3513, // Invalid receiver + E_RAFT_NOT_READY = -3514, // Raft did not start + E_RAFT_STOPPED = -3515, // Raft has stopped + E_RAFT_BAD_ROLE = -3516, // Wrong role + + // Local errors + E_RAFT_WAL_FAIL = -3521, // Write to a WAL failed + E_RAFT_HOST_STOPPED = -3522, // The host has stopped + E_RAFT_TOO_MANY_REQUESTS = -3523, // Too many requests + E_RAFT_PERSIST_SNAPSHOT_FAILED = -3524, // Persistent snapshot failed + E_RAFT_RPC_EXCEPTION = -3525, // RPC exception + E_RAFT_NO_WAL_FOUND = -3526, // No WAL logs found + E_RAFT_HOST_PAUSED = -3527, // Host suspended + E_RAFT_WRITE_BLOCKED = -3528, // Writes are blocked + E_RAFT_BUFFER_OVERFLOW = -3529, // Cache overflow + E_RAFT_ATOMIC_OP_FAILED = -3530, // Atomic operation failed + E_LEADER_LEASE_FAILED = -3531, // Leader lease expired + E_RAFT_CAUGHT_UP = -3532, // Data has been synchronized on Raft[only ent] + + // 4xxx for drainer + E_LOG_GAP = -4001, // Drainer logs lag behind[only ent] + E_LOG_STALE = -4002, // Drainer logs are out of date[only ent] + E_INVALID_DRAINER_STORE = -4003, // The drainer data storage is invalid[only ent] + E_SPACE_MISMATCH = -4004, // Graph space mismatch[only ent] + E_PART_MISMATCH = -4005, // Partition mismatch[only ent] + E_DATA_CONFLICT = -4006, // Data conflict[only ent] + E_REQ_CONFLICT = -4007, // Request conflict[only ent] + E_DATA_ILLEGAL = -4008, // Illegal data[only ent] + + // 5xxx for cache + E_CACHE_CONFIG_ERROR = -5001, // Cache configuration error[only ent] + E_NOT_ENOUGH_SPACE = -5002, // Insufficient space[only ent] + E_CACHE_MISS = -5003, // No cache hit[only ent] + E_POOL_NOT_FOUND = -5004, // [only ent] + E_CACHE_WRITE_FAILURE = -5005, // Write cache failed[only ent] + + // 7xxx for nebula enterprise + // license related + E_NODE_NUMBER_EXCEED_LIMIT = -7001, // Number of machines exceeded the limit[only ent] + E_PARSING_LICENSE_FAILURE = -7002, // Failed to resolve certificate[only ent] + + E_STORAGE_MEMORY_EXCEEDED = -3600, // Storage memory exceeded + + E_UNKNOWN = -8000, // Unknown error +} (cpp.enum_strict) diff --git a/thriftfiles/graph.thrift b/thriftfiles/graph.thrift new file mode 100644 index 00000000..319e430e --- /dev/null +++ b/thriftfiles/graph.thrift @@ -0,0 +1,119 @@ +/* vim: ft=proto + * Copyright (c) 2018 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +namespace go nebula.graph + +include "common.thrift" + +cpp_include "common/graph/PairOps-inl.h" +cpp_include "common/graph/ProfilingStatsOps-inl.h" +cpp_include "common/graph/PlanNodeBranchInfoOps-inl.h" +cpp_include "common/graph/PlanNodeDescriptionOps-inl.h" +cpp_include "common/graph/PlanDescriptionOps-inl.h" +cpp_include "common/graph/ExecutionResponseOps-inl.h" +cpp_include "common/graph/AuthResponseOps-inl.h" + +/* + * + * Note: In order to support multiple languages, all string + * have to be defined as **binary** in the thrift file + * + */ + +struct ProfilingStats { + // How many rows being processed in an executor. + 1: required i64 rows; + // Duration spent in an executor. + 2: required i64 exec_duration_in_us; + // Total duration spent in an executor, contains schedule time + 3: required i64 total_duration_in_us; + // Other profiling stats data map + 4: optional map + (cpp.template = "std::unordered_map") other_stats; +} (cpp.type = "nebula::ProfilingStats", cpp.noncopyable) + +// The info used for select/loop. +struct PlanNodeBranchInfo { + // True if loop body or then branch of select + 1: required bool is_do_branch; + // select/loop node id + 2: required i64 condition_node_id; +} (cpp.type = "nebula::PlanNodeBranchInfo") + +struct Pair { + 1: required binary key; + 2: required binary value; +} (cpp.type = "nebula::Pair") + +struct PlanNodeDescription { + 1: required binary name; + 2: required i64 id; + 3: required binary output_var; + // other description of an executor + 4: optional list description; + // If an executor would be executed multi times, + // the profiling statistics should be multi-versioned. + 5: optional list profiles; + 6: optional PlanNodeBranchInfo branch_info; + 7: optional list dependencies; +} (cpp.type = "nebula::PlanNodeDescription", cpp.noncopyable) + +struct PlanDescription { + 1: required list plan_node_descs; + // map from node id to index of list + 2: required map + (cpp.template = "std::unordered_map") node_index_map; + // the print format of exec plan, lowercase string like `dot' + 3: required binary format; + // the time optimizer spent + 4: required i32 optimize_time_in_us; +} (cpp.type = "nebula::PlanDescription", cpp.noncopyable) + + +struct ExecutionResponse { + 1: required common.ErrorCode error_code; + 2: required i64 latency_in_us; // Execution time on server + 3: optional common.DataSet data; + 4: optional binary space_name; + 5: optional binary error_msg; + 6: optional PlanDescription plan_desc; + 7: optional binary comment; // Supplementary instruction +} (cpp.type = "nebula::ExecutionResponse", cpp.noncopyable) + + +struct AuthResponse { + 1: required common.ErrorCode error_code; + 2: optional binary error_msg; + 3: optional i64 session_id; + 4: optional i32 time_zone_offset_seconds; + 5: optional binary time_zone_name; +} (cpp.type = "nebula::AuthResponse", cpp.noncopyable) + + +struct VerifyClientVersionResp { + 1: required common.ErrorCode error_code; + 2: optional binary error_msg; +} + + +struct VerifyClientVersionReq { + 1: required binary version = common.version; +} + + +service GraphService { + AuthResponse authenticate(1: binary username, 2: binary password) + + oneway void signout(1: i64 sessionId) + + ExecutionResponse execute(1: i64 sessionId, 2: binary stmt) + ExecutionResponse executeWithParameter(1: i64 sessionId, 2: binary stmt, 3: map(cpp.template = "std::unordered_map") parameterMap) + // Same as execute(), but response will be a json string + binary executeJson(1: i64 sessionId, 2: binary stmt) + binary executeJsonWithParameter(1: i64 sessionId, 2: binary stmt, 3: map(cpp.template = "std::unordered_map") parameterMap) + + VerifyClientVersionResp verifyClientVersion(1: VerifyClientVersionReq req) +} diff --git a/thriftfiles/meta.thrift b/thriftfiles/meta.thrift new file mode 100644 index 00000000..967faf9d --- /dev/null +++ b/thriftfiles/meta.thrift @@ -0,0 +1,1310 @@ +/* Copyright (c) 2018 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +namespace go nebula.meta + +include "common.thrift" + +/* + * + * Note: In order to support multiple languages, all strings + * have to be defined as **binary** in the thrift file + * + */ + +typedef i64 (cpp.type = "nebula::SchemaVer") SchemaVer + +typedef i64 (cpp.type = "nebula::ClusterID") ClusterID + +enum AlterSchemaOp { + ADD = 0x01, + CHANGE = 0x02, + DROP = 0x03, + UNKNOWN = 0x04, +} (cpp.enum_strict) + +/* + * GOD is A global senior administrator.like root of Linux systems. + * ADMIN is an administrator for a given Graph Space. + * USER is a normal user for a given Graph Space. A User can access (read and write) + * the data in the Graph Space. + * GUEST is a read-only role for a given Graph Space. A Guest cannot modify the data + * in the Graph Space. + * + * Refer to header file src/graph/PermissionManager.h for details. + */ + +enum RoleType { + GOD = 0x01, + ADMIN = 0x02, + DBA = 0x03, + USER = 0x04, + GUEST = 0x05, +} (cpp.enum_strict) + + +union ID { + 1: common.GraphSpaceID space_id, + 2: common.TagID tag_id, + 3: common.EdgeType edge_type, + 4: common.IndexID index_id, + 5: ClusterID cluster_id, +} + + +// Geo shape type +enum GeoShape { + ANY = 0, + POINT = 1, + LINESTRING = 2, + POLYGON = 3, +} (cpp.enum_strict) + + +struct ColumnTypeDef { + 1: required common.PropertyType type, + // type_length is valid for fixed_string type + 2: optional i16 type_length = 0, + // geo_shape is valid for geography type + 3: optional GeoShape geo_shape, +} + +struct ColumnDef { + 1: required binary name, + 2: required ColumnTypeDef type, + 3: optional binary default_value, + 4: optional bool nullable = false, + 5: optional binary comment, +} + +struct SchemaProp { + 1: optional i64 ttl_duration, + 2: optional binary ttl_col, + 3: optional binary comment, +} + +struct Schema { + 1: list columns, + 2: SchemaProp schema_prop, +} + +struct IdName { + 1: ID id, + 2: binary name, +} + +enum IsolationLevel { + DEFAULT = 0x00, // allow add half edge(either in or out edge succeeded) + TOSS = 0x01, // add in and out edge atomic +} (cpp.enum_strict) + +struct SpaceDesc { + 1: binary space_name, + 2: i32 partition_num = 0, + 3: i32 replica_factor = 0, + 4: binary charset_name, + 5: binary collate_name, + 6: ColumnTypeDef vid_type = {"type": common.PropertyType.FIXED_STRING, "type_length": 8}, + 7: list zone_names, + 8: optional IsolationLevel isolation_level, + 9: optional binary comment, +} + +struct SpaceItem { + 1: common.GraphSpaceID space_id, + 2: SpaceDesc properties, +} + +struct TagItem { + 1: common.TagID tag_id, + 2: binary tag_name, + 3: SchemaVer version, + 4: Schema schema, +} + +struct AlterSchemaItem { + 1: AlterSchemaOp op, + 2: Schema schema, +} + +struct EdgeItem { + 1: common.EdgeType edge_type, + 2: binary edge_name, + 3: SchemaVer version, + 4: Schema schema, +} + +struct IndexParams { + 1: optional i32 s2_max_level, + 2: optional i32 s2_max_cells, +} + +struct IndexItem { + 1: common.IndexID index_id, + 2: binary index_name, + 3: common.SchemaID schema_id + 4: binary schema_name, + 5: list fields, + 6: optional binary comment, + 7: optional IndexParams index_params, +} + +enum HostStatus { + ONLINE = 0x00, + OFFLINE = 0x01, + UNKNOWN = 0x02, +} (cpp.enum_strict) + +enum SnapshotStatus { + VALID = 0x00, + INVALID = 0x01, +} (cpp.enum_strict) + +struct HostItem { + 1: common.HostAddr hostAddr, + 2: HostStatus status, + 3: map> + (cpp.template = "std::unordered_map") leader_parts, + 4: map> + (cpp.template = "std::unordered_map") all_parts, + 5: HostRole role, + 6: binary git_info_sha, + 7: optional binary zone_name, + // version of binary + 8: optional binary version, +} + +struct UserItem { + 1: binary account, + // Disable user if lock status is true. + 2: bool is_lock, + // The number of queries an account can issue per hour + 3: i32 max_queries_per_hour, + // The number of updates an account can issue per hour + 4: i32 max_updates_per_hour, + // The number of times an account can connect to the server per hour + 5: i32 max_connections_per_hour, + // The number of simultaneous connections to the server by an account + 6: i32 max_user_connections, +} + +struct RoleItem { + 1: binary user_id, + 2: common.GraphSpaceID space_id, + 3: RoleType role_type, +} + +struct ExecResp { + 1: common.ErrorCode code, + // For custom kv operations, it is useless. + 2: ID id, + // Valid if ret equals E_LEADER_CHANGED. + 3: common.HostAddr leader, +} + +enum AlterSpaceOp { + ADD_ZONE = 0x01, +} (cpp.enum_strict) + +struct AlterSpaceReq { + 1: binary space_name, + 2: AlterSpaceOp op, + 3: list paras, +} + +// Job related data structures +enum JobOp { + ADD = 0x01, + SHOW_All = 0x02, + SHOW = 0x03, + STOP = 0x04, + RECOVER = 0x05, +} (cpp.enum_strict) + +enum JobType { + COMPACT = 0, + FLUSH = 1, + REBUILD_TAG_INDEX = 2, + REBUILD_EDGE_INDEX = 3, + REBUILD_FULLTEXT_INDEX = 4, + STATS = 5, + DATA_BALANCE = 6, + DOWNLOAD = 7, + INGEST = 8, + LEADER_BALANCE = 9, + ZONE_BALANCE = 10, + UNKNOWN = 99, +} (cpp.enum_strict) + +struct AdminJobReq { + 1: common.GraphSpaceID space_id, + 2: JobOp op, + 3: JobType type, + 4: list paras, +} + +enum JobStatus { + QUEUE = 0x01, + RUNNING = 0x02, + FINISHED = 0x03, + FAILED = 0x04, + STOPPED = 0x05, + INVALID = 0xFF, +} (cpp.enum_strict) + +struct JobDesc { + 1: common.GraphSpaceID space_id, + 2: i32 job_id, + 3: JobType type, + 4: list paras, + 5: JobStatus status, + 6: i64 start_time, + 7: i64 stop_time, + 8: common.ErrorCode code, +} + +struct TaskDesc { + 1: common.GraphSpaceID space_id, + 2: i32 job_id, + 3: i32 task_id, + 4: common.HostAddr host, + 5: JobStatus status, + 6: i64 start_time, + 7: i64 stop_time, + 8: common.ErrorCode code, +} + +struct AdminJobResult { + // used in a new added job, e.g. "flush" "compact" + // other job type which also need jobId in their result + // will use other filed. e.g. JobDesc::job_id + 1: optional i32 job_id, + + // used in "show jobs" and "show job " + 2: optional list job_desc, + + // used in "show job " + 3: optional list task_desc, + + // used in "recover job" + 4: optional i32 recovered_job_num, +} + +struct AdminJobResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: AdminJobResult result, +} + +struct Correlativity { + 1: common.PartitionID part_id, + 2: double proportion, +} + +struct StatsItem { + // The number of vertices of tagName + 1: map + (cpp.template = "std::unordered_map") tag_vertices, + // The number of out edges of edgeName + 2: map + (cpp.template = "std::unordered_map") edges, + // The number of vertices of current space + 3: i64 space_vertices, + // The number of edges of current space + 4: i64 space_edges, + // Used to describe the proportion of positive edges + // between the current partition and other partitions. + 5: map> + (cpp.template = "std::unordered_map") positive_part_correlativity, + // Used to describe the proportion of negative edges + // between the current partition and other partitions. + 6: map> + (cpp.template = "std::unordered_map") negative_part_correlativity, + 7: JobStatus status, +} + +// Graph space related operations. +struct CreateSpaceReq { + 1: SpaceDesc properties, + 2: bool if_not_exists, +} + +struct CreateSpaceAsReq { + 1: binary old_space_name, + 2: binary new_space_name, + 3: bool if_not_exists, +} + +struct DropSpaceReq { + 1: binary space_name + 2: bool if_exists, +} + +struct ClearSpaceReq { + 1: binary space_name, + 2: bool if_exists, +} + +struct ListSpacesReq { +} + +struct ListSpacesResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: list spaces, +} + +struct GetSpaceReq { + 1: binary space_name, +} + +struct GetSpaceResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: SpaceItem item, +} + +// Tags related operations +struct CreateTagReq { + 1: common.GraphSpaceID space_id, + 2: binary tag_name, + 3: Schema schema, + 4: bool if_not_exists, +} + +struct AlterTagReq { + 1: common.GraphSpaceID space_id, + 2: binary tag_name, + 3: list tag_items, + 4: SchemaProp schema_prop, +} + +struct DropTagReq { + 1: common.GraphSpaceID space_id, + 2: binary tag_name, + 3: bool if_exists, +} + +struct ListTagsReq { + 1: common.GraphSpaceID space_id, +} + +struct ListTagsResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: list tags, +} + +struct GetTagReq { + 1: common.GraphSpaceID space_id, + 2: binary tag_name, + 3: SchemaVer version, +} + +struct GetTagResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: Schema schema, +} + +// Edge related operations. +struct CreateEdgeReq { + 1: common.GraphSpaceID space_id, + 2: binary edge_name, + 3: Schema schema, + 4: bool if_not_exists, +} + +struct AlterEdgeReq { + 1: common.GraphSpaceID space_id, + 2: binary edge_name, + 3: list edge_items, + 4: SchemaProp schema_prop, +} + +struct GetEdgeReq { + 1: common.GraphSpaceID space_id, + 2: binary edge_name, + 3: SchemaVer version, +} + +struct GetEdgeResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: Schema schema, +} + +struct DropEdgeReq { + 1: common.GraphSpaceID space_id, + 2: binary edge_name, + 3: bool if_exists, +} + +struct ListEdgesReq { + 1: common.GraphSpaceID space_id, +} + +struct ListEdgesResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: list edges, +} + +struct AddHostsReq { + 1: list hosts, +} + +struct DropHostsReq { + 1: list hosts, +} + +enum ListHostType { + // nebula 1.0 show hosts, show leader, partition info + ALLOC = 0x00, + GRAPH = 0x01, + META = 0x02, + STORAGE = 0x03, + AGENT = 0x04, + STORAGE_LISTENER = 0x05, +} (cpp.enum_strict) + +struct ListHostsReq { + 1: ListHostType type +} + +struct ListHostsResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: list hosts, +} + +struct PartItem { + 1: required common.PartitionID part_id, + 2: optional common.HostAddr leader, + 3: required list peers, + 4: required list losts, +} + +struct ListPartsReq { + 1: common.GraphSpaceID space_id, + 2: list part_ids; +} + +struct ListPartsResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list parts, +} + +struct GetPartsAllocReq { + 1: common.GraphSpaceID space_id, +} + +struct GetPartsAllocResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: map>(cpp.template = "std::unordered_map") parts, + 4: optional map(cpp.template = "std::unordered_map") terms, +} + +// get workerid for snowflake +struct GetWorkerIdReq { + 1: binary host, +} + +struct GetWorkerIdResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: i64 workerid, +} + +struct GetSegmentIdReq { + 1: i64 length +} + +struct GetSegmentIdResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: i64 segment_id, +} + +struct HBResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: ClusterID cluster_id, + 4: i64 last_update_time_in_ms, + 5: i32 meta_version, +} + +enum HostRole { + GRAPH = 0x00, + META = 0x01, + STORAGE = 0x02, + STORAGE_LISTENER = 0x03, + AGENT = 0x04, + UNKNOWN = 0x05 +} (cpp.enum_strict) + +struct LeaderInfo { + 1: common.PartitionID part_id, + 2: i64 term +} + +struct PartitionList { + 1: list part_list; +} + +struct HBReq { + 1: HostRole role, + 2: common.HostAddr host, + 3: ClusterID cluster_id, + 4: optional map> + (cpp.template = "std::unordered_map") leader_partIds; + 5: binary git_info_sha, + 6: optional map + (cpp.template = "std::unordered_map")> + (cpp.template = "std::unordered_map") disk_parts; + 7: optional common.DirInfo dir, + // version of binary + 8: optional binary version, +} + +// service(agent/metad/storaged/graphd) info +struct ServiceInfo { + 1: common.DirInfo dir, + 2: common.HostAddr addr, + 3: HostRole role, +} + +struct AgentHBReq { + 1: common.HostAddr host, + 2: binary git_info_sha, + // version of binary + 3: optional binary version, +} + +struct AgentHBResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + // metad/graphd/storaged may in the same host + // do not include agent it self + 3: list service_list, +} + +struct IndexFieldDef { + 1: required binary name, + // type_length is required if the field type is STRING. + 2: optional i16 type_length, +} + +struct CreateTagIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary index_name, + 3: binary tag_name, + 4: list fields, + 5: bool if_not_exists, + 6: optional binary comment, + 7: optional IndexParams index_params, +} + +struct DropTagIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary index_name, + 3: bool if_exists, +} + +struct GetTagIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary index_name, +} + +struct GetTagIndexResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: IndexItem item, +} + +struct ListTagIndexesReq { + 1: common.GraphSpaceID space_id, +} + +struct ListTagIndexesResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list items, +} + +struct CreateEdgeIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary index_name, + 3: binary edge_name, + 4: list fields, + 5: bool if_not_exists, + 6: optional binary comment, + 7: optional IndexParams index_params, +} + +struct DropEdgeIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary index_name, + 3: bool if_exists, +} + +struct GetEdgeIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary index_name, +} + +struct GetEdgeIndexResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: IndexItem item, +} + +struct ListEdgeIndexesReq { + 1: common.GraphSpaceID space_id, +} + +struct ListEdgeIndexesResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list items, +} + +struct RebuildIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary index_name, +} + +struct CreateUserReq { + 1: binary account, + 2: binary encoded_pwd, + 3: bool if_not_exists, +} + +struct DropUserReq { + 1: binary account, + 2: bool if_exists, +} + +struct AlterUserReq { + 1: binary account, + 2: binary encoded_pwd, +} + +struct GrantRoleReq { + 1: RoleItem role_item, +} + +struct RevokeRoleReq { + 1: RoleItem role_item, +} + +struct ListUsersReq { +} + +struct ListUsersResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + // map + 3: map (cpp.template = "std::unordered_map") users, +} + +struct ListRolesReq { + 1: common.GraphSpaceID space_id, +} + +struct ListRolesResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: list roles, +} + +struct GetUserRolesReq { + 1: binary account, +} + +struct ChangePasswordReq { + 1: binary account, + 2: binary new_encoded_pwd, + 3: binary old_encoded_pwd, +} + +enum TaskResult { + SUCCEEDED = 0x00, + FAILED = 0x01, + IN_PROGRESS = 0x02, + INVALID = 0x03, +} (cpp.enum_strict) + + +struct BalanceTask { + 1: binary id, + 2: binary command, + 3: TaskResult result, + 4: i64 start_time, + 5: i64 stop_time, +} + +enum ConfigModule { + UNKNOWN = 0x00, + ALL = 0x01, + GRAPH = 0x02, + META = 0x03, + STORAGE = 0x04, +} (cpp.enum_strict) + +enum ConfigMode { + IMMUTABLE = 0x00, + REBOOT = 0x01, + MUTABLE = 0x02, + IGNORED = 0x03, +} (cpp.enum_strict) + +struct ConfigItem { + 1: ConfigModule module, + 2: binary name, + 3: ConfigMode mode, + 4: common.Value value, +} + +struct RegConfigReq { + 1: list items, +} + +struct GetConfigReq { + 1: ConfigItem item, +} + +struct GetConfigResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list items, +} + +struct SetConfigReq { + 1: ConfigItem item, +} + +struct ListConfigsReq { + 1: binary space, + 2: ConfigModule module, +} + +struct ListConfigsResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list items, +} + +struct CreateSnapshotReq { +} + +struct DropSnapshotReq { + 1: list names, +} + +struct ListSnapshotsReq { +} + +struct Snapshot { + 1: binary name, + 2: SnapshotStatus status, + 3: binary hosts, +} + +struct ListSnapshotsResp { + 1: common.ErrorCode code, + // Valid if code equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: list snapshots, +} + +struct ListIndexStatusReq { + 1: common.GraphSpaceID space_id, +} + +struct IndexStatus { + 1: binary name, + 2: binary status, +} + +struct ListIndexStatusResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list statuses, +} + +// Zone related interface +struct MergeZoneReq { + 1: list zones, + 2: binary zone_name, +} + +struct DropZoneReq { + 1: binary zone_name, +} + +struct DivideZoneReq { + 1: binary zone_name, + 2: map> (cpp.template = "std::unordered_map") zone_items, +} + +struct RenameZoneReq { + 1: binary original_zone_name, + 2: binary zone_name, +} + +struct AddHostsIntoZoneReq { + 1: list hosts, + 2: binary zone_name, + 3: bool is_new, +} + +struct GetZoneReq { + 1: binary zone_name, +} + +struct GetZoneResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list hosts, +} + +struct ListZonesReq { +} + +struct Zone { + 1: binary zone_name, + 2: list nodes, +} + +struct ListZonesResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list zones, +} + +enum ListenerType { + UNKNOWN = 0x00, + ELASTICSEARCH = 0x01, +} (cpp.enum_strict) + +struct AddListenerReq { + 1: common.GraphSpaceID space_id, + 2: ListenerType type, + 3: list hosts, +} + +struct RemoveListenerReq { + 1: common.GraphSpaceID space_id, + 2: ListenerType type, +} + +struct ListListenerReq { + 1: common.GraphSpaceID space_id, +} + +struct ListenerInfo { + 1: ListenerType type, + 2: common.HostAddr host, + 3: common.PartitionID part_id, + 4: HostStatus status, +} + +struct ListListenerResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list listeners, +} + +struct GetStatsReq { + 1: common.GraphSpaceID space_id, +} + +struct GetStatsResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: StatsItem stats, +} + +struct HostBackupInfo { + 1: common.HostAddr host, + // each for one data path + 2: list checkpoints, +} + +struct SpaceBackupInfo { + 1: SpaceDesc space, + 2: list host_backups, +} + +struct BackupMeta { + // spaceId => SpaceBackupInfo + 1: map(cpp.template = "std::unordered_map") space_backups, + // sst file + 2: list meta_files, + // backup + 3: binary backup_name, + 4: bool full, + 5: bool all_spaces, + 6: i64 create_time, + 7: binary base_backup_name, + 8: list storage_hosts, + // The clusterId of the current cluster + 9: ClusterID cluster_id, +} + +struct CreateBackupReq { + // null means all spaces + 1: optional list spaces, + // When empty, it means full backup + // When there is a value, it indicates the last incremental backup + 2: optional binary base_backup_name, + // The clusterId of the cluster corresponding to base_backup_name + 3: optional ClusterID cluster_id, + +} + +struct CreateBackupResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: BackupMeta meta, +} + +struct HostPair { + 1: common.HostAddr from_host, + 2: common.HostAddr to_host, +} + +struct RestoreMetaReq { + 1: list files, + 2: list hosts, +} + +struct PartInfo { + 1: common.PartitionID part_id, + 2: list hosts, +} + +struct RestoreMetaResp { + 1: common.ErrorCode code, + // Valid if ret equals E_LEADER_CHANGED. + 2: common.HostAddr leader, + 3: map> + (cpp.template = "std::unordered_map") part_hosts, +} + +enum ExternalServiceType { + ELASTICSEARCH = 0x01, +} (cpp.enum_strict) + +struct ServiceClient { + 1: required common.HostAddr host, + 2: optional binary user, + 3: optional binary pwd, + 4: optional binary conn_type, +} + +struct SignInServiceReq { + 1: ExternalServiceType type, + 2: list clients, +} + +struct SignOutServiceReq { + 1: ExternalServiceType type, +} + +struct ListServiceClientsReq { + 1: ExternalServiceType type, +} + +struct ListServiceClientsResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: map> + (cpp.template = "std::unordered_map") clients, +} + +struct FTIndex { + 1: common.GraphSpaceID space_id, + 2: common.SchemaID depend_schema, + 3: list fields, + 4: binary analyzer, +} + +struct CreateFTIndexReq { + 1: binary fulltext_index_name, + 2: FTIndex index, +} + +struct DropFTIndexReq { + 1: common.GraphSpaceID space_id, + 2: binary fulltext_index_name, +} + +struct ListFTIndexesReq { +} + +struct ListFTIndexesResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: map (cpp.template = "std::unordered_map") indexes, +} + +enum QueryStatus { + RUNNING = 0x01, + KILLING = 0x02, +} (cpp.enum_strict) + +struct QueryDesc { + 1: common.Timestamp start_time; + 2: QueryStatus status; + 3: i64 duration; + 4: binary query; + // The session might transfer between query engines, but the query do not, we must + // record which query engine the query belongs to + 5: common.HostAddr graph_addr, +} + +struct Session { + 1: common.SessionID session_id, + 2: common.Timestamp create_time, + 3: common.Timestamp update_time, + 4: binary user_name, + 5: binary space_name, + 6: common.HostAddr graph_addr, + 7: i32 timezone, + 8: binary client_ip, + 9: map(cpp.template = "std::unordered_map") configs, + 10: map(cpp.template = "std::unordered_map") queries; +} + +struct CreateSessionReq { + 1: binary user, + 2: common.HostAddr graph_addr, + 3: binary client_ip, +} + +struct CreateSessionResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: Session session, +} + +struct UpdateSessionsReq { + 1: list sessions, +} + +struct UpdateSessionsResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: map (cpp.template = "std::unordered_map")> + (cpp.template = "std::unordered_map") killed_queries, + 4: list killed_sessions, +} + +struct ListSessionsReq { +} + +struct ListSessionsResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list sessions, +} + +struct GetSessionReq { + 1: common.SessionID session_id, +} + +struct GetSessionResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: Session session, +} + +struct RemoveSessionReq { + 1: list session_ids, +} + +struct RemoveSessionResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: list removed_session_ids, +} + +struct KillQueryReq { + 1: map (cpp.template = "std::unordered_set")> + (cpp.template = "std::unordered_map") kill_queries, +} + +struct ReportTaskReq { + 1: common.ErrorCode code, + 2: common.GraphSpaceID space_id, + 3: i32 job_id, + 4: i32 task_id, + 5: optional StatsItem stats +} + +struct ListClusterInfoResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: map>(cpp.template = "std::unordered_map") host_services, +} + +struct ListClusterInfoReq { +} + +struct GetMetaDirInfoResp { + 1: common.ErrorCode code, + 2: common.DirInfo dir, +} + +struct GetMetaDirInfoReq { +} + +struct VerifyClientVersionResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: optional binary error_msg; +} + +struct VerifyClientVersionReq { + 1: required binary client_version = common.version; + 2: common.HostAddr host; + 3: binary build_version; +} + +struct SaveGraphVersionResp { + 1: common.ErrorCode code, + 2: common.HostAddr leader, + 3: optional binary error_msg; +} + +// SaveGraphVersionReq is used to save the graph version of a graph service. +// This is for internal using only. +struct SaveGraphVersionReq { + 1: required binary client_version = common.version; + 2: common.HostAddr host; + 3: binary build_version; +} + +service MetaService { + ExecResp createSpace(1: CreateSpaceReq req); + ExecResp dropSpace(1: DropSpaceReq req); + ExecResp clearSpace(1: ClearSpaceReq req); + GetSpaceResp getSpace(1: GetSpaceReq req); + ListSpacesResp listSpaces(1: ListSpacesReq req); + ExecResp alterSpace(1: AlterSpaceReq req); + + ExecResp createSpaceAs(1: CreateSpaceAsReq req); + + ExecResp createTag(1: CreateTagReq req); + ExecResp alterTag(1: AlterTagReq req); + ExecResp dropTag(1: DropTagReq req); + GetTagResp getTag(1: GetTagReq req); + ListTagsResp listTags(1: ListTagsReq req); + + ExecResp createEdge(1: CreateEdgeReq req); + ExecResp alterEdge(1: AlterEdgeReq req); + ExecResp dropEdge(1: DropEdgeReq req); + GetEdgeResp getEdge(1: GetEdgeReq req); + ListEdgesResp listEdges(1: ListEdgesReq req); + + ExecResp addHosts(1: AddHostsReq req); + ExecResp addHostsIntoZone(1: AddHostsIntoZoneReq req); + ExecResp dropHosts(1: DropHostsReq req); + ListHostsResp listHosts(1: ListHostsReq req); + + GetPartsAllocResp getPartsAlloc(1: GetPartsAllocReq req); + ListPartsResp listParts(1: ListPartsReq req); + + GetWorkerIdResp getWorkerId(1: GetWorkerIdReq req); + + ExecResp createTagIndex(1: CreateTagIndexReq req); + ExecResp dropTagIndex(1: DropTagIndexReq req ); + GetTagIndexResp getTagIndex(1: GetTagIndexReq req); + ListTagIndexesResp listTagIndexes(1:ListTagIndexesReq req); + ExecResp rebuildTagIndex(1: RebuildIndexReq req); + ListIndexStatusResp listTagIndexStatus(1: ListIndexStatusReq req); + ExecResp createEdgeIndex(1: CreateEdgeIndexReq req); + ExecResp dropEdgeIndex(1: DropEdgeIndexReq req ); + GetEdgeIndexResp getEdgeIndex(1: GetEdgeIndexReq req); + ListEdgeIndexesResp listEdgeIndexes(1: ListEdgeIndexesReq req); + ExecResp rebuildEdgeIndex(1: RebuildIndexReq req); + ListIndexStatusResp listEdgeIndexStatus(1: ListIndexStatusReq req); + + ExecResp createUser(1: CreateUserReq req); + ExecResp dropUser(1: DropUserReq req); + ExecResp alterUser(1: AlterUserReq req); + ExecResp grantRole(1: GrantRoleReq req); + ExecResp revokeRole(1: RevokeRoleReq req); + ListUsersResp listUsers(1: ListUsersReq req); + ListRolesResp listRoles(1: ListRolesReq req); + ListRolesResp getUserRoles(1: GetUserRolesReq req); + ExecResp changePassword(1: ChangePasswordReq req); + + HBResp heartBeat(1: HBReq req); + AgentHBResp agentHeartbeat(1: AgentHBReq req); + + ExecResp regConfig(1: RegConfigReq req); + GetConfigResp getConfig(1: GetConfigReq req); + ExecResp setConfig(1: SetConfigReq req); + ListConfigsResp listConfigs(1: ListConfigsReq req); + + ExecResp createSnapshot(1: CreateSnapshotReq req); + ExecResp dropSnapshot(1: DropSnapshotReq req); + ListSnapshotsResp listSnapshots(1: ListSnapshotsReq req); + + AdminJobResp runAdminJob(1: AdminJobReq req); + + ExecResp mergeZone(1: MergeZoneReq req); + ExecResp dropZone(1: DropZoneReq req); + ExecResp divideZone(1: DivideZoneReq req); + ExecResp renameZone(1: RenameZoneReq req); + GetZoneResp getZone(1: GetZoneReq req); + ListZonesResp listZones(1: ListZonesReq req); + + ExecResp addListener(1: AddListenerReq req); + ExecResp removeListener(1: RemoveListenerReq req); + ListListenerResp listListener(1: ListListenerReq req); + + GetStatsResp getStats(1: GetStatsReq req); + ExecResp signInService(1: SignInServiceReq req); + ExecResp signOutService(1: SignOutServiceReq req); + ListServiceClientsResp listServiceClients(1: ListServiceClientsReq req); + + ExecResp createFTIndex(1: CreateFTIndexReq req); + ExecResp dropFTIndex(1: DropFTIndexReq req); + ListFTIndexesResp listFTIndexes(1: ListFTIndexesReq req); + + CreateSessionResp createSession(1: CreateSessionReq req); + UpdateSessionsResp updateSessions(1: UpdateSessionsReq req); + ListSessionsResp listSessions(1: ListSessionsReq req); + GetSessionResp getSession(1: GetSessionReq req); + RemoveSessionResp removeSession(1: RemoveSessionReq req); + ExecResp killQuery(1: KillQueryReq req); + + ExecResp reportTaskFinish(1: ReportTaskReq req); + + // Interfaces for backup and restore + CreateBackupResp createBackup(1: CreateBackupReq req); + RestoreMetaResp restoreMeta(1: RestoreMetaReq req); + ListClusterInfoResp listCluster(1: ListClusterInfoReq req); + GetMetaDirInfoResp getMetaDirInfo(1: GetMetaDirInfoReq req); + + VerifyClientVersionResp verifyClientVersion(1: VerifyClientVersionReq req) + SaveGraphVersionResp saveGraphVersion(1: SaveGraphVersionReq req) + + GetSegmentIdResp getSegmentId(1: GetSegmentIdReq req); +} diff --git a/thriftfiles/raftex.thrift b/thriftfiles/raftex.thrift new file mode 100644 index 00000000..38a73228 --- /dev/null +++ b/thriftfiles/raftex.thrift @@ -0,0 +1,146 @@ +/* Copyright (c) 2018 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +namespace cpp nebula.raftex + +include "common.thrift" + +enum Role { + LEADER = 1, // the leader + FOLLOWER = 2; // following a leader + CANDIDATE = 3; // Has sent AskForVote request + LEARNER = 4; // same with FOLLOWER, except that it does + // not vote in leader election +} (cpp.enum_strict) + +enum Status { + STARTING = 0; // The part is starting, not ready for service + RUNNING = 1; // The part is running + STOPPED = 2; // The part has been stopped + WAITING_SNAPSHOT = 3; // Waiting for the snapshot. +} (cpp.enum_strict) + + +typedef i64 (cpp.type = "nebula::ClusterID") ClusterID +typedef i32 (cpp.type = "nebula::GraphSpaceID") GraphSpaceID +typedef i32 (cpp.type = "nebula::PartitionID") PartitionID +typedef i64 (cpp.type = "nebula::TermID") TermID +typedef i64 (cpp.type = "nebula::LogID") LogID +typedef i32 (cpp.type = "nebula::Port") Port + + +// A request to ask for vote +struct AskForVoteRequest { + 1: GraphSpaceID space; // The graph space id + 2: PartitionID part; // The data partition + 3: string candidate_addr; // My Address + 4: Port candidate_port; // My port + 5: TermID term; // Proposed term + 6: LogID last_log_id; // The last received log id + 7: TermID last_log_term; // The term receiving the last log + 8: bool is_pre_vote; // Is pre vote or not +} + + +// Response message for the vote call +struct AskForVoteResponse { + 1: common.ErrorCode error_code; + 2: TermID current_term; +} + +// Log entries being sent to follower, logId is not included, it could be calculated by +// last_log_id_sent and offset in log_str_list in AppendLogRequest +struct RaftLogEntry { + 1: ClusterID cluster; + 2: binary log_str; + 3: TermID log_term; +} + +struct AppendLogRequest { + 1: GraphSpaceID space; // Graphspace ID + 2: PartitionID part; // Partition ID + 3: TermID current_term; // Current term + 4: LogID committed_log_id; // Last committed Log ID + 5: string leader_addr; // The leader's address + 6: Port leader_port; // The leader's Port + 7: TermID last_log_term_sent; // Term of log entry preceding log_str_list + 8: LogID last_log_id_sent; // Id of log entry preceding log_str_list + 9: list log_str_list; // First log id in log_str_list is last_log_id_sent + 1 +} + +struct AppendLogResponse { + 1: common.ErrorCode error_code; + 2: TermID current_term; + 3: string leader_addr; + 4: Port leader_port; + 5: LogID committed_log_id; + 6: LogID last_matched_log_id; + 7: TermID last_matched_log_term; +} + +struct SendSnapshotRequest { + 1: GraphSpaceID space; + 2: PartitionID part; + 3: TermID current_term; + 4: LogID committed_log_id; + 5: TermID committed_log_term; + 6: string leader_addr; + 7: Port leader_port; + 8: list rows; + 9: i64 total_size; + 10: i64 total_count; + 11: bool done; +} + +struct HeartbeatRequest { + 1: GraphSpaceID space; // Graphspace ID + 2: PartitionID part; // Partition ID + 3: TermID current_term; // Current term + 5: LogID committed_log_id; // Last committed Log ID + 6: string leader_addr; // The leader's address + 7: Port leader_port; // The leader's Port + 8: TermID last_log_term_sent; + 9: LogID last_log_id_sent; +} + +struct HeartbeatResponse { + 1: common.ErrorCode error_code; + 2: TermID current_term; + 3: string leader_addr; + 4: Port leader_port; + 5: LogID committed_log_id; + 6: LogID last_log_id; + 7: TermID last_log_term; +} + +struct SendSnapshotResponse { + 1: common.ErrorCode error_code; + 2: TermID current_term; +} + +struct GetStateRequest { + 1: GraphSpaceID space; // Graphspace ID + 2: PartitionID part; // Partition ID +} + +struct GetStateResponse { + 1: common.ErrorCode error_code; + 2: Role role; + 3: TermID term; + 4: bool is_leader; + 5: LogID committed_log_id; + 6: LogID last_log_id; + 7: TermID last_log_term; + 8: Status status; + 9: list peers; +} + +service RaftexService { + AskForVoteResponse askForVote(1: AskForVoteRequest req); + AppendLogResponse appendLog(1: AppendLogRequest req); + SendSnapshotResponse sendSnapshot(1: SendSnapshotRequest req); + HeartbeatResponse heartbeat(1: HeartbeatRequest req) (thread = 'eb'); + GetStateResponse getState(1: GetStateRequest req); +} diff --git a/thriftfiles/storage.thrift b/thriftfiles/storage.thrift new file mode 100644 index 00000000..b3c4b23d --- /dev/null +++ b/thriftfiles/storage.thrift @@ -0,0 +1,933 @@ +/* vim: ft=proto + * Copyright (c) 2018 vesoft inc. All rights reserved. + * + * This source code is licensed under Apache 2.0 License. + */ + +namespace go nebula.storage + +include "common.thrift" +include "meta.thrift" + +/* + * + * Note: In order to support multiple languages, all strings + * have to be defined as **binary** in the thrift file + * + */ + +struct RequestCommon { + 1: optional common.SessionID session_id, + 2: optional common.ExecutionPlanID plan_id, + 3: optional bool profile_detail, +} + +struct PartitionResult { + 1: required common.ErrorCode code, + 2: required common.PartitionID part_id, + // Only valid when code is E_LEADER_CHANGED. + 3: optional common.HostAddr leader, +} + + +struct ResponseCommon { + // Only contains the partition that returns error + 1: required list failed_parts, + // Query latency from storage service + 2: required i64 latency_in_us, + 3: optional map latency_detail_us, +} + + +/* + * + * Common types used by all services + * + */ +// Enumeration of the statistic methods +enum StatType { + SUM = 1, + COUNT = 2, + AVG = 3, + MAX = 4, + MIN = 5, +} (cpp.enum_strict) + + +// Define a statistic calculator for each source vertex +struct StatProp { + // Alias of the stats property + 1: binary alias, + // An expression. In most of cases, it is a reference to a specific property + 2: binary prop, + // Stats method + 3: StatType stat, +} + + +// Define an expression +struct Expr { + // Alias of the expression + 1: binary alias, + // An expression. It could be any valid expression, + 2: binary expr, +} + + +// Define an edge property +struct EdgeProp { + // A valid edge type + 1: common.EdgeType type, + // The list of property names. If it is empty, then all properties in value will be returned. + // Support kSrc, kType, kRank and kDst as well. + 2: list props, +} + + +// Define a vertex property +struct VertexProp { + // A valid tag id + 1: common.TagID tag, + // The list of property names. If it is empty, then all properties in value will be returned. + // Support kVid and kTag as well. + 2: list props, +} + + +enum OrderDirection { + ASCENDING = 1, + DESCENDING = 2, +} + + +struct OrderBy { + // An expression which result will be used to sort + 1: binary prop, + 2: OrderDirection direction, +} + + +enum EdgeDirection { + BOTH = 1, + IN_EDGE = 2, + OUT_EDGE = 3, +} + + +/////////////////////////////////////////////////////////// +// +// Requests, responses for the GraphStorageService +// +/////////////////////////////////////////////////////////// + +struct TraverseSpec { + // When edge_type > 0, going along the out-edge, otherwise, along the in-edge + // If the edge type list is empty, all edges will be scanned + 1: list edge_types, + // When above edge_types is not empty, edge_direction should be ignored + // When edge_types is empty, edge_direction decided which edge types will be + // followed. The default value is BOTH, which means both in-edges and out-edges + // will be traversed. If the edge_direction is IN_EDGE, then only the in-edges + // will be traversed. OUT_EDGE indicates only the out-edges will be traversed + 2: EdgeDirection edge_direction = EdgeDirection.BOTH, + // Whether to do the dedup based on the entire row. The dedup will be done on the + // neighbors of each vertex + 3: bool dedup = false, + + 4: optional list stat_props, + // A list of source vertex properties to be returned. If the list is not given, + // no prop will be returned. If an empty prop list is given, all properties + // will be returned. + 5: optional list vertex_props, + // A list of edge properties to be returned. If the list is not given, + // no prop will be returned. If an empty prop list is given, all edge properties + // will be returned. + 6: optional list edge_props, + // A list of expressions which are evaluated on each edge + 7: optional list expressions, + // A list of expressions used to sort the result + 8: optional list order_by, + // Combined with "limit", the random flag makes the result of each query different + 9: optional bool random, + // Return the top/bottom N rows for each given vertex + 10: optional i64 limit, + // If provided, only the rows satisfied the given expression will be returned + 11: optional binary filter, + // only contain filter expression for tag, tag_filter is a subset of filter + // Attention: tag_filter cannot extract expression from filter + // when filter contains logicalOR expression + // bcz $^.player.age > 30 OR like.likeness > 80 can't filter data only by tag_Filter + 12: optional binary tag_filter, +} + + +/* + * Start of GetNeighbors section + */ +struct GetNeighborsRequest { + 1: common.GraphSpaceID space_id, + // Column names for input data. The first column name must be "_vid" + 2: list column_names, + // partId => rows + 3: map> + (cpp.template = "std::unordered_map") parts, + 4: TraverseSpec traverse_spec, + 5: optional RequestCommon common, +} + + +struct GetNeighborsResponse { + 1: required ResponseCommon result, + // The result will be returned in a dataset, which is in the following form + // + // Each row represents one source vertex and its neighbors + // + // Here is the layout of the dataset + // =========================================================================================== + // | _vid | stats_column | tag_column | ... | edge_column | ... | expr_column | + // |=========================================================================================| + // | string | list | list | ... | list> | ... | list> | + // |-----------------------------------------------------------------------------------------| + // | ..... | + // =========================================================================================== + // + // The first column in the dataset stores the source vertex id. The column name + // is "_vid". The value should be type of string + // + // The second column contains the statistic result for the vertex if stat_props + // in the request is not empty. The column name is in the following format + // + // "_stats:::..." + // + // Basically the column name contains the statistic alias names, separated by + // the ":". The value in this column is a list of Values, which are corresponding + // to the properties specified in the column name. + // + // Starting from the third column, source vertex properties will be returned if the + // GetNeighborsRequest::vertex_props is not empty. Each column contains properties + // from one tag. The column name will be in the following format in the same order + // which specified in VertexProp + // + // "_tag::::..." + // + // The value of each tag column is a list of Values, which follows the order of the + // property names specified in the above column name. If a vertex does not have + // the specific tag, the value will be empty value + // + // Columns after the tag columns are edge columns. One column per edge type. The + // column name is in the following format in the same order which specified in EdgeProp + // + // "_edge::::..." + // + // The value of each edge column is list>, which represents multiple + // edges. For each edge, the list of Values will follow the order of the property + // names specified in the column name. If a vertex does not have any edge for a + // specific edge type, the value for that column will be empty value + // + // The last column is the expression column, if the GetNeighborsRequest::expressions + // is not empty. The column name is in the format of this + // + // "_expr:::..." + // + 2: optional common.DataSet vertices, +} +/* + * End of GetNeighbors section + */ + +struct GetDstBySrcRequest { + 1: common.GraphSpaceID space_id, + // list of srcId in each part + 2: map> + (cpp.template = "std::unordered_map") parts, + 3: list edge_types, + 4: optional RequestCommon common, +} + +struct GetDstBySrcResponse { + 1: required ResponseCommon result, + // Only one dst column, each row is a dst + 2: optional common.DataSet dsts, +} + + +// +// Response for data modification requests +// +struct ExecResponse { + 1: required ResponseCommon result, +} + + +/* + * Start of GetProp section + */ +struct GetPropRequest { + 1: common.GraphSpaceID space_id, + 2: map> + (cpp.template = "std::unordered_map") parts, + // Based on whether to get the vertex properties or to get the edge properties, + // exactly one of the vertex_props or edge_props must be set. If an empty list is given + // then all properties of the vertex or the edge will be returned in tagId/edgeType ascending order + 3: optional list vertex_props, + 4: optional list edge_props, + // A list of expressions with alias + 5: optional list expressions, + // Whether to do the dedup based on the entire result row + 6: bool dedup = false, + // List of expressions used by the order-by clause + 7: optional list order_by, + 8: optional i64 limit, + // If a filter is provided, only vertices that are satisfied the filter + // will be returned + 9: optional binary filter, + 10: optional RequestCommon common, + +} + + +struct GetPropResponse { + 1: ResponseCommon result, + // The result will be returned in a dataset, which is in the following form + // + // Each row represents properties for one vertex or one edge + // + // Here is the layout of the dataset + // ==================================== + // | alias1 | alias2 | alias3 | ... | + // |==================================| + // | Value | Value | Value | ... | + // |----------------------------------| + // | ..... | + // ==================================== + // + // Each column represents one property. the column name is in the form of "tag_name.prop_alias" + // or "edge_type_name.prop_alias" in the same order which specified in VertexProp or EdgeProp + // + // If the request is to get tag prop, the first column will **always** be the vid, + // and the first column name is "_vid". + // + // If the vertex or the edge does NOT have the given property, the value will be an empty value + 2: optional common.DataSet props, +} +/* + * End of GetProp section + */ + + +/* + * Start of AddVertices section + */ +struct NewTag { + 1: common.TagID tag_id, + 2: list props, +} + + +struct NewVertex { + 1: common.Value id, + 2: list tags, +} + + +struct EdgeKey { + 1: common.Value src, + // When edge_type > 0, it's an out-edge, otherwise, it's an in-edge + // When query edge props, the field could be unset. + 2: common.EdgeType edge_type, + 3: common.EdgeRanking ranking, + 4: common.Value dst, +} + + +struct NewEdge { + 1: EdgeKey key, + 2: list props, +} + + +struct AddVerticesRequest { + 1: common.GraphSpaceID space_id, + // partId => vertices + 2: map> + (cpp.template = "std::unordered_map") parts, + // A map from TagID -> list of prop_names + // The order of the property names should match the data order specified + // in the NewVertex.NewTag.props + 3: map> + (cpp.template = "std::unordered_map") prop_names, + // if true, when (vertexID,tagID) already exists, do nothing + 4: bool if_not_exists, + 5: bool ignore_existed_index = false, + 6: optional RequestCommon common, +} + +struct AddEdgesRequest { + 1: common.GraphSpaceID space_id, + // partId => edges + 2: map>( + cpp.template = "std::unordered_map") parts, + // A list of property names. The order of the property names should match + // the data order specified in the NewEdge.props + 3: list prop_names, + // if true, when edge already exists, do nothing + 4: bool if_not_exists, + // If true, existed index won't be removed + 5: bool ignore_existed_index = false, + 6: optional RequestCommon common, +} + +/* + * End of AddVertices section + */ + + +/* + * Start of DeleteVertex section + */ +struct DeleteVerticesRequest { + 1: common.GraphSpaceID space_id, + // partId => vertexId + 2: map> + (cpp.template = "std::unordered_map") parts, + 3: optional RequestCommon common, +} + + +struct DeleteEdgesRequest { + 1: common.GraphSpaceID space_id, + // partId => edgeKeys + 2: map> + (cpp.template = "std::unordered_map") parts, + 3: optional RequestCommon common, +} +/* + * End of DeleteVertex section + */ + +struct DelTags { + 1: common.Value id, + 2: list tags, +} + +struct DeleteTagsRequest { + 1: common.GraphSpaceID space_id, + // partId => vertexId + 2: map> + (cpp.template = "std::unordered_map") parts, + 3: optional RequestCommon common, +} +// Response for update requests +struct UpdateResponse { + 1: required ResponseCommon result, + // The result will be returned in a dataset, which is in the following form + // + // The name of the first column is "_inserted". It has a boolean value. It's + // TRUE if insertion happens + // Starting from the second column, it's the all returned properties, one column + // per property. If there is no given property, the value will be a NULL + 2: optional common.DataSet props, +} + + +struct UpdatedProp { + 1: required binary name, // property name + 2: required binary value, // new value (encoded expression) +} + +/* + * Start of UpdateVertex section + */ +struct UpdateVertexRequest { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: common.Value vertex_id, + 4: required common.TagID tag_id + 5: list updated_props, + 6: optional bool insertable = false, + // A list of kSrcProperty expressions, support kVid and kTag + 7: optional list return_props, + // If provided, the update happens only when the condition evaluates true + 8: optional binary condition, + 9: optional RequestCommon common, +} +/* + * End of UpdateVertex section + */ + + +/* + * Start of UpdateEdge section + */ +struct UpdateEdgeRequest { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: EdgeKey edge_key, + 4: list updated_props, + 5: optional bool insertable = false, + // A list of kEdgeProperty expressions, support kSrc, kType, kRank and kDst + 6: optional list return_props, + // If provided, the update happens only when the condition evaluates true + 7: optional binary condition, + 8: optional RequestCommon common, +} +/* + * End of UpdateEdge section + */ + + +/* + * Start of GetUUID section + */ +struct GetUUIDReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: binary name, + 4: optional RequestCommon common, +} + + +struct GetUUIDResp { + 1: required ResponseCommon result, + 2: common.Value id, +} +/* + * End of GetUUID section + */ + + +/* + * Start of Index section + */ +struct LookupIndexResp { + 1: required ResponseCommon result, + // The result will be returned in a dataset, which is in the following form + // + // When looking up the vertex index, each row represents one vertex and its + // properties; when looking up the edge index, each row represents one edge + // and its properties. + // + // Each column represents one property. the column name is in the form of "tag_name.prop_alias" + // or "edge_type_name.prop_alias" in the same order which specified in return_columns of request + 2: optional common.DataSet data, + // stat_data only have one column, the column name is the order in LookupIndexRequest.stat_prop + 3: optional common.DataSet stat_data, +} + +enum ScanType { + PREFIX = 1, + RANGE = 2, +} (cpp.enum_strict) + +struct IndexColumnHint { + 1: binary column_name, + // If scan_type == PREFIX, using begin_value to handler prefix. + // Else using begin_value and end_value to handler ranger. + 2: ScanType scan_type, + 3: common.Value begin_value, + 4: common.Value end_value, + // When `columnhint` means ` >= begin_value`, `include_begin` is true + // and include_end is similar + 5: bool include_begin = true, + 6: bool include_end = false, +} + +struct IndexQueryContext { + 1: common.IndexID index_id, + // filter is an encoded expression of where clause. + // Used for secondary filtering from a result set + 2: binary filter, + // There are two types of scan: 1, range scan; 2, match scan (prefix); + // When the field size of index_id IndexItem is not zero, the columns_hints are not allowed + // to be empty, At least one index column must be hit. + // When the field size of index_id IndexItem is zero, the columns_hints must be empty. + 3: list column_hints, +} + + +struct IndexSpec { + // In order to union multiple indices, multiple index hints are allowed + 1: required list contexts, + 2: common.SchemaID schema_id, +} + + +struct LookupIndexRequest { + 1: required common.GraphSpaceID space_id, + 2: required list parts, + 3: IndexSpec indices, + // The list of property names. Should not be empty. + // Support kVid and kTag for vertex, kSrc, kType, kRank and kDst for edge. + 4: optional list return_columns, + 5: optional RequestCommon common, + // max row count of each partition in this response + 6: optional i64 limit, + 7: optional list order_by, + 8: optional list stat_columns, +} + + +// This request will make the storage lookup the index first, then traverse +// to the neighbor nodes from the index results. So it is the combination +// of lookupIndex() and getNeighbors() +struct LookupAndTraverseRequest { + 1: required common.GraphSpaceID space_id, + 2: required list parts, + 3: IndexSpec indices, + 4: TraverseSpec traverse_spec, + 5: optional RequestCommon common, +} + +/* + * End of Index section + */ + +struct ScanCursor { + // next start key of scan, only valid when has_next is true + 1: optional binary next_cursor, +} + +struct ScanVertexRequest { + 1: common.GraphSpaceID space_id, + 2: map (cpp.template = "std::unordered_map") + parts, + 3: list return_columns, + // max row count of tag in this response + 4: i64 limit, + // only return data in time range [start_time, end_time) + 5: optional i64 start_time, + 6: optional i64 end_time, + 7: optional binary filter, + // when storage enable multi versions and only_latest_version is true, only return latest version. + // when storage disable multi versions, just use the default value. + 8: bool only_latest_version = false, + // if set to false, forbid follower read + 9: bool enable_read_from_follower = true, + 10: optional RequestCommon common, +} + +struct ScanEdgeRequest { + 1: common.GraphSpaceID space_id, + 2: map (cpp.template = "std::unordered_map") + parts, + 3: list return_columns, + // max row count of edge in this response + 4: i64 limit, + // only return data in time range [start_time, end_time) + 5: optional i64 start_time, + 6: optional i64 end_time, + 7: optional binary filter, + // when storage enable multi versions and only_latest_version is true, only return latest version. + // when storage disable multi versions, just use the default value. + 8: bool only_latest_version = false, + // if set to false, forbid follower read + 9: bool enable_read_from_follower = true, + 10: optional RequestCommon common, +} + +struct ScanResponse { + 1: required ResponseCommon result, + // The data will return as a dataset. The format is as follows: + // Each column represents one property. the column name is in the form of "edge/tag_name.prop_alias" + // in the same order which specified in VertexProp/EdgeProp in request + // Should keep same with result of GetProps + 2: optional common.DataSet props, + 3: map (cpp.template = "std::unordered_map") + cursors; +} + +struct TaskPara { + 1: common.GraphSpaceID space_id, + 2: optional list parts, + 3: optional list task_specific_paras +} + +////////////////////////////////////////////////////////// +// +// Requests, responses for the kv interfaces +// +////////////////////////////////////////////////////////// +struct KVGetRequest { + 1: common.GraphSpaceID space_id, + 2: map>( + cpp.template = "std::unordered_map") parts, + // When return_partly is true and some of the keys not found, will return the keys + // which exist + 3: bool return_partly +} + +struct KVGetResponse { + 1: required ResponseCommon result, + 2: map(cpp.template = "std::unordered_map") key_values, +} + +struct KVPutRequest { + 1: common.GraphSpaceID space_id, + // part -> key/value + 2: map>( + cpp.template = "std::unordered_map") parts, +} + +struct KVRemoveRequest { + 1: common.GraphSpaceID space_id, + // part -> key + 2: map>( + cpp.template = "std::unordered_map") parts, +} + +service GraphStorageService { + GetNeighborsResponse getNeighbors(1: GetNeighborsRequest req); + GetDstBySrcResponse getDstBySrc(1: GetDstBySrcRequest req); + + // Get vertex or edge properties + GetPropResponse getProps(1: GetPropRequest req); + + ExecResponse addVertices(1: AddVerticesRequest req); + ExecResponse addEdges(1: AddEdgesRequest req); + + ExecResponse deleteEdges(1: DeleteEdgesRequest req); + ExecResponse deleteVertices(1: DeleteVerticesRequest req); + ExecResponse deleteTags(1: DeleteTagsRequest req); + + UpdateResponse updateVertex(1: UpdateVertexRequest req); + UpdateResponse updateEdge(1: UpdateEdgeRequest req); + + ScanResponse scanVertex(1: ScanVertexRequest req) + ScanResponse scanEdge(1: ScanEdgeRequest req) + + GetUUIDResp getUUID(1: GetUUIDReq req); + + // Interfaces for edge and vertex index scan + LookupIndexResp lookupIndex(1: LookupIndexRequest req); + + GetNeighborsResponse lookupAndTraverse(1: LookupAndTraverseRequest req); + + UpdateResponse chainUpdateEdge(1: UpdateEdgeRequest req); + ExecResponse chainAddEdges(1: AddEdgesRequest req); + ExecResponse chainDeleteEdges(1: DeleteEdgesRequest req); + + KVGetResponse get(1: KVGetRequest req); + ExecResponse put(1: KVPutRequest req); + ExecResponse remove(1: KVRemoveRequest req); +} + + +////////////////////////////////////////////////////////// +// +// Requests, responses for the StorageAdminService +// +////////////////////////////////////////////////////////// +// Common response for admin methods +struct AdminExecResp { + 1: required ResponseCommon result, + 2: optional meta.StatsItem stats, +} + + +struct TransLeaderReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: common.HostAddr new_leader, +} + + +struct AddPartReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: bool as_learner, + 4: list peers, +} + + +struct AddLearnerReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: common.HostAddr learner, +} + + +struct RemovePartReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, +} + + +struct MemberChangeReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: common.HostAddr peer, + // true means add a peer, false means remove a peer. + 4: bool add, +} + + +struct CatchUpDataReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: common.HostAddr target, +} + +struct GetLeaderReq { +} + +struct CreateCPRequest { + 1: list space_ids, + 2: binary name, +} + +struct CreateCPResp { + 1: common.ErrorCode code, + 2: list info, +} + +struct DropCPRequest { + 1: list space_ids, + 2: binary name, +} + +struct DropCPResp { + 1: common.ErrorCode code, +} + +enum EngineSignType { + BLOCK_ON = 1, + BLOCK_OFF = 2, +} + +struct BlockingSignRequest { + 1: list space_ids, + 2: required EngineSignType sign, +} + +struct BlockingSignResp { + 1: common.ErrorCode code, +} + +struct GetLeaderPartsResp { + 1: common.ErrorCode code, + 2: map> ( + cpp.template = "std::unordered_map") leader_parts; +} + + +struct CheckPeersReq { + 1: common.GraphSpaceID space_id, + 2: common.PartitionID part_id, + 3: list peers, +} + + +struct RebuildIndexRequest { + 1: common.GraphSpaceID space_id, + 2: list parts, + 3: common.IndexID index_id, +} + +struct ListClusterInfoResp { + 1: required ResponseCommon result, + 2: common.DirInfo dir, +} + +struct ListClusterInfoReq { +} + +struct AddTaskRequest { + // Task distributed to storage to execute, e.g. flush, compact, stats, etc. + 1: meta.JobType job_type + 2: i32 job_id + 3: i32 task_id + 4: TaskPara para +} + +struct AddTaskResp { + 1: common.ErrorCode code, +} + +struct StopTaskRequest { + 1: i32 job_id + 2: i32 task_id +} + +struct StopTaskResp { + 1: common.ErrorCode code, +} + +struct ClearSpaceReq { + 1: common.GraphSpaceID space_id, +} + +struct ClearSpaceResp { + 1: common.ErrorCode code, +} + +service StorageAdminService { + // Interfaces for admin operations + AdminExecResp transLeader(1: TransLeaderReq req); + AdminExecResp addPart(1: AddPartReq req); + AdminExecResp addLearner(1: AddLearnerReq req); + AdminExecResp removePart(1: RemovePartReq req); + AdminExecResp memberChange(1: MemberChangeReq req); + AdminExecResp waitingForCatchUpData(1: CatchUpDataReq req); + + // Interfaces for nebula cluster checkpoint + CreateCPResp createCheckpoint(1: CreateCPRequest req); + DropCPResp dropCheckpoint(1: DropCPRequest req); + BlockingSignResp blockingWrites(1: BlockingSignRequest req); + + // Return all leader partitions on this host + GetLeaderPartsResp getLeaderParts(1: GetLeaderReq req); + // Return all peers + AdminExecResp checkPeers(1: CheckPeersReq req); + + AddTaskResp addAdminTask(1: AddTaskRequest req); + StopTaskResp stopAdminTask(1: StopTaskRequest req); + + ClearSpaceResp clearSpace(1: ClearSpaceReq req); +} + + +////////////////////////////////////////////////////////// +// +// Requests, responses for the InternalStorageService +// +////////////////////////////////////////////////////////// + +struct ChainAddEdgesRequest { + 1: common.GraphSpaceID space_id, + // partId => edges + 2: map>( + cpp.template = "std::unordered_map") parts, + // A list of property names. The order of the property names should match + // the data order specified in the NewEdge.props + 3: list prop_names, + // if true, when edge already exists, do nothing + 4: bool if_not_exists, + 5: i64 term + 6: optional i64 edge_version + // 6: optional map>( + // cpp.template = "std::unordered_map") edge_ver, +} + + +struct ChainUpdateEdgeRequest { + 1: UpdateEdgeRequest update_edge_request, + 2: i64 term, + 3: optional i64 edge_version + 4: common.GraphSpaceID space_id, + 5: required list parts, +} + +struct ChainDeleteEdgesRequest { + 1: common.GraphSpaceID space_id, + // partId => edgeKeys + 2: map> + (cpp.template = "std::unordered_map") parts, + 3: binary txn_id + 4: i64 term, +} + +service InternalStorageService { + ExecResponse chainAddEdges(1: ChainAddEdgesRequest req); + UpdateResponse chainUpdateEdge(1: ChainUpdateEdgeRequest req); + ExecResponse chainDeleteEdges(1: ChainDeleteEdgesRequest req); +}