From 4afe1a5d3a117b9cb633836f3d9e290cc9d16407 Mon Sep 17 00:00:00 2001 From: w41ter Date: Wed, 11 Sep 2024 15:10:56 +0800 Subject: [PATCH 01/41] Disable 3.0 not supported cases --- .../test_syncer_ts_allow_table_exists.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/regression-test/suites/syncer/ts_allow_table_exists/test_syncer_ts_allow_table_exists.groovy b/regression-test/suites/syncer/ts_allow_table_exists/test_syncer_ts_allow_table_exists.groovy index 5b411e6b..22222a45 100644 --- a/regression-test/suites/syncer/ts_allow_table_exists/test_syncer_ts_allow_table_exists.groovy +++ b/regression-test/suites/syncer/ts_allow_table_exists/test_syncer_ts_allow_table_exists.groovy @@ -17,8 +17,9 @@ suite("test_syncer_ts_allow_tablet_exists") { def versions = sql_return_maparray "show variables like 'version_comment'" - if (versions[0].Value.contains('doris-2.0.') || versions[0].Value.contains('doris-2.1')) { - logger.info("2.0/2.1 not support this case, current version is: ${versions[0].Value}") + if (versions[0].Value.contains('doris-2.0.') || versions[0].Value.contains('doris-2.1') || + versions[0].Value.contains('doris-3.0.')) { + logger.info("2.0/2.1/3.0 not support this case, current version is: ${versions[0].Value}") return } From 7545a2979bb5eb91d94c8ad6f383ead4925b464a Mon Sep 17 00:00:00 2001 From: w41ter Date: Mon, 16 Dec 2024 20:30:55 +0800 Subject: [PATCH 02/41] Remove random_add_cluster_keys_for_mow from branch-3.0 --- regression-test/common/helper.groovy | 4 ---- 1 file changed, 4 deletions(-) diff --git a/regression-test/common/helper.groovy b/regression-test/common/helper.groovy index 93ecf403..59ddb84c 100644 --- a/regression-test/common/helper.groovy +++ b/regression-test/common/helper.groovy @@ -52,10 +52,6 @@ class Helper { this.suite = suite this.context = suite.context this.logger = suite.logger - - // Disable fuzzy config for the ccr test suites. - suite.sql """ ADMIN SET FRONTEND CONFIG ("random_add_cluster_keys_for_mow" = "false") """ - suite.target_sql """ ADMIN SET FRONTEND CONFIG ("random_add_cluster_keys_for_mow" = "false") """ } void set_alias(String alias) { From 4810ac1f279868ad1b6d59edc4e02ae55b4ebdd7 Mon Sep 17 00:00:00 2001 From: Uniqueyou <1520358997@qq.com> Date: Fri, 3 Jan 2025 10:33:05 +0800 Subject: [PATCH 03/41] Fix error test in br 3.0 (#365) --- ...test_ds_alt_prop_skip_bitmap_column.groovy | 98 ------------------- .../test_ds_prop_unique_key_mow.groovy | 4 +- ...test_ts_alt_prop_skip_bitmap_column.groovy | 98 ------------------- 3 files changed, 1 insertion(+), 199 deletions(-) delete mode 100644 regression-test/suites/db_sync/alt_prop/skip_bitmap_column/test_ds_alt_prop_skip_bitmap_column.groovy delete mode 100644 regression-test/suites/table_sync/alt_prop/skip_bitmap_column/test_ts_alt_prop_skip_bitmap_column.groovy diff --git a/regression-test/suites/db_sync/alt_prop/skip_bitmap_column/test_ds_alt_prop_skip_bitmap_column.groovy b/regression-test/suites/db_sync/alt_prop/skip_bitmap_column/test_ds_alt_prop_skip_bitmap_column.groovy deleted file mode 100644 index e9a71c71..00000000 --- a/regression-test/suites/db_sync/alt_prop/skip_bitmap_column/test_ds_alt_prop_skip_bitmap_column.groovy +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -suite("test_ds_alt_prop_skip_bitmap_column") { - def helper = new GroovyShell(new Binding(['suite': delegate])) - .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) - - if (!helper.is_version_supported([30099, 20199, 20099])) { - def version = helper.upstream_version() - logger.info("skip this suite because version is not supported, upstream version ${version}") - return - } - - def dbName = context.dbName - def tableName = "tbl" - def test_num = 0 - def insert_num = 5 - - def exist = { res -> Boolean - return res.size() != 0 - } - - def notEnableSkip = { res -> Boolean - return !res[0][1].contains("\"enable_unique_key_skip_bitmap_column\" = \"true\"") - } - - def enableSkip = { res -> Boolean - return res[0][1].contains("\"enable_unique_key_skip_bitmap_column\" = \"true\"") - } - - sql "DROP TABLE IF EXISTS ${dbName}.${tableName}" - target_sql "DROP TABLE IF EXISTS TEST_${dbName}.${tableName}" - - helper.enableDbBinlog() - - sql """ - CREATE TABLE ${tableName} - ( - `k` int(11) NULL, - `v1` BIGINT NULL, - `v2` BIGINT NULL DEFAULT "9876", - `v3` BIGINT NOT NULL, - `v4` BIGINT NOT NULL DEFAULT "1234", - `v5` BIGINT NULL - ) - UNIQUE KEY(`k`) - DISTRIBUTED BY HASH(`k`) BUCKETS 1 - PROPERTIES ( - "replication_num" = "1", - "enable_unique_key_merge_on_write" = "true", - "enable_unique_key_skip_bitmap_column" = "false", - "light_schema_change" = "true", - "store_row_column" = "false", - "binlog.enable" = "true" - ); - """ - - helper.ccrJobDelete() - helper.ccrJobCreate() - - assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 30)) - - logger.info("=== Test 1: check property not exist ===") - - assertTrue(helper.checkShowTimesOf("SHOW TABLES LIKE \"${tableName}\"", exist, 60, "sql")) - - assertTrue(helper.checkShowTimesOf("SHOW TABLES LIKE \"${tableName}\"", exist, 60, "target")) - - assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}", notEnableSkip, 60, "sql")) - - assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}", notEnableSkip, 60, "target")) - - logger.info("=== Test 2: alter table enable property enable_unique_key_merge_on_write ===") - - sql """ - ALTER TABLE ${tableName} ENABLE FEATURE "UPDATE_FLEXIBLE_COLUMNS"; - """ - - logger.info("=== Test 3: check property exist ===") - - assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}", enableSkip, 60, "sql")) - - assertTrue(helper.checkShowTimesOf("SHOW COLUMNS FROM ${tableName} WHERE Field = \"__DORIS_SKIP_BITMAP_COL__\"", exist, 30, "target")) -} \ No newline at end of file diff --git a/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy b/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy index a965b790..c92706bf 100644 --- a/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy +++ b/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy @@ -48,8 +48,7 @@ suite("test_ds_prop_unique_key_mow") { PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "binlog.enable" = "true", - "enable_unique_key_merge_on_write" = "true", - "enable_unique_key_skip_bitmap_column" = "true" + "enable_unique_key_merge_on_write" = "true" ) """ @@ -65,5 +64,4 @@ suite("test_ds_prop_unique_key_mow") { def target_res = target_sql "SHOW CREATE TABLE ${tableName}" assertTrue(target_res[0][1].contains("\"enable_unique_key_merge_on_write\" = \"true\"")) - assertTrue(target_res[0][1].contains("\"enable_unique_key_skip_bitmap_column\" = \"true\"")) } \ No newline at end of file diff --git a/regression-test/suites/table_sync/alt_prop/skip_bitmap_column/test_ts_alt_prop_skip_bitmap_column.groovy b/regression-test/suites/table_sync/alt_prop/skip_bitmap_column/test_ts_alt_prop_skip_bitmap_column.groovy deleted file mode 100644 index 979ecb3e..00000000 --- a/regression-test/suites/table_sync/alt_prop/skip_bitmap_column/test_ts_alt_prop_skip_bitmap_column.groovy +++ /dev/null @@ -1,98 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -suite("test_ts_alt_prop_skip_bitmap_column") { - def helper = new GroovyShell(new Binding(['suite': delegate])) - .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) - - if (!helper.is_version_supported([30099, 20199, 20099])) { - def version = helper.upstream_version() - logger.info("skip this suite because version is not supported, upstream version ${version}") - return - } - - def dbName = context.dbName - def tableName = "tbl" - def test_num = 0 - def insert_num = 5 - - def exist = { res -> Boolean - return res.size() != 0 - } - - def notEnableSkip = { res -> Boolean - return !res[0][1].contains("\"enable_unique_key_skip_bitmap_column\" = \"true\"") - } - - def enableSkip = { res -> Boolean - return res[0][1].contains("\"enable_unique_key_skip_bitmap_column\" = \"true\"") - } - - sql "DROP TABLE IF EXISTS ${dbName}.${tableName}" - target_sql "DROP TABLE IF EXISTS TEST_${dbName}.${tableName}" - - helper.enableDbBinlog() - - sql """ - CREATE TABLE ${tableName} - ( - `k` int(11) NULL, - `v1` BIGINT NULL, - `v2` BIGINT NULL DEFAULT "9876", - `v3` BIGINT NOT NULL, - `v4` BIGINT NOT NULL DEFAULT "1234", - `v5` BIGINT NULL - ) - UNIQUE KEY(`k`) - DISTRIBUTED BY HASH(`k`) BUCKETS 1 - PROPERTIES ( - "replication_num" = "1", - "enable_unique_key_merge_on_write" = "true", - "enable_unique_key_skip_bitmap_column" = "false", - "light_schema_change" = "true", - "store_row_column" = "false", - "binlog.enable" = "true" - ); - """ - - helper.ccrJobDelete(tableName) - helper.ccrJobCreate(tableName) - - assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 30)) - - logger.info("=== Test 1: check property not exist ===") - - assertTrue(helper.checkShowTimesOf("SHOW TABLES LIKE \"${tableName}\"", exist, 60, "sql")) - - assertTrue(helper.checkShowTimesOf("SHOW TABLES LIKE \"${tableName}\"", exist, 60, "target")) - - assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}", notEnableSkip, 60, "sql")) - - assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}", notEnableSkip, 60, "target")) - - logger.info("=== Test 2: alter table enable property enable_unique_key_merge_on_write ===") - - sql """ - ALTER TABLE ${tableName} ENABLE FEATURE "UPDATE_FLEXIBLE_COLUMNS"; - """ - - logger.info("=== Test 3: check property exist ===") - - assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE ${tableName}", enableSkip, 60, "sql")) - - assertTrue(helper.checkShowTimesOf("SHOW COLUMNS FROM ${tableName} WHERE Field = \"__DORIS_SKIP_BITMAP_COL__\"", exist, 30, "target")) -} \ No newline at end of file From 12d6ec9015c60c594b5852e832f5bae3ed616f08 Mon Sep 17 00:00:00 2001 From: w41ter Date: Thu, 9 Jan 2025 17:00:19 +0800 Subject: [PATCH 04/41] Disable some suites in 2.1 --- .../alt_prop/row_store/test_ds_alt_prop_row_store.groovy | 7 +++++++ .../db_sync/prop/row_store/test_ds_prop_row_store.groovy | 7 +++++++ .../table/res_agg_state/test_ds_tbl_res_agg_state.groovy | 6 ++++++ .../alt_prop/row_store/test_ts_alt_prop_row_store.groovy | 7 +++++++ 4 files changed, 27 insertions(+) diff --git a/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy b/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy index 960d8d4d..addfe403 100644 --- a/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy +++ b/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy @@ -19,6 +19,13 @@ suite("test_ds_alt_prop_row_store") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30004, 20199, 20099])) { + // disable in 2.1/2.0 + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/db_sync/prop/row_store/test_ds_prop_row_store.groovy b/regression-test/suites/db_sync/prop/row_store/test_ds_prop_row_store.groovy index 2d507b87..6b8f8cb9 100644 --- a/regression-test/suites/db_sync/prop/row_store/test_ds_prop_row_store.groovy +++ b/regression-test/suites/db_sync/prop/row_store/test_ds_prop_row_store.groovy @@ -19,6 +19,13 @@ suite("test_ds_prop_row_store") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30004, 20199, 20099])) { + // disable in 2.1/2.0 + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def test_num = 0 diff --git a/regression-test/suites/db_sync/table/res_agg_state/test_ds_tbl_res_agg_state.groovy b/regression-test/suites/db_sync/table/res_agg_state/test_ds_tbl_res_agg_state.groovy index 8f17bb1d..ef0f6423 100644 --- a/regression-test/suites/db_sync/table/res_agg_state/test_ds_tbl_res_agg_state.groovy +++ b/regression-test/suites/db_sync/table/res_agg_state/test_ds_tbl_res_agg_state.groovy @@ -18,6 +18,12 @@ suite("test_ds_tbl_res_agg_state") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30004, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def tableName = "tbl_" + helper.randomSuffix() def aggTableName = "agg_" + helper.randomSuffix() def test_num = 0 diff --git a/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy b/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy index fdaa721b..ae44071b 100644 --- a/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy +++ b/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy @@ -19,6 +19,13 @@ suite("test_ts_alt_prop_row_store") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30004, 20199, 20099])) { + // disable in 2.1/2.0 + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() From e8c56cf1caaf5c2c46dca83deb72535998aa8c14 Mon Sep 17 00:00:00 2001 From: walter Date: Thu, 9 Jan 2025 17:51:38 +0800 Subject: [PATCH 05/41] Fix version div (#387) --- regression-test/common/helper.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/regression-test/common/helper.groovy b/regression-test/common/helper.groovy index 59ddb84c..a291db7d 100644 --- a/regression-test/common/helper.groovy +++ b/regression-test/common/helper.groovy @@ -405,8 +405,8 @@ class Helper { def version = String.format("%d%02d%02d", major, minor, patch).toLong() for (long expect : versions) { logger.info("current version ${version}, expect version ${expect}") - def expect_version_set = expect / 100 - def got_version_set = version / 100 + def expect_version_set = expect.intdiv(100) + def got_version_set = version.intdiv(100) if (expect_version_set == got_version_set && version < expect) { return false } From b3566c2e97766b6280fb169f58097edff8e92c1f Mon Sep 17 00:00:00 2001 From: w41ter Date: Wed, 12 Feb 2025 16:55:30 +0800 Subject: [PATCH 06/41] fix: reuse restore job should keep the table alias --- pkg/ccr/job.go | 8 + regression-test/common/helper.groovy | 19 +++ .../test_cds_fullsync_with_alias.groovy | 2 + .../test_cds_fullsync_with_alias_1.groovy | 159 ++++++++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 regression-test/suites/cross_ds/fullsync/with_alias_1/test_cds_fullsync_with_alias_1.groovy diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 3340c73a..2aca3da4 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -1102,6 +1102,7 @@ func (j *Job) fullSync() error { j.progress.TableAliases = make(map[string]string) } j.progress.TableAliases[tableName] = TableAlias(tableName) + j.progress.NextSubCheckpoint(GetSnapshotInfo, inMemoryData.SnapshotName) // persist TableAliases j.progress.NextSubVolatile(RestoreSnapshot, inMemoryData) break } @@ -1129,6 +1130,13 @@ func (j *Job) fullSync() error { return nil } + if utils.HasJobFailpoint(j.Name, "fullsync_restore_snapshot_rebooting") { + log.Infof("hit failpoint fullsync_restore_snapshot_rebooting, step to RestoreSnapshot") + utils.RemoveJobFailpoint(j.Name, "fullsync_restore_snapshot_rebooting") + j.recoverJobProgress() + return nil + } + tableCommitSeqMap := inMemoryData.TableCommitSeqMap var commitSeq int64 = math.MaxInt64 switch j.SyncType { diff --git a/regression-test/common/helper.groovy b/regression-test/common/helper.groovy index a291db7d..e7dfb7fc 100644 --- a/regression-test/common/helper.groovy +++ b/regression-test/common/helper.groovy @@ -561,6 +561,25 @@ class Helper { } } } + + Boolean checkJobInIncrementalSync(Integer times = 30, String tableName = "") { + def DB_TABLES_INCREMENTAL_SYNC = 1 + def DB_INCREMENTAL_SYNC = 3 + def TABLE_INCREMENTAL_SYNC = 501 + + def job_progress + for (int i = 0; i < times; i++) { + job_progress = get_job_progress(tableName) + if (job_progress != null && (job_progress.sync_state == DB_TABLES_INCREMENTAL_SYNC || + job_progress.sync_state == DB_INCREMENTAL_SYNC || + job_progress.sync_state == TABLE_INCREMENTAL_SYNC)) { + return true + } + sleep(sync_gap_time) + } + logger.info("last job progress: ${job_progress}") + return false + } } new Helper(suite) diff --git a/regression-test/suites/cross_ds/fullsync/with_alias/test_cds_fullsync_with_alias.groovy b/regression-test/suites/cross_ds/fullsync/with_alias/test_cds_fullsync_with_alias.groovy index 212c3448..0a9853e2 100644 --- a/regression-test/suites/cross_ds/fullsync/with_alias/test_cds_fullsync_with_alias.groovy +++ b/regression-test/suites/cross_ds/fullsync/with_alias/test_cds_fullsync_with_alias.groovy @@ -104,6 +104,8 @@ suite("test_cds_fullsync_with_alias") { assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 60)) assertTrue(helper.checkRestoreFinishTimesOf("${tableName}_1", 60)) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableName}", insert_num, 60)) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableName}_1", insert_num, 60)) logger.info("pause ccr job, change table1 schema and trigger fullsync, then the upsert of table2 should be synced") helper.ccrJobPause() diff --git a/regression-test/suites/cross_ds/fullsync/with_alias_1/test_cds_fullsync_with_alias_1.groovy b/regression-test/suites/cross_ds/fullsync/with_alias_1/test_cds_fullsync_with_alias_1.groovy new file mode 100644 index 00000000..ef374a67 --- /dev/null +++ b/regression-test/suites/cross_ds/fullsync/with_alias_1/test_cds_fullsync_with_alias_1.groovy @@ -0,0 +1,159 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("test_cds_fullsync_with_alias_1") { + def helper = new GroovyShell(new Binding(['suite': delegate])) + .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + + if (!helper.has_feature("feature_replace_not_matched_with_alias")) { + logger.info("this case only works with feature_replace_not_matched_with_alias") + return + } + + if (helper.has_feature("feature_restore_replace_diff_schema")) { + logger.info("this case only works without feature_restore_replace_diff_schema") + return + } + + def tableName = "tbl_" + helper.randomSuffix() + def test_num = 0 + def insert_num = 20 + def opPartitonName = "less" + + def exist = { res -> Boolean + return res.size() != 0 + } + def notExist = { res -> Boolean + return res.size() == 0 + } + def has_count = { count -> + return { res -> Boolean + res.size() == count + } + } + + helper.enableDbBinlog() + + logger.info("create two tables") + + sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT + ) + ENGINE=OLAP + UNIQUE KEY(`test`, `id`) + PARTITION BY RANGE(`id`) + ( + PARTITION `${opPartitonName}_0` VALUES LESS THAN ("0"), + PARTITION `${opPartitonName}_1` VALUES LESS THAN ("10"), + PARTITION `${opPartitonName}_2` VALUES LESS THAN ("20"), + PARTITION `${opPartitonName}_3` VALUES LESS THAN ("30"), + PARTITION `${opPartitonName}_4` VALUES LESS THAN ("40") + ) + DISTRIBUTED BY HASH(id) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "binlog.enable" = "true" + ) + """ + sql """ + CREATE TABLE if NOT EXISTS ${tableName}_1 + ( + `test` INT, + `id` INT + ) + ENGINE=OLAP + UNIQUE KEY(`test`, `id`) + PARTITION BY RANGE(`id`) + ( + PARTITION `${opPartitonName}_0` VALUES LESS THAN ("0"), + PARTITION `${opPartitonName}_1` VALUES LESS THAN ("10"), + PARTITION `${opPartitonName}_2` VALUES LESS THAN ("20"), + PARTITION `${opPartitonName}_3` VALUES LESS THAN ("30"), + PARTITION `${opPartitonName}_4` VALUES LESS THAN ("40") + ) + DISTRIBUTED BY HASH(id) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "binlog.enable" = "true" + ) + """ + + List values = [] + for (int index = 0; index < insert_num; index++) { + values.add("(${test_num}, ${index})") + } + + sql """ INSERT INTO ${tableName} VALUES ${values.join(",")} """ + sql """ INSERT INTO ${tableName}_1 VALUES ${values.join(",")} """ + sql "sync" + + helper.ccrJobDelete() + helper.ccrJobCreate() + + assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 60)) + assertTrue(helper.checkRestoreFinishTimesOf("${tableName}_1", 60)) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableName}", insert_num, 60)) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableName}_1", insert_num, 60)) + assertTrue(helper.checkJobInIncrementalSync(60)) + + logger.info("pause ccr job, change table1 schema and trigger fullsync, then the upsert of table2 should be synced") + helper.ccrJobPause() + helper.force_fullsync() + helper.addFailpoint("fullsync_restore_snapshot_rebooting", "true") + + values.clear() + for (int index = insert_num; index < insert_num * 2; index++) { + values.add("(${test_num}, ${index})") + } + + sql """ INSERT INTO ${tableName} VALUES ${values.join(",")} """ + sql """ INSERT INTO ${tableName}_1 VALUES ${values.join(",")} """ + + sql """ + ALTER TABLE ${tableName} + ADD COLUMN `first` INT KEY DEFAULT "0" FIRST + """ + sql "sync" + + assertTrue(helper.checkShowTimesOf(""" + SHOW ALTER TABLE COLUMN + FROM ${context.dbName} + WHERE TableName = "${tableName}" AND State = "FINISHED" + """, + has_count(1), 30)) + + sql "sync" + + logger.info("resume job, then the upserts both table1 and table2 will be synced to downstream") + helper.ccrJobResume() + + def has_column_first = { res -> Boolean + // Field == 'first' && 'Key' == 'YES' + return res[0][0] == 'first' && (res[0][3] == 'YES' || res[0][3] == 'true') + } + + assertTrue(helper.checkShowTimesOf("SHOW COLUMNS FROM `${tableName}`", has_column_first, 60, "target_sql")) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableName}", insert_num * 2, 60)) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableName}_1", insert_num * 2, 60)) +} + + + + From b8a7d6bccd7a1e789619f0f4cd0f0975ad13b76b Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Thu, 13 Feb 2025 10:52:42 +0800 Subject: [PATCH 07/41] [branch-3.0] Fix change table to duplicate for row store related suties (#413) --- .../alt_prop/row_store/test_ds_alt_prop_row_store.groovy | 2 +- .../alt_prop/row_store/test_ts_alt_prop_row_store.groovy | 2 +- .../alt_prop/row_store/test_tsa_alt_prop_row_store.groovy | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy b/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy index addfe403..a6df790f 100644 --- a/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy +++ b/regression-test/suites/db_sync/alt_prop/row_store/test_ds_alt_prop_row_store.groovy @@ -79,7 +79,7 @@ suite("test_ds_alt_prop_row_store") { `id` INT ) ENGINE=OLAP - AGGREGATE KEY(`test`, `id`) + DUPLICATE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( ) diff --git a/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy b/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy index ae44071b..59eaed3b 100644 --- a/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy +++ b/regression-test/suites/table_sync/alt_prop/row_store/test_ts_alt_prop_row_store.groovy @@ -79,7 +79,7 @@ suite("test_ts_alt_prop_row_store") { `id` INT ) ENGINE=OLAP - AGGREGATE KEY(`test`, `id`) + DUPLICATE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( ) diff --git a/regression-test/suites/table_sync_alias/alt_prop/row_store/test_tsa_alt_prop_row_store.groovy b/regression-test/suites/table_sync_alias/alt_prop/row_store/test_tsa_alt_prop_row_store.groovy index 5e90e2b3..ac3dd265 100644 --- a/regression-test/suites/table_sync_alias/alt_prop/row_store/test_tsa_alt_prop_row_store.groovy +++ b/regression-test/suites/table_sync_alias/alt_prop/row_store/test_tsa_alt_prop_row_store.groovy @@ -81,7 +81,7 @@ suite("test_tsa_alt_prop_row_store") { `id` INT ) ENGINE=OLAP - AGGREGATE KEY(`test`, `id`) + DUPLICATE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( ) From 79e652dbbdf33b18fbb78e6232c1f47c0b74f818 Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Wed, 22 Jan 2025 17:37:44 +0800 Subject: [PATCH 08/41] Add F/L commitSeq and commitTs for get_lag (#395) --- .../frontendservice/FrontendService.go | 306 +++++++++++++++++- .../frontendservice/k-FrontendService.go | 204 ++++++++++++ pkg/rpc/thrift/FrontendService.thrift | 4 + pkg/service/http_service.go | 44 ++- 4 files changed, 552 insertions(+), 6 deletions(-) diff --git a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go index 159b689c..984920b9 100644 --- a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go @@ -62575,9 +62575,13 @@ func (p *TGetMasterTokenResult_) Field3DeepEqual(src *types.TNetworkAddress) boo } type TGetBinlogLagResult_ struct { - Status *status.TStatus `thrift:"status,1,optional" frugal:"1,optional,status.TStatus" json:"status,omitempty"` - Lag *int64 `thrift:"lag,2,optional" frugal:"2,optional,i64" json:"lag,omitempty"` - MasterAddress *types.TNetworkAddress `thrift:"master_address,3,optional" frugal:"3,optional,types.TNetworkAddress" json:"master_address,omitempty"` + Status *status.TStatus `thrift:"status,1,optional" frugal:"1,optional,status.TStatus" json:"status,omitempty"` + Lag *int64 `thrift:"lag,2,optional" frugal:"2,optional,i64" json:"lag,omitempty"` + MasterAddress *types.TNetworkAddress `thrift:"master_address,3,optional" frugal:"3,optional,types.TNetworkAddress" json:"master_address,omitempty"` + FirstCommitSeq *int64 `thrift:"first_commit_seq,4,optional" frugal:"4,optional,i64" json:"first_commit_seq,omitempty"` + LastCommitSeq *int64 `thrift:"last_commit_seq,5,optional" frugal:"5,optional,i64" json:"last_commit_seq,omitempty"` + FirstBinlogTimestamp *int64 `thrift:"first_binlog_timestamp,6,optional" frugal:"6,optional,i64" json:"first_binlog_timestamp,omitempty"` + LastBinlogTimestamp *int64 `thrift:"last_binlog_timestamp,7,optional" frugal:"7,optional,i64" json:"last_binlog_timestamp,omitempty"` } func NewTGetBinlogLagResult_() *TGetBinlogLagResult_ { @@ -62613,6 +62617,42 @@ func (p *TGetBinlogLagResult_) GetMasterAddress() (v *types.TNetworkAddress) { } return p.MasterAddress } + +var TGetBinlogLagResult__FirstCommitSeq_DEFAULT int64 + +func (p *TGetBinlogLagResult_) GetFirstCommitSeq() (v int64) { + if !p.IsSetFirstCommitSeq() { + return TGetBinlogLagResult__FirstCommitSeq_DEFAULT + } + return *p.FirstCommitSeq +} + +var TGetBinlogLagResult__LastCommitSeq_DEFAULT int64 + +func (p *TGetBinlogLagResult_) GetLastCommitSeq() (v int64) { + if !p.IsSetLastCommitSeq() { + return TGetBinlogLagResult__LastCommitSeq_DEFAULT + } + return *p.LastCommitSeq +} + +var TGetBinlogLagResult__FirstBinlogTimestamp_DEFAULT int64 + +func (p *TGetBinlogLagResult_) GetFirstBinlogTimestamp() (v int64) { + if !p.IsSetFirstBinlogTimestamp() { + return TGetBinlogLagResult__FirstBinlogTimestamp_DEFAULT + } + return *p.FirstBinlogTimestamp +} + +var TGetBinlogLagResult__LastBinlogTimestamp_DEFAULT int64 + +func (p *TGetBinlogLagResult_) GetLastBinlogTimestamp() (v int64) { + if !p.IsSetLastBinlogTimestamp() { + return TGetBinlogLagResult__LastBinlogTimestamp_DEFAULT + } + return *p.LastBinlogTimestamp +} func (p *TGetBinlogLagResult_) SetStatus(val *status.TStatus) { p.Status = val } @@ -62622,11 +62662,27 @@ func (p *TGetBinlogLagResult_) SetLag(val *int64) { func (p *TGetBinlogLagResult_) SetMasterAddress(val *types.TNetworkAddress) { p.MasterAddress = val } +func (p *TGetBinlogLagResult_) SetFirstCommitSeq(val *int64) { + p.FirstCommitSeq = val +} +func (p *TGetBinlogLagResult_) SetLastCommitSeq(val *int64) { + p.LastCommitSeq = val +} +func (p *TGetBinlogLagResult_) SetFirstBinlogTimestamp(val *int64) { + p.FirstBinlogTimestamp = val +} +func (p *TGetBinlogLagResult_) SetLastBinlogTimestamp(val *int64) { + p.LastBinlogTimestamp = val +} var fieldIDToName_TGetBinlogLagResult_ = map[int16]string{ 1: "status", 2: "lag", 3: "master_address", + 4: "first_commit_seq", + 5: "last_commit_seq", + 6: "first_binlog_timestamp", + 7: "last_binlog_timestamp", } func (p *TGetBinlogLagResult_) IsSetStatus() bool { @@ -62641,6 +62697,22 @@ func (p *TGetBinlogLagResult_) IsSetMasterAddress() bool { return p.MasterAddress != nil } +func (p *TGetBinlogLagResult_) IsSetFirstCommitSeq() bool { + return p.FirstCommitSeq != nil +} + +func (p *TGetBinlogLagResult_) IsSetLastCommitSeq() bool { + return p.LastCommitSeq != nil +} + +func (p *TGetBinlogLagResult_) IsSetFirstBinlogTimestamp() bool { + return p.FirstBinlogTimestamp != nil +} + +func (p *TGetBinlogLagResult_) IsSetLastBinlogTimestamp() bool { + return p.LastBinlogTimestamp != nil +} + func (p *TGetBinlogLagResult_) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -62684,6 +62756,38 @@ func (p *TGetBinlogLagResult_) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 4: + if fieldTypeId == thrift.I64 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I64 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -62740,6 +62844,50 @@ func (p *TGetBinlogLagResult_) ReadField3(iprot thrift.TProtocol) error { p.MasterAddress = _field return nil } +func (p *TGetBinlogLagResult_) ReadField4(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.FirstCommitSeq = _field + return nil +} +func (p *TGetBinlogLagResult_) ReadField5(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.LastCommitSeq = _field + return nil +} +func (p *TGetBinlogLagResult_) ReadField6(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.FirstBinlogTimestamp = _field + return nil +} +func (p *TGetBinlogLagResult_) ReadField7(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.LastBinlogTimestamp = _field + return nil +} func (p *TGetBinlogLagResult_) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -62759,6 +62907,22 @@ func (p *TGetBinlogLagResult_) Write(oprot thrift.TProtocol) (err error) { fieldId = 3 goto WriteFieldError } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -62834,6 +62998,82 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } +func (p *TGetBinlogLagResult_) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetFirstCommitSeq() { + if err = oprot.WriteFieldBegin("first_commit_seq", thrift.I64, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.FirstCommitSeq); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TGetBinlogLagResult_) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetLastCommitSeq() { + if err = oprot.WriteFieldBegin("last_commit_seq", thrift.I64, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.LastCommitSeq); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *TGetBinlogLagResult_) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetFirstBinlogTimestamp() { + if err = oprot.WriteFieldBegin("first_binlog_timestamp", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.FirstBinlogTimestamp); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *TGetBinlogLagResult_) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetLastBinlogTimestamp() { + if err = oprot.WriteFieldBegin("last_binlog_timestamp", thrift.I64, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.LastBinlogTimestamp); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + func (p *TGetBinlogLagResult_) String() string { if p == nil { return "" @@ -62857,6 +63097,18 @@ func (p *TGetBinlogLagResult_) DeepEqual(ano *TGetBinlogLagResult_) bool { if !p.Field3DeepEqual(ano.MasterAddress) { return false } + if !p.Field4DeepEqual(ano.FirstCommitSeq) { + return false + } + if !p.Field5DeepEqual(ano.LastCommitSeq) { + return false + } + if !p.Field6DeepEqual(ano.FirstBinlogTimestamp) { + return false + } + if !p.Field7DeepEqual(ano.LastBinlogTimestamp) { + return false + } return true } @@ -62886,6 +63138,54 @@ func (p *TGetBinlogLagResult_) Field3DeepEqual(src *types.TNetworkAddress) bool } return true } +func (p *TGetBinlogLagResult_) Field4DeepEqual(src *int64) bool { + + if p.FirstCommitSeq == src { + return true + } else if p.FirstCommitSeq == nil || src == nil { + return false + } + if *p.FirstCommitSeq != *src { + return false + } + return true +} +func (p *TGetBinlogLagResult_) Field5DeepEqual(src *int64) bool { + + if p.LastCommitSeq == src { + return true + } else if p.LastCommitSeq == nil || src == nil { + return false + } + if *p.LastCommitSeq != *src { + return false + } + return true +} +func (p *TGetBinlogLagResult_) Field6DeepEqual(src *int64) bool { + + if p.FirstBinlogTimestamp == src { + return true + } else if p.FirstBinlogTimestamp == nil || src == nil { + return false + } + if *p.FirstBinlogTimestamp != *src { + return false + } + return true +} +func (p *TGetBinlogLagResult_) Field7DeepEqual(src *int64) bool { + + if p.LastBinlogTimestamp == src { + return true + } else if p.LastBinlogTimestamp == nil || src == nil { + return false + } + if *p.LastBinlogTimestamp != *src { + return false + } + return true +} type TUpdateFollowerStatsCacheRequest struct { Key *string `thrift:"key,1,optional" frugal:"1,optional,string" json:"key,omitempty"` diff --git a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go index aa1acef3..428ad4b1 100644 --- a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go @@ -45540,6 +45540,62 @@ func (p *TGetBinlogLagResult_) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 4: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -45614,6 +45670,58 @@ func (p *TGetBinlogLagResult_) FastReadField3(buf []byte) (int, error) { return offset, nil } +func (p *TGetBinlogLagResult_) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.FirstCommitSeq = &v + + } + return offset, nil +} + +func (p *TGetBinlogLagResult_) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.LastCommitSeq = &v + + } + return offset, nil +} + +func (p *TGetBinlogLagResult_) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.FirstBinlogTimestamp = &v + + } + return offset, nil +} + +func (p *TGetBinlogLagResult_) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.LastBinlogTimestamp = &v + + } + return offset, nil +} + // for compatibility func (p *TGetBinlogLagResult_) FastWrite(buf []byte) int { return 0 @@ -45624,6 +45732,10 @@ func (p *TGetBinlogLagResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift. offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetBinlogLagResult") if p != nil { offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) } @@ -45639,6 +45751,10 @@ func (p *TGetBinlogLagResult_) BLength() int { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -45676,6 +45792,50 @@ func (p *TGetBinlogLagResult_) fastWriteField3(buf []byte, binaryWriter bthrift. return offset } +func (p *TGetBinlogLagResult_) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetFirstCommitSeq() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "first_commit_seq", thrift.I64, 4) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.FirstCommitSeq) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetBinlogLagResult_) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLastCommitSeq() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "last_commit_seq", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LastCommitSeq) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetBinlogLagResult_) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetFirstBinlogTimestamp() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "first_binlog_timestamp", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.FirstBinlogTimestamp) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetBinlogLagResult_) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLastBinlogTimestamp() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "last_binlog_timestamp", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LastBinlogTimestamp) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TGetBinlogLagResult_) field1Length() int { l := 0 if p.IsSetStatus() { @@ -45707,6 +45867,50 @@ func (p *TGetBinlogLagResult_) field3Length() int { return l } +func (p *TGetBinlogLagResult_) field4Length() int { + l := 0 + if p.IsSetFirstCommitSeq() { + l += bthrift.Binary.FieldBeginLength("first_commit_seq", thrift.I64, 4) + l += bthrift.Binary.I64Length(*p.FirstCommitSeq) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TGetBinlogLagResult_) field5Length() int { + l := 0 + if p.IsSetLastCommitSeq() { + l += bthrift.Binary.FieldBeginLength("last_commit_seq", thrift.I64, 5) + l += bthrift.Binary.I64Length(*p.LastCommitSeq) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TGetBinlogLagResult_) field6Length() int { + l := 0 + if p.IsSetFirstBinlogTimestamp() { + l += bthrift.Binary.FieldBeginLength("first_binlog_timestamp", thrift.I64, 6) + l += bthrift.Binary.I64Length(*p.FirstBinlogTimestamp) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TGetBinlogLagResult_) field7Length() int { + l := 0 + if p.IsSetLastBinlogTimestamp() { + l += bthrift.Binary.FieldBeginLength("last_binlog_timestamp", thrift.I64, 7) + l += bthrift.Binary.I64Length(*p.LastBinlogTimestamp) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TUpdateFollowerStatsCacheRequest) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/pkg/rpc/thrift/FrontendService.thrift b/pkg/rpc/thrift/FrontendService.thrift index c1a4d106..fca9c484 100644 --- a/pkg/rpc/thrift/FrontendService.thrift +++ b/pkg/rpc/thrift/FrontendService.thrift @@ -1465,6 +1465,10 @@ struct TGetBinlogLagResult { 1: optional Status.TStatus status 2: optional i64 lag 3: optional Types.TNetworkAddress master_address + 4: optional i64 first_commit_seq + 5: optional i64 last_commit_seq + 6: optional i64 first_binlog_timestamp + 7: optional i64 last_binlog_timestamp } struct TUpdateFollowerStatsCacheRequest { diff --git a/pkg/service/http_service.go b/pkg/service/http_service.go index bc155cd8..dbac7168 100644 --- a/pkg/service/http_service.go +++ b/pkg/service/http_service.go @@ -25,6 +25,7 @@ import ( "reflect" "strconv" "strings" + "time" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/selectdb/ccr_syncer/pkg/ccr" @@ -222,7 +223,12 @@ func (s *HttpService) getLagHandler(w http.ResponseWriter, r *http.Request) { type result struct { *defaultResult - Lag int64 `json:"lag"` + Lag int64 `json:"lag"` + FirstCommitSeq int64 `json:"first_commit_seq"` + LastCommitSeq int64 `json:"last_commit_seq"` + FirstBinlogTimestamp string `json:"first_binlog_timestamp"` + LastBinlogTimestamp string `json:"last_binlog_timestamp"` + TimeInterval float64 `json:"time_interval"` } var lagResult *result defer func() { writeJson(w, lagResult) }() @@ -308,10 +314,31 @@ func (s *HttpService) getLagHandler(w http.ResponseWriter, r *http.Request) { } lag := resp.GetLag() + firstCommitSeq := resp.GetFirstCommitSeq() + lastCommitSeq := resp.GetLastCommitSeq() + var firstBinlogTimestamp, lastBinlogTimestamp string + + if ts := resp.GetFirstBinlogTimestamp(); ts != -1 { + firstBinlogTimestamp = ConvertTimestampToString(resp.GetFirstBinlogTimestamp()) + } else { + firstBinlogTimestamp = "1970-01-01 08:00:00" + } + if ts := resp.GetLastBinlogTimestamp(); ts != -1 { + lastBinlogTimestamp = ConvertTimestampToString(resp.GetLastBinlogTimestamp()) + } else { + lastBinlogTimestamp = "1970-01-01 08:00:00" + } + + timeInterval := CalculateTimeDifferenceInSeconds(lastBinlogTimestamp, firstBinlogTimestamp) lagResult = &result{ - defaultResult: newSuccessResult(), - Lag: lag, + defaultResult: newSuccessResult(), + Lag: lag, + FirstCommitSeq: firstCommitSeq, + LastCommitSeq: lastCommitSeq, + FirstBinlogTimestamp: firstBinlogTimestamp, + LastBinlogTimestamp: lastBinlogTimestamp, + TimeInterval: timeInterval, } } @@ -907,3 +934,14 @@ func (s *HttpService) Stop() error { } return nil } + +func ConvertTimestampToString(timestamp int64) string { + return time.Unix(0, timestamp*int64(time.Millisecond)).Format(time.DateTime) +} + +func CalculateTimeDifferenceInSeconds(timeStr1, timeStr2 string) float64 { + t1, _ := time.Parse(time.DateTime, timeStr1) + t2, _ := time.Parse(time.DateTime, timeStr2) + diff := t1.Sub(t2) + return diff.Seconds() +} From 4de6762c7d26828cc7f3d2c1cd9e84276e53a70f Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Sat, 8 Feb 2025 15:33:02 +0800 Subject: [PATCH 09/41] Add force_replace flag for restore (#396) --- pkg/ccr/job.go | 6 ++ pkg/rpc/fe.go | 6 +- .../frontendservice/FrontendService.go | 75 ++++++++++++++++++ .../frontendservice/k-FrontendService.go | 51 ++++++++++++ pkg/rpc/thrift/FrontendService.thrift | 1 + .../test_ds_tbl_diff_schema.groovy | 78 +++++++++++++++++++ 6 files changed, 215 insertions(+), 2 deletions(-) create mode 100644 regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 2aca3da4..c7e03bba 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -66,6 +66,7 @@ var ( featureSkipRollupBinlogs bool featureTxnInsert bool featureFilterStorageMedium bool + featureRestoreReplaceDiffSchema bool ErrMaterializedViewTable = xerror.NewWithoutStack(xerror.Meta, "Not support table type: materialized view") ) @@ -95,6 +96,8 @@ func init() { "enable txn insert support") flag.BoolVar(&featureFilterStorageMedium, "feature_filter_storage_medium", true, "enable filter storage medium property") + flag.BoolVar(&featureRestoreReplaceDiffSchema, "feature_restore_replace_diff_schema", true, + "replace the table with different schema during restore") } type SyncType int @@ -1049,6 +1052,9 @@ func (j *Job) fullSync() error { if featureAtomicRestore { restoreReq.AtomicRestore = true } + if featureRestoreReplaceDiffSchema { + restoreReq.ForceReplace = true + } restoreResp, err := destRpc.RestoreSnapshot(dest, &restoreReq) if err != nil { return err diff --git a/pkg/rpc/fe.go b/pkg/rpc/fe.go index 8f2fa285..89fb5fd3 100644 --- a/pkg/rpc/fe.go +++ b/pkg/rpc/fe.go @@ -95,6 +95,7 @@ type RestoreSnapshotRequest struct { CleanPartitions bool CleanTables bool Compress bool + ForceReplace bool } type IFeRpc interface { @@ -802,14 +803,15 @@ func (rpc *singleFeClient) RestoreSnapshot(spec *base.Spec, restoreReq *RestoreS CleanPartitions: &restoreReq.CleanPartitions, AtomicRestore: &restoreReq.AtomicRestore, Compressed: utils.ThriftValueWrapper(restoreReq.Compress), + ForceReplace: &restoreReq.ForceReplace, } setAuthInfo(req, spec) // NOTE: ignore meta, because it's too large - log.Debugf("RestoreSnapshotRequest user %s, db %s, table %s, label name %s, properties %v, clean tables: %t, clean partitions: %t, atomic restore: %t, compressed: %t", + log.Debugf("RestoreSnapshotRequest user %s, db %s, table %s, label name %s, properties %v, clean tables: %t, clean partitions: %t, atomic restore: %t, compressed: %t, forceReplace: %t", req.GetUser(), req.GetDb(), req.GetTable(), req.GetLabelName(), properties, restoreReq.CleanTables, restoreReq.CleanPartitions, restoreReq.AtomicRestore, - req.GetCompressed()) + req.GetCompressed(), restoreReq.ForceReplace) if resp, err := client.RestoreSnapshot(context.Background(), req); err != nil { return nil, xerror.Wrapf(err, xerror.RPC, "RestoreSnapshot failed") diff --git a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go index 984920b9..e9e66bcd 100644 --- a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go @@ -57603,6 +57603,7 @@ type TRestoreSnapshotRequest struct { CleanPartitions *bool `thrift:"clean_partitions,14,optional" frugal:"14,optional,bool" json:"clean_partitions,omitempty"` AtomicRestore *bool `thrift:"atomic_restore,15,optional" frugal:"15,optional,bool" json:"atomic_restore,omitempty"` Compressed *bool `thrift:"compressed,16,optional" frugal:"16,optional,bool" json:"compressed,omitempty"` + ForceReplace *bool `thrift:"force_replace,17,optional" frugal:"17,optional,bool" json:"force_replace,omitempty"` } func NewTRestoreSnapshotRequest() *TRestoreSnapshotRequest { @@ -57755,6 +57756,15 @@ func (p *TRestoreSnapshotRequest) GetCompressed() (v bool) { } return *p.Compressed } + +var TRestoreSnapshotRequest_ForceReplace_DEFAULT bool + +func (p *TRestoreSnapshotRequest) GetForceReplace() (v bool) { + if !p.IsSetForceReplace() { + return TRestoreSnapshotRequest_ForceReplace_DEFAULT + } + return *p.ForceReplace +} func (p *TRestoreSnapshotRequest) SetCluster(val *string) { p.Cluster = val } @@ -57803,6 +57813,9 @@ func (p *TRestoreSnapshotRequest) SetAtomicRestore(val *bool) { func (p *TRestoreSnapshotRequest) SetCompressed(val *bool) { p.Compressed = val } +func (p *TRestoreSnapshotRequest) SetForceReplace(val *bool) { + p.ForceReplace = val +} var fieldIDToName_TRestoreSnapshotRequest = map[int16]string{ 1: "cluster", @@ -57821,6 +57834,7 @@ var fieldIDToName_TRestoreSnapshotRequest = map[int16]string{ 14: "clean_partitions", 15: "atomic_restore", 16: "compressed", + 17: "force_replace", } func (p *TRestoreSnapshotRequest) IsSetCluster() bool { @@ -57887,6 +57901,10 @@ func (p *TRestoreSnapshotRequest) IsSetCompressed() bool { return p.Compressed != nil } +func (p *TRestoreSnapshotRequest) IsSetForceReplace() bool { + return p.ForceReplace != nil +} + func (p *TRestoreSnapshotRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -58034,6 +58052,14 @@ func (p *TRestoreSnapshotRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 17: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField17(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -58269,6 +58295,17 @@ func (p *TRestoreSnapshotRequest) ReadField16(iprot thrift.TProtocol) error { p.Compressed = _field return nil } +func (p *TRestoreSnapshotRequest) ReadField17(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.ForceReplace = _field + return nil +} func (p *TRestoreSnapshotRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -58340,6 +58377,10 @@ func (p *TRestoreSnapshotRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 16 goto WriteFieldError } + if err = p.writeField17(oprot); err != nil { + fieldId = 17 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -58681,6 +58722,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err) } +func (p *TRestoreSnapshotRequest) writeField17(oprot thrift.TProtocol) (err error) { + if p.IsSetForceReplace() { + if err = oprot.WriteFieldBegin("force_replace", thrift.BOOL, 17); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.ForceReplace); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) +} + func (p *TRestoreSnapshotRequest) String() string { if p == nil { return "" @@ -58743,6 +58803,9 @@ func (p *TRestoreSnapshotRequest) DeepEqual(ano *TRestoreSnapshotRequest) bool { if !p.Field16DeepEqual(ano.Compressed) { return false } + if !p.Field17DeepEqual(ano.ForceReplace) { + return false + } return true } @@ -58930,6 +58993,18 @@ func (p *TRestoreSnapshotRequest) Field16DeepEqual(src *bool) bool { } return true } +func (p *TRestoreSnapshotRequest) Field17DeepEqual(src *bool) bool { + + if p.ForceReplace == src { + return true + } else if p.ForceReplace == nil || src == nil { + return false + } + if *p.ForceReplace != *src { + return false + } + return true +} type TRestoreSnapshotResult_ struct { Status *status.TStatus `thrift:"status,1,optional" frugal:"1,optional,status.TStatus" json:"status,omitempty"` diff --git a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go index 428ad4b1..4a21708c 100644 --- a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go @@ -42106,6 +42106,20 @@ func (p *TRestoreSnapshotRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 17: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField17(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -42392,6 +42406,19 @@ func (p *TRestoreSnapshotRequest) FastReadField16(buf []byte) (int, error) { return offset, nil } +func (p *TRestoreSnapshotRequest) FastReadField17(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ForceReplace = &v + + } + return offset, nil +} + // for compatibility func (p *TRestoreSnapshotRequest) FastWrite(buf []byte) int { return 0 @@ -42405,6 +42432,7 @@ func (p *TRestoreSnapshotRequest) FastWriteNocopy(buf []byte, binaryWriter bthri offset += p.fastWriteField14(buf[offset:], binaryWriter) offset += p.fastWriteField15(buf[offset:], binaryWriter) offset += p.fastWriteField16(buf[offset:], binaryWriter) + offset += p.fastWriteField17(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) @@ -42443,6 +42471,7 @@ func (p *TRestoreSnapshotRequest) BLength() int { l += p.field14Length() l += p.field15Length() l += p.field16Length() + l += p.field17Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -42643,6 +42672,17 @@ func (p *TRestoreSnapshotRequest) fastWriteField16(buf []byte, binaryWriter bthr return offset } +func (p *TRestoreSnapshotRequest) fastWriteField17(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetForceReplace() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "force_replace", thrift.BOOL, 17) + offset += bthrift.Binary.WriteBool(buf[offset:], *p.ForceReplace) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TRestoreSnapshotRequest) field1Length() int { l := 0 if p.IsSetCluster() { @@ -42829,6 +42869,17 @@ func (p *TRestoreSnapshotRequest) field16Length() int { return l } +func (p *TRestoreSnapshotRequest) field17Length() int { + l := 0 + if p.IsSetForceReplace() { + l += bthrift.Binary.FieldBeginLength("force_replace", thrift.BOOL, 17) + l += bthrift.Binary.BoolLength(*p.ForceReplace) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TRestoreSnapshotResult_) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/pkg/rpc/thrift/FrontendService.thrift b/pkg/rpc/thrift/FrontendService.thrift index fca9c484..f48f7291 100644 --- a/pkg/rpc/thrift/FrontendService.thrift +++ b/pkg/rpc/thrift/FrontendService.thrift @@ -1388,6 +1388,7 @@ struct TRestoreSnapshotRequest { 14: optional bool clean_partitions 15: optional bool atomic_restore 16: optional bool compressed; + 17: optional bool force_replace } struct TRestoreSnapshotResult { diff --git a/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy b/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy new file mode 100644 index 00000000..cf64b7f2 --- /dev/null +++ b/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy @@ -0,0 +1,78 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("test_ds_tbl_diff_schema") { + def helper = new GroovyShell(new Binding(['suite': delegate])) + .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + + def dbName = context.dbName + def tableName = "tbl_" + helper.randomSuffix() + + def exist = { res -> Boolean + return res.size() != 0 + } + + def notExist = { res -> Boolean + return res.size() == 0 + } + + sql "DROP TABLE IF EXISTS ${tableName}" + target_sql "DROP TABLE IF EXISTS ${tableName}" + + sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT + ) + ENGINE=OLAP + PARTITION BY RANGE(`test`, `id`) + ( + ) + DISTRIBUTED BY HASH(id) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "binlog.enable" = "true" + ) + """ + + target_sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT + ) + ENGINE=OLAP + PARTITION BY LIST(`test`, `id`) + ( + ) + DISTRIBUTED BY HASH(id) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "binlog.enable" = "true" + ) + """ + + helper.ccrJobDelete() + helper.ccrJobCreate() + + assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 30)) + + assertTrue(helper.checkShowTimesOf("SHOW TABLES LIKE \"${tableName}\"", exist, 60, "sql")) + + assertTrue(helper.checkShowTimesOf("SHOW TABLES LIKE \"${tableName}\"", exist, 60, "target")) +} \ No newline at end of file From d189c7775d625938428cc2dd4ae0b933b06746ab Mon Sep 17 00:00:00 2001 From: walter Date: Sat, 8 Feb 2025 15:33:29 +0800 Subject: [PATCH 10/41] feat: support lock binlogs (#399) --- pkg/ccr/checker.go | 2 +- pkg/ccr/job.go | 74 +- pkg/ccr/job_progress.go | 9 +- pkg/rpc/fe.go | 38 + .../kitex_gen/agentservice/AgentService.go | 38 +- .../kitex_gen/agentservice/k-AgentService.go | 18 +- .../backendservice/BackendService.go | 706 +- .../backendservice/backendservice.go | 29 - .../backendservice/backendservice/client.go | 6 - .../backendservice/k-BackendService.go | 474 +- pkg/rpc/kitex_gen/data/Data.go | 585 - pkg/rpc/kitex_gen/data/k-Data.go | 485 - pkg/rpc/kitex_gen/datasinks/DataSinks.go | 75 + pkg/rpc/kitex_gen/datasinks/k-DataSinks.go | 51 + .../frontendservice/FrontendService.go | 13464 ++++------- .../frontendservice/frontendservice/client.go | 12 +- .../frontendservice/frontendservice.go | 58 +- .../frontendservice/k-FrontendService.go | 20070 +++++++--------- .../kitex_gen/masterservice/MasterService.go | 292 +- .../masterservice/k-MasterService.go | 208 + .../PaloInternalService.go | 3289 +-- .../k-PaloInternalService.go | 2596 +- pkg/rpc/kitex_gen/plannodes/PlanNodes.go | 1238 +- pkg/rpc/kitex_gen/plannodes/k-PlanNodes.go | 898 +- pkg/rpc/kitex_gen/types/Types.go | 99 +- pkg/rpc/thrift/AgentService.thrift | 2 +- pkg/rpc/thrift/BackendService.thrift | 12 +- pkg/rpc/thrift/Data.thrift | 26 - pkg/rpc/thrift/DataSinks.thrift | 1 + pkg/rpc/thrift/FrontendService.thrift | 247 +- pkg/rpc/thrift/MasterService.thrift | 4 + pkg/rpc/thrift/PaloInternalService.thrift | 93 +- pkg/rpc/thrift/PlanNodes.thrift | 58 +- pkg/rpc/thrift/RuntimeProfile.thrift | 1 + pkg/rpc/thrift/Types.thrift | 21 +- 35 files changed, 16787 insertions(+), 28492 deletions(-) diff --git a/pkg/ccr/checker.go b/pkg/ccr/checker.go index f323db92..f7868dfa 100644 --- a/pkg/ccr/checker.go +++ b/pkg/ccr/checker.go @@ -109,7 +109,7 @@ func (c *Checker) next() { case checkerStateUpdate: c.state = checkerStateRefresh case checkerStateCheck: - if c.deadSyncers != nil && len(c.deadSyncers) != 0 { + if len(c.deadSyncers) != 0 { c.state = checkerStateRebalance } else { c.state = checkerStateFinish diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index c7e03bba..413bf736 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -18,10 +18,12 @@ package ccr import ( "context" + "crypto/md5" "encoding/json" "errors" "flag" "fmt" + "io" "math" "math/rand" "regexp" @@ -52,6 +54,8 @@ const ( SkipBySilence = "silence" SkipByFullSync = "fullsync" + + LockLastBinlogCommitSeq = -1 ) var ( @@ -152,6 +156,7 @@ type JobExtra struct { type Job struct { Name string `json:"name"` + Id string `json:"id"` SyncType SyncType `json:"sync_type"` Src base.Spec `json:"src"` ISrc base.Specer `json:"-"` @@ -199,8 +204,10 @@ func NewJobFromService(name string, ctx context.Context) (*Job, error) { factory := jobContext.Factory src := jobContext.Src dest := jobContext.Dest + id := getJobId(name, src, dest) job := &Job{ Name: name, + Id: id, Src: src, ISrc: factory.NewSpecer(&src), srcMeta: factory.NewMeta(&jobContext.Src), @@ -246,6 +253,10 @@ func NewJobFromJson(jsonData string, db storage.DB, factory *Factory) (*Job, err return nil, xerror.Wrapf(err, xerror.Normal, "unmarshal json failed, json: %s", jsonData) } + if len(job.Id) == 0 { + job.Id = getJobId(job.Name, job.Src, job.Dest) + } + // recover all not json fields job.factory = factory job.ISrc = factory.NewSpecer(&job.Src) @@ -789,6 +800,12 @@ func (j *Job) fullSync() error { } } + // Step 1.1: Lock the binlogs, to avoid the binlog is deleted during the full sync. + if err := j.lockBinlog(LockLastBinlogCommitSeq); err != nil { + return err + } + + // Step 1.2: Check the tables in the source db, if the tables are empty, retry later. backupTableList := make([]string, 0) switch j.SyncType { case DBSync: @@ -813,6 +830,7 @@ func (j *Job) fullSync() error { return xerror.Errorf(xerror.Normal, "invalid sync type %s", j.SyncType) } + // Step 1.3: Create snapshot snapshotName := NewLabelWithTs(prefix) if err := j.ISrc.CreateSnapshot(snapshotName, backupTableList); err != nil { return err @@ -3105,7 +3123,8 @@ func (j *Job) incrementalSync() error { if err, backToRunLoop := j.handleBinlogs(binlogs); err != nil { return err } else if backToRunLoop { - return nil + // release the binlogs before PrevCommitSeq. + return j.lockBinlog(j.progress.PrevCommitSeq) } } } @@ -3676,6 +3695,51 @@ func (j *Job) SkipBinlog(skipCommitSeq int64, skipBy string) error { return nil } +func (j *Job) lockBinlog(lockCommitSeq int64) error { + if lockCommitSeq != LockLastBinlogCommitSeq && j.progress.LockedCommitSeq+256 > lockCommitSeq { + // Avoid frequent lock binlog + return nil + } + + var tableId int64 + switch j.SyncType { + case TableSync: + tableId = j.Src.TableId + case DBSync: + tableId = -1 + default: + return xerror.Errorf(xerror.Normal, "unknown table sync type: %v", j.SyncType) + } + + src := &j.Src + srcRpc, err := j.factory.NewFeRpc(src) + if err != nil { + log.Errorf("new fe rpc failed, src: %v, err: %+v", src, err) + return err + } + + jobUniqueId := fmt.Sprintf("%s_%s", j.Name, j.Id) + resp, err := srcRpc.LockBinlog(src, jobUniqueId, tableId, lockCommitSeq) + if err != nil { + log.Errorf("lock binlog failed, src: %v, err: %+v", src, err) + return err + } else if status := resp.GetStatus().GetStatusCode(); status != tstatus.TStatusCode_OK && + status != tstatus.TStatusCode_BINLOG_NOT_FOUND_DB && + status != tstatus.TStatusCode_BINLOG_NOT_FOUND_TABLE { + log.Errorf("lock binlog failed, src: %v, status: %+v", src, resp.GetStatus()) + return xerror.Errorf(xerror.RPC, "lock binlog failed, status: %+v", resp.GetStatus()) + } else if status != tstatus.TStatusCode_OK { + log.Warnf("lock binlog failed, src: %v, status: %+v", src, resp.GetStatus()) + return nil + } + + lockedCommitSeq := resp.GetLockedCommitSeq() + log.Debugf("lock binlog success, commit seq: %d, locked commit seq: %d", lockCommitSeq, lockedCommitSeq) + + j.progress.LockedCommitSeq = lockedCommitSeq + return nil +} + func isTxnCommitted(status *tstatus.TStatus) bool { return isStatusContainsAny(status, "is already COMMITTED") } @@ -3724,3 +3788,11 @@ func FilterStorageMediumFromCreateTableSql(createSql string) string { pattern := `"storage_medium"\s*=\s*"[^"]*"(,\s*)?` return regexp.MustCompile(pattern).ReplaceAllString(createSql, "") } + +func getJobId(name string, src base.Spec, dest base.Spec) string { + h := md5.New() + io.WriteString(h, name) + io.WriteString(h, src.String()) + io.WriteString(h, dest.String()) + return fmt.Sprintf("%x", h.Sum(nil)) +} diff --git a/pkg/ccr/job_progress.go b/pkg/ccr/job_progress.go index 070907d4..a6359a67 100644 --- a/pkg/ccr/job_progress.go +++ b/pkg/ccr/job_progress.go @@ -170,10 +170,11 @@ type JobProgress struct { // The sync id of full/partial snapshot SyncId int64 `json:"job_sync_id"` // The commit seq where the target cluster has synced. - PrevCommitSeq int64 `json:"prev_commit_seq"` - CommitSeq int64 `json:"commit_seq"` - LastCommitSeq int64 `json:"last_commit_seq"` // the last commit seq try to sync - TableMapping map[int64]int64 `json:"table_mapping"` + PrevCommitSeq int64 `json:"prev_commit_seq"` + CommitSeq int64 `json:"commit_seq"` + LastCommitSeq int64 `json:"last_commit_seq"` // the last commit seq try to sync + LockedCommitSeq int64 `json:"-"` + TableMapping map[int64]int64 `json:"table_mapping"` // the upstream table id to name mapping, build during the fullsync, // keep snapshot to avoid rename. it might be staled. TableNameMapping map[int64]string `json:"table_name_mapping,omitempty"` diff --git a/pkg/rpc/fe.go b/pkg/rpc/fe.go index 89fb5fd3..77a2adb2 100644 --- a/pkg/rpc/fe.go +++ b/pkg/rpc/fe.go @@ -112,6 +112,7 @@ type IFeRpc interface { GetDbMeta(spec *base.Spec) (*festruct.TGetMetaResult_, error) GetTableMeta(spec *base.Spec, tableIds []int64) (*festruct.TGetMetaResult_, error) GetBackends(spec *base.Spec) (*festruct.TGetBackendMetaResult_, error) + LockBinlog(spec *base.Spec, jobUniqueId string, tableId int64, commitSeq int64) (*festruct.TLockBinlogResult_, error) Address() string } @@ -487,6 +488,14 @@ func (rpc *FeRpc) GetBackends(spec *base.Spec) (*festruct.TGetBackendMetaResult_ return convertResult[festruct.TGetBackendMetaResult_](result, err) } +func (rpc *FeRpc) LockBinlog(spec *base.Spec, jobUniqueId string, tableId int64, commitSeq int64) (*festruct.TLockBinlogResult_, error) { + caller := func(client IFeRpc) (resultType, error) { + return client.LockBinlog(spec, jobUniqueId, tableId, commitSeq) + } + result, err := rpc.callWithMasterRedirect(caller) + return convertResult[festruct.TLockBinlogResult_](result, err) +} + type Request interface { SetUser(*string) SetPasswd(*string) @@ -894,3 +903,32 @@ func (rpc *singleFeClient) GetBackends(spec *base.Spec) (*festruct.TGetBackendMe return resp, nil } } + +// struct TLockBinlogRequest { +// 1: optional string cluster +// 2: optional string user +// 3: optional string passwd +// 4: optional string db +// 5: optional string table +// 6: optional i64 table_id +// 7: optional string token +// 8: optional string job_unique_id +// 9: optional i64 lock_commit_seq // if not set, lock the latest binlog +// } +func (rpc *singleFeClient) LockBinlog(spec *base.Spec, jobUniqueId string, tableId int64, lockCommitSeq int64) (*festruct.TLockBinlogResult_, error) { + log.Tracef("Call LockBinlog, addr: %s, spec: %s, tableId: %d, jobUniqueId: %s, lockCommitSeq: %d", rpc.Address(), spec, tableId, jobUniqueId, lockCommitSeq) + + client := rpc.client + req := &festruct.TLockBinlogRequest{ + TableId: &tableId, + JobUniqueId: &jobUniqueId, + LockCommitSeq: &lockCommitSeq, + } + setAuthInfo(req, spec) + + if resp, err := client.LockBinlog(context.Background(), req); err != nil { + return nil, xerror.Wrapf(err, xerror.RPC, "LockBinlog failed, req: %+v", req) + } else { + return resp, nil + } +} diff --git a/pkg/rpc/kitex_gen/agentservice/AgentService.go b/pkg/rpc/kitex_gen/agentservice/AgentService.go index 884aea93..d775116a 100644 --- a/pkg/rpc/kitex_gen/agentservice/AgentService.go +++ b/pkg/rpc/kitex_gen/agentservice/AgentService.go @@ -490,7 +490,7 @@ type TTabletSchema struct { StoreRowColumn bool `thrift:"store_row_column,16,optional" frugal:"16,optional,bool" json:"store_row_column,omitempty"` EnableSingleReplicaCompaction bool `thrift:"enable_single_replica_compaction,17,optional" frugal:"17,optional,bool" json:"enable_single_replica_compaction,omitempty"` SkipWriteIndexOnLoad bool `thrift:"skip_write_index_on_load,18,optional" frugal:"18,optional,bool" json:"skip_write_index_on_load,omitempty"` - ClusterKeyIdxes []int32 `thrift:"cluster_key_idxes,19,optional" frugal:"19,optional,list" json:"cluster_key_idxes,omitempty"` + ClusterKeyUids []int32 `thrift:"cluster_key_uids,19,optional" frugal:"19,optional,list" json:"cluster_key_uids,omitempty"` RowStoreColCids []int32 `thrift:"row_store_col_cids,20,optional" frugal:"20,optional,list" json:"row_store_col_cids,omitempty"` RowStorePageSize int64 `thrift:"row_store_page_size,21,optional" frugal:"21,optional,i64" json:"row_store_page_size,omitempty"` VariantEnableFlattenNested bool `thrift:"variant_enable_flatten_nested,22,optional" frugal:"22,optional,bool" json:"variant_enable_flatten_nested,omitempty"` @@ -663,13 +663,13 @@ func (p *TTabletSchema) GetSkipWriteIndexOnLoad() (v bool) { return p.SkipWriteIndexOnLoad } -var TTabletSchema_ClusterKeyIdxes_DEFAULT []int32 +var TTabletSchema_ClusterKeyUids_DEFAULT []int32 -func (p *TTabletSchema) GetClusterKeyIdxes() (v []int32) { - if !p.IsSetClusterKeyIdxes() { - return TTabletSchema_ClusterKeyIdxes_DEFAULT +func (p *TTabletSchema) GetClusterKeyUids() (v []int32) { + if !p.IsSetClusterKeyUids() { + return TTabletSchema_ClusterKeyUids_DEFAULT } - return p.ClusterKeyIdxes + return p.ClusterKeyUids } var TTabletSchema_RowStoreColCids_DEFAULT []int32 @@ -761,8 +761,8 @@ func (p *TTabletSchema) SetEnableSingleReplicaCompaction(val bool) { func (p *TTabletSchema) SetSkipWriteIndexOnLoad(val bool) { p.SkipWriteIndexOnLoad = val } -func (p *TTabletSchema) SetClusterKeyIdxes(val []int32) { - p.ClusterKeyIdxes = val +func (p *TTabletSchema) SetClusterKeyUids(val []int32) { + p.ClusterKeyUids = val } func (p *TTabletSchema) SetRowStoreColCids(val []int32) { p.RowStoreColCids = val @@ -796,7 +796,7 @@ var fieldIDToName_TTabletSchema = map[int16]string{ 16: "store_row_column", 17: "enable_single_replica_compaction", 18: "skip_write_index_on_load", - 19: "cluster_key_idxes", + 19: "cluster_key_uids", 20: "row_store_col_cids", 21: "row_store_page_size", 22: "variant_enable_flatten_nested", @@ -855,8 +855,8 @@ func (p *TTabletSchema) IsSetSkipWriteIndexOnLoad() bool { return p.SkipWriteIndexOnLoad != TTabletSchema_SkipWriteIndexOnLoad_DEFAULT } -func (p *TTabletSchema) IsSetClusterKeyIdxes() bool { - return p.ClusterKeyIdxes != nil +func (p *TTabletSchema) IsSetClusterKeyUids() bool { + return p.ClusterKeyUids != nil } func (p *TTabletSchema) IsSetRowStoreColCids() bool { @@ -1386,7 +1386,7 @@ func (p *TTabletSchema) ReadField19(iprot thrift.TProtocol) error { if err := iprot.ReadListEnd(); err != nil { return err } - p.ClusterKeyIdxes = _field + p.ClusterKeyUids = _field return nil } func (p *TTabletSchema) ReadField20(iprot thrift.TProtocol) error { @@ -1911,14 +1911,14 @@ WriteFieldEndError: } func (p *TTabletSchema) writeField19(oprot thrift.TProtocol) (err error) { - if p.IsSetClusterKeyIdxes() { - if err = oprot.WriteFieldBegin("cluster_key_idxes", thrift.LIST, 19); err != nil { + if p.IsSetClusterKeyUids() { + if err = oprot.WriteFieldBegin("cluster_key_uids", thrift.LIST, 19); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.I32, len(p.ClusterKeyIdxes)); err != nil { + if err := oprot.WriteListBegin(thrift.I32, len(p.ClusterKeyUids)); err != nil { return err } - for _, v := range p.ClusterKeyIdxes { + for _, v := range p.ClusterKeyUids { if err := oprot.WriteI32(v); err != nil { return err } @@ -2089,7 +2089,7 @@ func (p *TTabletSchema) DeepEqual(ano *TTabletSchema) bool { if !p.Field18DeepEqual(ano.SkipWriteIndexOnLoad) { return false } - if !p.Field19DeepEqual(ano.ClusterKeyIdxes) { + if !p.Field19DeepEqual(ano.ClusterKeyUids) { return false } if !p.Field20DeepEqual(ano.RowStoreColCids) { @@ -2272,10 +2272,10 @@ func (p *TTabletSchema) Field18DeepEqual(src bool) bool { } func (p *TTabletSchema) Field19DeepEqual(src []int32) bool { - if len(p.ClusterKeyIdxes) != len(src) { + if len(p.ClusterKeyUids) != len(src) { return false } - for i, v := range p.ClusterKeyIdxes { + for i, v := range p.ClusterKeyUids { _src := src[i] if v != _src { return false diff --git a/pkg/rpc/kitex_gen/agentservice/k-AgentService.go b/pkg/rpc/kitex_gen/agentservice/k-AgentService.go index 667cffd1..1c702034 100644 --- a/pkg/rpc/kitex_gen/agentservice/k-AgentService.go +++ b/pkg/rpc/kitex_gen/agentservice/k-AgentService.go @@ -734,7 +734,7 @@ func (p *TTabletSchema) FastReadField19(buf []byte) (int, error) { if err != nil { return offset, err } - p.ClusterKeyIdxes = make([]int32, 0, size) + p.ClusterKeyUids = make([]int32, 0, size) for i := 0; i < size; i++ { var _elem int32 if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { @@ -746,7 +746,7 @@ func (p *TTabletSchema) FastReadField19(buf []byte) (int, error) { } - p.ClusterKeyIdxes = append(p.ClusterKeyIdxes, _elem) + p.ClusterKeyUids = append(p.ClusterKeyUids, _elem) } if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err @@ -1103,12 +1103,12 @@ func (p *TTabletSchema) fastWriteField18(buf []byte, binaryWriter bthrift.Binary func (p *TTabletSchema) fastWriteField19(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetClusterKeyIdxes() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cluster_key_idxes", thrift.LIST, 19) + if p.IsSetClusterKeyUids() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cluster_key_uids", thrift.LIST, 19) listBeginOffset := offset offset += bthrift.Binary.ListBeginLength(thrift.I32, 0) var length int - for _, v := range p.ClusterKeyIdxes { + for _, v := range p.ClusterKeyUids { length++ offset += bthrift.Binary.WriteI32(buf[offset:], v) @@ -1368,11 +1368,11 @@ func (p *TTabletSchema) field18Length() int { func (p *TTabletSchema) field19Length() int { l := 0 - if p.IsSetClusterKeyIdxes() { - l += bthrift.Binary.FieldBeginLength("cluster_key_idxes", thrift.LIST, 19) - l += bthrift.Binary.ListBeginLength(thrift.I32, len(p.ClusterKeyIdxes)) + if p.IsSetClusterKeyUids() { + l += bthrift.Binary.FieldBeginLength("cluster_key_uids", thrift.LIST, 19) + l += bthrift.Binary.ListBeginLength(thrift.I32, len(p.ClusterKeyUids)) var tmpV int32 - l += bthrift.Binary.I32Length(int32(tmpV)) * len(p.ClusterKeyIdxes) + l += bthrift.Binary.I32Length(int32(tmpV)) * len(p.ClusterKeyUids) l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } diff --git a/pkg/rpc/kitex_gen/backendservice/BackendService.go b/pkg/rpc/kitex_gen/backendservice/BackendService.go index 3b1477c5..94b892a2 100644 --- a/pkg/rpc/kitex_gen/backendservice/BackendService.go +++ b/pkg/rpc/kitex_gen/backendservice/BackendService.go @@ -594,13 +594,27 @@ type TTabletStat struct { RemoteDataSize *int64 `thrift:"remote_data_size,5,optional" frugal:"5,optional,i64" json:"remote_data_size,omitempty"` VisibleVersionCount *int64 `thrift:"visible_version_count,6,optional" frugal:"6,optional,i64" json:"visible_version_count,omitempty"` VisibleVersion *int64 `thrift:"visible_version,7,optional" frugal:"7,optional,i64" json:"visible_version,omitempty"` + LocalIndexSize int64 `thrift:"local_index_size,8,optional" frugal:"8,optional,i64" json:"local_index_size,omitempty"` + LocalSegmentSize int64 `thrift:"local_segment_size,9,optional" frugal:"9,optional,i64" json:"local_segment_size,omitempty"` + RemoteIndexSize int64 `thrift:"remote_index_size,10,optional" frugal:"10,optional,i64" json:"remote_index_size,omitempty"` + RemoteSegmentSize int64 `thrift:"remote_segment_size,11,optional" frugal:"11,optional,i64" json:"remote_segment_size,omitempty"` } func NewTTabletStat() *TTabletStat { - return &TTabletStat{} + return &TTabletStat{ + + LocalIndexSize: 0, + LocalSegmentSize: 0, + RemoteIndexSize: 0, + RemoteSegmentSize: 0, + } } func (p *TTabletStat) InitDefault() { + p.LocalIndexSize = 0 + p.LocalSegmentSize = 0 + p.RemoteIndexSize = 0 + p.RemoteSegmentSize = 0 } func (p *TTabletStat) GetTabletId() (v int64) { @@ -660,6 +674,42 @@ func (p *TTabletStat) GetVisibleVersion() (v int64) { } return *p.VisibleVersion } + +var TTabletStat_LocalIndexSize_DEFAULT int64 = 0 + +func (p *TTabletStat) GetLocalIndexSize() (v int64) { + if !p.IsSetLocalIndexSize() { + return TTabletStat_LocalIndexSize_DEFAULT + } + return p.LocalIndexSize +} + +var TTabletStat_LocalSegmentSize_DEFAULT int64 = 0 + +func (p *TTabletStat) GetLocalSegmentSize() (v int64) { + if !p.IsSetLocalSegmentSize() { + return TTabletStat_LocalSegmentSize_DEFAULT + } + return p.LocalSegmentSize +} + +var TTabletStat_RemoteIndexSize_DEFAULT int64 = 0 + +func (p *TTabletStat) GetRemoteIndexSize() (v int64) { + if !p.IsSetRemoteIndexSize() { + return TTabletStat_RemoteIndexSize_DEFAULT + } + return p.RemoteIndexSize +} + +var TTabletStat_RemoteSegmentSize_DEFAULT int64 = 0 + +func (p *TTabletStat) GetRemoteSegmentSize() (v int64) { + if !p.IsSetRemoteSegmentSize() { + return TTabletStat_RemoteSegmentSize_DEFAULT + } + return p.RemoteSegmentSize +} func (p *TTabletStat) SetTabletId(val int64) { p.TabletId = val } @@ -681,15 +731,31 @@ func (p *TTabletStat) SetVisibleVersionCount(val *int64) { func (p *TTabletStat) SetVisibleVersion(val *int64) { p.VisibleVersion = val } +func (p *TTabletStat) SetLocalIndexSize(val int64) { + p.LocalIndexSize = val +} +func (p *TTabletStat) SetLocalSegmentSize(val int64) { + p.LocalSegmentSize = val +} +func (p *TTabletStat) SetRemoteIndexSize(val int64) { + p.RemoteIndexSize = val +} +func (p *TTabletStat) SetRemoteSegmentSize(val int64) { + p.RemoteSegmentSize = val +} var fieldIDToName_TTabletStat = map[int16]string{ - 1: "tablet_id", - 2: "data_size", - 3: "row_count", - 4: "total_version_count", - 5: "remote_data_size", - 6: "visible_version_count", - 7: "visible_version", + 1: "tablet_id", + 2: "data_size", + 3: "row_count", + 4: "total_version_count", + 5: "remote_data_size", + 6: "visible_version_count", + 7: "visible_version", + 8: "local_index_size", + 9: "local_segment_size", + 10: "remote_index_size", + 11: "remote_segment_size", } func (p *TTabletStat) IsSetDataSize() bool { @@ -716,6 +782,22 @@ func (p *TTabletStat) IsSetVisibleVersion() bool { return p.VisibleVersion != nil } +func (p *TTabletStat) IsSetLocalIndexSize() bool { + return p.LocalIndexSize != TTabletStat_LocalIndexSize_DEFAULT +} + +func (p *TTabletStat) IsSetLocalSegmentSize() bool { + return p.LocalSegmentSize != TTabletStat_LocalSegmentSize_DEFAULT +} + +func (p *TTabletStat) IsSetRemoteIndexSize() bool { + return p.RemoteIndexSize != TTabletStat_RemoteIndexSize_DEFAULT +} + +func (p *TTabletStat) IsSetRemoteSegmentSize() bool { + return p.RemoteSegmentSize != TTabletStat_RemoteSegmentSize_DEFAULT +} + func (p *TTabletStat) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -793,6 +875,38 @@ func (p *TTabletStat) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 8: + if fieldTypeId == thrift.I64 { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 10: + if fieldTypeId == thrift.I64 { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 11: + if fieldTypeId == thrift.I64 { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -905,6 +1019,50 @@ func (p *TTabletStat) ReadField7(iprot thrift.TProtocol) error { p.VisibleVersion = _field return nil } +func (p *TTabletStat) ReadField8(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.LocalIndexSize = _field + return nil +} +func (p *TTabletStat) ReadField9(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.LocalSegmentSize = _field + return nil +} +func (p *TTabletStat) ReadField10(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.RemoteIndexSize = _field + return nil +} +func (p *TTabletStat) ReadField11(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.RemoteSegmentSize = _field + return nil +} func (p *TTabletStat) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -940,6 +1098,22 @@ func (p *TTabletStat) Write(oprot thrift.TProtocol) (err error) { fieldId = 7 goto WriteFieldError } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -1089,6 +1263,82 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) } +func (p *TTabletStat) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetLocalIndexSize() { + if err = oprot.WriteFieldBegin("local_index_size", thrift.I64, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.LocalIndexSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *TTabletStat) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetLocalSegmentSize() { + if err = oprot.WriteFieldBegin("local_segment_size", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.LocalSegmentSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *TTabletStat) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteIndexSize() { + if err = oprot.WriteFieldBegin("remote_index_size", thrift.I64, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.RemoteIndexSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + +func (p *TTabletStat) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteSegmentSize() { + if err = oprot.WriteFieldBegin("remote_segment_size", thrift.I64, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.RemoteSegmentSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + func (p *TTabletStat) String() string { if p == nil { return "" @@ -1124,6 +1374,18 @@ func (p *TTabletStat) DeepEqual(ano *TTabletStat) bool { if !p.Field7DeepEqual(ano.VisibleVersion) { return false } + if !p.Field8DeepEqual(ano.LocalIndexSize) { + return false + } + if !p.Field9DeepEqual(ano.LocalSegmentSize) { + return false + } + if !p.Field10DeepEqual(ano.RemoteIndexSize) { + return false + } + if !p.Field11DeepEqual(ano.RemoteSegmentSize) { + return false + } return true } @@ -1206,6 +1468,34 @@ func (p *TTabletStat) Field7DeepEqual(src *int64) bool { } return true } +func (p *TTabletStat) Field8DeepEqual(src int64) bool { + + if p.LocalIndexSize != src { + return false + } + return true +} +func (p *TTabletStat) Field9DeepEqual(src int64) bool { + + if p.LocalSegmentSize != src { + return false + } + return true +} +func (p *TTabletStat) Field10DeepEqual(src int64) bool { + + if p.RemoteIndexSize != src { + return false + } + return true +} +func (p *TTabletStat) Field11DeepEqual(src int64) bool { + + if p.RemoteSegmentSize != src { + return false + } + return true +} type TTabletStatResult_ struct { TabletsStats map[int64]*TTabletStat `thrift:"tablets_stats,1,required" frugal:"1,required,map" json:"tablets_stats"` @@ -15375,8 +15665,6 @@ type BackendService interface { CancelPlanFragment(ctx context.Context, params *palointernalservice.TCancelPlanFragmentParams) (r *palointernalservice.TCancelPlanFragmentResult_, err error) - TransmitData(ctx context.Context, params *palointernalservice.TTransmitDataParams) (r *palointernalservice.TTransmitDataResult_, err error) - SubmitTasks(ctx context.Context, tasks []*agentservice.TAgentTaskRequest) (r *agentservice.TAgentResult_, err error) MakeSnapshot(ctx context.Context, snapshotRequest *agentservice.TSnapshotRequest) (r *agentservice.TAgentResult_, err error) @@ -15472,15 +15760,6 @@ func (p *BackendServiceClient) CancelPlanFragment(ctx context.Context, params *p } return _result.GetSuccess(), nil } -func (p *BackendServiceClient) TransmitData(ctx context.Context, params *palointernalservice.TTransmitDataParams) (r *palointernalservice.TTransmitDataResult_, err error) { - var _args BackendServiceTransmitDataArgs - _args.Params = params - var _result BackendServiceTransmitDataResult - if err = p.Client_().Call(ctx, "transmit_data", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} func (p *BackendServiceClient) SubmitTasks(ctx context.Context, tasks []*agentservice.TAgentTaskRequest) (r *agentservice.TAgentResult_, err error) { var _args BackendServiceSubmitTasksArgs _args.Tasks = tasks @@ -15725,7 +16004,6 @@ func NewBackendServiceProcessor(handler BackendService) *BackendServiceProcessor self := &BackendServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} self.AddToProcessorMap("exec_plan_fragment", &backendServiceProcessorExecPlanFragment{handler: handler}) self.AddToProcessorMap("cancel_plan_fragment", &backendServiceProcessorCancelPlanFragment{handler: handler}) - self.AddToProcessorMap("transmit_data", &backendServiceProcessorTransmitData{handler: handler}) self.AddToProcessorMap("submit_tasks", &backendServiceProcessorSubmitTasks{handler: handler}) self.AddToProcessorMap("make_snapshot", &backendServiceProcessorMakeSnapshot{handler: handler}) self.AddToProcessorMap("release_snapshot", &backendServiceProcessorReleaseSnapshot{handler: handler}) @@ -15867,54 +16145,6 @@ func (p *backendServiceProcessorCancelPlanFragment) Process(ctx context.Context, return true, err } -type backendServiceProcessorTransmitData struct { - handler BackendService -} - -func (p *backendServiceProcessorTransmitData) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := BackendServiceTransmitDataArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("transmit_data", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := BackendServiceTransmitDataResult{} - var retval *palointernalservice.TTransmitDataResult_ - if retval, err2 = p.handler.TransmitData(ctx, args.Params); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing transmit_data: "+err2.Error()) - oprot.WriteMessageBegin("transmit_data", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("transmit_data", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - type backendServiceProcessorSubmitTasks struct { handler BackendService } @@ -17795,346 +18025,6 @@ func (p *BackendServiceCancelPlanFragmentResult) Field0DeepEqual(src *palointern return true } -type BackendServiceTransmitDataArgs struct { - Params *palointernalservice.TTransmitDataParams `thrift:"params,1" frugal:"1,default,palointernalservice.TTransmitDataParams" json:"params"` -} - -func NewBackendServiceTransmitDataArgs() *BackendServiceTransmitDataArgs { - return &BackendServiceTransmitDataArgs{} -} - -func (p *BackendServiceTransmitDataArgs) InitDefault() { -} - -var BackendServiceTransmitDataArgs_Params_DEFAULT *palointernalservice.TTransmitDataParams - -func (p *BackendServiceTransmitDataArgs) GetParams() (v *palointernalservice.TTransmitDataParams) { - if !p.IsSetParams() { - return BackendServiceTransmitDataArgs_Params_DEFAULT - } - return p.Params -} -func (p *BackendServiceTransmitDataArgs) SetParams(val *palointernalservice.TTransmitDataParams) { - p.Params = val -} - -var fieldIDToName_BackendServiceTransmitDataArgs = map[int16]string{ - 1: "params", -} - -func (p *BackendServiceTransmitDataArgs) IsSetParams() bool { - return p.Params != nil -} - -func (p *BackendServiceTransmitDataArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BackendServiceTransmitDataArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *BackendServiceTransmitDataArgs) ReadField1(iprot thrift.TProtocol) error { - _field := palointernalservice.NewTTransmitDataParams() - if err := _field.Read(iprot); err != nil { - return err - } - p.Params = _field - return nil -} - -func (p *BackendServiceTransmitDataArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("transmit_data_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *BackendServiceTransmitDataArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("params", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Params.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *BackendServiceTransmitDataArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BackendServiceTransmitDataArgs(%+v)", *p) - -} - -func (p *BackendServiceTransmitDataArgs) DeepEqual(ano *BackendServiceTransmitDataArgs) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Params) { - return false - } - return true -} - -func (p *BackendServiceTransmitDataArgs) Field1DeepEqual(src *palointernalservice.TTransmitDataParams) bool { - - if !p.Params.DeepEqual(src) { - return false - } - return true -} - -type BackendServiceTransmitDataResult struct { - Success *palointernalservice.TTransmitDataResult_ `thrift:"success,0,optional" frugal:"0,optional,palointernalservice.TTransmitDataResult_" json:"success,omitempty"` -} - -func NewBackendServiceTransmitDataResult() *BackendServiceTransmitDataResult { - return &BackendServiceTransmitDataResult{} -} - -func (p *BackendServiceTransmitDataResult) InitDefault() { -} - -var BackendServiceTransmitDataResult_Success_DEFAULT *palointernalservice.TTransmitDataResult_ - -func (p *BackendServiceTransmitDataResult) GetSuccess() (v *palointernalservice.TTransmitDataResult_) { - if !p.IsSetSuccess() { - return BackendServiceTransmitDataResult_Success_DEFAULT - } - return p.Success -} -func (p *BackendServiceTransmitDataResult) SetSuccess(x interface{}) { - p.Success = x.(*palointernalservice.TTransmitDataResult_) -} - -var fieldIDToName_BackendServiceTransmitDataResult = map[int16]string{ - 0: "success", -} - -func (p *BackendServiceTransmitDataResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *BackendServiceTransmitDataResult) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BackendServiceTransmitDataResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *BackendServiceTransmitDataResult) ReadField0(iprot thrift.TProtocol) error { - _field := palointernalservice.NewTTransmitDataResult_() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *BackendServiceTransmitDataResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("transmit_data_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *BackendServiceTransmitDataResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *BackendServiceTransmitDataResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("BackendServiceTransmitDataResult(%+v)", *p) - -} - -func (p *BackendServiceTransmitDataResult) DeepEqual(ano *BackendServiceTransmitDataResult) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field0DeepEqual(ano.Success) { - return false - } - return true -} - -func (p *BackendServiceTransmitDataResult) Field0DeepEqual(src *palointernalservice.TTransmitDataResult_) bool { - - if !p.Success.DeepEqual(src) { - return false - } - return true -} - type BackendServiceSubmitTasksArgs struct { Tasks []*agentservice.TAgentTaskRequest `thrift:"tasks,1" frugal:"1,default,list" json:"tasks"` } diff --git a/pkg/rpc/kitex_gen/backendservice/backendservice/backendservice.go b/pkg/rpc/kitex_gen/backendservice/backendservice/backendservice.go index 65089a73..3f3db3c8 100644 --- a/pkg/rpc/kitex_gen/backendservice/backendservice/backendservice.go +++ b/pkg/rpc/kitex_gen/backendservice/backendservice/backendservice.go @@ -26,7 +26,6 @@ func NewServiceInfo() *kitex.ServiceInfo { methods := map[string]kitex.MethodInfo{ "exec_plan_fragment": kitex.NewMethodInfo(execPlanFragmentHandler, newBackendServiceExecPlanFragmentArgs, newBackendServiceExecPlanFragmentResult, false), "cancel_plan_fragment": kitex.NewMethodInfo(cancelPlanFragmentHandler, newBackendServiceCancelPlanFragmentArgs, newBackendServiceCancelPlanFragmentResult, false), - "transmit_data": kitex.NewMethodInfo(transmitDataHandler, newBackendServiceTransmitDataArgs, newBackendServiceTransmitDataResult, false), "submit_tasks": kitex.NewMethodInfo(submitTasksHandler, newBackendServiceSubmitTasksArgs, newBackendServiceSubmitTasksResult, false), "make_snapshot": kitex.NewMethodInfo(makeSnapshotHandler, newBackendServiceMakeSnapshotArgs, newBackendServiceMakeSnapshotResult, false), "release_snapshot": kitex.NewMethodInfo(releaseSnapshotHandler, newBackendServiceReleaseSnapshotArgs, newBackendServiceReleaseSnapshotResult, false), @@ -104,24 +103,6 @@ func newBackendServiceCancelPlanFragmentResult() interface{} { return backendservice.NewBackendServiceCancelPlanFragmentResult() } -func transmitDataHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*backendservice.BackendServiceTransmitDataArgs) - realResult := result.(*backendservice.BackendServiceTransmitDataResult) - success, err := handler.(backendservice.BackendService).TransmitData(ctx, realArg.Params) - if err != nil { - return err - } - realResult.Success = success - return nil -} -func newBackendServiceTransmitDataArgs() interface{} { - return backendservice.NewBackendServiceTransmitDataArgs() -} - -func newBackendServiceTransmitDataResult() interface{} { - return backendservice.NewBackendServiceTransmitDataResult() -} - func submitTasksHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*backendservice.BackendServiceSubmitTasksArgs) realResult := result.(*backendservice.BackendServiceSubmitTasksResult) @@ -602,16 +583,6 @@ func (p *kClient) CancelPlanFragment(ctx context.Context, params *palointernalse return _result.GetSuccess(), nil } -func (p *kClient) TransmitData(ctx context.Context, params *palointernalservice.TTransmitDataParams) (r *palointernalservice.TTransmitDataResult_, err error) { - var _args backendservice.BackendServiceTransmitDataArgs - _args.Params = params - var _result backendservice.BackendServiceTransmitDataResult - if err = p.c.Call(ctx, "transmit_data", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - func (p *kClient) SubmitTasks(ctx context.Context, tasks []*agentservice.TAgentTaskRequest) (r *agentservice.TAgentResult_, err error) { var _args backendservice.BackendServiceSubmitTasksArgs _args.Tasks = tasks diff --git a/pkg/rpc/kitex_gen/backendservice/backendservice/client.go b/pkg/rpc/kitex_gen/backendservice/backendservice/client.go index e001d2bd..e04c5da0 100644 --- a/pkg/rpc/kitex_gen/backendservice/backendservice/client.go +++ b/pkg/rpc/kitex_gen/backendservice/backendservice/client.go @@ -18,7 +18,6 @@ import ( type Client interface { ExecPlanFragment(ctx context.Context, params *palointernalservice.TExecPlanFragmentParams, callOptions ...callopt.Option) (r *palointernalservice.TExecPlanFragmentResult_, err error) CancelPlanFragment(ctx context.Context, params *palointernalservice.TCancelPlanFragmentParams, callOptions ...callopt.Option) (r *palointernalservice.TCancelPlanFragmentResult_, err error) - TransmitData(ctx context.Context, params *palointernalservice.TTransmitDataParams, callOptions ...callopt.Option) (r *palointernalservice.TTransmitDataResult_, err error) SubmitTasks(ctx context.Context, tasks []*agentservice.TAgentTaskRequest, callOptions ...callopt.Option) (r *agentservice.TAgentResult_, err error) MakeSnapshot(ctx context.Context, snapshotRequest *agentservice.TSnapshotRequest, callOptions ...callopt.Option) (r *agentservice.TAgentResult_, err error) ReleaseSnapshot(ctx context.Context, snapshotPath string, callOptions ...callopt.Option) (r *agentservice.TAgentResult_, err error) @@ -85,11 +84,6 @@ func (p *kBackendServiceClient) CancelPlanFragment(ctx context.Context, params * return p.kClient.CancelPlanFragment(ctx, params) } -func (p *kBackendServiceClient) TransmitData(ctx context.Context, params *palointernalservice.TTransmitDataParams, callOptions ...callopt.Option) (r *palointernalservice.TTransmitDataResult_, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.TransmitData(ctx, params) -} - func (p *kBackendServiceClient) SubmitTasks(ctx context.Context, tasks []*agentservice.TAgentTaskRequest, callOptions ...callopt.Option) (r *agentservice.TAgentResult_, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.SubmitTasks(ctx, tasks) diff --git a/pkg/rpc/kitex_gen/backendservice/k-BackendService.go b/pkg/rpc/kitex_gen/backendservice/k-BackendService.go index 08b0b5d9..1b4465da 100644 --- a/pkg/rpc/kitex_gen/backendservice/k-BackendService.go +++ b/pkg/rpc/kitex_gen/backendservice/k-BackendService.go @@ -295,6 +295,62 @@ func (p *TTabletStat) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 8: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -428,6 +484,62 @@ func (p *TTabletStat) FastReadField7(buf []byte) (int, error) { return offset, nil } +func (p *TTabletStat) FastReadField8(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.LocalIndexSize = v + + } + return offset, nil +} + +func (p *TTabletStat) FastReadField9(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.LocalSegmentSize = v + + } + return offset, nil +} + +func (p *TTabletStat) FastReadField10(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.RemoteIndexSize = v + + } + return offset, nil +} + +func (p *TTabletStat) FastReadField11(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.RemoteSegmentSize = v + + } + return offset, nil +} + // for compatibility func (p *TTabletStat) FastWrite(buf []byte) int { return 0 @@ -444,6 +556,10 @@ func (p *TTabletStat) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWri offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField6(buf[offset:], binaryWriter) offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -461,6 +577,10 @@ func (p *TTabletStat) BLength() int { l += p.field5Length() l += p.field6Length() l += p.field7Length() + l += p.field8Length() + l += p.field9Length() + l += p.field10Length() + l += p.field11Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -542,6 +662,50 @@ func (p *TTabletStat) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWri return offset } +func (p *TTabletStat) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLocalIndexSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "local_index_size", thrift.I64, 8) + offset += bthrift.Binary.WriteI64(buf[offset:], p.LocalIndexSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTabletStat) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLocalSegmentSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "local_segment_size", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], p.LocalSegmentSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTabletStat) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRemoteIndexSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "remote_index_size", thrift.I64, 10) + offset += bthrift.Binary.WriteI64(buf[offset:], p.RemoteIndexSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTabletStat) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRemoteSegmentSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "remote_segment_size", thrift.I64, 11) + offset += bthrift.Binary.WriteI64(buf[offset:], p.RemoteSegmentSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TTabletStat) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("tablet_id", thrift.I64, 1) @@ -617,6 +781,50 @@ func (p *TTabletStat) field7Length() int { return l } +func (p *TTabletStat) field8Length() int { + l := 0 + if p.IsSetLocalIndexSize() { + l += bthrift.Binary.FieldBeginLength("local_index_size", thrift.I64, 8) + l += bthrift.Binary.I64Length(p.LocalIndexSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTabletStat) field9Length() int { + l := 0 + if p.IsSetLocalSegmentSize() { + l += bthrift.Binary.FieldBeginLength("local_segment_size", thrift.I64, 9) + l += bthrift.Binary.I64Length(p.LocalSegmentSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTabletStat) field10Length() int { + l := 0 + if p.IsSetRemoteIndexSize() { + l += bthrift.Binary.FieldBeginLength("remote_index_size", thrift.I64, 10) + l += bthrift.Binary.I64Length(p.RemoteIndexSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTabletStat) field11Length() int { + l := 0 + if p.IsSetRemoteSegmentSize() { + l += bthrift.Binary.FieldBeginLength("remote_segment_size", thrift.I64, 11) + l += bthrift.Binary.I64Length(p.RemoteSegmentSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TTabletStatResult_) FastRead(buf []byte) (int, error) { var err error var offset int @@ -11937,264 +12145,6 @@ func (p *BackendServiceCancelPlanFragmentResult) field0Length() int { return l } -func (p *BackendServiceTransmitDataArgs) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BackendServiceTransmitDataArgs[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *BackendServiceTransmitDataArgs) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := palointernalservice.NewTTransmitDataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Params = tmp - return offset, nil -} - -// for compatibility -func (p *BackendServiceTransmitDataArgs) FastWrite(buf []byte) int { - return 0 -} - -func (p *BackendServiceTransmitDataArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "transmit_data_args") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *BackendServiceTransmitDataArgs) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("transmit_data_args") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *BackendServiceTransmitDataArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "params", thrift.STRUCT, 1) - offset += p.Params.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *BackendServiceTransmitDataArgs) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("params", thrift.STRUCT, 1) - l += p.Params.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *BackendServiceTransmitDataResult) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField0(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_BackendServiceTransmitDataResult[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *BackendServiceTransmitDataResult) FastReadField0(buf []byte) (int, error) { - offset := 0 - - tmp := palointernalservice.NewTTransmitDataResult_() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Success = tmp - return offset, nil -} - -// for compatibility -func (p *BackendServiceTransmitDataResult) FastWrite(buf []byte) int { - return 0 -} - -func (p *BackendServiceTransmitDataResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "transmit_data_result") - if p != nil { - offset += p.fastWriteField0(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *BackendServiceTransmitDataResult) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("transmit_data_result") - if p != nil { - l += p.field0Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *BackendServiceTransmitDataResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetSuccess() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) - offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *BackendServiceTransmitDataResult) field0Length() int { - l := 0 - if p.IsSetSuccess() { - l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) - l += p.Success.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - func (p *BackendServiceSubmitTasksArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -18547,14 +18497,6 @@ func (p *BackendServiceCancelPlanFragmentResult) GetResult() interface{} { return p.Success } -func (p *BackendServiceTransmitDataArgs) GetFirstArgument() interface{} { - return p.Params -} - -func (p *BackendServiceTransmitDataResult) GetResult() interface{} { - return p.Success -} - func (p *BackendServiceSubmitTasksArgs) GetFirstArgument() interface{} { return p.Tasks } diff --git a/pkg/rpc/kitex_gen/data/Data.go b/pkg/rpc/kitex_gen/data/Data.go index 780e5545..4168cf4a 100644 --- a/pkg/rpc/kitex_gen/data/Data.go +++ b/pkg/rpc/kitex_gen/data/Data.go @@ -6,594 +6,9 @@ import ( "bytes" "fmt" "github.com/apache/thrift/lib/go/thrift" - "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/types" "strings" ) -type TRowBatch struct { - NumRows int32 `thrift:"num_rows,1,required" frugal:"1,required,i32" json:"num_rows"` - RowTuples []types.TTupleId `thrift:"row_tuples,2,required" frugal:"2,required,list" json:"row_tuples"` - TupleOffsets []int32 `thrift:"tuple_offsets,3" frugal:"3,default,list" json:"tuple_offsets"` - TupleData string `thrift:"tuple_data,4" frugal:"4,default,string" json:"tuple_data"` - IsCompressed bool `thrift:"is_compressed,5" frugal:"5,default,bool" json:"is_compressed"` - BeNumber int32 `thrift:"be_number,6" frugal:"6,default,i32" json:"be_number"` - PacketSeq int64 `thrift:"packet_seq,7" frugal:"7,default,i64" json:"packet_seq"` -} - -func NewTRowBatch() *TRowBatch { - return &TRowBatch{} -} - -func (p *TRowBatch) InitDefault() { -} - -func (p *TRowBatch) GetNumRows() (v int32) { - return p.NumRows -} - -func (p *TRowBatch) GetRowTuples() (v []types.TTupleId) { - return p.RowTuples -} - -func (p *TRowBatch) GetTupleOffsets() (v []int32) { - return p.TupleOffsets -} - -func (p *TRowBatch) GetTupleData() (v string) { - return p.TupleData -} - -func (p *TRowBatch) GetIsCompressed() (v bool) { - return p.IsCompressed -} - -func (p *TRowBatch) GetBeNumber() (v int32) { - return p.BeNumber -} - -func (p *TRowBatch) GetPacketSeq() (v int64) { - return p.PacketSeq -} -func (p *TRowBatch) SetNumRows(val int32) { - p.NumRows = val -} -func (p *TRowBatch) SetRowTuples(val []types.TTupleId) { - p.RowTuples = val -} -func (p *TRowBatch) SetTupleOffsets(val []int32) { - p.TupleOffsets = val -} -func (p *TRowBatch) SetTupleData(val string) { - p.TupleData = val -} -func (p *TRowBatch) SetIsCompressed(val bool) { - p.IsCompressed = val -} -func (p *TRowBatch) SetBeNumber(val int32) { - p.BeNumber = val -} -func (p *TRowBatch) SetPacketSeq(val int64) { - p.PacketSeq = val -} - -var fieldIDToName_TRowBatch = map[int16]string{ - 1: "num_rows", - 2: "row_tuples", - 3: "tuple_offsets", - 4: "tuple_data", - 5: "is_compressed", - 6: "be_number", - 7: "packet_seq", -} - -func (p *TRowBatch) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetNumRows bool = false - var issetRowTuples bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetNumRows = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.LIST { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetRowTuples = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.LIST { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.I32 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.I64 { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetNumRows { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetRowTuples { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TRowBatch[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TRowBatch[fieldId])) -} - -func (p *TRowBatch) ReadField1(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.NumRows = _field - return nil -} -func (p *TRowBatch) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]types.TTupleId, 0, size) - for i := 0; i < size; i++ { - - var _elem types.TTupleId - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _elem = v - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.RowTuples = _field - return nil -} -func (p *TRowBatch) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]int32, 0, size) - for i := 0; i < size; i++ { - - var _elem int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _elem = v - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.TupleOffsets = _field - return nil -} -func (p *TRowBatch) ReadField4(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.TupleData = _field - return nil -} -func (p *TRowBatch) ReadField5(iprot thrift.TProtocol) error { - - var _field bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = v - } - p.IsCompressed = _field - return nil -} -func (p *TRowBatch) ReadField6(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.BeNumber = _field - return nil -} -func (p *TRowBatch) ReadField7(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.PacketSeq = _field - return nil -} - -func (p *TRowBatch) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TRowBatch"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TRowBatch) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("num_rows", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.NumRows); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TRowBatch) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("row_tuples", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.I32, len(p.RowTuples)); err != nil { - return err - } - for _, v := range p.RowTuples { - if err := oprot.WriteI32(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TRowBatch) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("tuple_offsets", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.I32, len(p.TupleOffsets)); err != nil { - return err - } - for _, v := range p.TupleOffsets { - if err := oprot.WriteI32(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TRowBatch) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("tuple_data", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.TupleData); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TRowBatch) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("is_compressed", thrift.BOOL, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(p.IsCompressed); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TRowBatch) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("be_number", thrift.I32, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.BeNumber); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *TRowBatch) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("packet_seq", thrift.I64, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.PacketSeq); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *TRowBatch) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TRowBatch(%+v)", *p) - -} - -func (p *TRowBatch) DeepEqual(ano *TRowBatch) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.NumRows) { - return false - } - if !p.Field2DeepEqual(ano.RowTuples) { - return false - } - if !p.Field3DeepEqual(ano.TupleOffsets) { - return false - } - if !p.Field4DeepEqual(ano.TupleData) { - return false - } - if !p.Field5DeepEqual(ano.IsCompressed) { - return false - } - if !p.Field6DeepEqual(ano.BeNumber) { - return false - } - if !p.Field7DeepEqual(ano.PacketSeq) { - return false - } - return true -} - -func (p *TRowBatch) Field1DeepEqual(src int32) bool { - - if p.NumRows != src { - return false - } - return true -} -func (p *TRowBatch) Field2DeepEqual(src []types.TTupleId) bool { - - if len(p.RowTuples) != len(src) { - return false - } - for i, v := range p.RowTuples { - _src := src[i] - if v != _src { - return false - } - } - return true -} -func (p *TRowBatch) Field3DeepEqual(src []int32) bool { - - if len(p.TupleOffsets) != len(src) { - return false - } - for i, v := range p.TupleOffsets { - _src := src[i] - if v != _src { - return false - } - } - return true -} -func (p *TRowBatch) Field4DeepEqual(src string) bool { - - if strings.Compare(p.TupleData, src) != 0 { - return false - } - return true -} -func (p *TRowBatch) Field5DeepEqual(src bool) bool { - - if p.IsCompressed != src { - return false - } - return true -} -func (p *TRowBatch) Field6DeepEqual(src int32) bool { - - if p.BeNumber != src { - return false - } - return true -} -func (p *TRowBatch) Field7DeepEqual(src int64) bool { - - if p.PacketSeq != src { - return false - } - return true -} - type TCell struct { BoolVal *bool `thrift:"boolVal,1,optional" frugal:"1,optional,bool" json:"boolVal,omitempty"` IntVal *int32 `thrift:"intVal,2,optional" frugal:"2,optional,i32" json:"intVal,omitempty"` diff --git a/pkg/rpc/kitex_gen/data/k-Data.go b/pkg/rpc/kitex_gen/data/k-Data.go index fc31f974..956c8815 100644 --- a/pkg/rpc/kitex_gen/data/k-Data.go +++ b/pkg/rpc/kitex_gen/data/k-Data.go @@ -26,491 +26,6 @@ var ( _ = types.KitexUnusedProtection ) -func (p *TRowBatch) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetNumRows bool = false - var issetRowTuples bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetNumRows = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetRowTuples = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.BOOL { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField7(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetNumRows { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetRowTuples { - fieldId = 2 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TRowBatch[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TRowBatch[fieldId])) -} - -func (p *TRowBatch) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.NumRows = v - - } - return offset, nil -} - -func (p *TRowBatch) FastReadField2(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.RowTuples = make([]types.TTupleId, 0, size) - for i := 0; i < size; i++ { - var _elem types.TTupleId - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.RowTuples = append(p.RowTuples, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TRowBatch) FastReadField3(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.TupleOffsets = make([]int32, 0, size) - for i := 0; i < size; i++ { - var _elem int32 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.TupleOffsets = append(p.TupleOffsets, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TRowBatch) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.TupleData = v - - } - return offset, nil -} - -func (p *TRowBatch) FastReadField5(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.IsCompressed = v - - } - return offset, nil -} - -func (p *TRowBatch) FastReadField6(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.BeNumber = v - - } - return offset, nil -} - -func (p *TRowBatch) FastReadField7(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.PacketSeq = v - - } - return offset, nil -} - -// for compatibility -func (p *TRowBatch) FastWrite(buf []byte) int { - return 0 -} - -func (p *TRowBatch) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TRowBatch") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TRowBatch") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TRowBatch) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "num_rows", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], p.NumRows) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "row_tuples", thrift.LIST, 2) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I32, 0) - var length int - for _, v := range p.RowTuples { - length++ - offset += bthrift.Binary.WriteI32(buf[offset:], v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I32, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tuple_offsets", thrift.LIST, 3) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I32, 0) - var length int - for _, v := range p.TupleOffsets { - length++ - offset += bthrift.Binary.WriteI32(buf[offset:], v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I32, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tuple_data", thrift.STRING, 4) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.TupleData) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_compressed", thrift.BOOL, 5) - offset += bthrift.Binary.WriteBool(buf[offset:], p.IsCompressed) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "be_number", thrift.I32, 6) - offset += bthrift.Binary.WriteI32(buf[offset:], p.BeNumber) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "packet_seq", thrift.I64, 7) - offset += bthrift.Binary.WriteI64(buf[offset:], p.PacketSeq) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TRowBatch) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("num_rows", thrift.I32, 1) - l += bthrift.Binary.I32Length(p.NumRows) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TRowBatch) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("row_tuples", thrift.LIST, 2) - l += bthrift.Binary.ListBeginLength(thrift.I32, len(p.RowTuples)) - var tmpV types.TTupleId - l += bthrift.Binary.I32Length(int32(tmpV)) * len(p.RowTuples) - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TRowBatch) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("tuple_offsets", thrift.LIST, 3) - l += bthrift.Binary.ListBeginLength(thrift.I32, len(p.TupleOffsets)) - var tmpV int32 - l += bthrift.Binary.I32Length(int32(tmpV)) * len(p.TupleOffsets) - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TRowBatch) field4Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("tuple_data", thrift.STRING, 4) - l += bthrift.Binary.StringLengthNocopy(p.TupleData) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TRowBatch) field5Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("is_compressed", thrift.BOOL, 5) - l += bthrift.Binary.BoolLength(p.IsCompressed) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TRowBatch) field6Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("be_number", thrift.I32, 6) - l += bthrift.Binary.I32Length(p.BeNumber) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TRowBatch) field7Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("packet_seq", thrift.I64, 7) - l += bthrift.Binary.I64Length(p.PacketSeq) - - l += bthrift.Binary.FieldEndLength() - return l -} - func (p *TCell) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/pkg/rpc/kitex_gen/datasinks/DataSinks.go b/pkg/rpc/kitex_gen/datasinks/DataSinks.go index 3b8244c7..f5b40a0b 100644 --- a/pkg/rpc/kitex_gen/datasinks/DataSinks.go +++ b/pkg/rpc/kitex_gen/datasinks/DataSinks.go @@ -3270,6 +3270,7 @@ type TDataStreamSink struct { TabletSinkTxnId *int64 `thrift:"tablet_sink_txn_id,11,optional" frugal:"11,optional,i64" json:"tablet_sink_txn_id,omitempty"` TabletSinkTupleId *types.TTupleId `thrift:"tablet_sink_tuple_id,12,optional" frugal:"12,optional,i32" json:"tablet_sink_tuple_id,omitempty"` TabletSinkExprs []*exprs.TExpr `thrift:"tablet_sink_exprs,13,optional" frugal:"13,optional,list" json:"tablet_sink_exprs,omitempty"` + IsMerge *bool `thrift:"is_merge,14,optional" frugal:"14,optional,bool" json:"is_merge,omitempty"` } func NewTDataStreamSink() *TDataStreamSink { @@ -3390,6 +3391,15 @@ func (p *TDataStreamSink) GetTabletSinkExprs() (v []*exprs.TExpr) { } return p.TabletSinkExprs } + +var TDataStreamSink_IsMerge_DEFAULT bool + +func (p *TDataStreamSink) GetIsMerge() (v bool) { + if !p.IsSetIsMerge() { + return TDataStreamSink_IsMerge_DEFAULT + } + return *p.IsMerge +} func (p *TDataStreamSink) SetDestNodeId(val types.TPlanNodeId) { p.DestNodeId = val } @@ -3429,6 +3439,9 @@ func (p *TDataStreamSink) SetTabletSinkTupleId(val *types.TTupleId) { func (p *TDataStreamSink) SetTabletSinkExprs(val []*exprs.TExpr) { p.TabletSinkExprs = val } +func (p *TDataStreamSink) SetIsMerge(val *bool) { + p.IsMerge = val +} var fieldIDToName_TDataStreamSink = map[int16]string{ 1: "dest_node_id", @@ -3444,6 +3457,7 @@ var fieldIDToName_TDataStreamSink = map[int16]string{ 11: "tablet_sink_txn_id", 12: "tablet_sink_tuple_id", 13: "tablet_sink_exprs", + 14: "is_merge", } func (p *TDataStreamSink) IsSetOutputPartition() bool { @@ -3494,6 +3508,10 @@ func (p *TDataStreamSink) IsSetTabletSinkExprs() bool { return p.TabletSinkExprs != nil } +func (p *TDataStreamSink) IsSetIsMerge() bool { + return p.IsMerge != nil +} + func (p *TDataStreamSink) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -3621,6 +3639,14 @@ func (p *TDataStreamSink) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 14: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -3840,6 +3866,17 @@ func (p *TDataStreamSink) ReadField13(iprot thrift.TProtocol) error { p.TabletSinkExprs = _field return nil } +func (p *TDataStreamSink) ReadField14(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.IsMerge = _field + return nil +} func (p *TDataStreamSink) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -3899,6 +3936,10 @@ func (p *TDataStreamSink) Write(oprot thrift.TProtocol) (err error) { fieldId = 13 goto WriteFieldError } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -4192,6 +4233,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) } +func (p *TDataStreamSink) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetIsMerge() { + if err = oprot.WriteFieldBegin("is_merge", thrift.BOOL, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.IsMerge); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + func (p *TDataStreamSink) String() string { if p == nil { return "" @@ -4245,6 +4305,9 @@ func (p *TDataStreamSink) DeepEqual(ano *TDataStreamSink) bool { if !p.Field13DeepEqual(ano.TabletSinkExprs) { return false } + if !p.Field14DeepEqual(ano.IsMerge) { + return false + } return true } @@ -4383,6 +4446,18 @@ func (p *TDataStreamSink) Field13DeepEqual(src []*exprs.TExpr) bool { } return true } +func (p *TDataStreamSink) Field14DeepEqual(src *bool) bool { + + if p.IsMerge == src { + return true + } else if p.IsMerge == nil || src == nil { + return false + } + if *p.IsMerge != *src { + return false + } + return true +} type TMultiCastDataStreamSink struct { Sinks []*TDataStreamSink `thrift:"sinks,1,optional" frugal:"1,optional,list" json:"sinks,omitempty"` diff --git a/pkg/rpc/kitex_gen/datasinks/k-DataSinks.go b/pkg/rpc/kitex_gen/datasinks/k-DataSinks.go index 8f4a005f..cd9bc724 100644 --- a/pkg/rpc/kitex_gen/datasinks/k-DataSinks.go +++ b/pkg/rpc/kitex_gen/datasinks/k-DataSinks.go @@ -2158,6 +2158,20 @@ func (p *TDataStreamSink) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 14: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField14(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2430,6 +2444,19 @@ func (p *TDataStreamSink) FastReadField13(buf []byte) (int, error) { return offset, nil } +func (p *TDataStreamSink) FastReadField14(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.IsMerge = &v + + } + return offset, nil +} + // for compatibility func (p *TDataStreamSink) FastWrite(buf []byte) int { return 0 @@ -2444,6 +2471,7 @@ func (p *TDataStreamSink) FastWriteNocopy(buf []byte, binaryWriter bthrift.Binar offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField11(buf[offset:], binaryWriter) offset += p.fastWriteField12(buf[offset:], binaryWriter) + offset += p.fastWriteField14(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField6(buf[offset:], binaryWriter) @@ -2475,6 +2503,7 @@ func (p *TDataStreamSink) BLength() int { l += p.field11Length() l += p.field12Length() l += p.field13Length() + l += p.field14Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -2644,6 +2673,17 @@ func (p *TDataStreamSink) fastWriteField13(buf []byte, binaryWriter bthrift.Bina return offset } +func (p *TDataStreamSink) fastWriteField14(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetIsMerge() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_merge", thrift.BOOL, 14) + offset += bthrift.Binary.WriteBool(buf[offset:], *p.IsMerge) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TDataStreamSink) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("dest_node_id", thrift.I32, 1) @@ -2791,6 +2831,17 @@ func (p *TDataStreamSink) field13Length() int { return l } +func (p *TDataStreamSink) field14Length() int { + l := 0 + if p.IsSetIsMerge() { + l += bthrift.Binary.FieldBeginLength("is_merge", thrift.BOOL, 14) + l += bthrift.Binary.BoolLength(*p.IsMerge) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TMultiCastDataStreamSink) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go index e9e66bcd..e59ebe7d 100644 --- a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go @@ -23,167 +23,6 @@ import ( "strings" ) -type TFileFormat int64 - -const ( - TFileFormat_PARQUETFILE TFileFormat = 0 - TFileFormat_RCFILE TFileFormat = 1 - TFileFormat_SEQUENCEFILE TFileFormat = 2 - TFileFormat_TEXTFILE TFileFormat = 3 -) - -func (p TFileFormat) String() string { - switch p { - case TFileFormat_PARQUETFILE: - return "PARQUETFILE" - case TFileFormat_RCFILE: - return "RCFILE" - case TFileFormat_SEQUENCEFILE: - return "SEQUENCEFILE" - case TFileFormat_TEXTFILE: - return "TEXTFILE" - } - return "" -} - -func TFileFormatFromString(s string) (TFileFormat, error) { - switch s { - case "PARQUETFILE": - return TFileFormat_PARQUETFILE, nil - case "RCFILE": - return TFileFormat_RCFILE, nil - case "SEQUENCEFILE": - return TFileFormat_SEQUENCEFILE, nil - case "TEXTFILE": - return TFileFormat_TEXTFILE, nil - } - return TFileFormat(0), fmt.Errorf("not a valid TFileFormat string") -} - -func TFileFormatPtr(v TFileFormat) *TFileFormat { return &v } -func (p *TFileFormat) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = TFileFormat(result.Int64) - return -} - -func (p *TFileFormat) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type TSetType int64 - -const ( - TSetType_OPT_DEFAULT TSetType = 0 - TSetType_OPT_GLOBAL TSetType = 1 - TSetType_OPT_SESSION TSetType = 2 -) - -func (p TSetType) String() string { - switch p { - case TSetType_OPT_DEFAULT: - return "OPT_DEFAULT" - case TSetType_OPT_GLOBAL: - return "OPT_GLOBAL" - case TSetType_OPT_SESSION: - return "OPT_SESSION" - } - return "" -} - -func TSetTypeFromString(s string) (TSetType, error) { - switch s { - case "OPT_DEFAULT": - return TSetType_OPT_DEFAULT, nil - case "OPT_GLOBAL": - return TSetType_OPT_GLOBAL, nil - case "OPT_SESSION": - return TSetType_OPT_SESSION, nil - } - return TSetType(0), fmt.Errorf("not a valid TSetType string") -} - -func TSetTypePtr(v TSetType) *TSetType { return &v } -func (p *TSetType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = TSetType(result.Int64) - return -} - -func (p *TSetType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type TDdlType int64 - -const ( - TDdlType_USE TDdlType = 0 - TDdlType_DESCRIBE TDdlType = 1 - TDdlType_SET TDdlType = 2 - TDdlType_EXPLAIN TDdlType = 3 - TDdlType_KILL TDdlType = 4 - TDdlType_COMMON TDdlType = 5 -) - -func (p TDdlType) String() string { - switch p { - case TDdlType_USE: - return "USE" - case TDdlType_DESCRIBE: - return "DESCRIBE" - case TDdlType_SET: - return "SET" - case TDdlType_EXPLAIN: - return "EXPLAIN" - case TDdlType_KILL: - return "KILL" - case TDdlType_COMMON: - return "COMMON" - } - return "" -} - -func TDdlTypeFromString(s string) (TDdlType, error) { - switch s { - case "USE": - return TDdlType_USE, nil - case "DESCRIBE": - return TDdlType_DESCRIBE, nil - case "SET": - return TDdlType_SET, nil - case "EXPLAIN": - return TDdlType_EXPLAIN, nil - case "KILL": - return TDdlType_KILL, nil - case "COMMON": - return TDdlType_COMMON, nil - } - return TDdlType(0), fmt.Errorf("not a valid TDdlType string") -} - -func TDdlTypePtr(v TDdlType) *TDdlType { return &v } -func (p *TDdlType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = TDdlType(result.Int64) - return -} - -func (p *TDdlType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - type FrontendServiceVersion int64 const ( @@ -1275,559 +1114,169 @@ func NewTGetBinlogLagRequest() *TGetBinlogLagRequest { return (*TGetBinlogLagRequest)(NewTGetBinlogRequest()) } -type TSetSessionParams struct { - User string `thrift:"user,1,required" frugal:"1,required,string" json:"user"` +type TColumnDesc struct { + ColumnName string `thrift:"columnName,1,required" frugal:"1,required,string" json:"columnName"` + ColumnType types.TPrimitiveType `thrift:"columnType,2,required" frugal:"2,required,TPrimitiveType" json:"columnType"` + ColumnLength *int32 `thrift:"columnLength,3,optional" frugal:"3,optional,i32" json:"columnLength,omitempty"` + ColumnPrecision *int32 `thrift:"columnPrecision,4,optional" frugal:"4,optional,i32" json:"columnPrecision,omitempty"` + ColumnScale *int32 `thrift:"columnScale,5,optional" frugal:"5,optional,i32" json:"columnScale,omitempty"` + IsAllowNull *bool `thrift:"isAllowNull,6,optional" frugal:"6,optional,bool" json:"isAllowNull,omitempty"` + ColumnKey *string `thrift:"columnKey,7,optional" frugal:"7,optional,string" json:"columnKey,omitempty"` + Children []*TColumnDesc `thrift:"children,8,optional" frugal:"8,optional,list" json:"children,omitempty"` + DefaultValue *string `thrift:"defaultValue,9,optional" frugal:"9,optional,string" json:"defaultValue,omitempty"` } -func NewTSetSessionParams() *TSetSessionParams { - return &TSetSessionParams{} +func NewTColumnDesc() *TColumnDesc { + return &TColumnDesc{} } -func (p *TSetSessionParams) InitDefault() { +func (p *TColumnDesc) InitDefault() { } -func (p *TSetSessionParams) GetUser() (v string) { - return p.User -} -func (p *TSetSessionParams) SetUser(val string) { - p.User = val +func (p *TColumnDesc) GetColumnName() (v string) { + return p.ColumnName } -var fieldIDToName_TSetSessionParams = map[int16]string{ - 1: "user", +func (p *TColumnDesc) GetColumnType() (v types.TPrimitiveType) { + return p.ColumnType } -func (p *TSetSessionParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetUser bool = false +var TColumnDesc_ColumnLength_DEFAULT int32 - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError +func (p *TColumnDesc) GetColumnLength() (v int32) { + if !p.IsSetColumnLength() { + return TColumnDesc_ColumnLength_DEFAULT } + return *p.ColumnLength +} - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetUser = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } +var TColumnDesc_ColumnPrecision_DEFAULT int32 - if !issetUser { - fieldId = 1 - goto RequiredFieldNotSetError +func (p *TColumnDesc) GetColumnPrecision() (v int32) { + if !p.IsSetColumnPrecision() { + return TColumnDesc_ColumnPrecision_DEFAULT } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSetSessionParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSetSessionParams[fieldId])) + return *p.ColumnPrecision } -func (p *TSetSessionParams) ReadField1(iprot thrift.TProtocol) error { +var TColumnDesc_ColumnScale_DEFAULT int32 - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v +func (p *TColumnDesc) GetColumnScale() (v int32) { + if !p.IsSetColumnScale() { + return TColumnDesc_ColumnScale_DEFAULT } - p.User = _field - return nil + return *p.ColumnScale } -func (p *TSetSessionParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TSetSessionParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} +var TColumnDesc_IsAllowNull_DEFAULT bool -func (p *TSetSessionParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("user", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.User); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *TColumnDesc) GetIsAllowNull() (v bool) { + if !p.IsSetIsAllowNull() { + return TColumnDesc_IsAllowNull_DEFAULT } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) + return *p.IsAllowNull } -func (p *TSetSessionParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSetSessionParams(%+v)", *p) +var TColumnDesc_ColumnKey_DEFAULT string +func (p *TColumnDesc) GetColumnKey() (v string) { + if !p.IsSetColumnKey() { + return TColumnDesc_ColumnKey_DEFAULT + } + return *p.ColumnKey } -func (p *TSetSessionParams) DeepEqual(ano *TSetSessionParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.User) { - return false +var TColumnDesc_Children_DEFAULT []*TColumnDesc + +func (p *TColumnDesc) GetChildren() (v []*TColumnDesc) { + if !p.IsSetChildren() { + return TColumnDesc_Children_DEFAULT } - return true + return p.Children } -func (p *TSetSessionParams) Field1DeepEqual(src string) bool { +var TColumnDesc_DefaultValue_DEFAULT string - if strings.Compare(p.User, src) != 0 { - return false +func (p *TColumnDesc) GetDefaultValue() (v string) { + if !p.IsSetDefaultValue() { + return TColumnDesc_DefaultValue_DEFAULT } - return true + return *p.DefaultValue +} +func (p *TColumnDesc) SetColumnName(val string) { + p.ColumnName = val +} +func (p *TColumnDesc) SetColumnType(val types.TPrimitiveType) { + p.ColumnType = val +} +func (p *TColumnDesc) SetColumnLength(val *int32) { + p.ColumnLength = val +} +func (p *TColumnDesc) SetColumnPrecision(val *int32) { + p.ColumnPrecision = val +} +func (p *TColumnDesc) SetColumnScale(val *int32) { + p.ColumnScale = val +} +func (p *TColumnDesc) SetIsAllowNull(val *bool) { + p.IsAllowNull = val +} +func (p *TColumnDesc) SetColumnKey(val *string) { + p.ColumnKey = val +} +func (p *TColumnDesc) SetChildren(val []*TColumnDesc) { + p.Children = val +} +func (p *TColumnDesc) SetDefaultValue(val *string) { + p.DefaultValue = val } -type TAuthenticateParams struct { - User string `thrift:"user,1,required" frugal:"1,required,string" json:"user"` - Passwd string `thrift:"passwd,2,required" frugal:"2,required,string" json:"passwd"` +var fieldIDToName_TColumnDesc = map[int16]string{ + 1: "columnName", + 2: "columnType", + 3: "columnLength", + 4: "columnPrecision", + 5: "columnScale", + 6: "isAllowNull", + 7: "columnKey", + 8: "children", + 9: "defaultValue", } -func NewTAuthenticateParams() *TAuthenticateParams { - return &TAuthenticateParams{} +func (p *TColumnDesc) IsSetColumnLength() bool { + return p.ColumnLength != nil } -func (p *TAuthenticateParams) InitDefault() { +func (p *TColumnDesc) IsSetColumnPrecision() bool { + return p.ColumnPrecision != nil } -func (p *TAuthenticateParams) GetUser() (v string) { - return p.User +func (p *TColumnDesc) IsSetColumnScale() bool { + return p.ColumnScale != nil } -func (p *TAuthenticateParams) GetPasswd() (v string) { - return p.Passwd +func (p *TColumnDesc) IsSetIsAllowNull() bool { + return p.IsAllowNull != nil } -func (p *TAuthenticateParams) SetUser(val string) { - p.User = val + +func (p *TColumnDesc) IsSetColumnKey() bool { + return p.ColumnKey != nil } -func (p *TAuthenticateParams) SetPasswd(val string) { - p.Passwd = val + +func (p *TColumnDesc) IsSetChildren() bool { + return p.Children != nil } -var fieldIDToName_TAuthenticateParams = map[int16]string{ - 1: "user", - 2: "passwd", +func (p *TColumnDesc) IsSetDefaultValue() bool { + return p.DefaultValue != nil } -func (p *TAuthenticateParams) Read(iprot thrift.TProtocol) (err error) { +func (p *TColumnDesc) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetUser bool = false - var issetPasswd bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetUser = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetPasswd = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetUser { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetPasswd { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TAuthenticateParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TAuthenticateParams[fieldId])) -} - -func (p *TAuthenticateParams) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.User = _field - return nil -} -func (p *TAuthenticateParams) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Passwd = _field - return nil -} - -func (p *TAuthenticateParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TAuthenticateParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TAuthenticateParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("user", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.User); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TAuthenticateParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("passwd", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Passwd); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TAuthenticateParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TAuthenticateParams(%+v)", *p) - -} - -func (p *TAuthenticateParams) DeepEqual(ano *TAuthenticateParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.User) { - return false - } - if !p.Field2DeepEqual(ano.Passwd) { - return false - } - return true -} - -func (p *TAuthenticateParams) Field1DeepEqual(src string) bool { - - if strings.Compare(p.User, src) != 0 { - return false - } - return true -} -func (p *TAuthenticateParams) Field2DeepEqual(src string) bool { - - if strings.Compare(p.Passwd, src) != 0 { - return false - } - return true -} - -type TColumnDesc struct { - ColumnName string `thrift:"columnName,1,required" frugal:"1,required,string" json:"columnName"` - ColumnType types.TPrimitiveType `thrift:"columnType,2,required" frugal:"2,required,TPrimitiveType" json:"columnType"` - ColumnLength *int32 `thrift:"columnLength,3,optional" frugal:"3,optional,i32" json:"columnLength,omitempty"` - ColumnPrecision *int32 `thrift:"columnPrecision,4,optional" frugal:"4,optional,i32" json:"columnPrecision,omitempty"` - ColumnScale *int32 `thrift:"columnScale,5,optional" frugal:"5,optional,i32" json:"columnScale,omitempty"` - IsAllowNull *bool `thrift:"isAllowNull,6,optional" frugal:"6,optional,bool" json:"isAllowNull,omitempty"` - ColumnKey *string `thrift:"columnKey,7,optional" frugal:"7,optional,string" json:"columnKey,omitempty"` - Children []*TColumnDesc `thrift:"children,8,optional" frugal:"8,optional,list" json:"children,omitempty"` -} - -func NewTColumnDesc() *TColumnDesc { - return &TColumnDesc{} -} - -func (p *TColumnDesc) InitDefault() { -} - -func (p *TColumnDesc) GetColumnName() (v string) { - return p.ColumnName -} - -func (p *TColumnDesc) GetColumnType() (v types.TPrimitiveType) { - return p.ColumnType -} - -var TColumnDesc_ColumnLength_DEFAULT int32 - -func (p *TColumnDesc) GetColumnLength() (v int32) { - if !p.IsSetColumnLength() { - return TColumnDesc_ColumnLength_DEFAULT - } - return *p.ColumnLength -} - -var TColumnDesc_ColumnPrecision_DEFAULT int32 - -func (p *TColumnDesc) GetColumnPrecision() (v int32) { - if !p.IsSetColumnPrecision() { - return TColumnDesc_ColumnPrecision_DEFAULT - } - return *p.ColumnPrecision -} - -var TColumnDesc_ColumnScale_DEFAULT int32 - -func (p *TColumnDesc) GetColumnScale() (v int32) { - if !p.IsSetColumnScale() { - return TColumnDesc_ColumnScale_DEFAULT - } - return *p.ColumnScale -} - -var TColumnDesc_IsAllowNull_DEFAULT bool - -func (p *TColumnDesc) GetIsAllowNull() (v bool) { - if !p.IsSetIsAllowNull() { - return TColumnDesc_IsAllowNull_DEFAULT - } - return *p.IsAllowNull -} - -var TColumnDesc_ColumnKey_DEFAULT string - -func (p *TColumnDesc) GetColumnKey() (v string) { - if !p.IsSetColumnKey() { - return TColumnDesc_ColumnKey_DEFAULT - } - return *p.ColumnKey -} - -var TColumnDesc_Children_DEFAULT []*TColumnDesc - -func (p *TColumnDesc) GetChildren() (v []*TColumnDesc) { - if !p.IsSetChildren() { - return TColumnDesc_Children_DEFAULT - } - return p.Children -} -func (p *TColumnDesc) SetColumnName(val string) { - p.ColumnName = val -} -func (p *TColumnDesc) SetColumnType(val types.TPrimitiveType) { - p.ColumnType = val -} -func (p *TColumnDesc) SetColumnLength(val *int32) { - p.ColumnLength = val -} -func (p *TColumnDesc) SetColumnPrecision(val *int32) { - p.ColumnPrecision = val -} -func (p *TColumnDesc) SetColumnScale(val *int32) { - p.ColumnScale = val -} -func (p *TColumnDesc) SetIsAllowNull(val *bool) { - p.IsAllowNull = val -} -func (p *TColumnDesc) SetColumnKey(val *string) { - p.ColumnKey = val -} -func (p *TColumnDesc) SetChildren(val []*TColumnDesc) { - p.Children = val -} - -var fieldIDToName_TColumnDesc = map[int16]string{ - 1: "columnName", - 2: "columnType", - 3: "columnLength", - 4: "columnPrecision", - 5: "columnScale", - 6: "isAllowNull", - 7: "columnKey", - 8: "children", -} - -func (p *TColumnDesc) IsSetColumnLength() bool { - return p.ColumnLength != nil -} - -func (p *TColumnDesc) IsSetColumnPrecision() bool { - return p.ColumnPrecision != nil -} - -func (p *TColumnDesc) IsSetColumnScale() bool { - return p.ColumnScale != nil -} - -func (p *TColumnDesc) IsSetIsAllowNull() bool { - return p.IsAllowNull != nil -} - -func (p *TColumnDesc) IsSetColumnKey() bool { - return p.ColumnKey != nil -} - -func (p *TColumnDesc) IsSetChildren() bool { - return p.Children != nil -} - -func (p *TColumnDesc) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetColumnName bool = false - var issetColumnType bool = false + var issetColumnName bool = false + var issetColumnType bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -1909,6 +1358,14 @@ func (p *TColumnDesc) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 9: + if fieldTypeId == thrift.STRING { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -2049,6 +1506,17 @@ func (p *TColumnDesc) ReadField8(iprot thrift.TProtocol) error { p.Children = _field return nil } +func (p *TColumnDesc) ReadField9(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.DefaultValue = _field + return nil +} func (p *TColumnDesc) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -2088,6 +1556,10 @@ func (p *TColumnDesc) Write(oprot thrift.TProtocol) (err error) { fieldId = 8 goto WriteFieldError } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -2262,6 +1734,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) } +func (p *TColumnDesc) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetDefaultValue() { + if err = oprot.WriteFieldBegin("defaultValue", thrift.STRING, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.DefaultValue); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + func (p *TColumnDesc) String() string { if p == nil { return "" @@ -2300,6 +1791,9 @@ func (p *TColumnDesc) DeepEqual(ano *TColumnDesc) bool { if !p.Field8DeepEqual(ano.Children) { return false } + if !p.Field9DeepEqual(ano.DefaultValue) { + return false + } return true } @@ -2390,6 +1884,18 @@ func (p *TColumnDesc) Field8DeepEqual(src []*TColumnDesc) bool { } return true } +func (p *TColumnDesc) Field9DeepEqual(src *string) bool { + + if p.DefaultValue == src { + return true + } else if p.DefaultValue == nil || src == nil { + return false + } + if strings.Compare(*p.DefaultValue, *src) != 0 { + return false + } + return true +} type TColumnDef struct { ColumnDesc *TColumnDesc `thrift:"columnDesc,1,required" frugal:"1,required,TColumnDesc" json:"columnDesc"` @@ -2643,9 +2149,9 @@ func (p *TColumnDef) Field2DeepEqual(src *string) bool { return true } -type TDescribeTableParams struct { +type TDescribeTablesParams struct { Db *string `thrift:"db,1,optional" frugal:"1,optional,string" json:"db,omitempty"` - TableName string `thrift:"table_name,2,required" frugal:"2,required,string" json:"table_name"` + TablesName []string `thrift:"tables_name,2,required" frugal:"2,required,list" json:"tables_name"` User *string `thrift:"user,3,optional" frugal:"3,optional,string" json:"user,omitempty"` UserIp *string `thrift:"user_ip,4,optional" frugal:"4,optional,string" json:"user_ip,omitempty"` CurrentUserIdent *types.TUserIdentity `thrift:"current_user_ident,5,optional" frugal:"5,optional,types.TUserIdentity" json:"current_user_ident,omitempty"` @@ -2653,99 +2159,99 @@ type TDescribeTableParams struct { Catalog *string `thrift:"catalog,7,optional" frugal:"7,optional,string" json:"catalog,omitempty"` } -func NewTDescribeTableParams() *TDescribeTableParams { - return &TDescribeTableParams{ +func NewTDescribeTablesParams() *TDescribeTablesParams { + return &TDescribeTablesParams{ ShowHiddenColumns: false, } } -func (p *TDescribeTableParams) InitDefault() { +func (p *TDescribeTablesParams) InitDefault() { p.ShowHiddenColumns = false } -var TDescribeTableParams_Db_DEFAULT string +var TDescribeTablesParams_Db_DEFAULT string -func (p *TDescribeTableParams) GetDb() (v string) { +func (p *TDescribeTablesParams) GetDb() (v string) { if !p.IsSetDb() { - return TDescribeTableParams_Db_DEFAULT + return TDescribeTablesParams_Db_DEFAULT } return *p.Db } -func (p *TDescribeTableParams) GetTableName() (v string) { - return p.TableName +func (p *TDescribeTablesParams) GetTablesName() (v []string) { + return p.TablesName } -var TDescribeTableParams_User_DEFAULT string +var TDescribeTablesParams_User_DEFAULT string -func (p *TDescribeTableParams) GetUser() (v string) { +func (p *TDescribeTablesParams) GetUser() (v string) { if !p.IsSetUser() { - return TDescribeTableParams_User_DEFAULT + return TDescribeTablesParams_User_DEFAULT } return *p.User } -var TDescribeTableParams_UserIp_DEFAULT string +var TDescribeTablesParams_UserIp_DEFAULT string -func (p *TDescribeTableParams) GetUserIp() (v string) { +func (p *TDescribeTablesParams) GetUserIp() (v string) { if !p.IsSetUserIp() { - return TDescribeTableParams_UserIp_DEFAULT + return TDescribeTablesParams_UserIp_DEFAULT } return *p.UserIp } -var TDescribeTableParams_CurrentUserIdent_DEFAULT *types.TUserIdentity +var TDescribeTablesParams_CurrentUserIdent_DEFAULT *types.TUserIdentity -func (p *TDescribeTableParams) GetCurrentUserIdent() (v *types.TUserIdentity) { +func (p *TDescribeTablesParams) GetCurrentUserIdent() (v *types.TUserIdentity) { if !p.IsSetCurrentUserIdent() { - return TDescribeTableParams_CurrentUserIdent_DEFAULT + return TDescribeTablesParams_CurrentUserIdent_DEFAULT } return p.CurrentUserIdent } -var TDescribeTableParams_ShowHiddenColumns_DEFAULT bool = false +var TDescribeTablesParams_ShowHiddenColumns_DEFAULT bool = false -func (p *TDescribeTableParams) GetShowHiddenColumns() (v bool) { +func (p *TDescribeTablesParams) GetShowHiddenColumns() (v bool) { if !p.IsSetShowHiddenColumns() { - return TDescribeTableParams_ShowHiddenColumns_DEFAULT + return TDescribeTablesParams_ShowHiddenColumns_DEFAULT } return p.ShowHiddenColumns } -var TDescribeTableParams_Catalog_DEFAULT string +var TDescribeTablesParams_Catalog_DEFAULT string -func (p *TDescribeTableParams) GetCatalog() (v string) { +func (p *TDescribeTablesParams) GetCatalog() (v string) { if !p.IsSetCatalog() { - return TDescribeTableParams_Catalog_DEFAULT + return TDescribeTablesParams_Catalog_DEFAULT } return *p.Catalog } -func (p *TDescribeTableParams) SetDb(val *string) { +func (p *TDescribeTablesParams) SetDb(val *string) { p.Db = val } -func (p *TDescribeTableParams) SetTableName(val string) { - p.TableName = val +func (p *TDescribeTablesParams) SetTablesName(val []string) { + p.TablesName = val } -func (p *TDescribeTableParams) SetUser(val *string) { +func (p *TDescribeTablesParams) SetUser(val *string) { p.User = val } -func (p *TDescribeTableParams) SetUserIp(val *string) { +func (p *TDescribeTablesParams) SetUserIp(val *string) { p.UserIp = val } -func (p *TDescribeTableParams) SetCurrentUserIdent(val *types.TUserIdentity) { +func (p *TDescribeTablesParams) SetCurrentUserIdent(val *types.TUserIdentity) { p.CurrentUserIdent = val } -func (p *TDescribeTableParams) SetShowHiddenColumns(val bool) { +func (p *TDescribeTablesParams) SetShowHiddenColumns(val bool) { p.ShowHiddenColumns = val } -func (p *TDescribeTableParams) SetCatalog(val *string) { +func (p *TDescribeTablesParams) SetCatalog(val *string) { p.Catalog = val } -var fieldIDToName_TDescribeTableParams = map[int16]string{ +var fieldIDToName_TDescribeTablesParams = map[int16]string{ 1: "db", - 2: "table_name", + 2: "tables_name", 3: "user", 4: "user_ip", 5: "current_user_ident", @@ -2753,35 +2259,35 @@ var fieldIDToName_TDescribeTableParams = map[int16]string{ 7: "catalog", } -func (p *TDescribeTableParams) IsSetDb() bool { +func (p *TDescribeTablesParams) IsSetDb() bool { return p.Db != nil } -func (p *TDescribeTableParams) IsSetUser() bool { +func (p *TDescribeTablesParams) IsSetUser() bool { return p.User != nil } -func (p *TDescribeTableParams) IsSetUserIp() bool { +func (p *TDescribeTablesParams) IsSetUserIp() bool { return p.UserIp != nil } -func (p *TDescribeTableParams) IsSetCurrentUserIdent() bool { +func (p *TDescribeTablesParams) IsSetCurrentUserIdent() bool { return p.CurrentUserIdent != nil } -func (p *TDescribeTableParams) IsSetShowHiddenColumns() bool { - return p.ShowHiddenColumns != TDescribeTableParams_ShowHiddenColumns_DEFAULT +func (p *TDescribeTablesParams) IsSetShowHiddenColumns() bool { + return p.ShowHiddenColumns != TDescribeTablesParams_ShowHiddenColumns_DEFAULT } -func (p *TDescribeTableParams) IsSetCatalog() bool { +func (p *TDescribeTablesParams) IsSetCatalog() bool { return p.Catalog != nil } -func (p *TDescribeTableParams) Read(iprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetTableName bool = false + var issetTablesName bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -2806,11 +2312,11 @@ func (p *TDescribeTableParams) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetTableName = true + issetTablesName = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -2867,7 +2373,7 @@ func (p *TDescribeTableParams) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetTableName { + if !issetTablesName { fieldId = 2 goto RequiredFieldNotSetError } @@ -2877,7 +2383,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTableParams[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesParams[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -2886,10 +2392,10 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTableParams[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesParams[fieldId])) } -func (p *TDescribeTableParams) ReadField1(iprot thrift.TProtocol) error { +func (p *TDescribeTablesParams) ReadField1(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2900,18 +2406,30 @@ func (p *TDescribeTableParams) ReadField1(iprot thrift.TProtocol) error { p.Db = _field return nil } -func (p *TDescribeTableParams) ReadField2(iprot thrift.TProtocol) error { +func (p *TDescribeTablesParams) ReadField2(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]string, 0, size) + for i := 0; i < size; i++ { - var _field string - if v, err := iprot.ReadString(); err != nil { + var _elem string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = v } - p.TableName = _field + p.TablesName = _field return nil } -func (p *TDescribeTableParams) ReadField3(iprot thrift.TProtocol) error { +func (p *TDescribeTablesParams) ReadField3(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2922,7 +2440,7 @@ func (p *TDescribeTableParams) ReadField3(iprot thrift.TProtocol) error { p.User = _field return nil } -func (p *TDescribeTableParams) ReadField4(iprot thrift.TProtocol) error { +func (p *TDescribeTablesParams) ReadField4(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2933,7 +2451,7 @@ func (p *TDescribeTableParams) ReadField4(iprot thrift.TProtocol) error { p.UserIp = _field return nil } -func (p *TDescribeTableParams) ReadField5(iprot thrift.TProtocol) error { +func (p *TDescribeTablesParams) ReadField5(iprot thrift.TProtocol) error { _field := types.NewTUserIdentity() if err := _field.Read(iprot); err != nil { return err @@ -2941,7 +2459,7 @@ func (p *TDescribeTableParams) ReadField5(iprot thrift.TProtocol) error { p.CurrentUserIdent = _field return nil } -func (p *TDescribeTableParams) ReadField6(iprot thrift.TProtocol) error { +func (p *TDescribeTablesParams) ReadField6(iprot thrift.TProtocol) error { var _field bool if v, err := iprot.ReadBool(); err != nil { @@ -2952,7 +2470,7 @@ func (p *TDescribeTableParams) ReadField6(iprot thrift.TProtocol) error { p.ShowHiddenColumns = _field return nil } -func (p *TDescribeTableParams) ReadField7(iprot thrift.TProtocol) error { +func (p *TDescribeTablesParams) ReadField7(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -2964,9 +2482,9 @@ func (p *TDescribeTableParams) ReadField7(iprot thrift.TProtocol) error { return nil } -func (p *TDescribeTableParams) Write(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TDescribeTableParams"); err != nil { + if err = oprot.WriteStructBegin("TDescribeTablesParams"); err != nil { goto WriteStructBeginError } if p != nil { @@ -3016,7 +2534,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TDescribeTableParams) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetDb() { if err = oprot.WriteFieldBegin("db", thrift.STRING, 1); err != nil { goto WriteFieldBeginError @@ -3035,11 +2553,19 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TDescribeTableParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("table_name", thrift.STRING, 2); err != nil { +func (p *TDescribeTablesParams) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("tables_name", thrift.LIST, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(p.TableName); err != nil { + if err := oprot.WriteListBegin(thrift.STRING, len(p.TablesName)); err != nil { + return err + } + for _, v := range p.TablesName { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -3052,7 +2578,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TDescribeTableParams) writeField3(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) writeField3(oprot thrift.TProtocol) (err error) { if p.IsSetUser() { if err = oprot.WriteFieldBegin("user", thrift.STRING, 3); err != nil { goto WriteFieldBeginError @@ -3071,7 +2597,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *TDescribeTableParams) writeField4(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) writeField4(oprot thrift.TProtocol) (err error) { if p.IsSetUserIp() { if err = oprot.WriteFieldBegin("user_ip", thrift.STRING, 4); err != nil { goto WriteFieldBeginError @@ -3090,7 +2616,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *TDescribeTableParams) writeField5(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) writeField5(oprot thrift.TProtocol) (err error) { if p.IsSetCurrentUserIdent() { if err = oprot.WriteFieldBegin("current_user_ident", thrift.STRUCT, 5); err != nil { goto WriteFieldBeginError @@ -3109,7 +2635,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } -func (p *TDescribeTableParams) writeField6(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) writeField6(oprot thrift.TProtocol) (err error) { if p.IsSetShowHiddenColumns() { if err = oprot.WriteFieldBegin("show_hidden_columns", thrift.BOOL, 6); err != nil { goto WriteFieldBeginError @@ -3128,7 +2654,7 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -func (p *TDescribeTableParams) writeField7(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesParams) writeField7(oprot thrift.TProtocol) (err error) { if p.IsSetCatalog() { if err = oprot.WriteFieldBegin("catalog", thrift.STRING, 7); err != nil { goto WriteFieldBeginError @@ -3147,15 +2673,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) } -func (p *TDescribeTableParams) String() string { +func (p *TDescribeTablesParams) String() string { if p == nil { return "" } - return fmt.Sprintf("TDescribeTableParams(%+v)", *p) + return fmt.Sprintf("TDescribeTablesParams(%+v)", *p) } -func (p *TDescribeTableParams) DeepEqual(ano *TDescribeTableParams) bool { +func (p *TDescribeTablesParams) DeepEqual(ano *TDescribeTablesParams) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -3164,7 +2690,7 @@ func (p *TDescribeTableParams) DeepEqual(ano *TDescribeTableParams) bool { if !p.Field1DeepEqual(ano.Db) { return false } - if !p.Field2DeepEqual(ano.TableName) { + if !p.Field2DeepEqual(ano.TablesName) { return false } if !p.Field3DeepEqual(ano.User) { @@ -3185,7 +2711,7 @@ func (p *TDescribeTableParams) DeepEqual(ano *TDescribeTableParams) bool { return true } -func (p *TDescribeTableParams) Field1DeepEqual(src *string) bool { +func (p *TDescribeTablesParams) Field1DeepEqual(src *string) bool { if p.Db == src { return true @@ -3197,14 +2723,20 @@ func (p *TDescribeTableParams) Field1DeepEqual(src *string) bool { } return true } -func (p *TDescribeTableParams) Field2DeepEqual(src string) bool { +func (p *TDescribeTablesParams) Field2DeepEqual(src []string) bool { - if strings.Compare(p.TableName, src) != 0 { + if len(p.TablesName) != len(src) { return false } + for i, v := range p.TablesName { + _src := src[i] + if strings.Compare(v, _src) != 0 { + return false + } + } return true } -func (p *TDescribeTableParams) Field3DeepEqual(src *string) bool { +func (p *TDescribeTablesParams) Field3DeepEqual(src *string) bool { if p.User == src { return true @@ -3216,7 +2748,7 @@ func (p *TDescribeTableParams) Field3DeepEqual(src *string) bool { } return true } -func (p *TDescribeTableParams) Field4DeepEqual(src *string) bool { +func (p *TDescribeTablesParams) Field4DeepEqual(src *string) bool { if p.UserIp == src { return true @@ -3228,21 +2760,21 @@ func (p *TDescribeTableParams) Field4DeepEqual(src *string) bool { } return true } -func (p *TDescribeTableParams) Field5DeepEqual(src *types.TUserIdentity) bool { +func (p *TDescribeTablesParams) Field5DeepEqual(src *types.TUserIdentity) bool { if !p.CurrentUserIdent.DeepEqual(src) { return false } return true } -func (p *TDescribeTableParams) Field6DeepEqual(src bool) bool { +func (p *TDescribeTablesParams) Field6DeepEqual(src bool) bool { if p.ShowHiddenColumns != src { return false } return true } -func (p *TDescribeTableParams) Field7DeepEqual(src *string) bool { +func (p *TDescribeTablesParams) Field7DeepEqual(src *string) bool { if p.Catalog == src { return true @@ -3255,32 +2787,42 @@ func (p *TDescribeTableParams) Field7DeepEqual(src *string) bool { return true } -type TDescribeTableResult_ struct { - Columns []*TColumnDef `thrift:"columns,1,required" frugal:"1,required,list" json:"columns"` +type TDescribeTablesResult_ struct { + TablesOffset []int32 `thrift:"tables_offset,1,required" frugal:"1,required,list" json:"tables_offset"` + Columns []*TColumnDef `thrift:"columns,2,required" frugal:"2,required,list" json:"columns"` +} + +func NewTDescribeTablesResult_() *TDescribeTablesResult_ { + return &TDescribeTablesResult_{} } -func NewTDescribeTableResult_() *TDescribeTableResult_ { - return &TDescribeTableResult_{} +func (p *TDescribeTablesResult_) InitDefault() { } -func (p *TDescribeTableResult_) InitDefault() { +func (p *TDescribeTablesResult_) GetTablesOffset() (v []int32) { + return p.TablesOffset } -func (p *TDescribeTableResult_) GetColumns() (v []*TColumnDef) { +func (p *TDescribeTablesResult_) GetColumns() (v []*TColumnDef) { return p.Columns } -func (p *TDescribeTableResult_) SetColumns(val []*TColumnDef) { +func (p *TDescribeTablesResult_) SetTablesOffset(val []int32) { + p.TablesOffset = val +} +func (p *TDescribeTablesResult_) SetColumns(val []*TColumnDef) { p.Columns = val } -var fieldIDToName_TDescribeTableResult_ = map[int16]string{ - 1: "columns", +var fieldIDToName_TDescribeTablesResult_ = map[int16]string{ + 1: "tables_offset", + 2: "columns", } -func (p *TDescribeTableResult_) Read(iprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesResult_) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 + var issetTablesOffset bool = false var issetColumns bool = false if _, err = iprot.ReadStructBegin(); err != nil { @@ -3302,6 +2844,15 @@ func (p *TDescribeTableResult_) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetTablesOffset = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.LIST { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } issetColumns = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -3319,17 +2870,22 @@ func (p *TDescribeTableResult_) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetColumns { + if !issetTablesOffset { fieldId = 1 goto RequiredFieldNotSetError } + + if !issetColumns { + fieldId = 2 + goto RequiredFieldNotSetError + } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTableResult_[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesResult_[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -3338,10 +2894,33 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTableResult_[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesResult_[fieldId])) } -func (p *TDescribeTableResult_) ReadField1(iprot thrift.TProtocol) error { +func (p *TDescribeTablesResult_) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]int32, 0, size) + for i := 0; i < size; i++ { + + var _elem int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.TablesOffset = _field + return nil +} +func (p *TDescribeTablesResult_) ReadField2(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { return err @@ -3365,9 +2944,9 @@ func (p *TDescribeTableResult_) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *TDescribeTableResult_) Write(oprot thrift.TProtocol) (err error) { +func (p *TDescribeTablesResult_) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TDescribeTableResult"); err != nil { + if err = oprot.WriteStructBegin("TDescribeTablesResult"); err != nil { goto WriteStructBeginError } if p != nil { @@ -3375,6 +2954,10 @@ func (p *TDescribeTableResult_) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -3393,8 +2976,33 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TDescribeTableResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("columns", thrift.LIST, 1); err != nil { +func (p *TDescribeTablesResult_) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("tables_offset", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.I32, len(p.TablesOffset)); err != nil { + return err + } + for _, v := range p.TablesOffset { + if err := oprot.WriteI32(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TDescribeTablesResult_) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("columns", thrift.LIST, 2); err != nil { goto WriteFieldBeginError } if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { @@ -3413,184 +3021,98 @@ func (p *TDescribeTableResult_) writeField1(oprot thrift.TProtocol) (err error) } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TDescribeTableResult_) String() string { +func (p *TDescribeTablesResult_) String() string { if p == nil { return "" } - return fmt.Sprintf("TDescribeTableResult_(%+v)", *p) + return fmt.Sprintf("TDescribeTablesResult_(%+v)", *p) } -func (p *TDescribeTableResult_) DeepEqual(ano *TDescribeTableResult_) bool { +func (p *TDescribeTablesResult_) DeepEqual(ano *TDescribeTablesResult_) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Columns) { + if !p.Field1DeepEqual(ano.TablesOffset) { + return false + } + if !p.Field2DeepEqual(ano.Columns) { return false } return true } -func (p *TDescribeTableResult_) Field1DeepEqual(src []*TColumnDef) bool { +func (p *TDescribeTablesResult_) Field1DeepEqual(src []int32) bool { - if len(p.Columns) != len(src) { + if len(p.TablesOffset) != len(src) { return false } - for i, v := range p.Columns { + for i, v := range p.TablesOffset { _src := src[i] - if !v.DeepEqual(_src) { + if v != _src { return false } } return true } +func (p *TDescribeTablesResult_) Field2DeepEqual(src []*TColumnDef) bool { -type TDescribeTablesParams struct { - Db *string `thrift:"db,1,optional" frugal:"1,optional,string" json:"db,omitempty"` - TablesName []string `thrift:"tables_name,2,required" frugal:"2,required,list" json:"tables_name"` - User *string `thrift:"user,3,optional" frugal:"3,optional,string" json:"user,omitempty"` - UserIp *string `thrift:"user_ip,4,optional" frugal:"4,optional,string" json:"user_ip,omitempty"` - CurrentUserIdent *types.TUserIdentity `thrift:"current_user_ident,5,optional" frugal:"5,optional,types.TUserIdentity" json:"current_user_ident,omitempty"` - ShowHiddenColumns bool `thrift:"show_hidden_columns,6,optional" frugal:"6,optional,bool" json:"show_hidden_columns,omitempty"` - Catalog *string `thrift:"catalog,7,optional" frugal:"7,optional,string" json:"catalog,omitempty"` -} - -func NewTDescribeTablesParams() *TDescribeTablesParams { - return &TDescribeTablesParams{ - - ShowHiddenColumns: false, - } -} - -func (p *TDescribeTablesParams) InitDefault() { - p.ShowHiddenColumns = false -} - -var TDescribeTablesParams_Db_DEFAULT string - -func (p *TDescribeTablesParams) GetDb() (v string) { - if !p.IsSetDb() { - return TDescribeTablesParams_Db_DEFAULT - } - return *p.Db -} - -func (p *TDescribeTablesParams) GetTablesName() (v []string) { - return p.TablesName -} - -var TDescribeTablesParams_User_DEFAULT string - -func (p *TDescribeTablesParams) GetUser() (v string) { - if !p.IsSetUser() { - return TDescribeTablesParams_User_DEFAULT - } - return *p.User -} - -var TDescribeTablesParams_UserIp_DEFAULT string - -func (p *TDescribeTablesParams) GetUserIp() (v string) { - if !p.IsSetUserIp() { - return TDescribeTablesParams_UserIp_DEFAULT - } - return *p.UserIp -} - -var TDescribeTablesParams_CurrentUserIdent_DEFAULT *types.TUserIdentity - -func (p *TDescribeTablesParams) GetCurrentUserIdent() (v *types.TUserIdentity) { - if !p.IsSetCurrentUserIdent() { - return TDescribeTablesParams_CurrentUserIdent_DEFAULT + if len(p.Columns) != len(src) { + return false } - return p.CurrentUserIdent -} - -var TDescribeTablesParams_ShowHiddenColumns_DEFAULT bool = false - -func (p *TDescribeTablesParams) GetShowHiddenColumns() (v bool) { - if !p.IsSetShowHiddenColumns() { - return TDescribeTablesParams_ShowHiddenColumns_DEFAULT + for i, v := range p.Columns { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } } - return p.ShowHiddenColumns + return true } -var TDescribeTablesParams_Catalog_DEFAULT string - -func (p *TDescribeTablesParams) GetCatalog() (v string) { - if !p.IsSetCatalog() { - return TDescribeTablesParams_Catalog_DEFAULT - } - return *p.Catalog -} -func (p *TDescribeTablesParams) SetDb(val *string) { - p.Db = val -} -func (p *TDescribeTablesParams) SetTablesName(val []string) { - p.TablesName = val -} -func (p *TDescribeTablesParams) SetUser(val *string) { - p.User = val -} -func (p *TDescribeTablesParams) SetUserIp(val *string) { - p.UserIp = val -} -func (p *TDescribeTablesParams) SetCurrentUserIdent(val *types.TUserIdentity) { - p.CurrentUserIdent = val -} -func (p *TDescribeTablesParams) SetShowHiddenColumns(val bool) { - p.ShowHiddenColumns = val -} -func (p *TDescribeTablesParams) SetCatalog(val *string) { - p.Catalog = val +type TShowVariableRequest struct { + ThreadId int64 `thrift:"threadId,1,required" frugal:"1,required,i64" json:"threadId"` + VarType types.TVarType `thrift:"varType,2,required" frugal:"2,required,TVarType" json:"varType"` } -var fieldIDToName_TDescribeTablesParams = map[int16]string{ - 1: "db", - 2: "tables_name", - 3: "user", - 4: "user_ip", - 5: "current_user_ident", - 6: "show_hidden_columns", - 7: "catalog", +func NewTShowVariableRequest() *TShowVariableRequest { + return &TShowVariableRequest{} } -func (p *TDescribeTablesParams) IsSetDb() bool { - return p.Db != nil +func (p *TShowVariableRequest) InitDefault() { } -func (p *TDescribeTablesParams) IsSetUser() bool { - return p.User != nil +func (p *TShowVariableRequest) GetThreadId() (v int64) { + return p.ThreadId } -func (p *TDescribeTablesParams) IsSetUserIp() bool { - return p.UserIp != nil +func (p *TShowVariableRequest) GetVarType() (v types.TVarType) { + return p.VarType } - -func (p *TDescribeTablesParams) IsSetCurrentUserIdent() bool { - return p.CurrentUserIdent != nil +func (p *TShowVariableRequest) SetThreadId(val int64) { + p.ThreadId = val } - -func (p *TDescribeTablesParams) IsSetShowHiddenColumns() bool { - return p.ShowHiddenColumns != TDescribeTablesParams_ShowHiddenColumns_DEFAULT +func (p *TShowVariableRequest) SetVarType(val types.TVarType) { + p.VarType = val } -func (p *TDescribeTablesParams) IsSetCatalog() bool { - return p.Catalog != nil +var fieldIDToName_TShowVariableRequest = map[int16]string{ + 1: "threadId", + 2: "varType", } -func (p *TDescribeTablesParams) Read(iprot thrift.TProtocol) (err error) { +func (p *TShowVariableRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetTablesName bool = false + var issetThreadId bool = false + var issetVarType bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -3607,59 +3129,20 @@ func (p *TDescribeTablesParams) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } + issetThreadId = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.I32 { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetTablesName = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.STRING { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } + issetVarType = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -3676,7 +3159,12 @@ func (p *TDescribeTablesParams) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetTablesName { + if !issetThreadId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetVarType { fieldId = 2 goto RequiredFieldNotSetError } @@ -3686,7 +3174,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesParams[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -3695,159 +3183,73 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesParams[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableRequest[fieldId])) } -func (p *TDescribeTablesParams) ReadField1(iprot thrift.TProtocol) error { +func (p *TShowVariableRequest) ReadField1(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _field int64 + if v, err := iprot.ReadI64(); err != nil { return err } else { - _field = &v + _field = v } - p.Db = _field + p.ThreadId = _field return nil } -func (p *TDescribeTablesParams) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { +func (p *TShowVariableRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field types.TVarType + if v, err := iprot.ReadI32(); err != nil { return err + } else { + _field = types.TVarType(v) } - _field := make([]string, 0, size) - for i := 0; i < size; i++ { + p.VarType = _field + return nil +} - var _elem string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _elem = v +func (p *TShowVariableRequest) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TShowVariableRequest"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError } - - _field = append(_field, _elem) } - if err := iprot.ReadListEnd(); err != nil { - return err + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError } - p.TablesName = _field return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TDescribeTablesParams) ReadField3(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { +func (p *TShowVariableRequest) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("threadId", thrift.I64, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.ThreadId); err != nil { return err - } else { - _field = &v - } - p.User = _field - return nil -} -func (p *TDescribeTablesParams) ReadField4(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.UserIp = _field - return nil -} -func (p *TDescribeTablesParams) ReadField5(iprot thrift.TProtocol) error { - _field := types.NewTUserIdentity() - if err := _field.Read(iprot); err != nil { - return err - } - p.CurrentUserIdent = _field - return nil -} -func (p *TDescribeTablesParams) ReadField6(iprot thrift.TProtocol) error { - - var _field bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = v - } - p.ShowHiddenColumns = _field - return nil -} -func (p *TDescribeTablesParams) ReadField7(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Catalog = _field - return nil -} - -func (p *TDescribeTablesParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TDescribeTablesParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TDescribeTablesParams) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetDb() { - if err = oprot.WriteFieldBegin("db", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Db); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } return nil WriteFieldBeginError: @@ -3856,19 +3258,11 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TDescribeTablesParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("tables_name", thrift.LIST, 2); err != nil { +func (p *TShowVariableRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("varType", thrift.I32, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRING, len(p.TablesName)); err != nil { - return err - } - for _, v := range p.TablesName { - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteI32(int32(p.VarType)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -3877,5155 +3271,75 @@ func (p *TDescribeTablesParams) writeField2(oprot thrift.TProtocol) (err error) return nil WriteFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TDescribeTablesParams) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetUser() { - if err = oprot.WriteFieldBegin("user", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.User); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TDescribeTablesParams) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetUserIp() { - if err = oprot.WriteFieldBegin("user_ip", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.UserIp); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TDescribeTablesParams) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetCurrentUserIdent() { - if err = oprot.WriteFieldBegin("current_user_ident", thrift.STRUCT, 5); err != nil { - goto WriteFieldBeginError - } - if err := p.CurrentUserIdent.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TDescribeTablesParams) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetShowHiddenColumns() { - if err = oprot.WriteFieldBegin("show_hidden_columns", thrift.BOOL, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(p.ShowHiddenColumns); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *TDescribeTablesParams) writeField7(oprot thrift.TProtocol) (err error) { - if p.IsSetCatalog() { - if err = oprot.WriteFieldBegin("catalog", thrift.STRING, 7); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Catalog); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *TDescribeTablesParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDescribeTablesParams(%+v)", *p) - -} - -func (p *TDescribeTablesParams) DeepEqual(ano *TDescribeTablesParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Db) { - return false - } - if !p.Field2DeepEqual(ano.TablesName) { - return false - } - if !p.Field3DeepEqual(ano.User) { - return false - } - if !p.Field4DeepEqual(ano.UserIp) { - return false - } - if !p.Field5DeepEqual(ano.CurrentUserIdent) { - return false - } - if !p.Field6DeepEqual(ano.ShowHiddenColumns) { - return false - } - if !p.Field7DeepEqual(ano.Catalog) { - return false - } - return true -} - -func (p *TDescribeTablesParams) Field1DeepEqual(src *string) bool { - - if p.Db == src { - return true - } else if p.Db == nil || src == nil { - return false - } - if strings.Compare(*p.Db, *src) != 0 { - return false - } - return true -} -func (p *TDescribeTablesParams) Field2DeepEqual(src []string) bool { - - if len(p.TablesName) != len(src) { - return false - } - for i, v := range p.TablesName { - _src := src[i] - if strings.Compare(v, _src) != 0 { - return false - } - } - return true -} -func (p *TDescribeTablesParams) Field3DeepEqual(src *string) bool { - - if p.User == src { - return true - } else if p.User == nil || src == nil { - return false - } - if strings.Compare(*p.User, *src) != 0 { - return false - } - return true -} -func (p *TDescribeTablesParams) Field4DeepEqual(src *string) bool { - - if p.UserIp == src { - return true - } else if p.UserIp == nil || src == nil { - return false - } - if strings.Compare(*p.UserIp, *src) != 0 { - return false - } - return true -} -func (p *TDescribeTablesParams) Field5DeepEqual(src *types.TUserIdentity) bool { - - if !p.CurrentUserIdent.DeepEqual(src) { - return false - } - return true -} -func (p *TDescribeTablesParams) Field6DeepEqual(src bool) bool { - - if p.ShowHiddenColumns != src { - return false - } - return true -} -func (p *TDescribeTablesParams) Field7DeepEqual(src *string) bool { - - if p.Catalog == src { - return true - } else if p.Catalog == nil || src == nil { - return false - } - if strings.Compare(*p.Catalog, *src) != 0 { - return false - } - return true -} - -type TDescribeTablesResult_ struct { - TablesOffset []int32 `thrift:"tables_offset,1,required" frugal:"1,required,list" json:"tables_offset"` - Columns []*TColumnDef `thrift:"columns,2,required" frugal:"2,required,list" json:"columns"` -} - -func NewTDescribeTablesResult_() *TDescribeTablesResult_ { - return &TDescribeTablesResult_{} -} - -func (p *TDescribeTablesResult_) InitDefault() { -} - -func (p *TDescribeTablesResult_) GetTablesOffset() (v []int32) { - return p.TablesOffset -} - -func (p *TDescribeTablesResult_) GetColumns() (v []*TColumnDef) { - return p.Columns -} -func (p *TDescribeTablesResult_) SetTablesOffset(val []int32) { - p.TablesOffset = val -} -func (p *TDescribeTablesResult_) SetColumns(val []*TColumnDef) { - p.Columns = val -} - -var fieldIDToName_TDescribeTablesResult_ = map[int16]string{ - 1: "tables_offset", - 2: "columns", -} - -func (p *TDescribeTablesResult_) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetTablesOffset bool = false - var issetColumns bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetTablesOffset = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.LIST { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetColumns = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetTablesOffset { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetColumns { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesResult_[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesResult_[fieldId])) -} - -func (p *TDescribeTablesResult_) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]int32, 0, size) - for i := 0; i < size; i++ { - - var _elem int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _elem = v - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.TablesOffset = _field - return nil -} -func (p *TDescribeTablesResult_) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*TColumnDef, 0, size) - values := make([]TColumnDef, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.Columns = _field - return nil -} - -func (p *TDescribeTablesResult_) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TDescribeTablesResult"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TDescribeTablesResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("tables_offset", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.I32, len(p.TablesOffset)); err != nil { - return err - } - for _, v := range p.TablesOffset { - if err := oprot.WriteI32(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TDescribeTablesResult_) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("columns", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Columns)); err != nil { - return err - } - for _, v := range p.Columns { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TDescribeTablesResult_) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDescribeTablesResult_(%+v)", *p) - -} - -func (p *TDescribeTablesResult_) DeepEqual(ano *TDescribeTablesResult_) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.TablesOffset) { - return false - } - if !p.Field2DeepEqual(ano.Columns) { - return false - } - return true -} - -func (p *TDescribeTablesResult_) Field1DeepEqual(src []int32) bool { - - if len(p.TablesOffset) != len(src) { - return false - } - for i, v := range p.TablesOffset { - _src := src[i] - if v != _src { - return false - } - } - return true -} -func (p *TDescribeTablesResult_) Field2DeepEqual(src []*TColumnDef) bool { - - if len(p.Columns) != len(src) { - return false - } - for i, v := range p.Columns { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} - -type TShowVariableRequest struct { - ThreadId int64 `thrift:"threadId,1,required" frugal:"1,required,i64" json:"threadId"` - VarType types.TVarType `thrift:"varType,2,required" frugal:"2,required,TVarType" json:"varType"` -} - -func NewTShowVariableRequest() *TShowVariableRequest { - return &TShowVariableRequest{} -} - -func (p *TShowVariableRequest) InitDefault() { -} - -func (p *TShowVariableRequest) GetThreadId() (v int64) { - return p.ThreadId -} - -func (p *TShowVariableRequest) GetVarType() (v types.TVarType) { - return p.VarType -} -func (p *TShowVariableRequest) SetThreadId(val int64) { - p.ThreadId = val -} -func (p *TShowVariableRequest) SetVarType(val types.TVarType) { - p.VarType = val -} - -var fieldIDToName_TShowVariableRequest = map[int16]string{ - 1: "threadId", - 2: "varType", -} - -func (p *TShowVariableRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetThreadId bool = false - var issetVarType bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetThreadId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I32 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetVarType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetThreadId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetVarType { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableRequest[fieldId])) -} - -func (p *TShowVariableRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.ThreadId = _field - return nil -} -func (p *TShowVariableRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field types.TVarType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = types.TVarType(v) - } - p.VarType = _field - return nil -} - -func (p *TShowVariableRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TShowVariableRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TShowVariableRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("threadId", thrift.I64, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ThreadId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TShowVariableRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("varType", thrift.I32, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(p.VarType)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TShowVariableRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TShowVariableRequest(%+v)", *p) - -} - -func (p *TShowVariableRequest) DeepEqual(ano *TShowVariableRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ThreadId) { - return false - } - if !p.Field2DeepEqual(ano.VarType) { - return false - } - return true -} - -func (p *TShowVariableRequest) Field1DeepEqual(src int64) bool { - - if p.ThreadId != src { - return false - } - return true -} -func (p *TShowVariableRequest) Field2DeepEqual(src types.TVarType) bool { - - if p.VarType != src { - return false - } - return true -} - -type TShowVariableResult_ struct { - Variables [][]string `thrift:"variables,1,required" frugal:"1,required,list>" json:"variables"` -} - -func NewTShowVariableResult_() *TShowVariableResult_ { - return &TShowVariableResult_{} -} - -func (p *TShowVariableResult_) InitDefault() { -} - -func (p *TShowVariableResult_) GetVariables() (v [][]string) { - return p.Variables -} -func (p *TShowVariableResult_) SetVariables(val [][]string) { - p.Variables = val -} - -var fieldIDToName_TShowVariableResult_ = map[int16]string{ - 1: "variables", -} - -func (p *TShowVariableResult_) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetVariables bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetVariables = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetVariables { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableResult_[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableResult_[fieldId])) -} - -func (p *TShowVariableResult_) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([][]string, 0, size) - for i := 0; i < size; i++ { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _elem := make([]string, 0, size) - for i := 0; i < size; i++ { - - var _elem1 string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _elem1 = v - } - - _elem = append(_elem, _elem1) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.Variables = _field - return nil -} - -func (p *TShowVariableResult_) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TShowVariableResult"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TShowVariableResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("variables", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.LIST, len(p.Variables)); err != nil { - return err - } - for _, v := range p.Variables { - if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { - return err - } - for _, v := range v { - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TShowVariableResult_) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TShowVariableResult_(%+v)", *p) - -} - -func (p *TShowVariableResult_) DeepEqual(ano *TShowVariableResult_) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Variables) { - return false - } - return true -} - -func (p *TShowVariableResult_) Field1DeepEqual(src [][]string) bool { - - if len(p.Variables) != len(src) { - return false - } - for i, v := range p.Variables { - _src := src[i] - if len(v) != len(_src) { - return false - } - for i, v := range v { - _src1 := _src[i] - if strings.Compare(v, _src1) != 0 { - return false - } - } - } - return true -} - -type TTableRowFormat struct { - FieldTerminator *string `thrift:"field_terminator,1,optional" frugal:"1,optional,string" json:"field_terminator,omitempty"` - LineTerminator *string `thrift:"line_terminator,2,optional" frugal:"2,optional,string" json:"line_terminator,omitempty"` - EscapedBy *string `thrift:"escaped_by,3,optional" frugal:"3,optional,string" json:"escaped_by,omitempty"` -} - -func NewTTableRowFormat() *TTableRowFormat { - return &TTableRowFormat{} -} - -func (p *TTableRowFormat) InitDefault() { -} - -var TTableRowFormat_FieldTerminator_DEFAULT string - -func (p *TTableRowFormat) GetFieldTerminator() (v string) { - if !p.IsSetFieldTerminator() { - return TTableRowFormat_FieldTerminator_DEFAULT - } - return *p.FieldTerminator -} - -var TTableRowFormat_LineTerminator_DEFAULT string - -func (p *TTableRowFormat) GetLineTerminator() (v string) { - if !p.IsSetLineTerminator() { - return TTableRowFormat_LineTerminator_DEFAULT - } - return *p.LineTerminator -} - -var TTableRowFormat_EscapedBy_DEFAULT string - -func (p *TTableRowFormat) GetEscapedBy() (v string) { - if !p.IsSetEscapedBy() { - return TTableRowFormat_EscapedBy_DEFAULT - } - return *p.EscapedBy -} -func (p *TTableRowFormat) SetFieldTerminator(val *string) { - p.FieldTerminator = val -} -func (p *TTableRowFormat) SetLineTerminator(val *string) { - p.LineTerminator = val -} -func (p *TTableRowFormat) SetEscapedBy(val *string) { - p.EscapedBy = val -} - -var fieldIDToName_TTableRowFormat = map[int16]string{ - 1: "field_terminator", - 2: "line_terminator", - 3: "escaped_by", -} - -func (p *TTableRowFormat) IsSetFieldTerminator() bool { - return p.FieldTerminator != nil -} - -func (p *TTableRowFormat) IsSetLineTerminator() bool { - return p.LineTerminator != nil -} - -func (p *TTableRowFormat) IsSetEscapedBy() bool { - return p.EscapedBy != nil -} - -func (p *TTableRowFormat) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableRowFormat[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TTableRowFormat) ReadField1(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.FieldTerminator = _field - return nil -} -func (p *TTableRowFormat) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.LineTerminator = _field - return nil -} -func (p *TTableRowFormat) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.EscapedBy = _field - return nil -} - -func (p *TTableRowFormat) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTableRowFormat"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTableRowFormat) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetFieldTerminator() { - if err = oprot.WriteFieldBegin("field_terminator", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.FieldTerminator); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTableRowFormat) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetLineTerminator() { - if err = oprot.WriteFieldBegin("line_terminator", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.LineTerminator); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TTableRowFormat) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetEscapedBy() { - if err = oprot.WriteFieldBegin("escaped_by", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.EscapedBy); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TTableRowFormat) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTableRowFormat(%+v)", *p) - -} - -func (p *TTableRowFormat) DeepEqual(ano *TTableRowFormat) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.FieldTerminator) { - return false - } - if !p.Field2DeepEqual(ano.LineTerminator) { - return false - } - if !p.Field3DeepEqual(ano.EscapedBy) { - return false - } - return true -} - -func (p *TTableRowFormat) Field1DeepEqual(src *string) bool { - - if p.FieldTerminator == src { - return true - } else if p.FieldTerminator == nil || src == nil { - return false - } - if strings.Compare(*p.FieldTerminator, *src) != 0 { - return false - } - return true -} -func (p *TTableRowFormat) Field2DeepEqual(src *string) bool { - - if p.LineTerminator == src { - return true - } else if p.LineTerminator == nil || src == nil { - return false - } - if strings.Compare(*p.LineTerminator, *src) != 0 { - return false - } - return true -} -func (p *TTableRowFormat) Field3DeepEqual(src *string) bool { - - if p.EscapedBy == src { - return true - } else if p.EscapedBy == nil || src == nil { - return false - } - if strings.Compare(*p.EscapedBy, *src) != 0 { - return false - } - return true -} - -type TPartitionKeyValue struct { - Name string `thrift:"name,1,required" frugal:"1,required,string" json:"name"` - Value string `thrift:"value,2,required" frugal:"2,required,string" json:"value"` -} - -func NewTPartitionKeyValue() *TPartitionKeyValue { - return &TPartitionKeyValue{} -} - -func (p *TPartitionKeyValue) InitDefault() { -} - -func (p *TPartitionKeyValue) GetName() (v string) { - return p.Name -} - -func (p *TPartitionKeyValue) GetValue() (v string) { - return p.Value -} -func (p *TPartitionKeyValue) SetName(val string) { - p.Name = val -} -func (p *TPartitionKeyValue) SetValue(val string) { - p.Value = val -} - -var fieldIDToName_TPartitionKeyValue = map[int16]string{ - 1: "name", - 2: "value", -} - -func (p *TPartitionKeyValue) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetName bool = false - var issetValue bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetName = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetValue = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetName { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetValue { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPartitionKeyValue[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TPartitionKeyValue[fieldId])) -} - -func (p *TPartitionKeyValue) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Name = _field - return nil -} -func (p *TPartitionKeyValue) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Value = _field - return nil -} - -func (p *TPartitionKeyValue) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TPartitionKeyValue"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TPartitionKeyValue) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("name", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Name); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TPartitionKeyValue) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("value", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Value); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TPartitionKeyValue) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TPartitionKeyValue(%+v)", *p) - -} - -func (p *TPartitionKeyValue) DeepEqual(ano *TPartitionKeyValue) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Name) { - return false - } - if !p.Field2DeepEqual(ano.Value) { - return false - } - return true -} - -func (p *TPartitionKeyValue) Field1DeepEqual(src string) bool { - - if strings.Compare(p.Name, src) != 0 { - return false - } - return true -} -func (p *TPartitionKeyValue) Field2DeepEqual(src string) bool { - - if strings.Compare(p.Value, src) != 0 { - return false - } - return true -} - -type TSessionState struct { - Database string `thrift:"database,1,required" frugal:"1,required,string" json:"database"` - User string `thrift:"user,2,required" frugal:"2,required,string" json:"user"` - ConnectionId int64 `thrift:"connection_id,3,required" frugal:"3,required,i64" json:"connection_id"` -} - -func NewTSessionState() *TSessionState { - return &TSessionState{} -} - -func (p *TSessionState) InitDefault() { -} - -func (p *TSessionState) GetDatabase() (v string) { - return p.Database -} - -func (p *TSessionState) GetUser() (v string) { - return p.User -} - -func (p *TSessionState) GetConnectionId() (v int64) { - return p.ConnectionId -} -func (p *TSessionState) SetDatabase(val string) { - p.Database = val -} -func (p *TSessionState) SetUser(val string) { - p.User = val -} -func (p *TSessionState) SetConnectionId(val int64) { - p.ConnectionId = val -} - -var fieldIDToName_TSessionState = map[int16]string{ - 1: "database", - 2: "user", - 3: "connection_id", -} - -func (p *TSessionState) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetDatabase bool = false - var issetUser bool = false - var issetConnectionId bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetDatabase = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetUser = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetConnectionId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetDatabase { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetUser { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetConnectionId { - fieldId = 3 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSessionState[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSessionState[fieldId])) -} - -func (p *TSessionState) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Database = _field - return nil -} -func (p *TSessionState) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.User = _field - return nil -} -func (p *TSessionState) ReadField3(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.ConnectionId = _field - return nil -} - -func (p *TSessionState) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TSessionState"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TSessionState) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("database", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Database); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TSessionState) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.User); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TSessionState) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("connection_id", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ConnectionId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TSessionState) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSessionState(%+v)", *p) - -} - -func (p *TSessionState) DeepEqual(ano *TSessionState) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Database) { - return false - } - if !p.Field2DeepEqual(ano.User) { - return false - } - if !p.Field3DeepEqual(ano.ConnectionId) { - return false - } - return true -} - -func (p *TSessionState) Field1DeepEqual(src string) bool { - - if strings.Compare(p.Database, src) != 0 { - return false - } - return true -} -func (p *TSessionState) Field2DeepEqual(src string) bool { - - if strings.Compare(p.User, src) != 0 { - return false - } - return true -} -func (p *TSessionState) Field3DeepEqual(src int64) bool { - - if p.ConnectionId != src { - return false - } - return true -} - -type TClientRequest struct { - Stmt string `thrift:"stmt,1,required" frugal:"1,required,string" json:"stmt"` - QueryOptions *palointernalservice.TQueryOptions `thrift:"queryOptions,2,required" frugal:"2,required,palointernalservice.TQueryOptions" json:"queryOptions"` - SessionState *TSessionState `thrift:"sessionState,3,required" frugal:"3,required,TSessionState" json:"sessionState"` -} - -func NewTClientRequest() *TClientRequest { - return &TClientRequest{} -} - -func (p *TClientRequest) InitDefault() { -} - -func (p *TClientRequest) GetStmt() (v string) { - return p.Stmt -} - -var TClientRequest_QueryOptions_DEFAULT *palointernalservice.TQueryOptions - -func (p *TClientRequest) GetQueryOptions() (v *palointernalservice.TQueryOptions) { - if !p.IsSetQueryOptions() { - return TClientRequest_QueryOptions_DEFAULT - } - return p.QueryOptions -} - -var TClientRequest_SessionState_DEFAULT *TSessionState - -func (p *TClientRequest) GetSessionState() (v *TSessionState) { - if !p.IsSetSessionState() { - return TClientRequest_SessionState_DEFAULT - } - return p.SessionState -} -func (p *TClientRequest) SetStmt(val string) { - p.Stmt = val -} -func (p *TClientRequest) SetQueryOptions(val *palointernalservice.TQueryOptions) { - p.QueryOptions = val -} -func (p *TClientRequest) SetSessionState(val *TSessionState) { - p.SessionState = val -} - -var fieldIDToName_TClientRequest = map[int16]string{ - 1: "stmt", - 2: "queryOptions", - 3: "sessionState", -} - -func (p *TClientRequest) IsSetQueryOptions() bool { - return p.QueryOptions != nil -} - -func (p *TClientRequest) IsSetSessionState() bool { - return p.SessionState != nil -} - -func (p *TClientRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetStmt bool = false - var issetQueryOptions bool = false - var issetSessionState bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetStmt = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetQueryOptions = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetSessionState = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetStmt { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetQueryOptions { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetSessionState { - fieldId = 3 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TClientRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TClientRequest[fieldId])) -} - -func (p *TClientRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Stmt = _field - return nil -} -func (p *TClientRequest) ReadField2(iprot thrift.TProtocol) error { - _field := palointernalservice.NewTQueryOptions() - if err := _field.Read(iprot); err != nil { - return err - } - p.QueryOptions = _field - return nil -} -func (p *TClientRequest) ReadField3(iprot thrift.TProtocol) error { - _field := NewTSessionState() - if err := _field.Read(iprot); err != nil { - return err - } - p.SessionState = _field - return nil -} - -func (p *TClientRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TClientRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TClientRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("stmt", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Stmt); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TClientRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("queryOptions", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.QueryOptions.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TClientRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sessionState", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.SessionState.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TClientRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TClientRequest(%+v)", *p) - -} - -func (p *TClientRequest) DeepEqual(ano *TClientRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Stmt) { - return false - } - if !p.Field2DeepEqual(ano.QueryOptions) { - return false - } - if !p.Field3DeepEqual(ano.SessionState) { - return false - } - return true -} - -func (p *TClientRequest) Field1DeepEqual(src string) bool { - - if strings.Compare(p.Stmt, src) != 0 { - return false - } - return true -} -func (p *TClientRequest) Field2DeepEqual(src *palointernalservice.TQueryOptions) bool { - - if !p.QueryOptions.DeepEqual(src) { - return false - } - return true -} -func (p *TClientRequest) Field3DeepEqual(src *TSessionState) bool { - - if !p.SessionState.DeepEqual(src) { - return false - } - return true -} - -type TExplainParams struct { - Explain string `thrift:"explain,1,required" frugal:"1,required,string" json:"explain"` -} - -func NewTExplainParams() *TExplainParams { - return &TExplainParams{} -} - -func (p *TExplainParams) InitDefault() { -} - -func (p *TExplainParams) GetExplain() (v string) { - return p.Explain -} -func (p *TExplainParams) SetExplain(val string) { - p.Explain = val -} - -var fieldIDToName_TExplainParams = map[int16]string{ - 1: "explain", -} - -func (p *TExplainParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetExplain bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetExplain = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetExplain { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExplainParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExplainParams[fieldId])) -} - -func (p *TExplainParams) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Explain = _field - return nil -} - -func (p *TExplainParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TExplainParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TExplainParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("explain", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Explain); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TExplainParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExplainParams(%+v)", *p) - -} - -func (p *TExplainParams) DeepEqual(ano *TExplainParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Explain) { - return false - } - return true -} - -func (p *TExplainParams) Field1DeepEqual(src string) bool { - - if strings.Compare(p.Explain, src) != 0 { - return false - } - return true -} - -type TSetVar struct { - Type TSetType `thrift:"type,1,required" frugal:"1,required,TSetType" json:"type"` - Variable string `thrift:"variable,2,required" frugal:"2,required,string" json:"variable"` - Value *exprs.TExpr `thrift:"value,3,required" frugal:"3,required,exprs.TExpr" json:"value"` -} - -func NewTSetVar() *TSetVar { - return &TSetVar{} -} - -func (p *TSetVar) InitDefault() { -} - -func (p *TSetVar) GetType() (v TSetType) { - return p.Type -} - -func (p *TSetVar) GetVariable() (v string) { - return p.Variable -} - -var TSetVar_Value_DEFAULT *exprs.TExpr - -func (p *TSetVar) GetValue() (v *exprs.TExpr) { - if !p.IsSetValue() { - return TSetVar_Value_DEFAULT - } - return p.Value -} -func (p *TSetVar) SetType(val TSetType) { - p.Type = val -} -func (p *TSetVar) SetVariable(val string) { - p.Variable = val -} -func (p *TSetVar) SetValue(val *exprs.TExpr) { - p.Value = val -} - -var fieldIDToName_TSetVar = map[int16]string{ - 1: "type", - 2: "variable", - 3: "value", -} - -func (p *TSetVar) IsSetValue() bool { - return p.Value != nil -} - -func (p *TSetVar) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetType bool = false - var issetVariable bool = false - var issetValue bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetVariable = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetValue = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetType { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetVariable { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetValue { - fieldId = 3 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSetVar[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSetVar[fieldId])) -} - -func (p *TSetVar) ReadField1(iprot thrift.TProtocol) error { - - var _field TSetType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = TSetType(v) - } - p.Type = _field - return nil -} -func (p *TSetVar) ReadField2(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Variable = _field - return nil -} -func (p *TSetVar) ReadField3(iprot thrift.TProtocol) error { - _field := exprs.NewTExpr() - if err := _field.Read(iprot); err != nil { - return err - } - p.Value = _field - return nil -} - -func (p *TSetVar) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TSetVar"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TSetVar) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(p.Type)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TSetVar) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("variable", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Variable); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TSetVar) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("value", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.Value.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TSetVar) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSetVar(%+v)", *p) - -} - -func (p *TSetVar) DeepEqual(ano *TSetVar) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Type) { - return false - } - if !p.Field2DeepEqual(ano.Variable) { - return false - } - if !p.Field3DeepEqual(ano.Value) { - return false - } - return true -} - -func (p *TSetVar) Field1DeepEqual(src TSetType) bool { - - if p.Type != src { - return false - } - return true -} -func (p *TSetVar) Field2DeepEqual(src string) bool { - - if strings.Compare(p.Variable, src) != 0 { - return false - } - return true -} -func (p *TSetVar) Field3DeepEqual(src *exprs.TExpr) bool { - - if !p.Value.DeepEqual(src) { - return false - } - return true -} - -type TSetParams struct { - SetVars []*TSetVar `thrift:"set_vars,1,required" frugal:"1,required,list" json:"set_vars"` -} - -func NewTSetParams() *TSetParams { - return &TSetParams{} -} - -func (p *TSetParams) InitDefault() { -} - -func (p *TSetParams) GetSetVars() (v []*TSetVar) { - return p.SetVars -} -func (p *TSetParams) SetSetVars(val []*TSetVar) { - p.SetVars = val -} - -var fieldIDToName_TSetParams = map[int16]string{ - 1: "set_vars", -} - -func (p *TSetParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetSetVars bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetSetVars = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetSetVars { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSetParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSetParams[fieldId])) -} - -func (p *TSetParams) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*TSetVar, 0, size) - values := make([]TSetVar, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.SetVars = _field - return nil -} - -func (p *TSetParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TSetParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TSetParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("set_vars", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.SetVars)); err != nil { - return err - } - for _, v := range p.SetVars { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TSetParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TSetParams(%+v)", *p) - -} - -func (p *TSetParams) DeepEqual(ano *TSetParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.SetVars) { - return false - } - return true -} - -func (p *TSetParams) Field1DeepEqual(src []*TSetVar) bool { - - if len(p.SetVars) != len(src) { - return false - } - for i, v := range p.SetVars { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} - -type TKillParams struct { - IsKillConnection bool `thrift:"is_kill_connection,1,required" frugal:"1,required,bool" json:"is_kill_connection"` - ConnectionId int64 `thrift:"connection_id,2,required" frugal:"2,required,i64" json:"connection_id"` -} - -func NewTKillParams() *TKillParams { - return &TKillParams{} -} - -func (p *TKillParams) InitDefault() { -} - -func (p *TKillParams) GetIsKillConnection() (v bool) { - return p.IsKillConnection -} - -func (p *TKillParams) GetConnectionId() (v int64) { - return p.ConnectionId -} -func (p *TKillParams) SetIsKillConnection(val bool) { - p.IsKillConnection = val -} -func (p *TKillParams) SetConnectionId(val int64) { - p.ConnectionId = val -} - -var fieldIDToName_TKillParams = map[int16]string{ - 1: "is_kill_connection", - 2: "connection_id", -} - -func (p *TKillParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetIsKillConnection bool = false - var issetConnectionId bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetIsKillConnection = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetConnectionId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetIsKillConnection { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetConnectionId { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TKillParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TKillParams[fieldId])) -} - -func (p *TKillParams) ReadField1(iprot thrift.TProtocol) error { - - var _field bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = v - } - p.IsKillConnection = _field - return nil -} -func (p *TKillParams) ReadField2(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.ConnectionId = _field - return nil -} - -func (p *TKillParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TKillParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TKillParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("is_kill_connection", thrift.BOOL, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(p.IsKillConnection); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TKillParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("connection_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.ConnectionId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TKillParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TKillParams(%+v)", *p) - -} - -func (p *TKillParams) DeepEqual(ano *TKillParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.IsKillConnection) { - return false - } - if !p.Field2DeepEqual(ano.ConnectionId) { - return false - } - return true -} - -func (p *TKillParams) Field1DeepEqual(src bool) bool { - - if p.IsKillConnection != src { - return false - } - return true -} -func (p *TKillParams) Field2DeepEqual(src int64) bool { - - if p.ConnectionId != src { - return false - } - return true -} - -type TCommonDdlParams struct { -} - -func NewTCommonDdlParams() *TCommonDdlParams { - return &TCommonDdlParams{} -} - -func (p *TCommonDdlParams) InitDefault() { -} - -var fieldIDToName_TCommonDdlParams = map[int16]string{} - -func (p *TCommonDdlParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TCommonDdlParams) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("TCommonDdlParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TCommonDdlParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TCommonDdlParams(%+v)", *p) - -} - -func (p *TCommonDdlParams) DeepEqual(ano *TCommonDdlParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - return true -} - -type TUseDbParams struct { - Db string `thrift:"db,1,required" frugal:"1,required,string" json:"db"` -} - -func NewTUseDbParams() *TUseDbParams { - return &TUseDbParams{} -} - -func (p *TUseDbParams) InitDefault() { -} - -func (p *TUseDbParams) GetDb() (v string) { - return p.Db -} -func (p *TUseDbParams) SetDb(val string) { - p.Db = val -} - -var fieldIDToName_TUseDbParams = map[int16]string{ - 1: "db", -} - -func (p *TUseDbParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetDb bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetDb = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetDb { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TUseDbParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TUseDbParams[fieldId])) -} - -func (p *TUseDbParams) ReadField1(iprot thrift.TProtocol) error { - - var _field string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = v - } - p.Db = _field - return nil -} - -func (p *TUseDbParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TUseDbParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TUseDbParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("db", thrift.STRING, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Db); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TUseDbParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TUseDbParams(%+v)", *p) - -} - -func (p *TUseDbParams) DeepEqual(ano *TUseDbParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Db) { - return false - } - return true -} - -func (p *TUseDbParams) Field1DeepEqual(src string) bool { - - if strings.Compare(p.Db, src) != 0 { - return false - } - return true -} - -type TResultSetMetadata struct { - ColumnDescs []*TColumnDesc `thrift:"columnDescs,1,required" frugal:"1,required,list" json:"columnDescs"` -} - -func NewTResultSetMetadata() *TResultSetMetadata { - return &TResultSetMetadata{} -} - -func (p *TResultSetMetadata) InitDefault() { -} - -func (p *TResultSetMetadata) GetColumnDescs() (v []*TColumnDesc) { - return p.ColumnDescs -} -func (p *TResultSetMetadata) SetColumnDescs(val []*TColumnDesc) { - p.ColumnDescs = val -} - -var fieldIDToName_TResultSetMetadata = map[int16]string{ - 1: "columnDescs", -} - -func (p *TResultSetMetadata) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetColumnDescs bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetColumnDescs = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetColumnDescs { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TResultSetMetadata[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TResultSetMetadata[fieldId])) -} - -func (p *TResultSetMetadata) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*TColumnDesc, 0, size) - values := make([]TColumnDesc, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.ColumnDescs = _field - return nil -} - -func (p *TResultSetMetadata) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TResultSetMetadata"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TResultSetMetadata) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("columnDescs", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.ColumnDescs)); err != nil { - return err - } - for _, v := range p.ColumnDescs { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TResultSetMetadata) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TResultSetMetadata(%+v)", *p) - -} - -func (p *TResultSetMetadata) DeepEqual(ano *TResultSetMetadata) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ColumnDescs) { - return false - } - return true -} - -func (p *TResultSetMetadata) Field1DeepEqual(src []*TColumnDesc) bool { - - if len(p.ColumnDescs) != len(src) { - return false - } - for i, v := range p.ColumnDescs { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} - -type TQueryExecRequest struct { - DescTbl *descriptors.TDescriptorTable `thrift:"desc_tbl,1,optional" frugal:"1,optional,descriptors.TDescriptorTable" json:"desc_tbl,omitempty"` - Fragments []*planner.TPlanFragment `thrift:"fragments,2,required" frugal:"2,required,list" json:"fragments"` - DestFragmentIdx []int32 `thrift:"dest_fragment_idx,3,optional" frugal:"3,optional,list" json:"dest_fragment_idx,omitempty"` - PerNodeScanRanges map[types.TPlanNodeId][]*planner.TScanRangeLocations `thrift:"per_node_scan_ranges,4,optional" frugal:"4,optional,map>" json:"per_node_scan_ranges,omitempty"` - ResultSetMetadata *TResultSetMetadata `thrift:"result_set_metadata,5,optional" frugal:"5,optional,TResultSetMetadata" json:"result_set_metadata,omitempty"` - QueryGlobals *palointernalservice.TQueryGlobals `thrift:"query_globals,7,required" frugal:"7,required,palointernalservice.TQueryGlobals" json:"query_globals"` - StmtType types.TStmtType `thrift:"stmt_type,9,required" frugal:"9,required,TStmtType" json:"stmt_type"` - IsBlockQuery *bool `thrift:"is_block_query,10,optional" frugal:"10,optional,bool" json:"is_block_query,omitempty"` -} - -func NewTQueryExecRequest() *TQueryExecRequest { - return &TQueryExecRequest{} -} - -func (p *TQueryExecRequest) InitDefault() { -} - -var TQueryExecRequest_DescTbl_DEFAULT *descriptors.TDescriptorTable - -func (p *TQueryExecRequest) GetDescTbl() (v *descriptors.TDescriptorTable) { - if !p.IsSetDescTbl() { - return TQueryExecRequest_DescTbl_DEFAULT - } - return p.DescTbl -} - -func (p *TQueryExecRequest) GetFragments() (v []*planner.TPlanFragment) { - return p.Fragments -} - -var TQueryExecRequest_DestFragmentIdx_DEFAULT []int32 - -func (p *TQueryExecRequest) GetDestFragmentIdx() (v []int32) { - if !p.IsSetDestFragmentIdx() { - return TQueryExecRequest_DestFragmentIdx_DEFAULT - } - return p.DestFragmentIdx -} - -var TQueryExecRequest_PerNodeScanRanges_DEFAULT map[types.TPlanNodeId][]*planner.TScanRangeLocations - -func (p *TQueryExecRequest) GetPerNodeScanRanges() (v map[types.TPlanNodeId][]*planner.TScanRangeLocations) { - if !p.IsSetPerNodeScanRanges() { - return TQueryExecRequest_PerNodeScanRanges_DEFAULT - } - return p.PerNodeScanRanges -} - -var TQueryExecRequest_ResultSetMetadata_DEFAULT *TResultSetMetadata - -func (p *TQueryExecRequest) GetResultSetMetadata() (v *TResultSetMetadata) { - if !p.IsSetResultSetMetadata() { - return TQueryExecRequest_ResultSetMetadata_DEFAULT - } - return p.ResultSetMetadata -} - -var TQueryExecRequest_QueryGlobals_DEFAULT *palointernalservice.TQueryGlobals - -func (p *TQueryExecRequest) GetQueryGlobals() (v *palointernalservice.TQueryGlobals) { - if !p.IsSetQueryGlobals() { - return TQueryExecRequest_QueryGlobals_DEFAULT - } - return p.QueryGlobals -} - -func (p *TQueryExecRequest) GetStmtType() (v types.TStmtType) { - return p.StmtType -} - -var TQueryExecRequest_IsBlockQuery_DEFAULT bool - -func (p *TQueryExecRequest) GetIsBlockQuery() (v bool) { - if !p.IsSetIsBlockQuery() { - return TQueryExecRequest_IsBlockQuery_DEFAULT - } - return *p.IsBlockQuery -} -func (p *TQueryExecRequest) SetDescTbl(val *descriptors.TDescriptorTable) { - p.DescTbl = val -} -func (p *TQueryExecRequest) SetFragments(val []*planner.TPlanFragment) { - p.Fragments = val -} -func (p *TQueryExecRequest) SetDestFragmentIdx(val []int32) { - p.DestFragmentIdx = val -} -func (p *TQueryExecRequest) SetPerNodeScanRanges(val map[types.TPlanNodeId][]*planner.TScanRangeLocations) { - p.PerNodeScanRanges = val -} -func (p *TQueryExecRequest) SetResultSetMetadata(val *TResultSetMetadata) { - p.ResultSetMetadata = val -} -func (p *TQueryExecRequest) SetQueryGlobals(val *palointernalservice.TQueryGlobals) { - p.QueryGlobals = val -} -func (p *TQueryExecRequest) SetStmtType(val types.TStmtType) { - p.StmtType = val -} -func (p *TQueryExecRequest) SetIsBlockQuery(val *bool) { - p.IsBlockQuery = val -} - -var fieldIDToName_TQueryExecRequest = map[int16]string{ - 1: "desc_tbl", - 2: "fragments", - 3: "dest_fragment_idx", - 4: "per_node_scan_ranges", - 5: "result_set_metadata", - 7: "query_globals", - 9: "stmt_type", - 10: "is_block_query", -} - -func (p *TQueryExecRequest) IsSetDescTbl() bool { - return p.DescTbl != nil -} - -func (p *TQueryExecRequest) IsSetDestFragmentIdx() bool { - return p.DestFragmentIdx != nil -} - -func (p *TQueryExecRequest) IsSetPerNodeScanRanges() bool { - return p.PerNodeScanRanges != nil -} - -func (p *TQueryExecRequest) IsSetResultSetMetadata() bool { - return p.ResultSetMetadata != nil -} - -func (p *TQueryExecRequest) IsSetQueryGlobals() bool { - return p.QueryGlobals != nil -} - -func (p *TQueryExecRequest) IsSetIsBlockQuery() bool { - return p.IsBlockQuery != nil -} - -func (p *TQueryExecRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetFragments bool = false - var issetQueryGlobals bool = false - var issetStmtType bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.LIST { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetFragments = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.LIST { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.MAP { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - issetQueryGlobals = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 9: - if fieldTypeId == thrift.I32 { - if err = p.ReadField9(iprot); err != nil { - goto ReadFieldError - } - issetStmtType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 10: - if fieldTypeId == thrift.BOOL { - if err = p.ReadField10(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetFragments { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetQueryGlobals { - fieldId = 7 - goto RequiredFieldNotSetError - } - - if !issetStmtType { - fieldId = 9 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryExecRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TQueryExecRequest[fieldId])) -} - -func (p *TQueryExecRequest) ReadField1(iprot thrift.TProtocol) error { - _field := descriptors.NewTDescriptorTable() - if err := _field.Read(iprot); err != nil { - return err - } - p.DescTbl = _field - return nil -} -func (p *TQueryExecRequest) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*planner.TPlanFragment, 0, size) - values := make([]planner.TPlanFragment, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.Fragments = _field - return nil -} -func (p *TQueryExecRequest) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]int32, 0, size) - for i := 0; i < size; i++ { - - var _elem int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _elem = v - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.DestFragmentIdx = _field - return nil -} -func (p *TQueryExecRequest) ReadField4(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[types.TPlanNodeId][]*planner.TScanRangeLocations, size) - for i := 0; i < size; i++ { - var _key types.TPlanNodeId - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _key = v - } - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _val := make([]*planner.TScanRangeLocations, 0, size) - values := make([]planner.TScanRangeLocations, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _val = append(_val, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.PerNodeScanRanges = _field - return nil -} -func (p *TQueryExecRequest) ReadField5(iprot thrift.TProtocol) error { - _field := NewTResultSetMetadata() - if err := _field.Read(iprot); err != nil { - return err - } - p.ResultSetMetadata = _field - return nil -} -func (p *TQueryExecRequest) ReadField7(iprot thrift.TProtocol) error { - _field := palointernalservice.NewTQueryGlobals() - if err := _field.Read(iprot); err != nil { - return err - } - p.QueryGlobals = _field - return nil -} -func (p *TQueryExecRequest) ReadField9(iprot thrift.TProtocol) error { - - var _field types.TStmtType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = types.TStmtType(v) - } - p.StmtType = _field - return nil -} -func (p *TQueryExecRequest) ReadField10(iprot thrift.TProtocol) error { - - var _field *bool - if v, err := iprot.ReadBool(); err != nil { - return err - } else { - _field = &v - } - p.IsBlockQuery = _field - return nil -} - -func (p *TQueryExecRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TQueryExecRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField9(oprot); err != nil { - fieldId = 9 - goto WriteFieldError - } - if err = p.writeField10(oprot); err != nil { - fieldId = 10 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetDescTbl() { - if err = oprot.WriteFieldBegin("desc_tbl", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.DescTbl.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("fragments", thrift.LIST, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Fragments)); err != nil { - return err - } - for _, v := range p.Fragments { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetDestFragmentIdx() { - if err = oprot.WriteFieldBegin("dest_fragment_idx", thrift.LIST, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.I32, len(p.DestFragmentIdx)); err != nil { - return err - } - for _, v := range p.DestFragmentIdx { - if err := oprot.WriteI32(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetPerNodeScanRanges() { - if err = oprot.WriteFieldBegin("per_node_scan_ranges", thrift.MAP, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.I32, thrift.LIST, len(p.PerNodeScanRanges)); err != nil { - return err - } - for k, v := range p.PerNodeScanRanges { - if err := oprot.WriteI32(k); err != nil { - return err - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(v)); err != nil { - return err - } - for _, v := range v { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetResultSetMetadata() { - if err = oprot.WriteFieldBegin("result_set_metadata", thrift.STRUCT, 5); err != nil { - goto WriteFieldBeginError - } - if err := p.ResultSetMetadata.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField7(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("query_globals", thrift.STRUCT, 7); err != nil { - goto WriteFieldBeginError - } - if err := p.QueryGlobals.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField9(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("stmt_type", thrift.I32, 9); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(p.StmtType)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) -} - -func (p *TQueryExecRequest) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetIsBlockQuery() { - if err = oprot.WriteFieldBegin("is_block_query", thrift.BOOL, 10); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteBool(*p.IsBlockQuery); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) -} - -func (p *TQueryExecRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TQueryExecRequest(%+v)", *p) - -} - -func (p *TQueryExecRequest) DeepEqual(ano *TQueryExecRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.DescTbl) { - return false - } - if !p.Field2DeepEqual(ano.Fragments) { - return false - } - if !p.Field3DeepEqual(ano.DestFragmentIdx) { - return false - } - if !p.Field4DeepEqual(ano.PerNodeScanRanges) { - return false - } - if !p.Field5DeepEqual(ano.ResultSetMetadata) { - return false - } - if !p.Field7DeepEqual(ano.QueryGlobals) { - return false - } - if !p.Field9DeepEqual(ano.StmtType) { - return false - } - if !p.Field10DeepEqual(ano.IsBlockQuery) { - return false - } - return true -} - -func (p *TQueryExecRequest) Field1DeepEqual(src *descriptors.TDescriptorTable) bool { - - if !p.DescTbl.DeepEqual(src) { - return false - } - return true -} -func (p *TQueryExecRequest) Field2DeepEqual(src []*planner.TPlanFragment) bool { - - if len(p.Fragments) != len(src) { - return false - } - for i, v := range p.Fragments { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} -func (p *TQueryExecRequest) Field3DeepEqual(src []int32) bool { - - if len(p.DestFragmentIdx) != len(src) { - return false - } - for i, v := range p.DestFragmentIdx { - _src := src[i] - if v != _src { - return false - } - } - return true -} -func (p *TQueryExecRequest) Field4DeepEqual(src map[types.TPlanNodeId][]*planner.TScanRangeLocations) bool { - - if len(p.PerNodeScanRanges) != len(src) { - return false - } - for k, v := range p.PerNodeScanRanges { - _src := src[k] - if len(v) != len(_src) { - return false - } - for i, v := range v { - _src1 := _src[i] - if !v.DeepEqual(_src1) { - return false - } - } - } - return true -} -func (p *TQueryExecRequest) Field5DeepEqual(src *TResultSetMetadata) bool { - - if !p.ResultSetMetadata.DeepEqual(src) { - return false - } - return true -} -func (p *TQueryExecRequest) Field7DeepEqual(src *palointernalservice.TQueryGlobals) bool { - - if !p.QueryGlobals.DeepEqual(src) { - return false - } - return true -} -func (p *TQueryExecRequest) Field9DeepEqual(src types.TStmtType) bool { - - if p.StmtType != src { - return false - } - return true -} -func (p *TQueryExecRequest) Field10DeepEqual(src *bool) bool { - - if p.IsBlockQuery == src { - return true - } else if p.IsBlockQuery == nil || src == nil { - return false - } - if *p.IsBlockQuery != *src { - return false - } - return true -} - -type TDdlExecRequest struct { - DdlType TDdlType `thrift:"ddl_type,1,required" frugal:"1,required,TDdlType" json:"ddl_type"` - UseDbParams *TUseDbParams `thrift:"use_db_params,2,optional" frugal:"2,optional,TUseDbParams" json:"use_db_params,omitempty"` - DescribeTableParams *TDescribeTableParams `thrift:"describe_table_params,3,optional" frugal:"3,optional,TDescribeTableParams" json:"describe_table_params,omitempty"` - ExplainParams *TExplainParams `thrift:"explain_params,10,optional" frugal:"10,optional,TExplainParams" json:"explain_params,omitempty"` - SetParams *TSetParams `thrift:"set_params,11,optional" frugal:"11,optional,TSetParams" json:"set_params,omitempty"` - KillParams *TKillParams `thrift:"kill_params,12,optional" frugal:"12,optional,TKillParams" json:"kill_params,omitempty"` -} - -func NewTDdlExecRequest() *TDdlExecRequest { - return &TDdlExecRequest{} -} - -func (p *TDdlExecRequest) InitDefault() { -} - -func (p *TDdlExecRequest) GetDdlType() (v TDdlType) { - return p.DdlType -} - -var TDdlExecRequest_UseDbParams_DEFAULT *TUseDbParams - -func (p *TDdlExecRequest) GetUseDbParams() (v *TUseDbParams) { - if !p.IsSetUseDbParams() { - return TDdlExecRequest_UseDbParams_DEFAULT - } - return p.UseDbParams -} - -var TDdlExecRequest_DescribeTableParams_DEFAULT *TDescribeTableParams - -func (p *TDdlExecRequest) GetDescribeTableParams() (v *TDescribeTableParams) { - if !p.IsSetDescribeTableParams() { - return TDdlExecRequest_DescribeTableParams_DEFAULT - } - return p.DescribeTableParams -} - -var TDdlExecRequest_ExplainParams_DEFAULT *TExplainParams - -func (p *TDdlExecRequest) GetExplainParams() (v *TExplainParams) { - if !p.IsSetExplainParams() { - return TDdlExecRequest_ExplainParams_DEFAULT - } - return p.ExplainParams -} - -var TDdlExecRequest_SetParams_DEFAULT *TSetParams - -func (p *TDdlExecRequest) GetSetParams() (v *TSetParams) { - if !p.IsSetSetParams() { - return TDdlExecRequest_SetParams_DEFAULT - } - return p.SetParams -} - -var TDdlExecRequest_KillParams_DEFAULT *TKillParams - -func (p *TDdlExecRequest) GetKillParams() (v *TKillParams) { - if !p.IsSetKillParams() { - return TDdlExecRequest_KillParams_DEFAULT - } - return p.KillParams -} -func (p *TDdlExecRequest) SetDdlType(val TDdlType) { - p.DdlType = val -} -func (p *TDdlExecRequest) SetUseDbParams(val *TUseDbParams) { - p.UseDbParams = val -} -func (p *TDdlExecRequest) SetDescribeTableParams(val *TDescribeTableParams) { - p.DescribeTableParams = val -} -func (p *TDdlExecRequest) SetExplainParams(val *TExplainParams) { - p.ExplainParams = val -} -func (p *TDdlExecRequest) SetSetParams(val *TSetParams) { - p.SetParams = val -} -func (p *TDdlExecRequest) SetKillParams(val *TKillParams) { - p.KillParams = val -} - -var fieldIDToName_TDdlExecRequest = map[int16]string{ - 1: "ddl_type", - 2: "use_db_params", - 3: "describe_table_params", - 10: "explain_params", - 11: "set_params", - 12: "kill_params", -} - -func (p *TDdlExecRequest) IsSetUseDbParams() bool { - return p.UseDbParams != nil -} - -func (p *TDdlExecRequest) IsSetDescribeTableParams() bool { - return p.DescribeTableParams != nil -} - -func (p *TDdlExecRequest) IsSetExplainParams() bool { - return p.ExplainParams != nil -} - -func (p *TDdlExecRequest) IsSetSetParams() bool { - return p.SetParams != nil -} - -func (p *TDdlExecRequest) IsSetKillParams() bool { - return p.KillParams != nil -} - -func (p *TDdlExecRequest) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetDdlType bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetDdlType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 10: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField10(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 11: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField11(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 12: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField12(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetDdlType { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDdlExecRequest[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDdlExecRequest[fieldId])) -} - -func (p *TDdlExecRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field TDdlType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = TDdlType(v) - } - p.DdlType = _field - return nil -} -func (p *TDdlExecRequest) ReadField2(iprot thrift.TProtocol) error { - _field := NewTUseDbParams() - if err := _field.Read(iprot); err != nil { - return err - } - p.UseDbParams = _field - return nil -} -func (p *TDdlExecRequest) ReadField3(iprot thrift.TProtocol) error { - _field := NewTDescribeTableParams() - if err := _field.Read(iprot); err != nil { - return err - } - p.DescribeTableParams = _field - return nil -} -func (p *TDdlExecRequest) ReadField10(iprot thrift.TProtocol) error { - _field := NewTExplainParams() - if err := _field.Read(iprot); err != nil { - return err - } - p.ExplainParams = _field - return nil -} -func (p *TDdlExecRequest) ReadField11(iprot thrift.TProtocol) error { - _field := NewTSetParams() - if err := _field.Read(iprot); err != nil { - return err - } - p.SetParams = _field - return nil -} -func (p *TDdlExecRequest) ReadField12(iprot thrift.TProtocol) error { - _field := NewTKillParams() - if err := _field.Read(iprot); err != nil { - return err - } - p.KillParams = _field - return nil -} - -func (p *TDdlExecRequest) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TDdlExecRequest"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField10(oprot); err != nil { - fieldId = 10 - goto WriteFieldError - } - if err = p.writeField11(oprot); err != nil { - fieldId = 11 - goto WriteFieldError - } - if err = p.writeField12(oprot); err != nil { - fieldId = 12 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TDdlExecRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("ddl_type", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(p.DdlType)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TDdlExecRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetUseDbParams() { - if err = oprot.WriteFieldBegin("use_db_params", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.UseDbParams.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TDdlExecRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetDescribeTableParams() { - if err = oprot.WriteFieldBegin("describe_table_params", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.DescribeTableParams.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TDdlExecRequest) writeField10(oprot thrift.TProtocol) (err error) { - if p.IsSetExplainParams() { - if err = oprot.WriteFieldBegin("explain_params", thrift.STRUCT, 10); err != nil { - goto WriteFieldBeginError - } - if err := p.ExplainParams.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) -} - -func (p *TDdlExecRequest) writeField11(oprot thrift.TProtocol) (err error) { - if p.IsSetSetParams() { - if err = oprot.WriteFieldBegin("set_params", thrift.STRUCT, 11); err != nil { - goto WriteFieldBeginError - } - if err := p.SetParams.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) -} - -func (p *TDdlExecRequest) writeField12(oprot thrift.TProtocol) (err error) { - if p.IsSetKillParams() { - if err = oprot.WriteFieldBegin("kill_params", thrift.STRUCT, 12); err != nil { - goto WriteFieldBeginError - } - if err := p.KillParams.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) -} - -func (p *TDdlExecRequest) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TDdlExecRequest(%+v)", *p) - -} - -func (p *TDdlExecRequest) DeepEqual(ano *TDdlExecRequest) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.DdlType) { - return false - } - if !p.Field2DeepEqual(ano.UseDbParams) { - return false - } - if !p.Field3DeepEqual(ano.DescribeTableParams) { - return false - } - if !p.Field10DeepEqual(ano.ExplainParams) { - return false - } - if !p.Field11DeepEqual(ano.SetParams) { - return false - } - if !p.Field12DeepEqual(ano.KillParams) { - return false - } - return true -} - -func (p *TDdlExecRequest) Field1DeepEqual(src TDdlType) bool { - - if p.DdlType != src { - return false - } - return true -} -func (p *TDdlExecRequest) Field2DeepEqual(src *TUseDbParams) bool { - - if !p.UseDbParams.DeepEqual(src) { - return false - } - return true -} -func (p *TDdlExecRequest) Field3DeepEqual(src *TDescribeTableParams) bool { - - if !p.DescribeTableParams.DeepEqual(src) { - return false - } - return true -} -func (p *TDdlExecRequest) Field10DeepEqual(src *TExplainParams) bool { - - if !p.ExplainParams.DeepEqual(src) { - return false - } - return true -} -func (p *TDdlExecRequest) Field11DeepEqual(src *TSetParams) bool { - - if !p.SetParams.DeepEqual(src) { - return false - } - return true -} -func (p *TDdlExecRequest) Field12DeepEqual(src *TKillParams) bool { - - if !p.KillParams.DeepEqual(src) { - return false - } - return true -} - -type TExplainResult_ struct { - Results []*data.TResultRow `thrift:"results,1,required" frugal:"1,required,list" json:"results"` -} - -func NewTExplainResult_() *TExplainResult_ { - return &TExplainResult_{} -} - -func (p *TExplainResult_) InitDefault() { -} - -func (p *TExplainResult_) GetResults() (v []*data.TResultRow) { - return p.Results -} -func (p *TExplainResult_) SetResults(val []*data.TResultRow) { - p.Results = val -} - -var fieldIDToName_TExplainResult_ = map[int16]string{ - 1: "results", -} - -func (p *TExplainResult_) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetResults bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetResults = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetResults { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExplainResult_[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExplainResult_[fieldId])) -} - -func (p *TExplainResult_) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*data.TResultRow, 0, size) - values := make([]data.TResultRow, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.Results = _field - return nil -} - -func (p *TExplainResult_) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TExplainResult"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TExplainResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("results", thrift.LIST, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Results)); err != nil { - return err - } - for _, v := range p.Results { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TExplainResult_) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExplainResult_(%+v)", *p) - -} - -func (p *TExplainResult_) DeepEqual(ano *TExplainResult_) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Results) { - return false - } - return true -} - -func (p *TExplainResult_) Field1DeepEqual(src []*data.TResultRow) bool { - - if len(p.Results) != len(src) { - return false - } - for i, v := range p.Results { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} - -type TExecRequest struct { - StmtType types.TStmtType `thrift:"stmt_type,1,required" frugal:"1,required,TStmtType" json:"stmt_type"` - SqlStmt *string `thrift:"sql_stmt,2,optional" frugal:"2,optional,string" json:"sql_stmt,omitempty"` - RequestId *types.TUniqueId `thrift:"request_id,3,required" frugal:"3,required,types.TUniqueId" json:"request_id"` - QueryOptions *palointernalservice.TQueryOptions `thrift:"query_options,4,required" frugal:"4,required,palointernalservice.TQueryOptions" json:"query_options"` - QueryExecRequest *TQueryExecRequest `thrift:"query_exec_request,5,optional" frugal:"5,optional,TQueryExecRequest" json:"query_exec_request,omitempty"` - DdlExecRequest *TDdlExecRequest `thrift:"ddl_exec_request,6,optional" frugal:"6,optional,TDdlExecRequest" json:"ddl_exec_request,omitempty"` - ResultSetMetadata *TResultSetMetadata `thrift:"result_set_metadata,7,optional" frugal:"7,optional,TResultSetMetadata" json:"result_set_metadata,omitempty"` - ExplainResult_ *TExplainResult_ `thrift:"explain_result,8,optional" frugal:"8,optional,TExplainResult_" json:"explain_result,omitempty"` -} - -func NewTExecRequest() *TExecRequest { - return &TExecRequest{} -} - -func (p *TExecRequest) InitDefault() { -} - -func (p *TExecRequest) GetStmtType() (v types.TStmtType) { - return p.StmtType -} - -var TExecRequest_SqlStmt_DEFAULT string - -func (p *TExecRequest) GetSqlStmt() (v string) { - if !p.IsSetSqlStmt() { - return TExecRequest_SqlStmt_DEFAULT - } - return *p.SqlStmt -} - -var TExecRequest_RequestId_DEFAULT *types.TUniqueId - -func (p *TExecRequest) GetRequestId() (v *types.TUniqueId) { - if !p.IsSetRequestId() { - return TExecRequest_RequestId_DEFAULT - } - return p.RequestId -} - -var TExecRequest_QueryOptions_DEFAULT *palointernalservice.TQueryOptions - -func (p *TExecRequest) GetQueryOptions() (v *palointernalservice.TQueryOptions) { - if !p.IsSetQueryOptions() { - return TExecRequest_QueryOptions_DEFAULT - } - return p.QueryOptions +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -var TExecRequest_QueryExecRequest_DEFAULT *TQueryExecRequest - -func (p *TExecRequest) GetQueryExecRequest() (v *TQueryExecRequest) { - if !p.IsSetQueryExecRequest() { - return TExecRequest_QueryExecRequest_DEFAULT +func (p *TShowVariableRequest) String() string { + if p == nil { + return "" } - return p.QueryExecRequest -} - -var TExecRequest_DdlExecRequest_DEFAULT *TDdlExecRequest + return fmt.Sprintf("TShowVariableRequest(%+v)", *p) -func (p *TExecRequest) GetDdlExecRequest() (v *TDdlExecRequest) { - if !p.IsSetDdlExecRequest() { - return TExecRequest_DdlExecRequest_DEFAULT - } - return p.DdlExecRequest } -var TExecRequest_ResultSetMetadata_DEFAULT *TResultSetMetadata - -func (p *TExecRequest) GetResultSetMetadata() (v *TResultSetMetadata) { - if !p.IsSetResultSetMetadata() { - return TExecRequest_ResultSetMetadata_DEFAULT +func (p *TShowVariableRequest) DeepEqual(ano *TShowVariableRequest) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false } - return p.ResultSetMetadata + if !p.Field1DeepEqual(ano.ThreadId) { + return false + } + if !p.Field2DeepEqual(ano.VarType) { + return false + } + return true } -var TExecRequest_ExplainResult__DEFAULT *TExplainResult_ +func (p *TShowVariableRequest) Field1DeepEqual(src int64) bool { -func (p *TExecRequest) GetExplainResult_() (v *TExplainResult_) { - if !p.IsSetExplainResult_() { - return TExecRequest_ExplainResult__DEFAULT + if p.ThreadId != src { + return false } - return p.ExplainResult_ -} -func (p *TExecRequest) SetStmtType(val types.TStmtType) { - p.StmtType = val -} -func (p *TExecRequest) SetSqlStmt(val *string) { - p.SqlStmt = val -} -func (p *TExecRequest) SetRequestId(val *types.TUniqueId) { - p.RequestId = val -} -func (p *TExecRequest) SetQueryOptions(val *palointernalservice.TQueryOptions) { - p.QueryOptions = val -} -func (p *TExecRequest) SetQueryExecRequest(val *TQueryExecRequest) { - p.QueryExecRequest = val -} -func (p *TExecRequest) SetDdlExecRequest(val *TDdlExecRequest) { - p.DdlExecRequest = val -} -func (p *TExecRequest) SetResultSetMetadata(val *TResultSetMetadata) { - p.ResultSetMetadata = val -} -func (p *TExecRequest) SetExplainResult_(val *TExplainResult_) { - p.ExplainResult_ = val -} - -var fieldIDToName_TExecRequest = map[int16]string{ - 1: "stmt_type", - 2: "sql_stmt", - 3: "request_id", - 4: "query_options", - 5: "query_exec_request", - 6: "ddl_exec_request", - 7: "result_set_metadata", - 8: "explain_result", + return true } +func (p *TShowVariableRequest) Field2DeepEqual(src types.TVarType) bool { -func (p *TExecRequest) IsSetSqlStmt() bool { - return p.SqlStmt != nil + if p.VarType != src { + return false + } + return true } -func (p *TExecRequest) IsSetRequestId() bool { - return p.RequestId != nil +type TShowVariableResult_ struct { + Variables [][]string `thrift:"variables,1,required" frugal:"1,required,list>" json:"variables"` } -func (p *TExecRequest) IsSetQueryOptions() bool { - return p.QueryOptions != nil +func NewTShowVariableResult_() *TShowVariableResult_ { + return &TShowVariableResult_{} } -func (p *TExecRequest) IsSetQueryExecRequest() bool { - return p.QueryExecRequest != nil +func (p *TShowVariableResult_) InitDefault() { } -func (p *TExecRequest) IsSetDdlExecRequest() bool { - return p.DdlExecRequest != nil +func (p *TShowVariableResult_) GetVariables() (v [][]string) { + return p.Variables } - -func (p *TExecRequest) IsSetResultSetMetadata() bool { - return p.ResultSetMetadata != nil +func (p *TShowVariableResult_) SetVariables(val [][]string) { + p.Variables = val } -func (p *TExecRequest) IsSetExplainResult_() bool { - return p.ExplainResult_ != nil +var fieldIDToName_TShowVariableResult_ = map[int16]string{ + 1: "variables", } -func (p *TExecRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *TShowVariableResult_) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetStmtType bool = false - var issetRequestId bool = false - var issetQueryOptions bool = false + var issetVariables bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -9042,69 +3356,11 @@ func (p *TExecRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.LIST { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetStmtType = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetRequestId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - issetQueryOptions = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 7: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 8: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField8(iprot); err != nil { - goto ReadFieldError - } + issetVariables = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -9121,27 +3377,17 @@ func (p *TExecRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetStmtType { + if !issetVariables { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetRequestId { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetQueryOptions { - fieldId = 4 - goto RequiredFieldNotSetError - } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExecRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableResult_[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -9150,83 +3396,48 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExecRequest[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableResult_[fieldId])) } -func (p *TExecRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field types.TStmtType - if v, err := iprot.ReadI32(); err != nil { +func (p *TShowVariableResult_) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { return err - } else { - _field = types.TStmtType(v) } - p.StmtType = _field - return nil -} -func (p *TExecRequest) ReadField2(iprot thrift.TProtocol) error { + _field := make([][]string, 0, size) + for i := 0; i < size; i++ { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _elem := make([]string, 0, size) + for i := 0; i < size; i++ { - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.SqlStmt = _field - return nil -} -func (p *TExecRequest) ReadField3(iprot thrift.TProtocol) error { - _field := types.NewTUniqueId() - if err := _field.Read(iprot); err != nil { - return err - } - p.RequestId = _field - return nil -} -func (p *TExecRequest) ReadField4(iprot thrift.TProtocol) error { - _field := palointernalservice.NewTQueryOptions() - if err := _field.Read(iprot); err != nil { - return err - } - p.QueryOptions = _field - return nil -} -func (p *TExecRequest) ReadField5(iprot thrift.TProtocol) error { - _field := NewTQueryExecRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.QueryExecRequest = _field - return nil -} -func (p *TExecRequest) ReadField6(iprot thrift.TProtocol) error { - _field := NewTDdlExecRequest() - if err := _field.Read(iprot); err != nil { - return err - } - p.DdlExecRequest = _field - return nil -} -func (p *TExecRequest) ReadField7(iprot thrift.TProtocol) error { - _field := NewTResultSetMetadata() - if err := _field.Read(iprot); err != nil { - return err + var _elem1 string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _elem1 = v + } + + _elem = append(_elem, _elem1) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + + _field = append(_field, _elem) } - p.ResultSetMetadata = _field - return nil -} -func (p *TExecRequest) ReadField8(iprot thrift.TProtocol) error { - _field := NewTExplainResult_() - if err := _field.Read(iprot); err != nil { + if err := iprot.ReadListEnd(); err != nil { return err } - p.ExplainResult_ = _field + p.Variables = _field return nil } -func (p *TExecRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *TShowVariableResult_) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TExecRequest"); err != nil { + if err = oprot.WriteStructBegin("TShowVariableResult"); err != nil { goto WriteStructBeginError } if p != nil { @@ -9234,34 +3445,6 @@ func (p *TExecRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } - if err = p.writeField8(oprot); err != nil { - fieldId = 8 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -9280,64 +3463,27 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TExecRequest) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("stmt_type", thrift.I32, 1); err != nil { +func (p *TShowVariableResult_) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("variables", thrift.LIST, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI32(int32(p.StmtType)); err != nil { + if err := oprot.WriteListBegin(thrift.LIST, len(p.Variables)); err != nil { return err } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TExecRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetSqlStmt() { - if err = oprot.WriteFieldBegin("sql_stmt", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.SqlStmt); err != nil { + for _, v := range p.Variables { + if err := oprot.WriteListBegin(thrift.STRING, len(v)); err != nil { return err } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + for _, v := range v { + if err := oprot.WriteString(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err } } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TExecRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("request_id", thrift.STRUCT, 3); err != nil { - goto WriteFieldBeginError - } - if err := p.RequestId.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TExecRequest) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("query_options", thrift.STRUCT, 4); err != nil { - goto WriteFieldBeginError - } - if err := p.QueryOptions.Write(oprot); err != nil { + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -9345,186 +3491,47 @@ func (p *TExecRequest) writeField4(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TExecRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetQueryExecRequest() { - if err = oprot.WriteFieldBegin("query_exec_request", thrift.STRUCT, 5); err != nil { - goto WriteFieldBeginError - } - if err := p.QueryExecRequest.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TExecRequest) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetDdlExecRequest() { - if err = oprot.WriteFieldBegin("ddl_exec_request", thrift.STRUCT, 6); err != nil { - goto WriteFieldBeginError - } - if err := p.DdlExecRequest.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *TExecRequest) writeField7(oprot thrift.TProtocol) (err error) { - if p.IsSetResultSetMetadata() { - if err = oprot.WriteFieldBegin("result_set_metadata", thrift.STRUCT, 7); err != nil { - goto WriteFieldBeginError - } - if err := p.ResultSetMetadata.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) -} - -func (p *TExecRequest) writeField8(oprot thrift.TProtocol) (err error) { - if p.IsSetExplainResult_() { - if err = oprot.WriteFieldBegin("explain_result", thrift.STRUCT, 8); err != nil { - goto WriteFieldBeginError - } - if err := p.ExplainResult_.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TExecRequest) String() string { +func (p *TShowVariableResult_) String() string { if p == nil { return "" } - return fmt.Sprintf("TExecRequest(%+v)", *p) + return fmt.Sprintf("TShowVariableResult_(%+v)", *p) } -func (p *TExecRequest) DeepEqual(ano *TExecRequest) bool { +func (p *TShowVariableResult_) DeepEqual(ano *TShowVariableResult_) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.StmtType) { - return false - } - if !p.Field2DeepEqual(ano.SqlStmt) { - return false - } - if !p.Field3DeepEqual(ano.RequestId) { - return false - } - if !p.Field4DeepEqual(ano.QueryOptions) { - return false - } - if !p.Field5DeepEqual(ano.QueryExecRequest) { - return false - } - if !p.Field6DeepEqual(ano.DdlExecRequest) { - return false - } - if !p.Field7DeepEqual(ano.ResultSetMetadata) { - return false - } - if !p.Field8DeepEqual(ano.ExplainResult_) { - return false - } - return true -} - -func (p *TExecRequest) Field1DeepEqual(src types.TStmtType) bool { - - if p.StmtType != src { - return false - } - return true -} -func (p *TExecRequest) Field2DeepEqual(src *string) bool { - - if p.SqlStmt == src { - return true - } else if p.SqlStmt == nil || src == nil { - return false - } - if strings.Compare(*p.SqlStmt, *src) != 0 { - return false - } - return true -} -func (p *TExecRequest) Field3DeepEqual(src *types.TUniqueId) bool { - - if !p.RequestId.DeepEqual(src) { - return false - } - return true -} -func (p *TExecRequest) Field4DeepEqual(src *palointernalservice.TQueryOptions) bool { - - if !p.QueryOptions.DeepEqual(src) { - return false - } - return true -} -func (p *TExecRequest) Field5DeepEqual(src *TQueryExecRequest) bool { - - if !p.QueryExecRequest.DeepEqual(src) { + if !p.Field1DeepEqual(ano.Variables) { return false } return true } -func (p *TExecRequest) Field6DeepEqual(src *TDdlExecRequest) bool { - if !p.DdlExecRequest.DeepEqual(src) { - return false - } - return true -} -func (p *TExecRequest) Field7DeepEqual(src *TResultSetMetadata) bool { +func (p *TShowVariableResult_) Field1DeepEqual(src [][]string) bool { - if !p.ResultSetMetadata.DeepEqual(src) { + if len(p.Variables) != len(src) { return false } - return true -} -func (p *TExecRequest) Field8DeepEqual(src *TExplainResult_) bool { - - if !p.ExplainResult_.DeepEqual(src) { - return false + for i, v := range p.Variables { + _src := src[i] + if len(v) != len(_src) { + return false + } + for i, v := range v { + _src1 := _src[i] + if strings.Compare(v, _src1) != 0 { + return false + } + } } return true } @@ -11198,6 +5205,7 @@ type TTableStatus struct { Rows *int64 `thrift:"rows,11,optional" frugal:"11,optional,i64" json:"rows,omitempty"` AvgRowLength *int64 `thrift:"avg_row_length,12,optional" frugal:"12,optional,i64" json:"avg_row_length,omitempty"` DataLength *int64 `thrift:"data_length,13,optional" frugal:"13,optional,i64" json:"data_length,omitempty"` + IndexLength *int64 `thrift:"index_length,14,optional" frugal:"14,optional,i64" json:"index_length,omitempty"` } func NewTTableStatus() *TTableStatus { @@ -11308,6 +5316,15 @@ func (p *TTableStatus) GetDataLength() (v int64) { } return *p.DataLength } + +var TTableStatus_IndexLength_DEFAULT int64 + +func (p *TTableStatus) GetIndexLength() (v int64) { + if !p.IsSetIndexLength() { + return TTableStatus_IndexLength_DEFAULT + } + return *p.IndexLength +} func (p *TTableStatus) SetName(val string) { p.Name = val } @@ -11347,6 +5364,9 @@ func (p *TTableStatus) SetAvgRowLength(val *int64) { func (p *TTableStatus) SetDataLength(val *int64) { p.DataLength = val } +func (p *TTableStatus) SetIndexLength(val *int64) { + p.IndexLength = val +} var fieldIDToName_TTableStatus = map[int16]string{ 1: "name", @@ -11362,6 +5382,7 @@ var fieldIDToName_TTableStatus = map[int16]string{ 11: "rows", 12: "avg_row_length", 13: "data_length", + 14: "index_length", } func (p *TTableStatus) IsSetEngine() bool { @@ -11404,6 +5425,10 @@ func (p *TTableStatus) IsSetDataLength() bool { return p.DataLength != nil } +func (p *TTableStatus) IsSetIndexLength() bool { + return p.IndexLength != nil +} + func (p *TTableStatus) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -11533,6 +5558,14 @@ func (p *TTableStatus) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 14: + if fieldTypeId == thrift.I64 { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -11721,6 +5754,17 @@ func (p *TTableStatus) ReadField13(iprot thrift.TProtocol) error { p.DataLength = _field return nil } +func (p *TTableStatus) ReadField14(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.IndexLength = _field + return nil +} func (p *TTableStatus) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -11780,6 +5824,10 @@ func (p *TTableStatus) Write(oprot thrift.TProtocol) (err error) { fieldId = 13 goto WriteFieldError } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -12039,6 +6087,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) } +func (p *TTableStatus) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetIndexLength() { + if err = oprot.WriteFieldBegin("index_length", thrift.I64, 14); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.IndexLength); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + func (p *TTableStatus) String() string { if p == nil { return "" @@ -12092,6 +6159,9 @@ func (p *TTableStatus) DeepEqual(ano *TTableStatus) bool { if !p.Field13DeepEqual(ano.DataLength) { return false } + if !p.Field14DeepEqual(ano.IndexLength) { + return false + } return true } @@ -12236,6 +6306,18 @@ func (p *TTableStatus) Field13DeepEqual(src *int64) bool { } return true } +func (p *TTableStatus) Field14DeepEqual(src *int64) bool { + + if p.IndexLength == src { + return true + } else if p.IndexLength == nil || src == nil { + return false + } + if *p.IndexLength != *src { + return false + } + return true +} type TListTableStatusResult_ struct { Tables []*TTableStatus `thrift:"tables,1,required" frugal:"1,required,list" json:"tables"` @@ -46927,6 +41009,7 @@ type TMetadataTableRequestParams struct { PartitionsMetadataParams *plannodes.TPartitionsMetadataParams `thrift:"partitions_metadata_params,11,optional" frugal:"11,optional,plannodes.TPartitionsMetadataParams" json:"partitions_metadata_params,omitempty"` MetaCacheStatsParams *plannodes.TMetaCacheStatsParams `thrift:"meta_cache_stats_params,12,optional" frugal:"12,optional,plannodes.TMetaCacheStatsParams" json:"meta_cache_stats_params,omitempty"` PartitionValuesMetadataParams *plannodes.TPartitionValuesMetadataParams `thrift:"partition_values_metadata_params,13,optional" frugal:"13,optional,plannodes.TPartitionValuesMetadataParams" json:"partition_values_metadata_params,omitempty"` + HudiMetadataParams *plannodes.THudiMetadataParams `thrift:"hudi_metadata_params,14,optional" frugal:"14,optional,plannodes.THudiMetadataParams" json:"hudi_metadata_params,omitempty"` } func NewTMetadataTableRequestParams() *TMetadataTableRequestParams { @@ -47052,6 +41135,15 @@ func (p *TMetadataTableRequestParams) GetPartitionValuesMetadataParams() (v *pla } return p.PartitionValuesMetadataParams } + +var TMetadataTableRequestParams_HudiMetadataParams_DEFAULT *plannodes.THudiMetadataParams + +func (p *TMetadataTableRequestParams) GetHudiMetadataParams() (v *plannodes.THudiMetadataParams) { + if !p.IsSetHudiMetadataParams() { + return TMetadataTableRequestParams_HudiMetadataParams_DEFAULT + } + return p.HudiMetadataParams +} func (p *TMetadataTableRequestParams) SetMetadataType(val *types.TMetadataType) { p.MetadataType = val } @@ -47091,6 +41183,9 @@ func (p *TMetadataTableRequestParams) SetMetaCacheStatsParams(val *plannodes.TMe func (p *TMetadataTableRequestParams) SetPartitionValuesMetadataParams(val *plannodes.TPartitionValuesMetadataParams) { p.PartitionValuesMetadataParams = val } +func (p *TMetadataTableRequestParams) SetHudiMetadataParams(val *plannodes.THudiMetadataParams) { + p.HudiMetadataParams = val +} var fieldIDToName_TMetadataTableRequestParams = map[int16]string{ 1: "metadata_type", @@ -47106,6 +41201,7 @@ var fieldIDToName_TMetadataTableRequestParams = map[int16]string{ 11: "partitions_metadata_params", 12: "meta_cache_stats_params", 13: "partition_values_metadata_params", + 14: "hudi_metadata_params", } func (p *TMetadataTableRequestParams) IsSetMetadataType() bool { @@ -47160,6 +41256,10 @@ func (p *TMetadataTableRequestParams) IsSetPartitionValuesMetadataParams() bool return p.PartitionValuesMetadataParams != nil } +func (p *TMetadataTableRequestParams) IsSetHudiMetadataParams() bool { + return p.HudiMetadataParams != nil +} + func (p *TMetadataTableRequestParams) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -47283,6 +41383,14 @@ func (p *TMetadataTableRequestParams) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 14: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField14(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -47435,6 +41543,14 @@ func (p *TMetadataTableRequestParams) ReadField13(iprot thrift.TProtocol) error p.PartitionValuesMetadataParams = _field return nil } +func (p *TMetadataTableRequestParams) ReadField14(iprot thrift.TProtocol) error { + _field := plannodes.NewTHudiMetadataParams() + if err := _field.Read(iprot); err != nil { + return err + } + p.HudiMetadataParams = _field + return nil +} func (p *TMetadataTableRequestParams) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -47494,6 +41610,10 @@ func (p *TMetadataTableRequestParams) Write(oprot thrift.TProtocol) (err error) fieldId = 13 goto WriteFieldError } + if err = p.writeField14(oprot); err != nil { + fieldId = 14 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -47767,6 +41887,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) } +func (p *TMetadataTableRequestParams) writeField14(oprot thrift.TProtocol) (err error) { + if p.IsSetHudiMetadataParams() { + if err = oprot.WriteFieldBegin("hudi_metadata_params", thrift.STRUCT, 14); err != nil { + goto WriteFieldBeginError + } + if err := p.HudiMetadataParams.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 14 end error: ", p), err) +} + func (p *TMetadataTableRequestParams) String() string { if p == nil { return "" @@ -47820,6 +41959,9 @@ func (p *TMetadataTableRequestParams) DeepEqual(ano *TMetadataTableRequestParams if !p.Field13DeepEqual(ano.PartitionValuesMetadataParams) { return false } + if !p.Field14DeepEqual(ano.HudiMetadataParams) { + return false + } return true } @@ -47925,6 +42067,13 @@ func (p *TMetadataTableRequestParams) Field13DeepEqual(src *plannodes.TPartition } return true } +func (p *TMetadataTableRequestParams) Field14DeepEqual(src *plannodes.THudiMetadataParams) bool { + + if !p.HudiMetadataParams.DeepEqual(src) { + return false + } + return true +} type TSchemaTableRequestParams struct { ColumnsName []string `thrift:"columns_name,1,optional" frugal:"1,optional,list" json:"columns_name,omitempty"` @@ -49917,33 +44066,406 @@ func (p *TConfirmUnusedRemoteFilesResult_) Read(iprot thrift.TProtocol) (err err if err = iprot.ReadStructEnd(); err != nil { goto ReadStructEndError } - + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TConfirmUnusedRemoteFilesResult_[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *TConfirmUnusedRemoteFilesResult_) ReadField1(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]types.TTabletId, 0, size) + for i := 0; i < size; i++ { + + var _elem types.TTabletId + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.ConfirmedTablets = _field + return nil +} + +func (p *TConfirmUnusedRemoteFilesResult_) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TConfirmUnusedRemoteFilesResult"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TConfirmUnusedRemoteFilesResult_) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetConfirmedTablets() { + if err = oprot.WriteFieldBegin("confirmed_tablets", thrift.LIST, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.I64, len(p.ConfirmedTablets)); err != nil { + return err + } + for _, v := range p.ConfirmedTablets { + if err := oprot.WriteI64(v); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TConfirmUnusedRemoteFilesResult_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TConfirmUnusedRemoteFilesResult_(%+v)", *p) + +} + +func (p *TConfirmUnusedRemoteFilesResult_) DeepEqual(ano *TConfirmUnusedRemoteFilesResult_) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.ConfirmedTablets) { + return false + } + return true +} + +func (p *TConfirmUnusedRemoteFilesResult_) Field1DeepEqual(src []types.TTabletId) bool { + + if len(p.ConfirmedTablets) != len(src) { + return false + } + for i, v := range p.ConfirmedTablets { + _src := src[i] + if v != _src { + return false + } + } + return true +} + +type TPrivilegeCtrl struct { + PrivHier TPrivilegeHier `thrift:"priv_hier,1,required" frugal:"1,required,TPrivilegeHier" json:"priv_hier"` + Ctl *string `thrift:"ctl,2,optional" frugal:"2,optional,string" json:"ctl,omitempty"` + Db *string `thrift:"db,3,optional" frugal:"3,optional,string" json:"db,omitempty"` + Tbl *string `thrift:"tbl,4,optional" frugal:"4,optional,string" json:"tbl,omitempty"` + Cols []string `thrift:"cols,5,optional" frugal:"5,optional,set" json:"cols,omitempty"` + Res *string `thrift:"res,6,optional" frugal:"6,optional,string" json:"res,omitempty"` +} + +func NewTPrivilegeCtrl() *TPrivilegeCtrl { + return &TPrivilegeCtrl{} +} + +func (p *TPrivilegeCtrl) InitDefault() { +} + +func (p *TPrivilegeCtrl) GetPrivHier() (v TPrivilegeHier) { + return p.PrivHier +} + +var TPrivilegeCtrl_Ctl_DEFAULT string + +func (p *TPrivilegeCtrl) GetCtl() (v string) { + if !p.IsSetCtl() { + return TPrivilegeCtrl_Ctl_DEFAULT + } + return *p.Ctl +} + +var TPrivilegeCtrl_Db_DEFAULT string + +func (p *TPrivilegeCtrl) GetDb() (v string) { + if !p.IsSetDb() { + return TPrivilegeCtrl_Db_DEFAULT + } + return *p.Db +} + +var TPrivilegeCtrl_Tbl_DEFAULT string + +func (p *TPrivilegeCtrl) GetTbl() (v string) { + if !p.IsSetTbl() { + return TPrivilegeCtrl_Tbl_DEFAULT + } + return *p.Tbl +} + +var TPrivilegeCtrl_Cols_DEFAULT []string + +func (p *TPrivilegeCtrl) GetCols() (v []string) { + if !p.IsSetCols() { + return TPrivilegeCtrl_Cols_DEFAULT + } + return p.Cols +} + +var TPrivilegeCtrl_Res_DEFAULT string + +func (p *TPrivilegeCtrl) GetRes() (v string) { + if !p.IsSetRes() { + return TPrivilegeCtrl_Res_DEFAULT + } + return *p.Res +} +func (p *TPrivilegeCtrl) SetPrivHier(val TPrivilegeHier) { + p.PrivHier = val +} +func (p *TPrivilegeCtrl) SetCtl(val *string) { + p.Ctl = val +} +func (p *TPrivilegeCtrl) SetDb(val *string) { + p.Db = val +} +func (p *TPrivilegeCtrl) SetTbl(val *string) { + p.Tbl = val +} +func (p *TPrivilegeCtrl) SetCols(val []string) { + p.Cols = val +} +func (p *TPrivilegeCtrl) SetRes(val *string) { + p.Res = val +} + +var fieldIDToName_TPrivilegeCtrl = map[int16]string{ + 1: "priv_hier", + 2: "ctl", + 3: "db", + 4: "tbl", + 5: "cols", + 6: "res", +} + +func (p *TPrivilegeCtrl) IsSetCtl() bool { + return p.Ctl != nil +} + +func (p *TPrivilegeCtrl) IsSetDb() bool { + return p.Db != nil +} + +func (p *TPrivilegeCtrl) IsSetTbl() bool { + return p.Tbl != nil +} + +func (p *TPrivilegeCtrl) IsSetCols() bool { + return p.Cols != nil +} + +func (p *TPrivilegeCtrl) IsSetRes() bool { + return p.Res != nil +} + +func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetPrivHier bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetPrivHier = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.SET { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.STRING { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetPrivHier { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPrivilegeCtrl[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TPrivilegeCtrl[fieldId])) +} + +func (p *TPrivilegeCtrl) ReadField1(iprot thrift.TProtocol) error { + + var _field TPrivilegeHier + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = TPrivilegeHier(v) + } + p.PrivHier = _field + return nil +} +func (p *TPrivilegeCtrl) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Ctl = _field + return nil +} +func (p *TPrivilegeCtrl) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Db = _field + return nil +} +func (p *TPrivilegeCtrl) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Tbl = _field return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TConfirmUnusedRemoteFilesResult_[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } - -func (p *TConfirmUnusedRemoteFilesResult_) ReadField1(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() +func (p *TPrivilegeCtrl) ReadField5(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadSetBegin() if err != nil { return err } - _field := make([]types.TTabletId, 0, size) + _field := make([]string, 0, size) for i := 0; i < size; i++ { - var _elem types.TTabletId - if v, err := iprot.ReadI64(); err != nil { + var _elem string + if v, err := iprot.ReadString(); err != nil { return err } else { _elem = v @@ -49951,16 +44473,27 @@ func (p *TConfirmUnusedRemoteFilesResult_) ReadField1(iprot thrift.TProtocol) er _field = append(_field, _elem) } - if err := iprot.ReadListEnd(); err != nil { + if err := iprot.ReadSetEnd(); err != nil { return err } - p.ConfirmedTablets = _field + p.Cols = _field return nil } +func (p *TPrivilegeCtrl) ReadField6(iprot thrift.TProtocol) error { -func (p *TConfirmUnusedRemoteFilesResult_) Write(oprot thrift.TProtocol) (err error) { + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Res = _field + return nil +} + +func (p *TPrivilegeCtrl) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TConfirmUnusedRemoteFilesResult"); err != nil { + if err = oprot.WriteStructBegin("TPrivilegeCtrl"); err != nil { goto WriteStructBeginError } if p != nil { @@ -49968,6 +44501,26 @@ func (p *TConfirmUnusedRemoteFilesResult_) Write(oprot thrift.TProtocol) (err er fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -49986,20 +44539,106 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TConfirmUnusedRemoteFilesResult_) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetConfirmedTablets() { - if err = oprot.WriteFieldBegin("confirmed_tablets", thrift.LIST, 1); err != nil { +func (p *TPrivilegeCtrl) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("priv_hier", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(p.PrivHier)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TPrivilegeCtrl) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCtl() { + if err = oprot.WriteFieldBegin("ctl", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.I64, len(p.ConfirmedTablets)); err != nil { + if err := oprot.WriteString(*p.Ctl); err != nil { return err } - for _, v := range p.ConfirmedTablets { - if err := oprot.WriteI64(v); err != nil { + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *TPrivilegeCtrl) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetDb() { + if err = oprot.WriteFieldBegin("db", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Db); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *TPrivilegeCtrl) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTbl() { + if err = oprot.WriteFieldBegin("tbl", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Tbl); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TPrivilegeCtrl) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetCols() { + if err = oprot.WriteFieldBegin("cols", thrift.SET, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteSetBegin(thrift.STRING, len(p.Cols)); err != nil { + return err + } + for i := 0; i < len(p.Cols); i++ { + for j := i + 1; j < len(p.Cols); j++ { + if func(tgt, src string) bool { + if strings.Compare(tgt, src) != 0 { + return false + } + return true + }(p.Cols[i], p.Cols[j]) { + return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Cols[i])) + } + } + } + for _, v := range p.Cols { + if err := oprot.WriteString(v); err != nil { return err } } - if err := oprot.WriteListEnd(); err != nil { + if err := oprot.WriteSetEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -50008,162 +44647,261 @@ func (p *TConfirmUnusedRemoteFilesResult_) writeField1(oprot thrift.TProtocol) ( } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } -func (p *TConfirmUnusedRemoteFilesResult_) String() string { +func (p *TPrivilegeCtrl) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetRes() { + if err = oprot.WriteFieldBegin("res", thrift.STRING, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Res); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *TPrivilegeCtrl) String() string { if p == nil { return "" } - return fmt.Sprintf("TConfirmUnusedRemoteFilesResult_(%+v)", *p) + return fmt.Sprintf("TPrivilegeCtrl(%+v)", *p) } -func (p *TConfirmUnusedRemoteFilesResult_) DeepEqual(ano *TConfirmUnusedRemoteFilesResult_) bool { +func (p *TPrivilegeCtrl) DeepEqual(ano *TPrivilegeCtrl) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.ConfirmedTablets) { + if !p.Field1DeepEqual(ano.PrivHier) { + return false + } + if !p.Field2DeepEqual(ano.Ctl) { + return false + } + if !p.Field3DeepEqual(ano.Db) { + return false + } + if !p.Field4DeepEqual(ano.Tbl) { + return false + } + if !p.Field5DeepEqual(ano.Cols) { + return false + } + if !p.Field6DeepEqual(ano.Res) { return false } return true } -func (p *TConfirmUnusedRemoteFilesResult_) Field1DeepEqual(src []types.TTabletId) bool { +func (p *TPrivilegeCtrl) Field1DeepEqual(src TPrivilegeHier) bool { - if len(p.ConfirmedTablets) != len(src) { + if p.PrivHier != src { return false } - for i, v := range p.ConfirmedTablets { + return true +} +func (p *TPrivilegeCtrl) Field2DeepEqual(src *string) bool { + + if p.Ctl == src { + return true + } else if p.Ctl == nil || src == nil { + return false + } + if strings.Compare(*p.Ctl, *src) != 0 { + return false + } + return true +} +func (p *TPrivilegeCtrl) Field3DeepEqual(src *string) bool { + + if p.Db == src { + return true + } else if p.Db == nil || src == nil { + return false + } + if strings.Compare(*p.Db, *src) != 0 { + return false + } + return true +} +func (p *TPrivilegeCtrl) Field4DeepEqual(src *string) bool { + + if p.Tbl == src { + return true + } else if p.Tbl == nil || src == nil { + return false + } + if strings.Compare(*p.Tbl, *src) != 0 { + return false + } + return true +} +func (p *TPrivilegeCtrl) Field5DeepEqual(src []string) bool { + + if len(p.Cols) != len(src) { + return false + } + for i, v := range p.Cols { _src := src[i] - if v != _src { + if strings.Compare(v, _src) != 0 { return false } } return true } +func (p *TPrivilegeCtrl) Field6DeepEqual(src *string) bool { -type TPrivilegeCtrl struct { - PrivHier TPrivilegeHier `thrift:"priv_hier,1,required" frugal:"1,required,TPrivilegeHier" json:"priv_hier"` - Ctl *string `thrift:"ctl,2,optional" frugal:"2,optional,string" json:"ctl,omitempty"` - Db *string `thrift:"db,3,optional" frugal:"3,optional,string" json:"db,omitempty"` - Tbl *string `thrift:"tbl,4,optional" frugal:"4,optional,string" json:"tbl,omitempty"` - Cols []string `thrift:"cols,5,optional" frugal:"5,optional,set" json:"cols,omitempty"` - Res *string `thrift:"res,6,optional" frugal:"6,optional,string" json:"res,omitempty"` + if p.Res == src { + return true + } else if p.Res == nil || src == nil { + return false + } + if strings.Compare(*p.Res, *src) != 0 { + return false + } + return true } -func NewTPrivilegeCtrl() *TPrivilegeCtrl { - return &TPrivilegeCtrl{} +type TCheckAuthRequest struct { + Cluster *string `thrift:"cluster,1,optional" frugal:"1,optional,string" json:"cluster,omitempty"` + User string `thrift:"user,2,required" frugal:"2,required,string" json:"user"` + Passwd string `thrift:"passwd,3,required" frugal:"3,required,string" json:"passwd"` + UserIp *string `thrift:"user_ip,4,optional" frugal:"4,optional,string" json:"user_ip,omitempty"` + PrivCtrl *TPrivilegeCtrl `thrift:"priv_ctrl,5,optional" frugal:"5,optional,TPrivilegeCtrl" json:"priv_ctrl,omitempty"` + PrivType *TPrivilegeType `thrift:"priv_type,6,optional" frugal:"6,optional,TPrivilegeType" json:"priv_type,omitempty"` + ThriftRpcTimeoutMs *int64 `thrift:"thrift_rpc_timeout_ms,7,optional" frugal:"7,optional,i64" json:"thrift_rpc_timeout_ms,omitempty"` } -func (p *TPrivilegeCtrl) InitDefault() { +func NewTCheckAuthRequest() *TCheckAuthRequest { + return &TCheckAuthRequest{} } -func (p *TPrivilegeCtrl) GetPrivHier() (v TPrivilegeHier) { - return p.PrivHier +func (p *TCheckAuthRequest) InitDefault() { } -var TPrivilegeCtrl_Ctl_DEFAULT string +var TCheckAuthRequest_Cluster_DEFAULT string -func (p *TPrivilegeCtrl) GetCtl() (v string) { - if !p.IsSetCtl() { - return TPrivilegeCtrl_Ctl_DEFAULT +func (p *TCheckAuthRequest) GetCluster() (v string) { + if !p.IsSetCluster() { + return TCheckAuthRequest_Cluster_DEFAULT } - return *p.Ctl + return *p.Cluster } -var TPrivilegeCtrl_Db_DEFAULT string +func (p *TCheckAuthRequest) GetUser() (v string) { + return p.User +} -func (p *TPrivilegeCtrl) GetDb() (v string) { - if !p.IsSetDb() { - return TPrivilegeCtrl_Db_DEFAULT +func (p *TCheckAuthRequest) GetPasswd() (v string) { + return p.Passwd +} + +var TCheckAuthRequest_UserIp_DEFAULT string + +func (p *TCheckAuthRequest) GetUserIp() (v string) { + if !p.IsSetUserIp() { + return TCheckAuthRequest_UserIp_DEFAULT } - return *p.Db + return *p.UserIp } -var TPrivilegeCtrl_Tbl_DEFAULT string +var TCheckAuthRequest_PrivCtrl_DEFAULT *TPrivilegeCtrl -func (p *TPrivilegeCtrl) GetTbl() (v string) { - if !p.IsSetTbl() { - return TPrivilegeCtrl_Tbl_DEFAULT +func (p *TCheckAuthRequest) GetPrivCtrl() (v *TPrivilegeCtrl) { + if !p.IsSetPrivCtrl() { + return TCheckAuthRequest_PrivCtrl_DEFAULT } - return *p.Tbl + return p.PrivCtrl } -var TPrivilegeCtrl_Cols_DEFAULT []string +var TCheckAuthRequest_PrivType_DEFAULT TPrivilegeType -func (p *TPrivilegeCtrl) GetCols() (v []string) { - if !p.IsSetCols() { - return TPrivilegeCtrl_Cols_DEFAULT +func (p *TCheckAuthRequest) GetPrivType() (v TPrivilegeType) { + if !p.IsSetPrivType() { + return TCheckAuthRequest_PrivType_DEFAULT } - return p.Cols + return *p.PrivType } -var TPrivilegeCtrl_Res_DEFAULT string +var TCheckAuthRequest_ThriftRpcTimeoutMs_DEFAULT int64 -func (p *TPrivilegeCtrl) GetRes() (v string) { - if !p.IsSetRes() { - return TPrivilegeCtrl_Res_DEFAULT +func (p *TCheckAuthRequest) GetThriftRpcTimeoutMs() (v int64) { + if !p.IsSetThriftRpcTimeoutMs() { + return TCheckAuthRequest_ThriftRpcTimeoutMs_DEFAULT } - return *p.Res + return *p.ThriftRpcTimeoutMs } -func (p *TPrivilegeCtrl) SetPrivHier(val TPrivilegeHier) { - p.PrivHier = val +func (p *TCheckAuthRequest) SetCluster(val *string) { + p.Cluster = val } -func (p *TPrivilegeCtrl) SetCtl(val *string) { - p.Ctl = val +func (p *TCheckAuthRequest) SetUser(val string) { + p.User = val } -func (p *TPrivilegeCtrl) SetDb(val *string) { - p.Db = val +func (p *TCheckAuthRequest) SetPasswd(val string) { + p.Passwd = val } -func (p *TPrivilegeCtrl) SetTbl(val *string) { - p.Tbl = val +func (p *TCheckAuthRequest) SetUserIp(val *string) { + p.UserIp = val } -func (p *TPrivilegeCtrl) SetCols(val []string) { - p.Cols = val +func (p *TCheckAuthRequest) SetPrivCtrl(val *TPrivilegeCtrl) { + p.PrivCtrl = val } -func (p *TPrivilegeCtrl) SetRes(val *string) { - p.Res = val +func (p *TCheckAuthRequest) SetPrivType(val *TPrivilegeType) { + p.PrivType = val +} +func (p *TCheckAuthRequest) SetThriftRpcTimeoutMs(val *int64) { + p.ThriftRpcTimeoutMs = val } -var fieldIDToName_TPrivilegeCtrl = map[int16]string{ - 1: "priv_hier", - 2: "ctl", - 3: "db", - 4: "tbl", - 5: "cols", - 6: "res", +var fieldIDToName_TCheckAuthRequest = map[int16]string{ + 1: "cluster", + 2: "user", + 3: "passwd", + 4: "user_ip", + 5: "priv_ctrl", + 6: "priv_type", + 7: "thrift_rpc_timeout_ms", } -func (p *TPrivilegeCtrl) IsSetCtl() bool { - return p.Ctl != nil +func (p *TCheckAuthRequest) IsSetCluster() bool { + return p.Cluster != nil } -func (p *TPrivilegeCtrl) IsSetDb() bool { - return p.Db != nil +func (p *TCheckAuthRequest) IsSetUserIp() bool { + return p.UserIp != nil } -func (p *TPrivilegeCtrl) IsSetTbl() bool { - return p.Tbl != nil +func (p *TCheckAuthRequest) IsSetPrivCtrl() bool { + return p.PrivCtrl != nil } -func (p *TPrivilegeCtrl) IsSetCols() bool { - return p.Cols != nil +func (p *TCheckAuthRequest) IsSetPrivType() bool { + return p.PrivType != nil } -func (p *TPrivilegeCtrl) IsSetRes() bool { - return p.Res != nil +func (p *TCheckAuthRequest) IsSetThriftRpcTimeoutMs() bool { + return p.ThriftRpcTimeoutMs != nil } -func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { +func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetPrivHier bool = false + var issetUser bool = false + var issetPasswd bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -50180,11 +44918,10 @@ func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetPrivHier = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -50193,6 +44930,7 @@ func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } + issetUser = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -50201,6 +44939,7 @@ func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } + issetPasswd = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -50213,7 +44952,7 @@ func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 5: - if fieldTypeId == thrift.SET { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField5(iprot); err != nil { goto ReadFieldError } @@ -50221,13 +44960,21 @@ func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 6: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I32 { if err = p.ReadField6(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 7: + if fieldTypeId == thrift.I64 { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -50241,8 +44988,13 @@ func (p *TPrivilegeCtrl) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetPrivHier { - fieldId = 1 + if !issetUser { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetPasswd { + fieldId = 3 goto RequiredFieldNotSetError } return nil @@ -50251,7 +45003,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPrivilegeCtrl[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -50260,43 +45012,43 @@ ReadFieldEndError: ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TPrivilegeCtrl[fieldId])) + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthRequest[fieldId])) } -func (p *TPrivilegeCtrl) ReadField1(iprot thrift.TProtocol) error { +func (p *TCheckAuthRequest) ReadField1(iprot thrift.TProtocol) error { - var _field TPrivilegeHier - if v, err := iprot.ReadI32(); err != nil { + var _field *string + if v, err := iprot.ReadString(); err != nil { return err } else { - _field = TPrivilegeHier(v) + _field = &v } - p.PrivHier = _field + p.Cluster = _field return nil } -func (p *TPrivilegeCtrl) ReadField2(iprot thrift.TProtocol) error { +func (p *TCheckAuthRequest) ReadField2(iprot thrift.TProtocol) error { - var _field *string + var _field string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = &v + _field = v } - p.Ctl = _field + p.User = _field return nil } -func (p *TPrivilegeCtrl) ReadField3(iprot thrift.TProtocol) error { +func (p *TCheckAuthRequest) ReadField3(iprot thrift.TProtocol) error { - var _field *string + var _field string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = &v + _field = v } - p.Db = _field + p.Passwd = _field return nil } -func (p *TPrivilegeCtrl) ReadField4(iprot thrift.TProtocol) error { +func (p *TCheckAuthRequest) ReadField4(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -50304,47 +45056,44 @@ func (p *TPrivilegeCtrl) ReadField4(iprot thrift.TProtocol) error { } else { _field = &v } - p.Tbl = _field + p.UserIp = _field return nil } -func (p *TPrivilegeCtrl) ReadField5(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadSetBegin() - if err != nil { +func (p *TCheckAuthRequest) ReadField5(iprot thrift.TProtocol) error { + _field := NewTPrivilegeCtrl() + if err := _field.Read(iprot); err != nil { return err } - _field := make([]string, 0, size) - for i := 0; i < size; i++ { - - var _elem string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _elem = v - } + p.PrivCtrl = _field + return nil +} +func (p *TCheckAuthRequest) ReadField6(iprot thrift.TProtocol) error { - _field = append(_field, _elem) - } - if err := iprot.ReadSetEnd(); err != nil { + var _field *TPrivilegeType + if v, err := iprot.ReadI32(); err != nil { return err + } else { + tmp := TPrivilegeType(v) + _field = &tmp } - p.Cols = _field + p.PrivType = _field return nil } -func (p *TPrivilegeCtrl) ReadField6(iprot thrift.TProtocol) error { +func (p *TCheckAuthRequest) ReadField7(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { return err } else { _field = &v } - p.Res = _field + p.ThriftRpcTimeoutMs = _field return nil } -func (p *TPrivilegeCtrl) Write(oprot thrift.TProtocol) (err error) { +func (p *TCheckAuthRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TPrivilegeCtrl"); err != nil { + if err = oprot.WriteStructBegin("TCheckAuthRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -50372,6 +45121,10 @@ func (p *TPrivilegeCtrl) Write(oprot thrift.TProtocol) (err error) { fieldId = 6 goto WriteFieldError } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -50390,11 +45143,30 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TPrivilegeCtrl) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("priv_hier", thrift.I32, 1); err != nil { +func (p *TCheckAuthRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetCluster() { + if err = oprot.WriteFieldBegin("cluster", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Cluster); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TCheckAuthRequest) writeField2(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI32(int32(p.PrivHier)); err != nil { + if err := oprot.WriteString(p.User); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -50402,36 +45174,34 @@ func (p *TPrivilegeCtrl) writeField1(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TPrivilegeCtrl) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCtl() { - if err = oprot.WriteFieldBegin("ctl", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Ctl); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } +func (p *TCheckAuthRequest) writeField3(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("passwd", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(p.Passwd); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *TPrivilegeCtrl) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetDb() { - if err = oprot.WriteFieldBegin("db", thrift.STRING, 3); err != nil { +func (p *TCheckAuthRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetUserIp() { + if err = oprot.WriteFieldBegin("user_ip", thrift.STRING, 4); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Db); err != nil { + if err := oprot.WriteString(*p.UserIp); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -50440,17 +45210,17 @@ func (p *TPrivilegeCtrl) writeField3(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *TPrivilegeCtrl) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetTbl() { - if err = oprot.WriteFieldBegin("tbl", thrift.STRING, 4); err != nil { +func (p *TCheckAuthRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetPrivCtrl() { + if err = oprot.WriteFieldBegin("priv_ctrl", thrift.STRUCT, 5); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Tbl); err != nil { + if err := p.PrivCtrl.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -50459,37 +45229,17 @@ func (p *TPrivilegeCtrl) writeField4(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } -func (p *TPrivilegeCtrl) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetCols() { - if err = oprot.WriteFieldBegin("cols", thrift.SET, 5); err != nil { +func (p *TCheckAuthRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetPrivType() { + if err = oprot.WriteFieldBegin("priv_type", thrift.I32, 6); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteSetBegin(thrift.STRING, len(p.Cols)); err != nil { - return err - } - for i := 0; i < len(p.Cols); i++ { - for j := i + 1; j < len(p.Cols); j++ { - if func(tgt, src string) bool { - if strings.Compare(tgt, src) != 0 { - return false - } - return true - }(p.Cols[i], p.Cols[j]) { - return thrift.PrependError("", fmt.Errorf("%T error writing set field: slice is not unique", p.Cols[i])) - } - } - } - for _, v := range p.Cols { - if err := oprot.WriteString(v); err != nil { - return err - } - } - if err := oprot.WriteSetEnd(); err != nil { + if err := oprot.WriteI32(int32(*p.PrivType)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -50498,17 +45248,17 @@ func (p *TPrivilegeCtrl) writeField5(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -func (p *TPrivilegeCtrl) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetRes() { - if err = oprot.WriteFieldBegin("res", thrift.STRING, 6); err != nil { +func (p *TCheckAuthRequest) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetThriftRpcTimeoutMs() { + if err = oprot.WriteFieldBegin("thrift_rpc_timeout_ms", thrift.I64, 7); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Res); err != nil { + if err := oprot.WriteI64(*p.ThriftRpcTimeoutMs); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -50517,242 +45267,421 @@ func (p *TPrivilegeCtrl) writeField6(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) } -func (p *TPrivilegeCtrl) String() string { +func (p *TCheckAuthRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("TPrivilegeCtrl(%+v)", *p) + return fmt.Sprintf("TCheckAuthRequest(%+v)", *p) } -func (p *TPrivilegeCtrl) DeepEqual(ano *TPrivilegeCtrl) bool { +func (p *TCheckAuthRequest) DeepEqual(ano *TCheckAuthRequest) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.PrivHier) { + if !p.Field1DeepEqual(ano.Cluster) { return false } - if !p.Field2DeepEqual(ano.Ctl) { + if !p.Field2DeepEqual(ano.User) { return false } - if !p.Field3DeepEqual(ano.Db) { + if !p.Field3DeepEqual(ano.Passwd) { return false } - if !p.Field4DeepEqual(ano.Tbl) { + if !p.Field4DeepEqual(ano.UserIp) { return false } - if !p.Field5DeepEqual(ano.Cols) { + if !p.Field5DeepEqual(ano.PrivCtrl) { return false } - if !p.Field6DeepEqual(ano.Res) { + if !p.Field6DeepEqual(ano.PrivType) { + return false + } + if !p.Field7DeepEqual(ano.ThriftRpcTimeoutMs) { return false } return true } -func (p *TPrivilegeCtrl) Field1DeepEqual(src TPrivilegeHier) bool { +func (p *TCheckAuthRequest) Field1DeepEqual(src *string) bool { - if p.PrivHier != src { + if p.Cluster == src { + return true + } else if p.Cluster == nil || src == nil { + return false + } + if strings.Compare(*p.Cluster, *src) != 0 { return false } return true } -func (p *TPrivilegeCtrl) Field2DeepEqual(src *string) bool { +func (p *TCheckAuthRequest) Field2DeepEqual(src string) bool { - if p.Ctl == src { - return true - } else if p.Ctl == nil || src == nil { + if strings.Compare(p.User, src) != 0 { return false } - if strings.Compare(*p.Ctl, *src) != 0 { + return true +} +func (p *TCheckAuthRequest) Field3DeepEqual(src string) bool { + + if strings.Compare(p.Passwd, src) != 0 { return false } return true } -func (p *TPrivilegeCtrl) Field3DeepEqual(src *string) bool { +func (p *TCheckAuthRequest) Field4DeepEqual(src *string) bool { - if p.Db == src { + if p.UserIp == src { return true - } else if p.Db == nil || src == nil { + } else if p.UserIp == nil || src == nil { return false } - if strings.Compare(*p.Db, *src) != 0 { + if strings.Compare(*p.UserIp, *src) != 0 { return false } return true } -func (p *TPrivilegeCtrl) Field4DeepEqual(src *string) bool { +func (p *TCheckAuthRequest) Field5DeepEqual(src *TPrivilegeCtrl) bool { - if p.Tbl == src { + if !p.PrivCtrl.DeepEqual(src) { + return false + } + return true +} +func (p *TCheckAuthRequest) Field6DeepEqual(src *TPrivilegeType) bool { + + if p.PrivType == src { return true - } else if p.Tbl == nil || src == nil { + } else if p.PrivType == nil || src == nil { return false } - if strings.Compare(*p.Tbl, *src) != 0 { + if *p.PrivType != *src { return false } return true } -func (p *TPrivilegeCtrl) Field5DeepEqual(src []string) bool { +func (p *TCheckAuthRequest) Field7DeepEqual(src *int64) bool { - if len(p.Cols) != len(src) { + if p.ThriftRpcTimeoutMs == src { + return true + } else if p.ThriftRpcTimeoutMs == nil || src == nil { return false } - for i, v := range p.Cols { - _src := src[i] - if strings.Compare(v, _src) != 0 { - return false - } + if *p.ThriftRpcTimeoutMs != *src { + return false } return true } -func (p *TPrivilegeCtrl) Field6DeepEqual(src *string) bool { - if p.Res == src { +type TCheckAuthResult_ struct { + Status *status.TStatus `thrift:"status,1,required" frugal:"1,required,status.TStatus" json:"status"` +} + +func NewTCheckAuthResult_() *TCheckAuthResult_ { + return &TCheckAuthResult_{} +} + +func (p *TCheckAuthResult_) InitDefault() { +} + +var TCheckAuthResult__Status_DEFAULT *status.TStatus + +func (p *TCheckAuthResult_) GetStatus() (v *status.TStatus) { + if !p.IsSetStatus() { + return TCheckAuthResult__Status_DEFAULT + } + return p.Status +} +func (p *TCheckAuthResult_) SetStatus(val *status.TStatus) { + p.Status = val +} + +var fieldIDToName_TCheckAuthResult_ = map[int16]string{ + 1: "status", +} + +func (p *TCheckAuthResult_) IsSetStatus() bool { + return p.Status != nil +} + +func (p *TCheckAuthResult_) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + var issetStatus bool = false + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + issetStatus = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + if !issetStatus { + fieldId = 1 + goto RequiredFieldNotSetError + } + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthResult_[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthResult_[fieldId])) +} + +func (p *TCheckAuthResult_) ReadField1(iprot thrift.TProtocol) error { + _field := status.NewTStatus() + if err := _field.Read(iprot); err != nil { + return err + } + p.Status = _field + return nil +} + +func (p *TCheckAuthResult_) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("TCheckAuthResult"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *TCheckAuthResult_) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Status.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TCheckAuthResult_) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("TCheckAuthResult_(%+v)", *p) + +} + +func (p *TCheckAuthResult_) DeepEqual(ano *TCheckAuthResult_) bool { + if p == ano { return true - } else if p.Res == nil || src == nil { + } else if p == nil || ano == nil { return false } - if strings.Compare(*p.Res, *src) != 0 { + if !p.Field1DeepEqual(ano.Status) { return false } return true } -type TCheckAuthRequest struct { - Cluster *string `thrift:"cluster,1,optional" frugal:"1,optional,string" json:"cluster,omitempty"` - User string `thrift:"user,2,required" frugal:"2,required,string" json:"user"` - Passwd string `thrift:"passwd,3,required" frugal:"3,required,string" json:"passwd"` - UserIp *string `thrift:"user_ip,4,optional" frugal:"4,optional,string" json:"user_ip,omitempty"` - PrivCtrl *TPrivilegeCtrl `thrift:"priv_ctrl,5,optional" frugal:"5,optional,TPrivilegeCtrl" json:"priv_ctrl,omitempty"` - PrivType *TPrivilegeType `thrift:"priv_type,6,optional" frugal:"6,optional,TPrivilegeType" json:"priv_type,omitempty"` - ThriftRpcTimeoutMs *int64 `thrift:"thrift_rpc_timeout_ms,7,optional" frugal:"7,optional,i64" json:"thrift_rpc_timeout_ms,omitempty"` +func (p *TCheckAuthResult_) Field1DeepEqual(src *status.TStatus) bool { + + if !p.Status.DeepEqual(src) { + return false + } + return true } -func NewTCheckAuthRequest() *TCheckAuthRequest { - return &TCheckAuthRequest{} +type TGetQueryStatsRequest struct { + Type *TQueryStatsType `thrift:"type,1,optional" frugal:"1,optional,TQueryStatsType" json:"type,omitempty"` + Catalog *string `thrift:"catalog,2,optional" frugal:"2,optional,string" json:"catalog,omitempty"` + Db *string `thrift:"db,3,optional" frugal:"3,optional,string" json:"db,omitempty"` + Tbl *string `thrift:"tbl,4,optional" frugal:"4,optional,string" json:"tbl,omitempty"` + ReplicaId *int64 `thrift:"replica_id,5,optional" frugal:"5,optional,i64" json:"replica_id,omitempty"` + ReplicaIds []int64 `thrift:"replica_ids,6,optional" frugal:"6,optional,list" json:"replica_ids,omitempty"` } -func (p *TCheckAuthRequest) InitDefault() { +func NewTGetQueryStatsRequest() *TGetQueryStatsRequest { + return &TGetQueryStatsRequest{} } -var TCheckAuthRequest_Cluster_DEFAULT string +func (p *TGetQueryStatsRequest) InitDefault() { +} -func (p *TCheckAuthRequest) GetCluster() (v string) { - if !p.IsSetCluster() { - return TCheckAuthRequest_Cluster_DEFAULT +var TGetQueryStatsRequest_Type_DEFAULT TQueryStatsType + +func (p *TGetQueryStatsRequest) GetType() (v TQueryStatsType) { + if !p.IsSetType() { + return TGetQueryStatsRequest_Type_DEFAULT } - return *p.Cluster + return *p.Type } -func (p *TCheckAuthRequest) GetUser() (v string) { - return p.User -} +var TGetQueryStatsRequest_Catalog_DEFAULT string -func (p *TCheckAuthRequest) GetPasswd() (v string) { - return p.Passwd +func (p *TGetQueryStatsRequest) GetCatalog() (v string) { + if !p.IsSetCatalog() { + return TGetQueryStatsRequest_Catalog_DEFAULT + } + return *p.Catalog } -var TCheckAuthRequest_UserIp_DEFAULT string +var TGetQueryStatsRequest_Db_DEFAULT string -func (p *TCheckAuthRequest) GetUserIp() (v string) { - if !p.IsSetUserIp() { - return TCheckAuthRequest_UserIp_DEFAULT +func (p *TGetQueryStatsRequest) GetDb() (v string) { + if !p.IsSetDb() { + return TGetQueryStatsRequest_Db_DEFAULT } - return *p.UserIp + return *p.Db } -var TCheckAuthRequest_PrivCtrl_DEFAULT *TPrivilegeCtrl +var TGetQueryStatsRequest_Tbl_DEFAULT string -func (p *TCheckAuthRequest) GetPrivCtrl() (v *TPrivilegeCtrl) { - if !p.IsSetPrivCtrl() { - return TCheckAuthRequest_PrivCtrl_DEFAULT +func (p *TGetQueryStatsRequest) GetTbl() (v string) { + if !p.IsSetTbl() { + return TGetQueryStatsRequest_Tbl_DEFAULT } - return p.PrivCtrl + return *p.Tbl } -var TCheckAuthRequest_PrivType_DEFAULT TPrivilegeType +var TGetQueryStatsRequest_ReplicaId_DEFAULT int64 -func (p *TCheckAuthRequest) GetPrivType() (v TPrivilegeType) { - if !p.IsSetPrivType() { - return TCheckAuthRequest_PrivType_DEFAULT +func (p *TGetQueryStatsRequest) GetReplicaId() (v int64) { + if !p.IsSetReplicaId() { + return TGetQueryStatsRequest_ReplicaId_DEFAULT } - return *p.PrivType + return *p.ReplicaId } -var TCheckAuthRequest_ThriftRpcTimeoutMs_DEFAULT int64 +var TGetQueryStatsRequest_ReplicaIds_DEFAULT []int64 -func (p *TCheckAuthRequest) GetThriftRpcTimeoutMs() (v int64) { - if !p.IsSetThriftRpcTimeoutMs() { - return TCheckAuthRequest_ThriftRpcTimeoutMs_DEFAULT +func (p *TGetQueryStatsRequest) GetReplicaIds() (v []int64) { + if !p.IsSetReplicaIds() { + return TGetQueryStatsRequest_ReplicaIds_DEFAULT } - return *p.ThriftRpcTimeoutMs -} -func (p *TCheckAuthRequest) SetCluster(val *string) { - p.Cluster = val + return p.ReplicaIds } -func (p *TCheckAuthRequest) SetUser(val string) { - p.User = val +func (p *TGetQueryStatsRequest) SetType(val *TQueryStatsType) { + p.Type = val } -func (p *TCheckAuthRequest) SetPasswd(val string) { - p.Passwd = val +func (p *TGetQueryStatsRequest) SetCatalog(val *string) { + p.Catalog = val } -func (p *TCheckAuthRequest) SetUserIp(val *string) { - p.UserIp = val +func (p *TGetQueryStatsRequest) SetDb(val *string) { + p.Db = val } -func (p *TCheckAuthRequest) SetPrivCtrl(val *TPrivilegeCtrl) { - p.PrivCtrl = val +func (p *TGetQueryStatsRequest) SetTbl(val *string) { + p.Tbl = val } -func (p *TCheckAuthRequest) SetPrivType(val *TPrivilegeType) { - p.PrivType = val +func (p *TGetQueryStatsRequest) SetReplicaId(val *int64) { + p.ReplicaId = val } -func (p *TCheckAuthRequest) SetThriftRpcTimeoutMs(val *int64) { - p.ThriftRpcTimeoutMs = val +func (p *TGetQueryStatsRequest) SetReplicaIds(val []int64) { + p.ReplicaIds = val } -var fieldIDToName_TCheckAuthRequest = map[int16]string{ - 1: "cluster", - 2: "user", - 3: "passwd", - 4: "user_ip", - 5: "priv_ctrl", - 6: "priv_type", - 7: "thrift_rpc_timeout_ms", +var fieldIDToName_TGetQueryStatsRequest = map[int16]string{ + 1: "type", + 2: "catalog", + 3: "db", + 4: "tbl", + 5: "replica_id", + 6: "replica_ids", +} + +func (p *TGetQueryStatsRequest) IsSetType() bool { + return p.Type != nil } -func (p *TCheckAuthRequest) IsSetCluster() bool { - return p.Cluster != nil +func (p *TGetQueryStatsRequest) IsSetCatalog() bool { + return p.Catalog != nil } -func (p *TCheckAuthRequest) IsSetUserIp() bool { - return p.UserIp != nil +func (p *TGetQueryStatsRequest) IsSetDb() bool { + return p.Db != nil } -func (p *TCheckAuthRequest) IsSetPrivCtrl() bool { - return p.PrivCtrl != nil +func (p *TGetQueryStatsRequest) IsSetTbl() bool { + return p.Tbl != nil } -func (p *TCheckAuthRequest) IsSetPrivType() bool { - return p.PrivType != nil +func (p *TGetQueryStatsRequest) IsSetReplicaId() bool { + return p.ReplicaId != nil } -func (p *TCheckAuthRequest) IsSetThriftRpcTimeoutMs() bool { - return p.ThriftRpcTimeoutMs != nil +func (p *TGetQueryStatsRequest) IsSetReplicaIds() bool { + return p.ReplicaIds != nil } -func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *TGetQueryStatsRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetUser bool = false - var issetPasswd bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -50769,7 +45698,7 @@ func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I32 { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } @@ -50781,7 +45710,6 @@ func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } - issetUser = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -50790,7 +45718,6 @@ func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } - issetPasswd = true } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -50803,7 +45730,7 @@ func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 5: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { if err = p.ReadField5(iprot); err != nil { goto ReadFieldError } @@ -50811,21 +45738,13 @@ func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 6: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.LIST { if err = p.ReadField6(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 7: - if fieldTypeId == thrift.I64 { - if err = p.ReadField7(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -50839,22 +45758,13 @@ func (p *TCheckAuthRequest) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetUser { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetPasswd { - fieldId = 3 - goto RequiredFieldNotSetError - } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetQueryStatsRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -50862,44 +45772,43 @@ ReadFieldEndError: return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthRequest[fieldId])) } -func (p *TCheckAuthRequest) ReadField1(iprot thrift.TProtocol) error { +func (p *TGetQueryStatsRequest) ReadField1(iprot thrift.TProtocol) error { - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _field *TQueryStatsType + if v, err := iprot.ReadI32(); err != nil { return err } else { - _field = &v + tmp := TQueryStatsType(v) + _field = &tmp } - p.Cluster = _field + p.Type = _field return nil } -func (p *TCheckAuthRequest) ReadField2(iprot thrift.TProtocol) error { +func (p *TGetQueryStatsRequest) ReadField2(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.User = _field + p.Catalog = _field return nil } -func (p *TCheckAuthRequest) ReadField3(iprot thrift.TProtocol) error { +func (p *TGetQueryStatsRequest) ReadField3(iprot thrift.TProtocol) error { - var _field string + var _field *string if v, err := iprot.ReadString(); err != nil { return err } else { - _field = v + _field = &v } - p.Passwd = _field + p.Db = _field return nil } -func (p *TCheckAuthRequest) ReadField4(iprot thrift.TProtocol) error { +func (p *TGetQueryStatsRequest) ReadField4(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -50907,44 +45816,47 @@ func (p *TCheckAuthRequest) ReadField4(iprot thrift.TProtocol) error { } else { _field = &v } - p.UserIp = _field - return nil -} -func (p *TCheckAuthRequest) ReadField5(iprot thrift.TProtocol) error { - _field := NewTPrivilegeCtrl() - if err := _field.Read(iprot); err != nil { - return err - } - p.PrivCtrl = _field + p.Tbl = _field return nil } -func (p *TCheckAuthRequest) ReadField6(iprot thrift.TProtocol) error { +func (p *TGetQueryStatsRequest) ReadField5(iprot thrift.TProtocol) error { - var _field *TPrivilegeType - if v, err := iprot.ReadI32(); err != nil { + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { return err } else { - tmp := TPrivilegeType(v) - _field = &tmp + _field = &v } - p.PrivType = _field + p.ReplicaId = _field return nil } -func (p *TCheckAuthRequest) ReadField7(iprot thrift.TProtocol) error { +func (p *TGetQueryStatsRequest) ReadField6(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]int64, 0, size) + for i := 0; i < size; i++ { - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { + var _elem int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _elem = v + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = &v } - p.ThriftRpcTimeoutMs = _field + p.ReplicaIds = _field return nil } -func (p *TCheckAuthRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *TGetQueryStatsRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TCheckAuthRequest"); err != nil { + if err = oprot.WriteStructBegin("TGetQueryStatsRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -50972,10 +45884,6 @@ func (p *TCheckAuthRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 6 goto WriteFieldError } - if err = p.writeField7(oprot); err != nil { - fieldId = 7 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -50994,12 +45902,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TCheckAuthRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetCluster() { - if err = oprot.WriteFieldBegin("cluster", thrift.STRING, 1); err != nil { +func (p *TGetQueryStatsRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetType() { + if err = oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Cluster); err != nil { + if err := oprot.WriteI32(int32(*p.Type)); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -51013,15 +45921,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TCheckAuthRequest) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.User); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *TGetQueryStatsRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCatalog() { + if err = oprot.WriteFieldBegin("catalog", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Catalog); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -51030,15 +45940,17 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TCheckAuthRequest) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("passwd", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(p.Passwd); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError +func (p *TGetQueryStatsRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetDb() { + if err = oprot.WriteFieldBegin("db", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Db); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: @@ -51047,12 +45959,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *TCheckAuthRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetUserIp() { - if err = oprot.WriteFieldBegin("user_ip", thrift.STRING, 4); err != nil { +func (p *TGetQueryStatsRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTbl() { + if err = oprot.WriteFieldBegin("tbl", thrift.STRING, 4); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.UserIp); err != nil { + if err := oprot.WriteString(*p.Tbl); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -51066,12 +45978,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *TCheckAuthRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetPrivCtrl() { - if err = oprot.WriteFieldBegin("priv_ctrl", thrift.STRUCT, 5); err != nil { +func (p *TGetQueryStatsRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetReplicaId() { + if err = oprot.WriteFieldBegin("replica_id", thrift.I64, 5); err != nil { goto WriteFieldBeginError } - if err := p.PrivCtrl.Write(oprot); err != nil { + if err := oprot.WriteI64(*p.ReplicaId); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -51085,31 +45997,20 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) } -func (p *TCheckAuthRequest) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetPrivType() { - if err = oprot.WriteFieldBegin("priv_type", thrift.I32, 6); err != nil { +func (p *TGetQueryStatsRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetReplicaIds() { + if err = oprot.WriteFieldBegin("replica_ids", thrift.LIST, 6); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI32(int32(*p.PrivType)); err != nil { + if err := oprot.WriteListBegin(thrift.I64, len(p.ReplicaIds)); err != nil { return err } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *TCheckAuthRequest) writeField7(oprot thrift.TProtocol) (err error) { - if p.IsSetThriftRpcTimeoutMs() { - if err = oprot.WriteFieldBegin("thrift_rpc_timeout_ms", thrift.I64, 7); err != nil { - goto WriteFieldBeginError + for _, v := range p.ReplicaIds { + if err := oprot.WriteI64(v); err != nil { + return err + } } - if err := oprot.WriteI64(*p.ThriftRpcTimeoutMs); err != nil { + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -51118,155 +46019,191 @@ func (p *TCheckAuthRequest) writeField7(oprot thrift.TProtocol) (err error) { } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) } -func (p *TCheckAuthRequest) String() string { +func (p *TGetQueryStatsRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("TCheckAuthRequest(%+v)", *p) + return fmt.Sprintf("TGetQueryStatsRequest(%+v)", *p) } -func (p *TCheckAuthRequest) DeepEqual(ano *TCheckAuthRequest) bool { +func (p *TGetQueryStatsRequest) DeepEqual(ano *TGetQueryStatsRequest) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Cluster) { - return false - } - if !p.Field2DeepEqual(ano.User) { + if !p.Field1DeepEqual(ano.Type) { return false } - if !p.Field3DeepEqual(ano.Passwd) { + if !p.Field2DeepEqual(ano.Catalog) { return false } - if !p.Field4DeepEqual(ano.UserIp) { + if !p.Field3DeepEqual(ano.Db) { return false } - if !p.Field5DeepEqual(ano.PrivCtrl) { + if !p.Field4DeepEqual(ano.Tbl) { return false } - if !p.Field6DeepEqual(ano.PrivType) { + if !p.Field5DeepEqual(ano.ReplicaId) { return false } - if !p.Field7DeepEqual(ano.ThriftRpcTimeoutMs) { + if !p.Field6DeepEqual(ano.ReplicaIds) { return false } return true } -func (p *TCheckAuthRequest) Field1DeepEqual(src *string) bool { +func (p *TGetQueryStatsRequest) Field1DeepEqual(src *TQueryStatsType) bool { - if p.Cluster == src { + if p.Type == src { return true - } else if p.Cluster == nil || src == nil { + } else if p.Type == nil || src == nil { return false } - if strings.Compare(*p.Cluster, *src) != 0 { + if *p.Type != *src { return false } return true } -func (p *TCheckAuthRequest) Field2DeepEqual(src string) bool { +func (p *TGetQueryStatsRequest) Field2DeepEqual(src *string) bool { - if strings.Compare(p.User, src) != 0 { + if p.Catalog == src { + return true + } else if p.Catalog == nil || src == nil { return false } - return true -} -func (p *TCheckAuthRequest) Field3DeepEqual(src string) bool { - - if strings.Compare(p.Passwd, src) != 0 { + if strings.Compare(*p.Catalog, *src) != 0 { return false } return true } -func (p *TCheckAuthRequest) Field4DeepEqual(src *string) bool { +func (p *TGetQueryStatsRequest) Field3DeepEqual(src *string) bool { - if p.UserIp == src { + if p.Db == src { return true - } else if p.UserIp == nil || src == nil { + } else if p.Db == nil || src == nil { return false } - if strings.Compare(*p.UserIp, *src) != 0 { + if strings.Compare(*p.Db, *src) != 0 { return false } return true } -func (p *TCheckAuthRequest) Field5DeepEqual(src *TPrivilegeCtrl) bool { +func (p *TGetQueryStatsRequest) Field4DeepEqual(src *string) bool { - if !p.PrivCtrl.DeepEqual(src) { + if p.Tbl == src { + return true + } else if p.Tbl == nil || src == nil { + return false + } + if strings.Compare(*p.Tbl, *src) != 0 { return false } return true } -func (p *TCheckAuthRequest) Field6DeepEqual(src *TPrivilegeType) bool { +func (p *TGetQueryStatsRequest) Field5DeepEqual(src *int64) bool { - if p.PrivType == src { + if p.ReplicaId == src { return true - } else if p.PrivType == nil || src == nil { + } else if p.ReplicaId == nil || src == nil { return false } - if *p.PrivType != *src { + if *p.ReplicaId != *src { return false } return true } -func (p *TCheckAuthRequest) Field7DeepEqual(src *int64) bool { +func (p *TGetQueryStatsRequest) Field6DeepEqual(src []int64) bool { - if p.ThriftRpcTimeoutMs == src { - return true - } else if p.ThriftRpcTimeoutMs == nil || src == nil { + if len(p.ReplicaIds) != len(src) { return false } - if *p.ThriftRpcTimeoutMs != *src { - return false + for i, v := range p.ReplicaIds { + _src := src[i] + if v != _src { + return false + } } return true } -type TCheckAuthResult_ struct { - Status *status.TStatus `thrift:"status,1,required" frugal:"1,required,status.TStatus" json:"status"` +type TTableQueryStats struct { + Field *string `thrift:"field,1,optional" frugal:"1,optional,string" json:"field,omitempty"` + QueryStats *int64 `thrift:"query_stats,2,optional" frugal:"2,optional,i64" json:"query_stats,omitempty"` + FilterStats *int64 `thrift:"filter_stats,3,optional" frugal:"3,optional,i64" json:"filter_stats,omitempty"` } -func NewTCheckAuthResult_() *TCheckAuthResult_ { - return &TCheckAuthResult_{} +func NewTTableQueryStats() *TTableQueryStats { + return &TTableQueryStats{} } -func (p *TCheckAuthResult_) InitDefault() { +func (p *TTableQueryStats) InitDefault() { } -var TCheckAuthResult__Status_DEFAULT *status.TStatus +var TTableQueryStats_Field_DEFAULT string -func (p *TCheckAuthResult_) GetStatus() (v *status.TStatus) { - if !p.IsSetStatus() { - return TCheckAuthResult__Status_DEFAULT +func (p *TTableQueryStats) GetField() (v string) { + if !p.IsSetField() { + return TTableQueryStats_Field_DEFAULT } - return p.Status + return *p.Field } -func (p *TCheckAuthResult_) SetStatus(val *status.TStatus) { - p.Status = val + +var TTableQueryStats_QueryStats_DEFAULT int64 + +func (p *TTableQueryStats) GetQueryStats() (v int64) { + if !p.IsSetQueryStats() { + return TTableQueryStats_QueryStats_DEFAULT + } + return *p.QueryStats } -var fieldIDToName_TCheckAuthResult_ = map[int16]string{ - 1: "status", +var TTableQueryStats_FilterStats_DEFAULT int64 + +func (p *TTableQueryStats) GetFilterStats() (v int64) { + if !p.IsSetFilterStats() { + return TTableQueryStats_FilterStats_DEFAULT + } + return *p.FilterStats +} +func (p *TTableQueryStats) SetField(val *string) { + p.Field = val +} +func (p *TTableQueryStats) SetQueryStats(val *int64) { + p.QueryStats = val +} +func (p *TTableQueryStats) SetFilterStats(val *int64) { + p.FilterStats = val } -func (p *TCheckAuthResult_) IsSetStatus() bool { - return p.Status != nil +var fieldIDToName_TTableQueryStats = map[int16]string{ + 1: "field", + 2: "query_stats", + 3: "filter_stats", } -func (p *TCheckAuthResult_) Read(iprot thrift.TProtocol) (err error) { +func (p *TTableQueryStats) IsSetField() bool { + return p.Field != nil +} + +func (p *TTableQueryStats) IsSetQueryStats() bool { + return p.QueryStats != nil +} + +func (p *TTableQueryStats) IsSetFilterStats() bool { + return p.FilterStats != nil +} + +func (p *TTableQueryStats) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 - var issetStatus bool = false if _, err = iprot.ReadStructBegin(); err != nil { goto ReadStructBeginError @@ -51283,11 +46220,26 @@ func (p *TCheckAuthResult_) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.STRING { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } - issetStatus = true + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.I64 { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.I64 { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } @@ -51304,17 +46256,13 @@ func (p *TCheckAuthResult_) Read(iprot thrift.TProtocol) (err error) { goto ReadStructEndError } - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } return nil ReadStructBeginError: return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthResult_[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableQueryStats[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -51322,22 +46270,45 @@ ReadFieldEndError: return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthResult_[fieldId])) } -func (p *TCheckAuthResult_) ReadField1(iprot thrift.TProtocol) error { - _field := status.NewTStatus() - if err := _field.Read(iprot); err != nil { +func (p *TTableQueryStats) ReadField1(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - p.Status = _field + p.Field = _field return nil } +func (p *TTableQueryStats) ReadField2(iprot thrift.TProtocol) error { -func (p *TCheckAuthResult_) Write(oprot thrift.TProtocol) (err error) { + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.QueryStats = _field + return nil +} +func (p *TTableQueryStats) ReadField3(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.FilterStats = _field + return nil +} + +func (p *TTableQueryStats) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TCheckAuthResult"); err != nil { + if err = oprot.WriteStructBegin("TTableQueryStats"); err != nil { goto WriteStructBeginError } if p != nil { @@ -51345,6 +46316,14 @@ func (p *TCheckAuthResult_) Write(oprot thrift.TProtocol) (err error) { fieldId = 1 goto WriteFieldError } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -51363,173 +46342,176 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TCheckAuthResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError +func (p *TTableQueryStats) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetField() { + if err = oprot.WriteFieldBegin("field", thrift.STRING, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Field); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - if err := p.Status.Write(oprot); err != nil { - return err + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *TTableQueryStats) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetQueryStats() { + if err = oprot.WriteFieldBegin("query_stats", thrift.I64, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.QueryStats); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *TTableQueryStats) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetFilterStats() { + if err = oprot.WriteFieldBegin("filter_stats", thrift.I64, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.FilterStats); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *TCheckAuthResult_) String() string { +func (p *TTableQueryStats) String() string { if p == nil { return "" } - return fmt.Sprintf("TCheckAuthResult_(%+v)", *p) + return fmt.Sprintf("TTableQueryStats(%+v)", *p) } -func (p *TCheckAuthResult_) DeepEqual(ano *TCheckAuthResult_) bool { +func (p *TTableQueryStats) DeepEqual(ano *TTableQueryStats) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Status) { + if !p.Field1DeepEqual(ano.Field) { + return false + } + if !p.Field2DeepEqual(ano.QueryStats) { + return false + } + if !p.Field3DeepEqual(ano.FilterStats) { return false } return true } -func (p *TCheckAuthResult_) Field1DeepEqual(src *status.TStatus) bool { +func (p *TTableQueryStats) Field1DeepEqual(src *string) bool { - if !p.Status.DeepEqual(src) { + if p.Field == src { + return true + } else if p.Field == nil || src == nil { + return false + } + if strings.Compare(*p.Field, *src) != 0 { return false } return true } +func (p *TTableQueryStats) Field2DeepEqual(src *int64) bool { -type TGetQueryStatsRequest struct { - Type *TQueryStatsType `thrift:"type,1,optional" frugal:"1,optional,TQueryStatsType" json:"type,omitempty"` - Catalog *string `thrift:"catalog,2,optional" frugal:"2,optional,string" json:"catalog,omitempty"` - Db *string `thrift:"db,3,optional" frugal:"3,optional,string" json:"db,omitempty"` - Tbl *string `thrift:"tbl,4,optional" frugal:"4,optional,string" json:"tbl,omitempty"` - ReplicaId *int64 `thrift:"replica_id,5,optional" frugal:"5,optional,i64" json:"replica_id,omitempty"` - ReplicaIds []int64 `thrift:"replica_ids,6,optional" frugal:"6,optional,list" json:"replica_ids,omitempty"` -} - -func NewTGetQueryStatsRequest() *TGetQueryStatsRequest { - return &TGetQueryStatsRequest{} -} - -func (p *TGetQueryStatsRequest) InitDefault() { -} - -var TGetQueryStatsRequest_Type_DEFAULT TQueryStatsType - -func (p *TGetQueryStatsRequest) GetType() (v TQueryStatsType) { - if !p.IsSetType() { - return TGetQueryStatsRequest_Type_DEFAULT + if p.QueryStats == src { + return true + } else if p.QueryStats == nil || src == nil { + return false } - return *p.Type -} - -var TGetQueryStatsRequest_Catalog_DEFAULT string - -func (p *TGetQueryStatsRequest) GetCatalog() (v string) { - if !p.IsSetCatalog() { - return TGetQueryStatsRequest_Catalog_DEFAULT + if *p.QueryStats != *src { + return false } - return *p.Catalog + return true } +func (p *TTableQueryStats) Field3DeepEqual(src *int64) bool { -var TGetQueryStatsRequest_Db_DEFAULT string - -func (p *TGetQueryStatsRequest) GetDb() (v string) { - if !p.IsSetDb() { - return TGetQueryStatsRequest_Db_DEFAULT + if p.FilterStats == src { + return true + } else if p.FilterStats == nil || src == nil { + return false } - return *p.Db + if *p.FilterStats != *src { + return false + } + return true } -var TGetQueryStatsRequest_Tbl_DEFAULT string - -func (p *TGetQueryStatsRequest) GetTbl() (v string) { - if !p.IsSetTbl() { - return TGetQueryStatsRequest_Tbl_DEFAULT - } - return *p.Tbl +type TTableIndexQueryStats struct { + IndexName *string `thrift:"index_name,1,optional" frugal:"1,optional,string" json:"index_name,omitempty"` + TableStats []*TTableQueryStats `thrift:"table_stats,2,optional" frugal:"2,optional,list" json:"table_stats,omitempty"` } -var TGetQueryStatsRequest_ReplicaId_DEFAULT int64 +func NewTTableIndexQueryStats() *TTableIndexQueryStats { + return &TTableIndexQueryStats{} +} -func (p *TGetQueryStatsRequest) GetReplicaId() (v int64) { - if !p.IsSetReplicaId() { - return TGetQueryStatsRequest_ReplicaId_DEFAULT - } - return *p.ReplicaId +func (p *TTableIndexQueryStats) InitDefault() { } -var TGetQueryStatsRequest_ReplicaIds_DEFAULT []int64 +var TTableIndexQueryStats_IndexName_DEFAULT string -func (p *TGetQueryStatsRequest) GetReplicaIds() (v []int64) { - if !p.IsSetReplicaIds() { - return TGetQueryStatsRequest_ReplicaIds_DEFAULT +func (p *TTableIndexQueryStats) GetIndexName() (v string) { + if !p.IsSetIndexName() { + return TTableIndexQueryStats_IndexName_DEFAULT } - return p.ReplicaIds -} -func (p *TGetQueryStatsRequest) SetType(val *TQueryStatsType) { - p.Type = val -} -func (p *TGetQueryStatsRequest) SetCatalog(val *string) { - p.Catalog = val -} -func (p *TGetQueryStatsRequest) SetDb(val *string) { - p.Db = val -} -func (p *TGetQueryStatsRequest) SetTbl(val *string) { - p.Tbl = val -} -func (p *TGetQueryStatsRequest) SetReplicaId(val *int64) { - p.ReplicaId = val -} -func (p *TGetQueryStatsRequest) SetReplicaIds(val []int64) { - p.ReplicaIds = val + return *p.IndexName } -var fieldIDToName_TGetQueryStatsRequest = map[int16]string{ - 1: "type", - 2: "catalog", - 3: "db", - 4: "tbl", - 5: "replica_id", - 6: "replica_ids", -} +var TTableIndexQueryStats_TableStats_DEFAULT []*TTableQueryStats -func (p *TGetQueryStatsRequest) IsSetType() bool { - return p.Type != nil +func (p *TTableIndexQueryStats) GetTableStats() (v []*TTableQueryStats) { + if !p.IsSetTableStats() { + return TTableIndexQueryStats_TableStats_DEFAULT + } + return p.TableStats } - -func (p *TGetQueryStatsRequest) IsSetCatalog() bool { - return p.Catalog != nil +func (p *TTableIndexQueryStats) SetIndexName(val *string) { + p.IndexName = val } - -func (p *TGetQueryStatsRequest) IsSetDb() bool { - return p.Db != nil +func (p *TTableIndexQueryStats) SetTableStats(val []*TTableQueryStats) { + p.TableStats = val } -func (p *TGetQueryStatsRequest) IsSetTbl() bool { - return p.Tbl != nil +var fieldIDToName_TTableIndexQueryStats = map[int16]string{ + 1: "index_name", + 2: "table_stats", } -func (p *TGetQueryStatsRequest) IsSetReplicaId() bool { - return p.ReplicaId != nil +func (p *TTableIndexQueryStats) IsSetIndexName() bool { + return p.IndexName != nil } -func (p *TGetQueryStatsRequest) IsSetReplicaIds() bool { - return p.ReplicaIds != nil +func (p *TTableIndexQueryStats) IsSetTableStats() bool { + return p.TableStats != nil } -func (p *TGetQueryStatsRequest) Read(iprot thrift.TProtocol) (err error) { +func (p *TTableIndexQueryStats) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -51549,7 +46531,7 @@ func (p *TGetQueryStatsRequest) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } @@ -51557,40 +46539,8 @@ func (p *TGetQueryStatsRequest) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.STRING { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.STRING { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRING { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.I64 { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: if fieldTypeId == thrift.LIST { - if err = p.ReadField6(iprot); err != nil { + if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { @@ -51615,7 +46565,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetQueryStatsRequest[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableIndexQueryStats[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -51625,41 +46575,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TGetQueryStatsRequest) ReadField1(iprot thrift.TProtocol) error { - - var _field *TQueryStatsType - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - tmp := TQueryStatsType(v) - _field = &tmp - } - p.Type = _field - return nil -} -func (p *TGetQueryStatsRequest) ReadField2(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Catalog = _field - return nil -} -func (p *TGetQueryStatsRequest) ReadField3(iprot thrift.TProtocol) error { - - var _field *string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _field = &v - } - p.Db = _field - return nil -} -func (p *TGetQueryStatsRequest) ReadField4(iprot thrift.TProtocol) error { +func (p *TTableIndexQueryStats) ReadField1(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -51667,33 +46583,22 @@ func (p *TGetQueryStatsRequest) ReadField4(iprot thrift.TProtocol) error { } else { _field = &v } - p.Tbl = _field - return nil -} -func (p *TGetQueryStatsRequest) ReadField5(iprot thrift.TProtocol) error { - - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = &v - } - p.ReplicaId = _field + p.IndexName = _field return nil } -func (p *TGetQueryStatsRequest) ReadField6(iprot thrift.TProtocol) error { +func (p *TTableIndexQueryStats) ReadField2(iprot thrift.TProtocol) error { _, size, err := iprot.ReadListBegin() if err != nil { return err } - _field := make([]int64, 0, size) + _field := make([]*TTableQueryStats, 0, size) + values := make([]TTableQueryStats, size) for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() - var _elem int64 - if v, err := iprot.ReadI64(); err != nil { + if err := _elem.Read(iprot); err != nil { return err - } else { - _elem = v } _field = append(_field, _elem) @@ -51701,13 +46606,13 @@ func (p *TGetQueryStatsRequest) ReadField6(iprot thrift.TProtocol) error { if err := iprot.ReadListEnd(); err != nil { return err } - p.ReplicaIds = _field + p.TableStats = _field return nil } -func (p *TGetQueryStatsRequest) Write(oprot thrift.TProtocol) (err error) { +func (p *TTableIndexQueryStats) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TGetQueryStatsRequest"); err != nil { + if err = oprot.WriteStructBegin("TTableIndexQueryStats"); err != nil { goto WriteStructBeginError } if p != nil { @@ -51719,22 +46624,6 @@ func (p *TGetQueryStatsRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -51753,12 +46642,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TGetQueryStatsRequest) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetType() { - if err = oprot.WriteFieldBegin("type", thrift.I32, 1); err != nil { +func (p *TTableIndexQueryStats) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetIndexName() { + if err = oprot.WriteFieldBegin("index_name", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI32(int32(*p.Type)); err != nil { + if err := oprot.WriteString(*p.IndexName); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -51772,92 +46661,16 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TGetQueryStatsRequest) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetCatalog() { - if err = oprot.WriteFieldBegin("catalog", thrift.STRING, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Catalog); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TGetQueryStatsRequest) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetDb() { - if err = oprot.WriteFieldBegin("db", thrift.STRING, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Db); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TGetQueryStatsRequest) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetTbl() { - if err = oprot.WriteFieldBegin("tbl", thrift.STRING, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteString(*p.Tbl); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TGetQueryStatsRequest) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetReplicaId() { - if err = oprot.WriteFieldBegin("replica_id", thrift.I64, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(*p.ReplicaId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TGetQueryStatsRequest) writeField6(oprot thrift.TProtocol) (err error) { - if p.IsSetReplicaIds() { - if err = oprot.WriteFieldBegin("replica_ids", thrift.LIST, 6); err != nil { +func (p *TTableIndexQueryStats) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetTableStats() { + if err = oprot.WriteFieldBegin("table_stats", thrift.LIST, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.I64, len(p.ReplicaIds)); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableStats)); err != nil { return err } - for _, v := range p.ReplicaIds { - if err := oprot.WriteI64(v); err != nil { + for _, v := range p.TableStats { + if err := v.Write(oprot); err != nil { return err } } @@ -51870,188 +46683,164 @@ func (p *TGetQueryStatsRequest) writeField6(oprot thrift.TProtocol) (err error) } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TGetQueryStatsRequest) String() string { +func (p *TTableIndexQueryStats) String() string { if p == nil { return "" } - return fmt.Sprintf("TGetQueryStatsRequest(%+v)", *p) + return fmt.Sprintf("TTableIndexQueryStats(%+v)", *p) } -func (p *TGetQueryStatsRequest) DeepEqual(ano *TGetQueryStatsRequest) bool { +func (p *TTableIndexQueryStats) DeepEqual(ano *TTableIndexQueryStats) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Type) { - return false - } - if !p.Field2DeepEqual(ano.Catalog) { - return false - } - if !p.Field3DeepEqual(ano.Db) { - return false - } - if !p.Field4DeepEqual(ano.Tbl) { - return false - } - if !p.Field5DeepEqual(ano.ReplicaId) { + if !p.Field1DeepEqual(ano.IndexName) { return false } - if !p.Field6DeepEqual(ano.ReplicaIds) { + if !p.Field2DeepEqual(ano.TableStats) { return false } return true } -func (p *TGetQueryStatsRequest) Field1DeepEqual(src *TQueryStatsType) bool { +func (p *TTableIndexQueryStats) Field1DeepEqual(src *string) bool { - if p.Type == src { + if p.IndexName == src { return true - } else if p.Type == nil || src == nil { + } else if p.IndexName == nil || src == nil { return false } - if *p.Type != *src { + if strings.Compare(*p.IndexName, *src) != 0 { return false } return true } -func (p *TGetQueryStatsRequest) Field2DeepEqual(src *string) bool { +func (p *TTableIndexQueryStats) Field2DeepEqual(src []*TTableQueryStats) bool { - if p.Catalog == src { - return true - } else if p.Catalog == nil || src == nil { + if len(p.TableStats) != len(src) { return false } - if strings.Compare(*p.Catalog, *src) != 0 { - return false + for i, v := range p.TableStats { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } } return true } -func (p *TGetQueryStatsRequest) Field3DeepEqual(src *string) bool { - if p.Db == src { - return true - } else if p.Db == nil || src == nil { - return false - } - if strings.Compare(*p.Db, *src) != 0 { - return false - } - return true +type TQueryStatsResult_ struct { + Status *status.TStatus `thrift:"status,1,optional" frugal:"1,optional,status.TStatus" json:"status,omitempty"` + SimpleResult_ map[string]int64 `thrift:"simple_result,2,optional" frugal:"2,optional,map" json:"simple_result,omitempty"` + TableStats []*TTableQueryStats `thrift:"table_stats,3,optional" frugal:"3,optional,list" json:"table_stats,omitempty"` + TableVerbosStats []*TTableIndexQueryStats `thrift:"table_verbos_stats,4,optional" frugal:"4,optional,list" json:"table_verbos_stats,omitempty"` + TabletStats map[int64]int64 `thrift:"tablet_stats,5,optional" frugal:"5,optional,map" json:"tablet_stats,omitempty"` } -func (p *TGetQueryStatsRequest) Field4DeepEqual(src *string) bool { - if p.Tbl == src { - return true - } else if p.Tbl == nil || src == nil { - return false - } - if strings.Compare(*p.Tbl, *src) != 0 { - return false - } - return true +func NewTQueryStatsResult_() *TQueryStatsResult_ { + return &TQueryStatsResult_{} } -func (p *TGetQueryStatsRequest) Field5DeepEqual(src *int64) bool { - if p.ReplicaId == src { - return true - } else if p.ReplicaId == nil || src == nil { - return false - } - if *p.ReplicaId != *src { - return false - } - return true +func (p *TQueryStatsResult_) InitDefault() { } -func (p *TGetQueryStatsRequest) Field6DeepEqual(src []int64) bool { - if len(p.ReplicaIds) != len(src) { - return false - } - for i, v := range p.ReplicaIds { - _src := src[i] - if v != _src { - return false - } - } - return true -} +var TQueryStatsResult__Status_DEFAULT *status.TStatus -type TTableQueryStats struct { - Field *string `thrift:"field,1,optional" frugal:"1,optional,string" json:"field,omitempty"` - QueryStats *int64 `thrift:"query_stats,2,optional" frugal:"2,optional,i64" json:"query_stats,omitempty"` - FilterStats *int64 `thrift:"filter_stats,3,optional" frugal:"3,optional,i64" json:"filter_stats,omitempty"` +func (p *TQueryStatsResult_) GetStatus() (v *status.TStatus) { + if !p.IsSetStatus() { + return TQueryStatsResult__Status_DEFAULT + } + return p.Status } -func NewTTableQueryStats() *TTableQueryStats { - return &TTableQueryStats{} -} +var TQueryStatsResult__SimpleResult__DEFAULT map[string]int64 -func (p *TTableQueryStats) InitDefault() { +func (p *TQueryStatsResult_) GetSimpleResult_() (v map[string]int64) { + if !p.IsSetSimpleResult_() { + return TQueryStatsResult__SimpleResult__DEFAULT + } + return p.SimpleResult_ } -var TTableQueryStats_Field_DEFAULT string +var TQueryStatsResult__TableStats_DEFAULT []*TTableQueryStats -func (p *TTableQueryStats) GetField() (v string) { - if !p.IsSetField() { - return TTableQueryStats_Field_DEFAULT +func (p *TQueryStatsResult_) GetTableStats() (v []*TTableQueryStats) { + if !p.IsSetTableStats() { + return TQueryStatsResult__TableStats_DEFAULT } - return *p.Field + return p.TableStats } -var TTableQueryStats_QueryStats_DEFAULT int64 +var TQueryStatsResult__TableVerbosStats_DEFAULT []*TTableIndexQueryStats -func (p *TTableQueryStats) GetQueryStats() (v int64) { - if !p.IsSetQueryStats() { - return TTableQueryStats_QueryStats_DEFAULT +func (p *TQueryStatsResult_) GetTableVerbosStats() (v []*TTableIndexQueryStats) { + if !p.IsSetTableVerbosStats() { + return TQueryStatsResult__TableVerbosStats_DEFAULT } - return *p.QueryStats + return p.TableVerbosStats } -var TTableQueryStats_FilterStats_DEFAULT int64 +var TQueryStatsResult__TabletStats_DEFAULT map[int64]int64 -func (p *TTableQueryStats) GetFilterStats() (v int64) { - if !p.IsSetFilterStats() { - return TTableQueryStats_FilterStats_DEFAULT +func (p *TQueryStatsResult_) GetTabletStats() (v map[int64]int64) { + if !p.IsSetTabletStats() { + return TQueryStatsResult__TabletStats_DEFAULT } - return *p.FilterStats + return p.TabletStats } -func (p *TTableQueryStats) SetField(val *string) { - p.Field = val +func (p *TQueryStatsResult_) SetStatus(val *status.TStatus) { + p.Status = val } -func (p *TTableQueryStats) SetQueryStats(val *int64) { - p.QueryStats = val +func (p *TQueryStatsResult_) SetSimpleResult_(val map[string]int64) { + p.SimpleResult_ = val } -func (p *TTableQueryStats) SetFilterStats(val *int64) { - p.FilterStats = val +func (p *TQueryStatsResult_) SetTableStats(val []*TTableQueryStats) { + p.TableStats = val +} +func (p *TQueryStatsResult_) SetTableVerbosStats(val []*TTableIndexQueryStats) { + p.TableVerbosStats = val +} +func (p *TQueryStatsResult_) SetTabletStats(val map[int64]int64) { + p.TabletStats = val } -var fieldIDToName_TTableQueryStats = map[int16]string{ - 1: "field", - 2: "query_stats", - 3: "filter_stats", +var fieldIDToName_TQueryStatsResult_ = map[int16]string{ + 1: "status", + 2: "simple_result", + 3: "table_stats", + 4: "table_verbos_stats", + 5: "tablet_stats", } -func (p *TTableQueryStats) IsSetField() bool { - return p.Field != nil +func (p *TQueryStatsResult_) IsSetStatus() bool { + return p.Status != nil } -func (p *TTableQueryStats) IsSetQueryStats() bool { - return p.QueryStats != nil +func (p *TQueryStatsResult_) IsSetSimpleResult_() bool { + return p.SimpleResult_ != nil } -func (p *TTableQueryStats) IsSetFilterStats() bool { - return p.FilterStats != nil +func (p *TQueryStatsResult_) IsSetTableStats() bool { + return p.TableStats != nil } -func (p *TTableQueryStats) Read(iprot thrift.TProtocol) (err error) { +func (p *TQueryStatsResult_) IsSetTableVerbosStats() bool { + return p.TableVerbosStats != nil +} + +func (p *TQueryStatsResult_) IsSetTabletStats() bool { + return p.TabletStats != nil +} + +func (p *TQueryStatsResult_) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -52071,7 +46860,7 @@ func (p *TTableQueryStats) Read(iprot thrift.TProtocol) (err error) { switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField1(iprot); err != nil { goto ReadFieldError } @@ -52079,7 +46868,7 @@ func (p *TTableQueryStats) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.MAP { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } @@ -52087,13 +46876,29 @@ func (p *TTableQueryStats) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 3: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.LIST { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 4: + if fieldTypeId == thrift.LIST { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.MAP { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -52113,7 +46918,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableQueryStats[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryStatsResult_[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -52123,43 +46928,122 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TTableQueryStats) ReadField1(iprot thrift.TProtocol) error { +func (p *TQueryStatsResult_) ReadField1(iprot thrift.TProtocol) error { + _field := status.NewTStatus() + if err := _field.Read(iprot); err != nil { + return err + } + p.Status = _field + return nil +} +func (p *TQueryStatsResult_) ReadField2(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[string]int64, size) + for i := 0; i < size; i++ { + var _key string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _key = v + } - var _field *string - if v, err := iprot.ReadString(); err != nil { + var _val int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { return err - } else { - _field = &v } - p.Field = _field + p.SimpleResult_ = _field return nil } -func (p *TTableQueryStats) ReadField2(iprot thrift.TProtocol) error { +func (p *TQueryStatsResult_) ReadField3(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*TTableQueryStats, 0, size) + values := make([]TTableQueryStats, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = &v } - p.QueryStats = _field + p.TableStats = _field return nil } -func (p *TTableQueryStats) ReadField3(iprot thrift.TProtocol) error { +func (p *TQueryStatsResult_) ReadField4(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*TTableIndexQueryStats, 0, size) + values := make([]TTableIndexQueryStats, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() - var _field *int64 - if v, err := iprot.ReadI64(); err != nil { + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { return err - } else { - _field = &v } - p.FilterStats = _field + p.TableVerbosStats = _field + return nil +} +func (p *TQueryStatsResult_) ReadField5(iprot thrift.TProtocol) error { + _, _, size, err := iprot.ReadMapBegin() + if err != nil { + return err + } + _field := make(map[int64]int64, size) + for i := 0; i < size; i++ { + var _key int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _key = v + } + + var _val int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _val = v + } + + _field[_key] = _val + } + if err := iprot.ReadMapEnd(); err != nil { + return err + } + p.TabletStats = _field return nil } -func (p *TTableQueryStats) Write(oprot thrift.TProtocol) (err error) { +func (p *TQueryStatsResult_) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TTableQueryStats"); err != nil { + if err = oprot.WriteStructBegin("TQueryStatsResult"); err != nil { goto WriteStructBeginError } if p != nil { @@ -52175,6 +47059,14 @@ func (p *TTableQueryStats) Write(oprot thrift.TProtocol) (err error) { fieldId = 3 goto WriteFieldError } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -52193,12 +47085,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TTableQueryStats) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetField() { - if err = oprot.WriteFieldBegin("field", thrift.STRING, 1); err != nil { +func (p *TQueryStatsResult_) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetStatus() { + if err = oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.Field); err != nil { + if err := p.Status.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -52212,12 +47104,23 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TTableQueryStats) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetQueryStats() { - if err = oprot.WriteFieldBegin("query_stats", thrift.I64, 2); err != nil { +func (p *TQueryStatsResult_) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetSimpleResult_() { + if err = oprot.WriteFieldBegin("simple_result", thrift.MAP, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(*p.QueryStats); err != nil { + if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.SimpleResult_)); err != nil { + return err + } + for k, v := range p.SimpleResult_ { + if err := oprot.WriteString(k); err != nil { + return err + } + if err := oprot.WriteI64(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -52231,12 +47134,20 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TTableQueryStats) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetFilterStats() { - if err = oprot.WriteFieldBegin("filter_stats", thrift.I64, 3); err != nil { +func (p *TQueryStatsResult_) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetTableStats() { + if err = oprot.WriteFieldBegin("table_stats", thrift.LIST, 3); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteI64(*p.FilterStats); err != nil { + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableStats)); err != nil { + return err + } + for _, v := range p.TableStats { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -52250,119 +47161,331 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *TTableQueryStats) String() string { +func (p *TQueryStatsResult_) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTableVerbosStats() { + if err = oprot.WriteFieldBegin("table_verbos_stats", thrift.LIST, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableVerbosStats)); err != nil { + return err + } + for _, v := range p.TableVerbosStats { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TQueryStatsResult_) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetTabletStats() { + if err = oprot.WriteFieldBegin("tablet_stats", thrift.MAP, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteMapBegin(thrift.I64, thrift.I64, len(p.TabletStats)); err != nil { + return err + } + for k, v := range p.TabletStats { + if err := oprot.WriteI64(k); err != nil { + return err + } + if err := oprot.WriteI64(v); err != nil { + return err + } + } + if err := oprot.WriteMapEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *TQueryStatsResult_) String() string { if p == nil { return "" } - return fmt.Sprintf("TTableQueryStats(%+v)", *p) + return fmt.Sprintf("TQueryStatsResult_(%+v)", *p) } -func (p *TTableQueryStats) DeepEqual(ano *TTableQueryStats) bool { +func (p *TQueryStatsResult_) DeepEqual(ano *TQueryStatsResult_) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Field) { + if !p.Field1DeepEqual(ano.Status) { return false } - if !p.Field2DeepEqual(ano.QueryStats) { + if !p.Field2DeepEqual(ano.SimpleResult_) { return false } - if !p.Field3DeepEqual(ano.FilterStats) { + if !p.Field3DeepEqual(ano.TableStats) { + return false + } + if !p.Field4DeepEqual(ano.TableVerbosStats) { + return false + } + if !p.Field5DeepEqual(ano.TabletStats) { return false } return true } -func (p *TTableQueryStats) Field1DeepEqual(src *string) bool { +func (p *TQueryStatsResult_) Field1DeepEqual(src *status.TStatus) bool { - if p.Field == src { - return true - } else if p.Field == nil || src == nil { + if !p.Status.DeepEqual(src) { return false } - if strings.Compare(*p.Field, *src) != 0 { + return true +} +func (p *TQueryStatsResult_) Field2DeepEqual(src map[string]int64) bool { + + if len(p.SimpleResult_) != len(src) { return false } + for k, v := range p.SimpleResult_ { + _src := src[k] + if v != _src { + return false + } + } return true } -func (p *TTableQueryStats) Field2DeepEqual(src *int64) bool { +func (p *TQueryStatsResult_) Field3DeepEqual(src []*TTableQueryStats) bool { - if p.QueryStats == src { - return true - } else if p.QueryStats == nil || src == nil { + if len(p.TableStats) != len(src) { return false } - if *p.QueryStats != *src { - return false + for i, v := range p.TableStats { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } } return true } -func (p *TTableQueryStats) Field3DeepEqual(src *int64) bool { +func (p *TQueryStatsResult_) Field4DeepEqual(src []*TTableIndexQueryStats) bool { - if p.FilterStats == src { - return true - } else if p.FilterStats == nil || src == nil { + if len(p.TableVerbosStats) != len(src) { return false } - if *p.FilterStats != *src { + for i, v := range p.TableVerbosStats { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} +func (p *TQueryStatsResult_) Field5DeepEqual(src map[int64]int64) bool { + + if len(p.TabletStats) != len(src) { return false } + for k, v := range p.TabletStats { + _src := src[k] + if v != _src { + return false + } + } return true } -type TTableIndexQueryStats struct { - IndexName *string `thrift:"index_name,1,optional" frugal:"1,optional,string" json:"index_name,omitempty"` - TableStats []*TTableQueryStats `thrift:"table_stats,2,optional" frugal:"2,optional,list" json:"table_stats,omitempty"` +type TLockBinlogRequest struct { + Cluster *string `thrift:"cluster,1,optional" frugal:"1,optional,string" json:"cluster,omitempty"` + User *string `thrift:"user,2,optional" frugal:"2,optional,string" json:"user,omitempty"` + Passwd *string `thrift:"passwd,3,optional" frugal:"3,optional,string" json:"passwd,omitempty"` + Db *string `thrift:"db,4,optional" frugal:"4,optional,string" json:"db,omitempty"` + Table *string `thrift:"table,5,optional" frugal:"5,optional,string" json:"table,omitempty"` + TableId *int64 `thrift:"table_id,6,optional" frugal:"6,optional,i64" json:"table_id,omitempty"` + Token *string `thrift:"token,7,optional" frugal:"7,optional,string" json:"token,omitempty"` + JobUniqueId *string `thrift:"job_unique_id,8,optional" frugal:"8,optional,string" json:"job_unique_id,omitempty"` + LockCommitSeq *int64 `thrift:"lock_commit_seq,9,optional" frugal:"9,optional,i64" json:"lock_commit_seq,omitempty"` } -func NewTTableIndexQueryStats() *TTableIndexQueryStats { - return &TTableIndexQueryStats{} +func NewTLockBinlogRequest() *TLockBinlogRequest { + return &TLockBinlogRequest{} } -func (p *TTableIndexQueryStats) InitDefault() { +func (p *TLockBinlogRequest) InitDefault() { } -var TTableIndexQueryStats_IndexName_DEFAULT string +var TLockBinlogRequest_Cluster_DEFAULT string -func (p *TTableIndexQueryStats) GetIndexName() (v string) { - if !p.IsSetIndexName() { - return TTableIndexQueryStats_IndexName_DEFAULT +func (p *TLockBinlogRequest) GetCluster() (v string) { + if !p.IsSetCluster() { + return TLockBinlogRequest_Cluster_DEFAULT } - return *p.IndexName + return *p.Cluster } -var TTableIndexQueryStats_TableStats_DEFAULT []*TTableQueryStats +var TLockBinlogRequest_User_DEFAULT string -func (p *TTableIndexQueryStats) GetTableStats() (v []*TTableQueryStats) { - if !p.IsSetTableStats() { - return TTableIndexQueryStats_TableStats_DEFAULT +func (p *TLockBinlogRequest) GetUser() (v string) { + if !p.IsSetUser() { + return TLockBinlogRequest_User_DEFAULT } - return p.TableStats + return *p.User } -func (p *TTableIndexQueryStats) SetIndexName(val *string) { - p.IndexName = val + +var TLockBinlogRequest_Passwd_DEFAULT string + +func (p *TLockBinlogRequest) GetPasswd() (v string) { + if !p.IsSetPasswd() { + return TLockBinlogRequest_Passwd_DEFAULT + } + return *p.Passwd } -func (p *TTableIndexQueryStats) SetTableStats(val []*TTableQueryStats) { - p.TableStats = val + +var TLockBinlogRequest_Db_DEFAULT string + +func (p *TLockBinlogRequest) GetDb() (v string) { + if !p.IsSetDb() { + return TLockBinlogRequest_Db_DEFAULT + } + return *p.Db } -var fieldIDToName_TTableIndexQueryStats = map[int16]string{ - 1: "index_name", - 2: "table_stats", +var TLockBinlogRequest_Table_DEFAULT string + +func (p *TLockBinlogRequest) GetTable() (v string) { + if !p.IsSetTable() { + return TLockBinlogRequest_Table_DEFAULT + } + return *p.Table } -func (p *TTableIndexQueryStats) IsSetIndexName() bool { - return p.IndexName != nil +var TLockBinlogRequest_TableId_DEFAULT int64 + +func (p *TLockBinlogRequest) GetTableId() (v int64) { + if !p.IsSetTableId() { + return TLockBinlogRequest_TableId_DEFAULT + } + return *p.TableId } -func (p *TTableIndexQueryStats) IsSetTableStats() bool { - return p.TableStats != nil +var TLockBinlogRequest_Token_DEFAULT string + +func (p *TLockBinlogRequest) GetToken() (v string) { + if !p.IsSetToken() { + return TLockBinlogRequest_Token_DEFAULT + } + return *p.Token } -func (p *TTableIndexQueryStats) Read(iprot thrift.TProtocol) (err error) { +var TLockBinlogRequest_JobUniqueId_DEFAULT string + +func (p *TLockBinlogRequest) GetJobUniqueId() (v string) { + if !p.IsSetJobUniqueId() { + return TLockBinlogRequest_JobUniqueId_DEFAULT + } + return *p.JobUniqueId +} + +var TLockBinlogRequest_LockCommitSeq_DEFAULT int64 + +func (p *TLockBinlogRequest) GetLockCommitSeq() (v int64) { + if !p.IsSetLockCommitSeq() { + return TLockBinlogRequest_LockCommitSeq_DEFAULT + } + return *p.LockCommitSeq +} +func (p *TLockBinlogRequest) SetCluster(val *string) { + p.Cluster = val +} +func (p *TLockBinlogRequest) SetUser(val *string) { + p.User = val +} +func (p *TLockBinlogRequest) SetPasswd(val *string) { + p.Passwd = val +} +func (p *TLockBinlogRequest) SetDb(val *string) { + p.Db = val +} +func (p *TLockBinlogRequest) SetTable(val *string) { + p.Table = val +} +func (p *TLockBinlogRequest) SetTableId(val *int64) { + p.TableId = val +} +func (p *TLockBinlogRequest) SetToken(val *string) { + p.Token = val +} +func (p *TLockBinlogRequest) SetJobUniqueId(val *string) { + p.JobUniqueId = val +} +func (p *TLockBinlogRequest) SetLockCommitSeq(val *int64) { + p.LockCommitSeq = val +} + +var fieldIDToName_TLockBinlogRequest = map[int16]string{ + 1: "cluster", + 2: "user", + 3: "passwd", + 4: "db", + 5: "table", + 6: "table_id", + 7: "token", + 8: "job_unique_id", + 9: "lock_commit_seq", +} + +func (p *TLockBinlogRequest) IsSetCluster() bool { + return p.Cluster != nil +} + +func (p *TLockBinlogRequest) IsSetUser() bool { + return p.User != nil +} + +func (p *TLockBinlogRequest) IsSetPasswd() bool { + return p.Passwd != nil +} + +func (p *TLockBinlogRequest) IsSetDb() bool { + return p.Db != nil +} + +func (p *TLockBinlogRequest) IsSetTable() bool { + return p.Table != nil +} + +func (p *TLockBinlogRequest) IsSetTableId() bool { + return p.TableId != nil +} + +func (p *TLockBinlogRequest) IsSetToken() bool { + return p.Token != nil +} + +func (p *TLockBinlogRequest) IsSetJobUniqueId() bool { + return p.JobUniqueId != nil +} + +func (p *TLockBinlogRequest) IsSetLockCommitSeq() bool { + return p.LockCommitSeq != nil +} + +func (p *TLockBinlogRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -52390,13 +47513,69 @@ func (p *TTableIndexQueryStats) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRING { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I64 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 7: + if fieldTypeId == thrift.STRING { + if err = p.ReadField7(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 8: + if fieldTypeId == thrift.STRING { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 9: + if fieldTypeId == thrift.I64 { + if err = p.ReadField9(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -52416,7 +47595,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableIndexQueryStats[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TLockBinlogRequest[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -52426,7 +47605,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TTableIndexQueryStats) ReadField1(iprot thrift.TProtocol) error { +func (p *TLockBinlogRequest) ReadField1(iprot thrift.TProtocol) error { var _field *string if v, err := iprot.ReadString(); err != nil { @@ -52434,36 +47613,101 @@ func (p *TTableIndexQueryStats) ReadField1(iprot thrift.TProtocol) error { } else { _field = &v } - p.IndexName = _field + p.Cluster = _field return nil } -func (p *TTableIndexQueryStats) ReadField2(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { +func (p *TLockBinlogRequest) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - _field := make([]*TTableQueryStats, 0, size) - values := make([]TTableQueryStats, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() + p.User = _field + return nil +} +func (p *TLockBinlogRequest) ReadField3(iprot thrift.TProtocol) error { - if err := _elem.Read(iprot); err != nil { - return err - } + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Passwd = _field + return nil +} +func (p *TLockBinlogRequest) ReadField4(iprot thrift.TProtocol) error { - _field = append(_field, _elem) + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v } - if err := iprot.ReadListEnd(); err != nil { + p.Db = _field + return nil +} +func (p *TLockBinlogRequest) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { return err + } else { + _field = &v } - p.TableStats = _field + p.Table = _field return nil } +func (p *TLockBinlogRequest) ReadField6(iprot thrift.TProtocol) error { -func (p *TTableIndexQueryStats) Write(oprot thrift.TProtocol) (err error) { + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.TableId = _field + return nil +} +func (p *TLockBinlogRequest) ReadField7(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Token = _field + return nil +} +func (p *TLockBinlogRequest) ReadField8(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.JobUniqueId = _field + return nil +} +func (p *TLockBinlogRequest) ReadField9(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.LockCommitSeq = _field + return nil +} + +func (p *TLockBinlogRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TTableIndexQueryStats"); err != nil { + if err = oprot.WriteStructBegin("TLockBinlogRequest"); err != nil { goto WriteStructBeginError } if p != nil { @@ -52475,6 +47719,34 @@ func (p *TTableIndexQueryStats) Write(oprot thrift.TProtocol) (err error) { fieldId = 2 goto WriteFieldError } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } + if err = p.writeField7(oprot); err != nil { + fieldId = 7 + goto WriteFieldError + } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } + if err = p.writeField9(oprot); err != nil { + fieldId = 9 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -52493,12 +47765,12 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TTableIndexQueryStats) writeField1(oprot thrift.TProtocol) (err error) { - if p.IsSetIndexName() { - if err = oprot.WriteFieldBegin("index_name", thrift.STRING, 1); err != nil { +func (p *TLockBinlogRequest) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetCluster() { + if err = oprot.WriteFieldBegin("cluster", thrift.STRING, 1); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteString(*p.IndexName); err != nil { + if err := oprot.WriteString(*p.Cluster); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -52512,20 +47784,31 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TTableIndexQueryStats) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetTableStats() { - if err = oprot.WriteFieldBegin("table_stats", thrift.LIST, 2); err != nil { +func (p *TLockBinlogRequest) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetUser() { + if err = oprot.WriteFieldBegin("user", thrift.STRING, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableStats)); err != nil { + if err := oprot.WriteString(*p.User); err != nil { return err } - for _, v := range p.TableStats { - if err := v.Write(oprot); err != nil { - return err - } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError } - if err := oprot.WriteListEnd(); err != nil { + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *TLockBinlogRequest) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetPasswd() { + if err = oprot.WriteFieldBegin("passwd", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Passwd); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -52534,164 +47817,346 @@ func (p *TTableIndexQueryStats) writeField2(oprot thrift.TProtocol) (err error) } return nil WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *TTableIndexQueryStats) String() string { +func (p *TLockBinlogRequest) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetDb() { + if err = oprot.WriteFieldBegin("db", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Db); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TLockBinlogRequest) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetTable() { + if err = oprot.WriteFieldBegin("table", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Table); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *TLockBinlogRequest) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetTableId() { + if err = oprot.WriteFieldBegin("table_id", thrift.I64, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.TableId); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + +func (p *TLockBinlogRequest) writeField7(oprot thrift.TProtocol) (err error) { + if p.IsSetToken() { + if err = oprot.WriteFieldBegin("token", thrift.STRING, 7); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Token); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) +} + +func (p *TLockBinlogRequest) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetJobUniqueId() { + if err = oprot.WriteFieldBegin("job_unique_id", thrift.STRING, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.JobUniqueId); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + +func (p *TLockBinlogRequest) writeField9(oprot thrift.TProtocol) (err error) { + if p.IsSetLockCommitSeq() { + if err = oprot.WriteFieldBegin("lock_commit_seq", thrift.I64, 9); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.LockCommitSeq); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) +} + +func (p *TLockBinlogRequest) String() string { if p == nil { return "" } - return fmt.Sprintf("TTableIndexQueryStats(%+v)", *p) + return fmt.Sprintf("TLockBinlogRequest(%+v)", *p) } -func (p *TTableIndexQueryStats) DeepEqual(ano *TTableIndexQueryStats) bool { +func (p *TLockBinlogRequest) DeepEqual(ano *TLockBinlogRequest) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.IndexName) { + if !p.Field1DeepEqual(ano.Cluster) { return false } - if !p.Field2DeepEqual(ano.TableStats) { + if !p.Field2DeepEqual(ano.User) { + return false + } + if !p.Field3DeepEqual(ano.Passwd) { + return false + } + if !p.Field4DeepEqual(ano.Db) { + return false + } + if !p.Field5DeepEqual(ano.Table) { + return false + } + if !p.Field6DeepEqual(ano.TableId) { + return false + } + if !p.Field7DeepEqual(ano.Token) { + return false + } + if !p.Field8DeepEqual(ano.JobUniqueId) { + return false + } + if !p.Field9DeepEqual(ano.LockCommitSeq) { return false } return true } -func (p *TTableIndexQueryStats) Field1DeepEqual(src *string) bool { +func (p *TLockBinlogRequest) Field1DeepEqual(src *string) bool { - if p.IndexName == src { + if p.Cluster == src { return true - } else if p.IndexName == nil || src == nil { + } else if p.Cluster == nil || src == nil { return false } - if strings.Compare(*p.IndexName, *src) != 0 { + if strings.Compare(*p.Cluster, *src) != 0 { return false } return true } -func (p *TTableIndexQueryStats) Field2DeepEqual(src []*TTableQueryStats) bool { +func (p *TLockBinlogRequest) Field2DeepEqual(src *string) bool { - if len(p.TableStats) != len(src) { + if p.User == src { + return true + } else if p.User == nil || src == nil { return false } - for i, v := range p.TableStats { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } + if strings.Compare(*p.User, *src) != 0 { + return false } return true } +func (p *TLockBinlogRequest) Field3DeepEqual(src *string) bool { -type TQueryStatsResult_ struct { - Status *status.TStatus `thrift:"status,1,optional" frugal:"1,optional,status.TStatus" json:"status,omitempty"` - SimpleResult_ map[string]int64 `thrift:"simple_result,2,optional" frugal:"2,optional,map" json:"simple_result,omitempty"` - TableStats []*TTableQueryStats `thrift:"table_stats,3,optional" frugal:"3,optional,list" json:"table_stats,omitempty"` - TableVerbosStats []*TTableIndexQueryStats `thrift:"table_verbos_stats,4,optional" frugal:"4,optional,list" json:"table_verbos_stats,omitempty"` - TabletStats map[int64]int64 `thrift:"tablet_stats,5,optional" frugal:"5,optional,map" json:"tablet_stats,omitempty"` + if p.Passwd == src { + return true + } else if p.Passwd == nil || src == nil { + return false + } + if strings.Compare(*p.Passwd, *src) != 0 { + return false + } + return true } +func (p *TLockBinlogRequest) Field4DeepEqual(src *string) bool { -func NewTQueryStatsResult_() *TQueryStatsResult_ { - return &TQueryStatsResult_{} + if p.Db == src { + return true + } else if p.Db == nil || src == nil { + return false + } + if strings.Compare(*p.Db, *src) != 0 { + return false + } + return true } +func (p *TLockBinlogRequest) Field5DeepEqual(src *string) bool { -func (p *TQueryStatsResult_) InitDefault() { + if p.Table == src { + return true + } else if p.Table == nil || src == nil { + return false + } + if strings.Compare(*p.Table, *src) != 0 { + return false + } + return true } +func (p *TLockBinlogRequest) Field6DeepEqual(src *int64) bool { -var TQueryStatsResult__Status_DEFAULT *status.TStatus + if p.TableId == src { + return true + } else if p.TableId == nil || src == nil { + return false + } + if *p.TableId != *src { + return false + } + return true +} +func (p *TLockBinlogRequest) Field7DeepEqual(src *string) bool { -func (p *TQueryStatsResult_) GetStatus() (v *status.TStatus) { - if !p.IsSetStatus() { - return TQueryStatsResult__Status_DEFAULT + if p.Token == src { + return true + } else if p.Token == nil || src == nil { + return false } - return p.Status + if strings.Compare(*p.Token, *src) != 0 { + return false + } + return true } +func (p *TLockBinlogRequest) Field8DeepEqual(src *string) bool { -var TQueryStatsResult__SimpleResult__DEFAULT map[string]int64 + if p.JobUniqueId == src { + return true + } else if p.JobUniqueId == nil || src == nil { + return false + } + if strings.Compare(*p.JobUniqueId, *src) != 0 { + return false + } + return true +} +func (p *TLockBinlogRequest) Field9DeepEqual(src *int64) bool { -func (p *TQueryStatsResult_) GetSimpleResult_() (v map[string]int64) { - if !p.IsSetSimpleResult_() { - return TQueryStatsResult__SimpleResult__DEFAULT + if p.LockCommitSeq == src { + return true + } else if p.LockCommitSeq == nil || src == nil { + return false } - return p.SimpleResult_ + if *p.LockCommitSeq != *src { + return false + } + return true } -var TQueryStatsResult__TableStats_DEFAULT []*TTableQueryStats +type TLockBinlogResult_ struct { + Status *status.TStatus `thrift:"status,1,optional" frugal:"1,optional,status.TStatus" json:"status,omitempty"` + LockedCommitSeq *int64 `thrift:"locked_commit_seq,2,optional" frugal:"2,optional,i64" json:"locked_commit_seq,omitempty"` + MasterAddress *types.TNetworkAddress `thrift:"master_address,3,optional" frugal:"3,optional,types.TNetworkAddress" json:"master_address,omitempty"` +} -func (p *TQueryStatsResult_) GetTableStats() (v []*TTableQueryStats) { - if !p.IsSetTableStats() { - return TQueryStatsResult__TableStats_DEFAULT +func NewTLockBinlogResult_() *TLockBinlogResult_ { + return &TLockBinlogResult_{} +} + +func (p *TLockBinlogResult_) InitDefault() { +} + +var TLockBinlogResult__Status_DEFAULT *status.TStatus + +func (p *TLockBinlogResult_) GetStatus() (v *status.TStatus) { + if !p.IsSetStatus() { + return TLockBinlogResult__Status_DEFAULT } - return p.TableStats + return p.Status } -var TQueryStatsResult__TableVerbosStats_DEFAULT []*TTableIndexQueryStats +var TLockBinlogResult__LockedCommitSeq_DEFAULT int64 -func (p *TQueryStatsResult_) GetTableVerbosStats() (v []*TTableIndexQueryStats) { - if !p.IsSetTableVerbosStats() { - return TQueryStatsResult__TableVerbosStats_DEFAULT +func (p *TLockBinlogResult_) GetLockedCommitSeq() (v int64) { + if !p.IsSetLockedCommitSeq() { + return TLockBinlogResult__LockedCommitSeq_DEFAULT } - return p.TableVerbosStats + return *p.LockedCommitSeq } -var TQueryStatsResult__TabletStats_DEFAULT map[int64]int64 +var TLockBinlogResult__MasterAddress_DEFAULT *types.TNetworkAddress -func (p *TQueryStatsResult_) GetTabletStats() (v map[int64]int64) { - if !p.IsSetTabletStats() { - return TQueryStatsResult__TabletStats_DEFAULT +func (p *TLockBinlogResult_) GetMasterAddress() (v *types.TNetworkAddress) { + if !p.IsSetMasterAddress() { + return TLockBinlogResult__MasterAddress_DEFAULT } - return p.TabletStats + return p.MasterAddress } -func (p *TQueryStatsResult_) SetStatus(val *status.TStatus) { +func (p *TLockBinlogResult_) SetStatus(val *status.TStatus) { p.Status = val } -func (p *TQueryStatsResult_) SetSimpleResult_(val map[string]int64) { - p.SimpleResult_ = val -} -func (p *TQueryStatsResult_) SetTableStats(val []*TTableQueryStats) { - p.TableStats = val -} -func (p *TQueryStatsResult_) SetTableVerbosStats(val []*TTableIndexQueryStats) { - p.TableVerbosStats = val +func (p *TLockBinlogResult_) SetLockedCommitSeq(val *int64) { + p.LockedCommitSeq = val } -func (p *TQueryStatsResult_) SetTabletStats(val map[int64]int64) { - p.TabletStats = val +func (p *TLockBinlogResult_) SetMasterAddress(val *types.TNetworkAddress) { + p.MasterAddress = val } -var fieldIDToName_TQueryStatsResult_ = map[int16]string{ +var fieldIDToName_TLockBinlogResult_ = map[int16]string{ 1: "status", - 2: "simple_result", - 3: "table_stats", - 4: "table_verbos_stats", - 5: "tablet_stats", + 2: "locked_commit_seq", + 3: "master_address", } -func (p *TQueryStatsResult_) IsSetStatus() bool { +func (p *TLockBinlogResult_) IsSetStatus() bool { return p.Status != nil } -func (p *TQueryStatsResult_) IsSetSimpleResult_() bool { - return p.SimpleResult_ != nil -} - -func (p *TQueryStatsResult_) IsSetTableStats() bool { - return p.TableStats != nil -} - -func (p *TQueryStatsResult_) IsSetTableVerbosStats() bool { - return p.TableVerbosStats != nil +func (p *TLockBinlogResult_) IsSetLockedCommitSeq() bool { + return p.LockedCommitSeq != nil } -func (p *TQueryStatsResult_) IsSetTabletStats() bool { - return p.TabletStats != nil +func (p *TLockBinlogResult_) IsSetMasterAddress() bool { + return p.MasterAddress != nil } -func (p *TQueryStatsResult_) Read(iprot thrift.TProtocol) (err error) { +func (p *TLockBinlogResult_) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -52719,7 +48184,7 @@ func (p *TQueryStatsResult_) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 2: - if fieldTypeId == thrift.MAP { + if fieldTypeId == thrift.I64 { if err = p.ReadField2(iprot); err != nil { goto ReadFieldError } @@ -52727,29 +48192,13 @@ func (p *TQueryStatsResult_) Read(iprot thrift.TProtocol) (err error) { goto SkipFieldError } case 3: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { if err = p.ReadField3(iprot); err != nil { goto ReadFieldError } } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 4: - if fieldTypeId == thrift.LIST { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.MAP { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -52769,7 +48218,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryStatsResult_[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TLockBinlogResult_[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -52779,7 +48228,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TQueryStatsResult_) ReadField1(iprot thrift.TProtocol) error { +func (p *TLockBinlogResult_) ReadField1(iprot thrift.TProtocol) error { _field := status.NewTStatus() if err := _field.Read(iprot); err != nil { return err @@ -52787,114 +48236,29 @@ func (p *TQueryStatsResult_) ReadField1(iprot thrift.TProtocol) error { p.Status = _field return nil } -func (p *TQueryStatsResult_) ReadField2(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]int64, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - var _val int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _val = v - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.SimpleResult_ = _field - return nil -} -func (p *TQueryStatsResult_) ReadField3(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*TTableQueryStats, 0, size) - values := make([]TTableQueryStats, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.TableStats = _field - return nil -} -func (p *TQueryStatsResult_) ReadField4(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*TTableIndexQueryStats, 0, size) - values := make([]TTableIndexQueryStats, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() +func (p *TLockBinlogResult_) ReadField2(iprot thrift.TProtocol) error { - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { return err + } else { + _field = &v } - p.TableVerbosStats = _field + p.LockedCommitSeq = _field return nil } -func (p *TQueryStatsResult_) ReadField5(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[int64]int64, size) - for i := 0; i < size; i++ { - var _key int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _key = v - } - - var _val int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _val = v - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { +func (p *TLockBinlogResult_) ReadField3(iprot thrift.TProtocol) error { + _field := types.NewTNetworkAddress() + if err := _field.Read(iprot); err != nil { return err } - p.TabletStats = _field + p.MasterAddress = _field return nil } -func (p *TQueryStatsResult_) Write(oprot thrift.TProtocol) (err error) { +func (p *TLockBinlogResult_) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("TQueryStatsResult"); err != nil { + if err = oprot.WriteStructBegin("TLockBinlogResult"); err != nil { goto WriteStructBeginError } if p != nil { @@ -52910,14 +48274,6 @@ func (p *TQueryStatsResult_) Write(oprot thrift.TProtocol) (err error) { fieldId = 3 goto WriteFieldError } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -52936,7 +48292,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *TQueryStatsResult_) writeField1(oprot thrift.TProtocol) (err error) { +func (p *TLockBinlogResult_) writeField1(oprot thrift.TProtocol) (err error) { if p.IsSetStatus() { if err = oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError @@ -52955,23 +48311,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *TQueryStatsResult_) writeField2(oprot thrift.TProtocol) (err error) { - if p.IsSetSimpleResult_() { - if err = oprot.WriteFieldBegin("simple_result", thrift.MAP, 2); err != nil { +func (p *TLockBinlogResult_) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetLockedCommitSeq() { + if err = oprot.WriteFieldBegin("locked_commit_seq", thrift.I64, 2); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.I64, len(p.SimpleResult_)); err != nil { - return err - } - for k, v := range p.SimpleResult_ { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := oprot.WriteI64(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { + if err := oprot.WriteI64(*p.LockedCommitSeq); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -52985,20 +48330,12 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) } -func (p *TQueryStatsResult_) writeField3(oprot thrift.TProtocol) (err error) { - if p.IsSetTableStats() { - if err = oprot.WriteFieldBegin("table_stats", thrift.LIST, 3); err != nil { +func (p *TLockBinlogResult_) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetMasterAddress() { + if err = oprot.WriteFieldBegin("master_address", thrift.STRUCT, 3); err != nil { goto WriteFieldBeginError } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableStats)); err != nil { - return err - } - for _, v := range p.TableStats { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { + if err := p.MasterAddress.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -53012,72 +48349,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } -func (p *TQueryStatsResult_) writeField4(oprot thrift.TProtocol) (err error) { - if p.IsSetTableVerbosStats() { - if err = oprot.WriteFieldBegin("table_verbos_stats", thrift.LIST, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.TableVerbosStats)); err != nil { - return err - } - for _, v := range p.TableVerbosStats { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TQueryStatsResult_) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetTabletStats() { - if err = oprot.WriteFieldBegin("tablet_stats", thrift.MAP, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.I64, thrift.I64, len(p.TabletStats)); err != nil { - return err - } - for k, v := range p.TabletStats { - if err := oprot.WriteI64(k); err != nil { - return err - } - if err := oprot.WriteI64(v); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TQueryStatsResult_) String() string { +func (p *TLockBinlogResult_) String() string { if p == nil { return "" } - return fmt.Sprintf("TQueryStatsResult_(%+v)", *p) + return fmt.Sprintf("TLockBinlogResult_(%+v)", *p) } -func (p *TQueryStatsResult_) DeepEqual(ano *TQueryStatsResult_) bool { +func (p *TLockBinlogResult_) DeepEqual(ano *TLockBinlogResult_) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -53086,78 +48366,39 @@ func (p *TQueryStatsResult_) DeepEqual(ano *TQueryStatsResult_) bool { if !p.Field1DeepEqual(ano.Status) { return false } - if !p.Field2DeepEqual(ano.SimpleResult_) { + if !p.Field2DeepEqual(ano.LockedCommitSeq) { return false } - if !p.Field3DeepEqual(ano.TableStats) { - return false - } - if !p.Field4DeepEqual(ano.TableVerbosStats) { - return false - } - if !p.Field5DeepEqual(ano.TabletStats) { + if !p.Field3DeepEqual(ano.MasterAddress) { return false } return true } -func (p *TQueryStatsResult_) Field1DeepEqual(src *status.TStatus) bool { +func (p *TLockBinlogResult_) Field1DeepEqual(src *status.TStatus) bool { if !p.Status.DeepEqual(src) { return false } return true } -func (p *TQueryStatsResult_) Field2DeepEqual(src map[string]int64) bool { - - if len(p.SimpleResult_) != len(src) { - return false - } - for k, v := range p.SimpleResult_ { - _src := src[k] - if v != _src { - return false - } - } - return true -} -func (p *TQueryStatsResult_) Field3DeepEqual(src []*TTableQueryStats) bool { +func (p *TLockBinlogResult_) Field2DeepEqual(src *int64) bool { - if len(p.TableStats) != len(src) { + if p.LockedCommitSeq == src { + return true + } else if p.LockedCommitSeq == nil || src == nil { return false } - for i, v := range p.TableStats { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} -func (p *TQueryStatsResult_) Field4DeepEqual(src []*TTableIndexQueryStats) bool { - - if len(p.TableVerbosStats) != len(src) { + if *p.LockedCommitSeq != *src { return false } - for i, v := range p.TableVerbosStats { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } return true } -func (p *TQueryStatsResult_) Field5DeepEqual(src map[int64]int64) bool { +func (p *TLockBinlogResult_) Field3DeepEqual(src *types.TNetworkAddress) bool { - if len(p.TabletStats) != len(src) { + if !p.MasterAddress.DeepEqual(src) { return false } - for k, v := range p.TabletStats { - _src := src[k] - if v != _src { - return false - } - } return true } @@ -71165,6 +66406,7 @@ type TGetMetaTableMeta struct { Name *string `thrift:"name,2,optional" frugal:"2,optional,string" json:"name,omitempty"` InTrash *bool `thrift:"in_trash,3,optional" frugal:"3,optional,bool" json:"in_trash,omitempty"` Partitions []*TGetMetaPartitionMeta `thrift:"partitions,4,optional" frugal:"4,optional,list" json:"partitions,omitempty"` + Type *string `thrift:"type,5,optional" frugal:"5,optional,string" json:"type,omitempty"` } func NewTGetMetaTableMeta() *TGetMetaTableMeta { @@ -71209,6 +66451,15 @@ func (p *TGetMetaTableMeta) GetPartitions() (v []*TGetMetaPartitionMeta) { } return p.Partitions } + +var TGetMetaTableMeta_Type_DEFAULT string + +func (p *TGetMetaTableMeta) GetType() (v string) { + if !p.IsSetType() { + return TGetMetaTableMeta_Type_DEFAULT + } + return *p.Type +} func (p *TGetMetaTableMeta) SetId(val *int64) { p.Id = val } @@ -71221,12 +66472,16 @@ func (p *TGetMetaTableMeta) SetInTrash(val *bool) { func (p *TGetMetaTableMeta) SetPartitions(val []*TGetMetaPartitionMeta) { p.Partitions = val } +func (p *TGetMetaTableMeta) SetType(val *string) { + p.Type = val +} var fieldIDToName_TGetMetaTableMeta = map[int16]string{ 1: "id", 2: "name", 3: "in_trash", 4: "partitions", + 5: "type", } func (p *TGetMetaTableMeta) IsSetId() bool { @@ -71245,6 +66500,10 @@ func (p *TGetMetaTableMeta) IsSetPartitions() bool { return p.Partitions != nil } +func (p *TGetMetaTableMeta) IsSetType() bool { + return p.Type != nil +} + func (p *TGetMetaTableMeta) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -71296,6 +66555,14 @@ func (p *TGetMetaTableMeta) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 5: + if fieldTypeId == thrift.STRING { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -71381,6 +66648,17 @@ func (p *TGetMetaTableMeta) ReadField4(iprot thrift.TProtocol) error { p.Partitions = _field return nil } +func (p *TGetMetaTableMeta) ReadField5(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Type = _field + return nil +} func (p *TGetMetaTableMeta) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -71404,6 +66682,10 @@ func (p *TGetMetaTableMeta) Write(oprot thrift.TProtocol) (err error) { fieldId = 4 goto WriteFieldError } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -71506,6 +66788,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } +func (p *TGetMetaTableMeta) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetType() { + if err = oprot.WriteFieldBegin("type", thrift.STRING, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Type); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + func (p *TGetMetaTableMeta) String() string { if p == nil { return "" @@ -71532,6 +66833,9 @@ func (p *TGetMetaTableMeta) DeepEqual(ano *TGetMetaTableMeta) bool { if !p.Field4DeepEqual(ano.Partitions) { return false } + if !p.Field5DeepEqual(ano.Type) { + return false + } return true } @@ -71584,6 +66888,18 @@ func (p *TGetMetaTableMeta) Field4DeepEqual(src []*TGetMetaPartitionMeta) bool { } return true } +func (p *TGetMetaTableMeta) Field5DeepEqual(src *string) bool { + + if p.Type == src { + return true + } else if p.Type == nil || src == nil { + return false + } + if strings.Compare(*p.Type, *src) != 0 { + return false + } + return true +} type TGetMetaDBMeta struct { Id *int64 `thrift:"id,1,optional" frugal:"1,optional,i64" json:"id,omitempty"` @@ -76977,8 +72293,6 @@ type FrontendService interface { GetTableNames(ctx context.Context, params *TGetTablesParams) (r *TGetTablesResult_, err error) - DescribeTable(ctx context.Context, params *TDescribeTableParams) (r *TDescribeTableResult_, err error) - DescribeTables(ctx context.Context, params *TDescribeTablesParams) (r *TDescribeTablesResult_, err error) ShowVariables(ctx context.Context, params *TShowVariableRequest) (r *TShowVariableResult_, err error) @@ -77027,6 +72341,8 @@ type FrontendService interface { RestoreSnapshot(ctx context.Context, request *TRestoreSnapshotRequest) (r *TRestoreSnapshotResult_, err error) + LockBinlog(ctx context.Context, request *TLockBinlogRequest) (r *TLockBinlogResult_, err error) + WaitingTxnStatus(ctx context.Context, request *TWaitingTxnStatusRequest) (r *TWaitingTxnStatusResult_, err error) StreamLoadPut(ctx context.Context, request *TStreamLoadPutRequest) (r *TStreamLoadPutResult_, err error) @@ -77140,15 +72456,6 @@ func (p *FrontendServiceClient) GetTableNames(ctx context.Context, params *TGetT } return _result.GetSuccess(), nil } -func (p *FrontendServiceClient) DescribeTable(ctx context.Context, params *TDescribeTableParams) (r *TDescribeTableResult_, err error) { - var _args FrontendServiceDescribeTableArgs - _args.Params = params - var _result FrontendServiceDescribeTableResult - if err = p.Client_().Call(ctx, "describeTable", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} func (p *FrontendServiceClient) DescribeTables(ctx context.Context, params *TDescribeTablesParams) (r *TDescribeTablesResult_, err error) { var _args FrontendServiceDescribeTablesArgs _args.Params = params @@ -77364,6 +72671,15 @@ func (p *FrontendServiceClient) RestoreSnapshot(ctx context.Context, request *TR } return _result.GetSuccess(), nil } +func (p *FrontendServiceClient) LockBinlog(ctx context.Context, request *TLockBinlogRequest) (r *TLockBinlogResult_, err error) { + var _args FrontendServiceLockBinlogArgs + _args.Request = request + var _result FrontendServiceLockBinlogResult + if err = p.Client_().Call(ctx, "lockBinlog", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} func (p *FrontendServiceClient) WaitingTxnStatus(ctx context.Context, request *TWaitingTxnStatusRequest) (r *TWaitingTxnStatusResult_, err error) { var _args FrontendServiceWaitingTxnStatusArgs _args.Request = request @@ -77692,7 +73008,6 @@ func NewFrontendServiceProcessor(handler FrontendService) *FrontendServiceProces self := &FrontendServiceProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)} self.AddToProcessorMap("getDbNames", &frontendServiceProcessorGetDbNames{handler: handler}) self.AddToProcessorMap("getTableNames", &frontendServiceProcessorGetTableNames{handler: handler}) - self.AddToProcessorMap("describeTable", &frontendServiceProcessorDescribeTable{handler: handler}) self.AddToProcessorMap("describeTables", &frontendServiceProcessorDescribeTables{handler: handler}) self.AddToProcessorMap("showVariables", &frontendServiceProcessorShowVariables{handler: handler}) self.AddToProcessorMap("reportExecStatus", &frontendServiceProcessorReportExecStatus{handler: handler}) @@ -77717,6 +73032,7 @@ func NewFrontendServiceProcessor(handler FrontendService) *FrontendServiceProces self.AddToProcessorMap("getBinlog", &frontendServiceProcessorGetBinlog{handler: handler}) self.AddToProcessorMap("getSnapshot", &frontendServiceProcessorGetSnapshot{handler: handler}) self.AddToProcessorMap("restoreSnapshot", &frontendServiceProcessorRestoreSnapshot{handler: handler}) + self.AddToProcessorMap("lockBinlog", &frontendServiceProcessorLockBinlog{handler: handler}) self.AddToProcessorMap("waitingTxnStatus", &frontendServiceProcessorWaitingTxnStatus{handler: handler}) self.AddToProcessorMap("streamLoadPut", &frontendServiceProcessorStreamLoadPut{handler: handler}) self.AddToProcessorMap("streamLoadMultiTablePut", &frontendServiceProcessorStreamLoadMultiTablePut{handler: handler}) @@ -77867,54 +73183,6 @@ func (p *frontendServiceProcessorGetTableNames) Process(ctx context.Context, seq return true, err } -type frontendServiceProcessorDescribeTable struct { - handler FrontendService -} - -func (p *frontendServiceProcessorDescribeTable) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { - args := FrontendServiceDescribeTableArgs{} - if err = args.Read(iprot); err != nil { - iprot.ReadMessageEnd() - x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) - oprot.WriteMessageBegin("describeTable", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return false, err - } - - iprot.ReadMessageEnd() - var err2 error - result := FrontendServiceDescribeTableResult{} - var retval *TDescribeTableResult_ - if retval, err2 = p.handler.DescribeTable(ctx, args.Params); err2 != nil { - x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing describeTable: "+err2.Error()) - oprot.WriteMessageBegin("describeTable", thrift.EXCEPTION, seqId) - x.Write(oprot) - oprot.WriteMessageEnd() - oprot.Flush(ctx) - return true, err2 - } else { - result.Success = retval - } - if err2 = oprot.WriteMessageBegin("describeTable", thrift.REPLY, seqId); err2 != nil { - err = err2 - } - if err2 = result.Write(oprot); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { - err = err2 - } - if err2 = oprot.Flush(ctx); err == nil && err2 != nil { - err = err2 - } - if err != nil { - return - } - return true, err -} - type frontendServiceProcessorDescribeTables struct { handler FrontendService } @@ -79067,6 +74335,54 @@ func (p *frontendServiceProcessorRestoreSnapshot) Process(ctx context.Context, s return true, err } +type frontendServiceProcessorLockBinlog struct { + handler FrontendService +} + +func (p *frontendServiceProcessorLockBinlog) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) { + args := FrontendServiceLockBinlogArgs{} + if err = args.Read(iprot); err != nil { + iprot.ReadMessageEnd() + x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error()) + oprot.WriteMessageBegin("lockBinlog", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return false, err + } + + iprot.ReadMessageEnd() + var err2 error + result := FrontendServiceLockBinlogResult{} + var retval *TLockBinlogResult_ + if retval, err2 = p.handler.LockBinlog(ctx, args.Request); err2 != nil { + x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing lockBinlog: "+err2.Error()) + oprot.WriteMessageBegin("lockBinlog", thrift.EXCEPTION, seqId) + x.Write(oprot) + oprot.WriteMessageEnd() + oprot.Flush(ctx) + return true, err2 + } else { + result.Success = retval + } + if err2 = oprot.WriteMessageBegin("lockBinlog", thrift.REPLY, seqId); err2 != nil { + err = err2 + } + if err2 = result.Write(oprot); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil { + err = err2 + } + if err2 = oprot.Flush(ctx); err == nil && err2 != nil { + err = err2 + } + if err != nil { + return + } + return true, err +} + type frontendServiceProcessorWaitingTxnStatus struct { handler FrontendService } @@ -81379,346 +76695,6 @@ func (p *FrontendServiceGetTableNamesResult) Field0DeepEqual(src *TGetTablesResu return true } -type FrontendServiceDescribeTableArgs struct { - Params *TDescribeTableParams `thrift:"params,1" frugal:"1,default,TDescribeTableParams" json:"params"` -} - -func NewFrontendServiceDescribeTableArgs() *FrontendServiceDescribeTableArgs { - return &FrontendServiceDescribeTableArgs{} -} - -func (p *FrontendServiceDescribeTableArgs) InitDefault() { -} - -var FrontendServiceDescribeTableArgs_Params_DEFAULT *TDescribeTableParams - -func (p *FrontendServiceDescribeTableArgs) GetParams() (v *TDescribeTableParams) { - if !p.IsSetParams() { - return FrontendServiceDescribeTableArgs_Params_DEFAULT - } - return p.Params -} -func (p *FrontendServiceDescribeTableArgs) SetParams(val *TDescribeTableParams) { - p.Params = val -} - -var fieldIDToName_FrontendServiceDescribeTableArgs = map[int16]string{ - 1: "params", -} - -func (p *FrontendServiceDescribeTableArgs) IsSetParams() bool { - return p.Params != nil -} - -func (p *FrontendServiceDescribeTableArgs) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceDescribeTableArgs[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *FrontendServiceDescribeTableArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTDescribeTableParams() - if err := _field.Read(iprot); err != nil { - return err - } - p.Params = _field - return nil -} - -func (p *FrontendServiceDescribeTableArgs) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("describeTable_args"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *FrontendServiceDescribeTableArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("params", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Params.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *FrontendServiceDescribeTableArgs) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("FrontendServiceDescribeTableArgs(%+v)", *p) - -} - -func (p *FrontendServiceDescribeTableArgs) DeepEqual(ano *FrontendServiceDescribeTableArgs) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Params) { - return false - } - return true -} - -func (p *FrontendServiceDescribeTableArgs) Field1DeepEqual(src *TDescribeTableParams) bool { - - if !p.Params.DeepEqual(src) { - return false - } - return true -} - -type FrontendServiceDescribeTableResult struct { - Success *TDescribeTableResult_ `thrift:"success,0,optional" frugal:"0,optional,TDescribeTableResult_" json:"success,omitempty"` -} - -func NewFrontendServiceDescribeTableResult() *FrontendServiceDescribeTableResult { - return &FrontendServiceDescribeTableResult{} -} - -func (p *FrontendServiceDescribeTableResult) InitDefault() { -} - -var FrontendServiceDescribeTableResult_Success_DEFAULT *TDescribeTableResult_ - -func (p *FrontendServiceDescribeTableResult) GetSuccess() (v *TDescribeTableResult_) { - if !p.IsSetSuccess() { - return FrontendServiceDescribeTableResult_Success_DEFAULT - } - return p.Success -} -func (p *FrontendServiceDescribeTableResult) SetSuccess(x interface{}) { - p.Success = x.(*TDescribeTableResult_) -} - -var fieldIDToName_FrontendServiceDescribeTableResult = map[int16]string{ - 0: "success", -} - -func (p *FrontendServiceDescribeTableResult) IsSetSuccess() bool { - return p.Success != nil -} - -func (p *FrontendServiceDescribeTableResult) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField0(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceDescribeTableResult[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *FrontendServiceDescribeTableResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTDescribeTableResult_() - if err := _field.Read(iprot); err != nil { - return err - } - p.Success = _field - return nil -} - -func (p *FrontendServiceDescribeTableResult) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("describeTable_result"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField0(oprot); err != nil { - fieldId = 0 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *FrontendServiceDescribeTableResult) writeField0(oprot thrift.TProtocol) (err error) { - if p.IsSetSuccess() { - if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { - goto WriteFieldBeginError - } - if err := p.Success.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) -} - -func (p *FrontendServiceDescribeTableResult) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("FrontendServiceDescribeTableResult(%+v)", *p) - -} - -func (p *FrontendServiceDescribeTableResult) DeepEqual(ano *FrontendServiceDescribeTableResult) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field0DeepEqual(ano.Success) { - return false - } - return true -} - -func (p *FrontendServiceDescribeTableResult) Field0DeepEqual(src *TDescribeTableResult_) bool { - - if !p.Success.DeepEqual(src) { - return false - } - return true -} - type FrontendServiceDescribeTablesArgs struct { Params *TDescribeTablesParams `thrift:"params,1" frugal:"1,default,TDescribeTablesParams" json:"params"` } @@ -84486,7 +79462,347 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListTableMetadataNameIdsArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListTableMetadataNameIdsArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("params", thrift.STRUCT, 1); err != nil { + goto WriteFieldBeginError + } + if err := p.Params.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *FrontendServiceListTableMetadataNameIdsArgs) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FrontendServiceListTableMetadataNameIdsArgs(%+v)", *p) + +} + +func (p *FrontendServiceListTableMetadataNameIdsArgs) DeepEqual(ano *FrontendServiceListTableMetadataNameIdsArgs) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.Params) { + return false + } + return true +} + +func (p *FrontendServiceListTableMetadataNameIdsArgs) Field1DeepEqual(src *TGetTablesParams) bool { + + if !p.Params.DeepEqual(src) { + return false + } + return true +} + +type FrontendServiceListTableMetadataNameIdsResult struct { + Success *TListTableMetadataNameIdsResult_ `thrift:"success,0,optional" frugal:"0,optional,TListTableMetadataNameIdsResult_" json:"success,omitempty"` +} + +func NewFrontendServiceListTableMetadataNameIdsResult() *FrontendServiceListTableMetadataNameIdsResult { + return &FrontendServiceListTableMetadataNameIdsResult{} +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) InitDefault() { +} + +var FrontendServiceListTableMetadataNameIdsResult_Success_DEFAULT *TListTableMetadataNameIdsResult_ + +func (p *FrontendServiceListTableMetadataNameIdsResult) GetSuccess() (v *TListTableMetadataNameIdsResult_) { + if !p.IsSetSuccess() { + return FrontendServiceListTableMetadataNameIdsResult_Success_DEFAULT + } + return p.Success +} +func (p *FrontendServiceListTableMetadataNameIdsResult) SetSuccess(x interface{}) { + p.Success = x.(*TListTableMetadataNameIdsResult_) +} + +var fieldIDToName_FrontendServiceListTableMetadataNameIdsResult = map[int16]string{ + 0: "success", +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) IsSetSuccess() bool { + return p.Success != nil +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField0(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListTableMetadataNameIdsResult[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTListTableMetadataNameIdsResult_() + if err := _field.Read(iprot); err != nil { + return err + } + p.Success = _field + return nil +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("listTableMetadataNameIds_result"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField0(oprot); err != nil { + fieldId = 0 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) writeField0(oprot thrift.TProtocol) (err error) { + if p.IsSetSuccess() { + if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { + goto WriteFieldBeginError + } + if err := p.Success.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("FrontendServiceListTableMetadataNameIdsResult(%+v)", *p) + +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) DeepEqual(ano *FrontendServiceListTableMetadataNameIdsResult) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field0DeepEqual(ano.Success) { + return false + } + return true +} + +func (p *FrontendServiceListTableMetadataNameIdsResult) Field0DeepEqual(src *TListTableMetadataNameIdsResult_) bool { + + if !p.Success.DeepEqual(src) { + return false + } + return true +} + +type FrontendServiceListTablePrivilegeStatusArgs struct { + Params *TGetTablesParams `thrift:"params,1" frugal:"1,default,TGetTablesParams" json:"params"` +} + +func NewFrontendServiceListTablePrivilegeStatusArgs() *FrontendServiceListTablePrivilegeStatusArgs { + return &FrontendServiceListTablePrivilegeStatusArgs{} +} + +func (p *FrontendServiceListTablePrivilegeStatusArgs) InitDefault() { +} + +var FrontendServiceListTablePrivilegeStatusArgs_Params_DEFAULT *TGetTablesParams + +func (p *FrontendServiceListTablePrivilegeStatusArgs) GetParams() (v *TGetTablesParams) { + if !p.IsSetParams() { + return FrontendServiceListTablePrivilegeStatusArgs_Params_DEFAULT + } + return p.Params +} +func (p *FrontendServiceListTablePrivilegeStatusArgs) SetParams(val *TGetTablesParams) { + p.Params = val +} + +var fieldIDToName_FrontendServiceListTablePrivilegeStatusArgs = map[int16]string{ + 1: "params", +} + +func (p *FrontendServiceListTablePrivilegeStatusArgs) IsSetParams() bool { + return p.Params != nil +} + +func (p *FrontendServiceListTablePrivilegeStatusArgs) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListTablePrivilegeStatusArgs[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *FrontendServiceListTablePrivilegeStatusArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTGetTablesParams() + if err := _field.Read(iprot); err != nil { + return err + } + p.Params = _field + return nil +} + +func (p *FrontendServiceListTablePrivilegeStatusArgs) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("listTablePrivilegeStatus_args"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *FrontendServiceListTablePrivilegeStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("params", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -84503,15 +79819,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceListTableMetadataNameIdsArgs) String() string { +func (p *FrontendServiceListTablePrivilegeStatusArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListTableMetadataNameIdsArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceListTablePrivilegeStatusArgs(%+v)", *p) } -func (p *FrontendServiceListTableMetadataNameIdsArgs) DeepEqual(ano *FrontendServiceListTableMetadataNameIdsArgs) bool { +func (p *FrontendServiceListTablePrivilegeStatusArgs) DeepEqual(ano *FrontendServiceListTablePrivilegeStatusArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -84523,7 +79839,7 @@ func (p *FrontendServiceListTableMetadataNameIdsArgs) DeepEqual(ano *FrontendSer return true } -func (p *FrontendServiceListTableMetadataNameIdsArgs) Field1DeepEqual(src *TGetTablesParams) bool { +func (p *FrontendServiceListTablePrivilegeStatusArgs) Field1DeepEqual(src *TGetTablesParams) bool { if !p.Params.DeepEqual(src) { return false @@ -84531,38 +79847,38 @@ func (p *FrontendServiceListTableMetadataNameIdsArgs) Field1DeepEqual(src *TGetT return true } -type FrontendServiceListTableMetadataNameIdsResult struct { - Success *TListTableMetadataNameIdsResult_ `thrift:"success,0,optional" frugal:"0,optional,TListTableMetadataNameIdsResult_" json:"success,omitempty"` +type FrontendServiceListTablePrivilegeStatusResult struct { + Success *TListPrivilegesResult_ `thrift:"success,0,optional" frugal:"0,optional,TListPrivilegesResult_" json:"success,omitempty"` } -func NewFrontendServiceListTableMetadataNameIdsResult() *FrontendServiceListTableMetadataNameIdsResult { - return &FrontendServiceListTableMetadataNameIdsResult{} +func NewFrontendServiceListTablePrivilegeStatusResult() *FrontendServiceListTablePrivilegeStatusResult { + return &FrontendServiceListTablePrivilegeStatusResult{} } -func (p *FrontendServiceListTableMetadataNameIdsResult) InitDefault() { +func (p *FrontendServiceListTablePrivilegeStatusResult) InitDefault() { } -var FrontendServiceListTableMetadataNameIdsResult_Success_DEFAULT *TListTableMetadataNameIdsResult_ +var FrontendServiceListTablePrivilegeStatusResult_Success_DEFAULT *TListPrivilegesResult_ -func (p *FrontendServiceListTableMetadataNameIdsResult) GetSuccess() (v *TListTableMetadataNameIdsResult_) { +func (p *FrontendServiceListTablePrivilegeStatusResult) GetSuccess() (v *TListPrivilegesResult_) { if !p.IsSetSuccess() { - return FrontendServiceListTableMetadataNameIdsResult_Success_DEFAULT + return FrontendServiceListTablePrivilegeStatusResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceListTableMetadataNameIdsResult) SetSuccess(x interface{}) { - p.Success = x.(*TListTableMetadataNameIdsResult_) +func (p *FrontendServiceListTablePrivilegeStatusResult) SetSuccess(x interface{}) { + p.Success = x.(*TListPrivilegesResult_) } -var fieldIDToName_FrontendServiceListTableMetadataNameIdsResult = map[int16]string{ +var fieldIDToName_FrontendServiceListTablePrivilegeStatusResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceListTableMetadataNameIdsResult) IsSetSuccess() bool { +func (p *FrontendServiceListTablePrivilegeStatusResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceListTableMetadataNameIdsResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListTablePrivilegeStatusResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -84608,7 +79924,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListTableMetadataNameIdsResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListTablePrivilegeStatusResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -84618,8 +79934,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceListTableMetadataNameIdsResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTListTableMetadataNameIdsResult_() +func (p *FrontendServiceListTablePrivilegeStatusResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTListPrivilegesResult_() if err := _field.Read(iprot); err != nil { return err } @@ -84627,9 +79943,9 @@ func (p *FrontendServiceListTableMetadataNameIdsResult) ReadField0(iprot thrift. return nil } -func (p *FrontendServiceListTableMetadataNameIdsResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListTablePrivilegeStatusResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("listTableMetadataNameIds_result"); err != nil { + if err = oprot.WriteStructBegin("listTablePrivilegeStatus_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -84655,7 +79971,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListTableMetadataNameIdsResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListTablePrivilegeStatusResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -84674,15 +79990,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceListTableMetadataNameIdsResult) String() string { +func (p *FrontendServiceListTablePrivilegeStatusResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListTableMetadataNameIdsResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceListTablePrivilegeStatusResult(%+v)", *p) } -func (p *FrontendServiceListTableMetadataNameIdsResult) DeepEqual(ano *FrontendServiceListTableMetadataNameIdsResult) bool { +func (p *FrontendServiceListTablePrivilegeStatusResult) DeepEqual(ano *FrontendServiceListTablePrivilegeStatusResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -84694,7 +80010,7 @@ func (p *FrontendServiceListTableMetadataNameIdsResult) DeepEqual(ano *FrontendS return true } -func (p *FrontendServiceListTableMetadataNameIdsResult) Field0DeepEqual(src *TListTableMetadataNameIdsResult_) bool { +func (p *FrontendServiceListTablePrivilegeStatusResult) Field0DeepEqual(src *TListPrivilegesResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -84702,38 +80018,38 @@ func (p *FrontendServiceListTableMetadataNameIdsResult) Field0DeepEqual(src *TLi return true } -type FrontendServiceListTablePrivilegeStatusArgs struct { +type FrontendServiceListSchemaPrivilegeStatusArgs struct { Params *TGetTablesParams `thrift:"params,1" frugal:"1,default,TGetTablesParams" json:"params"` } -func NewFrontendServiceListTablePrivilegeStatusArgs() *FrontendServiceListTablePrivilegeStatusArgs { - return &FrontendServiceListTablePrivilegeStatusArgs{} +func NewFrontendServiceListSchemaPrivilegeStatusArgs() *FrontendServiceListSchemaPrivilegeStatusArgs { + return &FrontendServiceListSchemaPrivilegeStatusArgs{} } -func (p *FrontendServiceListTablePrivilegeStatusArgs) InitDefault() { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) InitDefault() { } -var FrontendServiceListTablePrivilegeStatusArgs_Params_DEFAULT *TGetTablesParams +var FrontendServiceListSchemaPrivilegeStatusArgs_Params_DEFAULT *TGetTablesParams -func (p *FrontendServiceListTablePrivilegeStatusArgs) GetParams() (v *TGetTablesParams) { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) GetParams() (v *TGetTablesParams) { if !p.IsSetParams() { - return FrontendServiceListTablePrivilegeStatusArgs_Params_DEFAULT + return FrontendServiceListSchemaPrivilegeStatusArgs_Params_DEFAULT } return p.Params } -func (p *FrontendServiceListTablePrivilegeStatusArgs) SetParams(val *TGetTablesParams) { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) SetParams(val *TGetTablesParams) { p.Params = val } -var fieldIDToName_FrontendServiceListTablePrivilegeStatusArgs = map[int16]string{ +var fieldIDToName_FrontendServiceListSchemaPrivilegeStatusArgs = map[int16]string{ 1: "params", } -func (p *FrontendServiceListTablePrivilegeStatusArgs) IsSetParams() bool { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) IsSetParams() bool { return p.Params != nil } -func (p *FrontendServiceListTablePrivilegeStatusArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -84779,7 +80095,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListTablePrivilegeStatusArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListSchemaPrivilegeStatusArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -84789,7 +80105,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceListTablePrivilegeStatusArgs) ReadField1(iprot thrift.TProtocol) error { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) ReadField1(iprot thrift.TProtocol) error { _field := NewTGetTablesParams() if err := _field.Read(iprot); err != nil { return err @@ -84798,9 +80114,9 @@ func (p *FrontendServiceListTablePrivilegeStatusArgs) ReadField1(iprot thrift.TP return nil } -func (p *FrontendServiceListTablePrivilegeStatusArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("listTablePrivilegeStatus_args"); err != nil { + if err = oprot.WriteStructBegin("listSchemaPrivilegeStatus_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -84826,7 +80142,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListTablePrivilegeStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("params", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -84843,15 +80159,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceListTablePrivilegeStatusArgs) String() string { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListTablePrivilegeStatusArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceListSchemaPrivilegeStatusArgs(%+v)", *p) } -func (p *FrontendServiceListTablePrivilegeStatusArgs) DeepEqual(ano *FrontendServiceListTablePrivilegeStatusArgs) bool { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) DeepEqual(ano *FrontendServiceListSchemaPrivilegeStatusArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -84863,7 +80179,7 @@ func (p *FrontendServiceListTablePrivilegeStatusArgs) DeepEqual(ano *FrontendSer return true } -func (p *FrontendServiceListTablePrivilegeStatusArgs) Field1DeepEqual(src *TGetTablesParams) bool { +func (p *FrontendServiceListSchemaPrivilegeStatusArgs) Field1DeepEqual(src *TGetTablesParams) bool { if !p.Params.DeepEqual(src) { return false @@ -84871,38 +80187,38 @@ func (p *FrontendServiceListTablePrivilegeStatusArgs) Field1DeepEqual(src *TGetT return true } -type FrontendServiceListTablePrivilegeStatusResult struct { +type FrontendServiceListSchemaPrivilegeStatusResult struct { Success *TListPrivilegesResult_ `thrift:"success,0,optional" frugal:"0,optional,TListPrivilegesResult_" json:"success,omitempty"` } -func NewFrontendServiceListTablePrivilegeStatusResult() *FrontendServiceListTablePrivilegeStatusResult { - return &FrontendServiceListTablePrivilegeStatusResult{} +func NewFrontendServiceListSchemaPrivilegeStatusResult() *FrontendServiceListSchemaPrivilegeStatusResult { + return &FrontendServiceListSchemaPrivilegeStatusResult{} } -func (p *FrontendServiceListTablePrivilegeStatusResult) InitDefault() { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) InitDefault() { } -var FrontendServiceListTablePrivilegeStatusResult_Success_DEFAULT *TListPrivilegesResult_ +var FrontendServiceListSchemaPrivilegeStatusResult_Success_DEFAULT *TListPrivilegesResult_ -func (p *FrontendServiceListTablePrivilegeStatusResult) GetSuccess() (v *TListPrivilegesResult_) { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) GetSuccess() (v *TListPrivilegesResult_) { if !p.IsSetSuccess() { - return FrontendServiceListTablePrivilegeStatusResult_Success_DEFAULT + return FrontendServiceListSchemaPrivilegeStatusResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceListTablePrivilegeStatusResult) SetSuccess(x interface{}) { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) SetSuccess(x interface{}) { p.Success = x.(*TListPrivilegesResult_) } -var fieldIDToName_FrontendServiceListTablePrivilegeStatusResult = map[int16]string{ +var fieldIDToName_FrontendServiceListSchemaPrivilegeStatusResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceListTablePrivilegeStatusResult) IsSetSuccess() bool { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceListTablePrivilegeStatusResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -84948,7 +80264,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListTablePrivilegeStatusResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListSchemaPrivilegeStatusResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -84958,7 +80274,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceListTablePrivilegeStatusResult) ReadField0(iprot thrift.TProtocol) error { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) ReadField0(iprot thrift.TProtocol) error { _field := NewTListPrivilegesResult_() if err := _field.Read(iprot); err != nil { return err @@ -84967,9 +80283,9 @@ func (p *FrontendServiceListTablePrivilegeStatusResult) ReadField0(iprot thrift. return nil } -func (p *FrontendServiceListTablePrivilegeStatusResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("listTablePrivilegeStatus_result"); err != nil { + if err = oprot.WriteStructBegin("listSchemaPrivilegeStatus_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -84995,7 +80311,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListTablePrivilegeStatusResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -85014,15 +80330,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceListTablePrivilegeStatusResult) String() string { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListTablePrivilegeStatusResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceListSchemaPrivilegeStatusResult(%+v)", *p) } -func (p *FrontendServiceListTablePrivilegeStatusResult) DeepEqual(ano *FrontendServiceListTablePrivilegeStatusResult) bool { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) DeepEqual(ano *FrontendServiceListSchemaPrivilegeStatusResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -85034,7 +80350,7 @@ func (p *FrontendServiceListTablePrivilegeStatusResult) DeepEqual(ano *FrontendS return true } -func (p *FrontendServiceListTablePrivilegeStatusResult) Field0DeepEqual(src *TListPrivilegesResult_) bool { +func (p *FrontendServiceListSchemaPrivilegeStatusResult) Field0DeepEqual(src *TListPrivilegesResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -85042,38 +80358,38 @@ func (p *FrontendServiceListTablePrivilegeStatusResult) Field0DeepEqual(src *TLi return true } -type FrontendServiceListSchemaPrivilegeStatusArgs struct { +type FrontendServiceListUserPrivilegeStatusArgs struct { Params *TGetTablesParams `thrift:"params,1" frugal:"1,default,TGetTablesParams" json:"params"` } -func NewFrontendServiceListSchemaPrivilegeStatusArgs() *FrontendServiceListSchemaPrivilegeStatusArgs { - return &FrontendServiceListSchemaPrivilegeStatusArgs{} +func NewFrontendServiceListUserPrivilegeStatusArgs() *FrontendServiceListUserPrivilegeStatusArgs { + return &FrontendServiceListUserPrivilegeStatusArgs{} } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) InitDefault() { +func (p *FrontendServiceListUserPrivilegeStatusArgs) InitDefault() { } -var FrontendServiceListSchemaPrivilegeStatusArgs_Params_DEFAULT *TGetTablesParams +var FrontendServiceListUserPrivilegeStatusArgs_Params_DEFAULT *TGetTablesParams -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) GetParams() (v *TGetTablesParams) { +func (p *FrontendServiceListUserPrivilegeStatusArgs) GetParams() (v *TGetTablesParams) { if !p.IsSetParams() { - return FrontendServiceListSchemaPrivilegeStatusArgs_Params_DEFAULT + return FrontendServiceListUserPrivilegeStatusArgs_Params_DEFAULT } return p.Params } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) SetParams(val *TGetTablesParams) { +func (p *FrontendServiceListUserPrivilegeStatusArgs) SetParams(val *TGetTablesParams) { p.Params = val } -var fieldIDToName_FrontendServiceListSchemaPrivilegeStatusArgs = map[int16]string{ +var fieldIDToName_FrontendServiceListUserPrivilegeStatusArgs = map[int16]string{ 1: "params", } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) IsSetParams() bool { +func (p *FrontendServiceListUserPrivilegeStatusArgs) IsSetParams() bool { return p.Params != nil } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListUserPrivilegeStatusArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -85119,7 +80435,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListSchemaPrivilegeStatusArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListUserPrivilegeStatusArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -85129,7 +80445,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) ReadField1(iprot thrift.TProtocol) error { +func (p *FrontendServiceListUserPrivilegeStatusArgs) ReadField1(iprot thrift.TProtocol) error { _field := NewTGetTablesParams() if err := _field.Read(iprot); err != nil { return err @@ -85138,9 +80454,9 @@ func (p *FrontendServiceListSchemaPrivilegeStatusArgs) ReadField1(iprot thrift.T return nil } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListUserPrivilegeStatusArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("listSchemaPrivilegeStatus_args"); err != nil { + if err = oprot.WriteStructBegin("listUserPrivilegeStatus_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -85166,7 +80482,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListUserPrivilegeStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("params", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -85183,15 +80499,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) String() string { +func (p *FrontendServiceListUserPrivilegeStatusArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListSchemaPrivilegeStatusArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceListUserPrivilegeStatusArgs(%+v)", *p) } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) DeepEqual(ano *FrontendServiceListSchemaPrivilegeStatusArgs) bool { +func (p *FrontendServiceListUserPrivilegeStatusArgs) DeepEqual(ano *FrontendServiceListUserPrivilegeStatusArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -85203,7 +80519,7 @@ func (p *FrontendServiceListSchemaPrivilegeStatusArgs) DeepEqual(ano *FrontendSe return true } -func (p *FrontendServiceListSchemaPrivilegeStatusArgs) Field1DeepEqual(src *TGetTablesParams) bool { +func (p *FrontendServiceListUserPrivilegeStatusArgs) Field1DeepEqual(src *TGetTablesParams) bool { if !p.Params.DeepEqual(src) { return false @@ -85211,38 +80527,38 @@ func (p *FrontendServiceListSchemaPrivilegeStatusArgs) Field1DeepEqual(src *TGet return true } -type FrontendServiceListSchemaPrivilegeStatusResult struct { +type FrontendServiceListUserPrivilegeStatusResult struct { Success *TListPrivilegesResult_ `thrift:"success,0,optional" frugal:"0,optional,TListPrivilegesResult_" json:"success,omitempty"` } -func NewFrontendServiceListSchemaPrivilegeStatusResult() *FrontendServiceListSchemaPrivilegeStatusResult { - return &FrontendServiceListSchemaPrivilegeStatusResult{} +func NewFrontendServiceListUserPrivilegeStatusResult() *FrontendServiceListUserPrivilegeStatusResult { + return &FrontendServiceListUserPrivilegeStatusResult{} } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) InitDefault() { +func (p *FrontendServiceListUserPrivilegeStatusResult) InitDefault() { } -var FrontendServiceListSchemaPrivilegeStatusResult_Success_DEFAULT *TListPrivilegesResult_ +var FrontendServiceListUserPrivilegeStatusResult_Success_DEFAULT *TListPrivilegesResult_ -func (p *FrontendServiceListSchemaPrivilegeStatusResult) GetSuccess() (v *TListPrivilegesResult_) { +func (p *FrontendServiceListUserPrivilegeStatusResult) GetSuccess() (v *TListPrivilegesResult_) { if !p.IsSetSuccess() { - return FrontendServiceListSchemaPrivilegeStatusResult_Success_DEFAULT + return FrontendServiceListUserPrivilegeStatusResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) SetSuccess(x interface{}) { +func (p *FrontendServiceListUserPrivilegeStatusResult) SetSuccess(x interface{}) { p.Success = x.(*TListPrivilegesResult_) } -var fieldIDToName_FrontendServiceListSchemaPrivilegeStatusResult = map[int16]string{ +var fieldIDToName_FrontendServiceListUserPrivilegeStatusResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) IsSetSuccess() bool { +func (p *FrontendServiceListUserPrivilegeStatusResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListUserPrivilegeStatusResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -85288,7 +80604,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListSchemaPrivilegeStatusResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListUserPrivilegeStatusResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -85298,7 +80614,7 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) ReadField0(iprot thrift.TProtocol) error { +func (p *FrontendServiceListUserPrivilegeStatusResult) ReadField0(iprot thrift.TProtocol) error { _field := NewTListPrivilegesResult_() if err := _field.Read(iprot); err != nil { return err @@ -85307,9 +80623,9 @@ func (p *FrontendServiceListSchemaPrivilegeStatusResult) ReadField0(iprot thrift return nil } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListUserPrivilegeStatusResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("listSchemaPrivilegeStatus_result"); err != nil { + if err = oprot.WriteStructBegin("listUserPrivilegeStatus_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -85335,7 +80651,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceListUserPrivilegeStatusResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -85354,15 +80670,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) String() string { +func (p *FrontendServiceListUserPrivilegeStatusResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListSchemaPrivilegeStatusResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceListUserPrivilegeStatusResult(%+v)", *p) } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) DeepEqual(ano *FrontendServiceListSchemaPrivilegeStatusResult) bool { +func (p *FrontendServiceListUserPrivilegeStatusResult) DeepEqual(ano *FrontendServiceListUserPrivilegeStatusResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -85374,7 +80690,7 @@ func (p *FrontendServiceListSchemaPrivilegeStatusResult) DeepEqual(ano *Frontend return true } -func (p *FrontendServiceListSchemaPrivilegeStatusResult) Field0DeepEqual(src *TListPrivilegesResult_) bool { +func (p *FrontendServiceListUserPrivilegeStatusResult) Field0DeepEqual(src *TListPrivilegesResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -85382,38 +80698,38 @@ func (p *FrontendServiceListSchemaPrivilegeStatusResult) Field0DeepEqual(src *TL return true } -type FrontendServiceListUserPrivilegeStatusArgs struct { - Params *TGetTablesParams `thrift:"params,1" frugal:"1,default,TGetTablesParams" json:"params"` +type FrontendServiceUpdateExportTaskStatusArgs struct { + Request *TUpdateExportTaskStatusRequest `thrift:"request,1" frugal:"1,default,TUpdateExportTaskStatusRequest" json:"request"` } -func NewFrontendServiceListUserPrivilegeStatusArgs() *FrontendServiceListUserPrivilegeStatusArgs { - return &FrontendServiceListUserPrivilegeStatusArgs{} +func NewFrontendServiceUpdateExportTaskStatusArgs() *FrontendServiceUpdateExportTaskStatusArgs { + return &FrontendServiceUpdateExportTaskStatusArgs{} } -func (p *FrontendServiceListUserPrivilegeStatusArgs) InitDefault() { +func (p *FrontendServiceUpdateExportTaskStatusArgs) InitDefault() { } -var FrontendServiceListUserPrivilegeStatusArgs_Params_DEFAULT *TGetTablesParams +var FrontendServiceUpdateExportTaskStatusArgs_Request_DEFAULT *TUpdateExportTaskStatusRequest -func (p *FrontendServiceListUserPrivilegeStatusArgs) GetParams() (v *TGetTablesParams) { - if !p.IsSetParams() { - return FrontendServiceListUserPrivilegeStatusArgs_Params_DEFAULT +func (p *FrontendServiceUpdateExportTaskStatusArgs) GetRequest() (v *TUpdateExportTaskStatusRequest) { + if !p.IsSetRequest() { + return FrontendServiceUpdateExportTaskStatusArgs_Request_DEFAULT } - return p.Params + return p.Request } -func (p *FrontendServiceListUserPrivilegeStatusArgs) SetParams(val *TGetTablesParams) { - p.Params = val +func (p *FrontendServiceUpdateExportTaskStatusArgs) SetRequest(val *TUpdateExportTaskStatusRequest) { + p.Request = val } -var fieldIDToName_FrontendServiceListUserPrivilegeStatusArgs = map[int16]string{ - 1: "params", +var fieldIDToName_FrontendServiceUpdateExportTaskStatusArgs = map[int16]string{ + 1: "request", } -func (p *FrontendServiceListUserPrivilegeStatusArgs) IsSetParams() bool { - return p.Params != nil +func (p *FrontendServiceUpdateExportTaskStatusArgs) IsSetRequest() bool { + return p.Request != nil } -func (p *FrontendServiceListUserPrivilegeStatusArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceUpdateExportTaskStatusArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -85459,7 +80775,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListUserPrivilegeStatusArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceUpdateExportTaskStatusArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -85469,18 +80785,18 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceListUserPrivilegeStatusArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTGetTablesParams() +func (p *FrontendServiceUpdateExportTaskStatusArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTUpdateExportTaskStatusRequest() if err := _field.Read(iprot); err != nil { return err } - p.Params = _field + p.Request = _field return nil } -func (p *FrontendServiceListUserPrivilegeStatusArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceUpdateExportTaskStatusArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("listUserPrivilegeStatus_args"); err != nil { + if err = oprot.WriteStructBegin("updateExportTaskStatus_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -85506,11 +80822,11 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListUserPrivilegeStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("params", thrift.STRUCT, 1); err != nil { +func (p *FrontendServiceUpdateExportTaskStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { + if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } - if err := p.Params.Write(oprot); err != nil { + if err := p.Request.Write(oprot); err != nil { return err } if err = oprot.WriteFieldEnd(); err != nil { @@ -85523,66 +80839,66 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceListUserPrivilegeStatusArgs) String() string { +func (p *FrontendServiceUpdateExportTaskStatusArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListUserPrivilegeStatusArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceUpdateExportTaskStatusArgs(%+v)", *p) } -func (p *FrontendServiceListUserPrivilegeStatusArgs) DeepEqual(ano *FrontendServiceListUserPrivilegeStatusArgs) bool { +func (p *FrontendServiceUpdateExportTaskStatusArgs) DeepEqual(ano *FrontendServiceUpdateExportTaskStatusArgs) bool { if p == ano { return true } else if p == nil || ano == nil { return false } - if !p.Field1DeepEqual(ano.Params) { + if !p.Field1DeepEqual(ano.Request) { return false } return true } -func (p *FrontendServiceListUserPrivilegeStatusArgs) Field1DeepEqual(src *TGetTablesParams) bool { +func (p *FrontendServiceUpdateExportTaskStatusArgs) Field1DeepEqual(src *TUpdateExportTaskStatusRequest) bool { - if !p.Params.DeepEqual(src) { + if !p.Request.DeepEqual(src) { return false } return true } -type FrontendServiceListUserPrivilegeStatusResult struct { - Success *TListPrivilegesResult_ `thrift:"success,0,optional" frugal:"0,optional,TListPrivilegesResult_" json:"success,omitempty"` +type FrontendServiceUpdateExportTaskStatusResult struct { + Success *TFeResult_ `thrift:"success,0,optional" frugal:"0,optional,TFeResult_" json:"success,omitempty"` } -func NewFrontendServiceListUserPrivilegeStatusResult() *FrontendServiceListUserPrivilegeStatusResult { - return &FrontendServiceListUserPrivilegeStatusResult{} +func NewFrontendServiceUpdateExportTaskStatusResult() *FrontendServiceUpdateExportTaskStatusResult { + return &FrontendServiceUpdateExportTaskStatusResult{} } -func (p *FrontendServiceListUserPrivilegeStatusResult) InitDefault() { +func (p *FrontendServiceUpdateExportTaskStatusResult) InitDefault() { } -var FrontendServiceListUserPrivilegeStatusResult_Success_DEFAULT *TListPrivilegesResult_ +var FrontendServiceUpdateExportTaskStatusResult_Success_DEFAULT *TFeResult_ -func (p *FrontendServiceListUserPrivilegeStatusResult) GetSuccess() (v *TListPrivilegesResult_) { +func (p *FrontendServiceUpdateExportTaskStatusResult) GetSuccess() (v *TFeResult_) { if !p.IsSetSuccess() { - return FrontendServiceListUserPrivilegeStatusResult_Success_DEFAULT + return FrontendServiceUpdateExportTaskStatusResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceListUserPrivilegeStatusResult) SetSuccess(x interface{}) { - p.Success = x.(*TListPrivilegesResult_) +func (p *FrontendServiceUpdateExportTaskStatusResult) SetSuccess(x interface{}) { + p.Success = x.(*TFeResult_) } -var fieldIDToName_FrontendServiceListUserPrivilegeStatusResult = map[int16]string{ +var fieldIDToName_FrontendServiceUpdateExportTaskStatusResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceListUserPrivilegeStatusResult) IsSetSuccess() bool { +func (p *FrontendServiceUpdateExportTaskStatusResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceListUserPrivilegeStatusResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceUpdateExportTaskStatusResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -85628,7 +80944,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceListUserPrivilegeStatusResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceUpdateExportTaskStatusResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -85638,8 +80954,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceListUserPrivilegeStatusResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTListPrivilegesResult_() +func (p *FrontendServiceUpdateExportTaskStatusResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTFeResult_() if err := _field.Read(iprot); err != nil { return err } @@ -85647,9 +80963,9 @@ func (p *FrontendServiceListUserPrivilegeStatusResult) ReadField0(iprot thrift.T return nil } -func (p *FrontendServiceListUserPrivilegeStatusResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceUpdateExportTaskStatusResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("listUserPrivilegeStatus_result"); err != nil { + if err = oprot.WriteStructBegin("updateExportTaskStatus_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -85675,7 +80991,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceListUserPrivilegeStatusResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceUpdateExportTaskStatusResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -85694,15 +81010,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceListUserPrivilegeStatusResult) String() string { +func (p *FrontendServiceUpdateExportTaskStatusResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceListUserPrivilegeStatusResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceUpdateExportTaskStatusResult(%+v)", *p) } -func (p *FrontendServiceListUserPrivilegeStatusResult) DeepEqual(ano *FrontendServiceListUserPrivilegeStatusResult) bool { +func (p *FrontendServiceUpdateExportTaskStatusResult) DeepEqual(ano *FrontendServiceUpdateExportTaskStatusResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -85714,7 +81030,7 @@ func (p *FrontendServiceListUserPrivilegeStatusResult) DeepEqual(ano *FrontendSe return true } -func (p *FrontendServiceListUserPrivilegeStatusResult) Field0DeepEqual(src *TListPrivilegesResult_) bool { +func (p *FrontendServiceUpdateExportTaskStatusResult) Field0DeepEqual(src *TFeResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -85722,38 +81038,38 @@ func (p *FrontendServiceListUserPrivilegeStatusResult) Field0DeepEqual(src *TLis return true } -type FrontendServiceUpdateExportTaskStatusArgs struct { - Request *TUpdateExportTaskStatusRequest `thrift:"request,1" frugal:"1,default,TUpdateExportTaskStatusRequest" json:"request"` +type FrontendServiceLoadTxnBeginArgs struct { + Request *TLoadTxnBeginRequest `thrift:"request,1" frugal:"1,default,TLoadTxnBeginRequest" json:"request"` } -func NewFrontendServiceUpdateExportTaskStatusArgs() *FrontendServiceUpdateExportTaskStatusArgs { - return &FrontendServiceUpdateExportTaskStatusArgs{} +func NewFrontendServiceLoadTxnBeginArgs() *FrontendServiceLoadTxnBeginArgs { + return &FrontendServiceLoadTxnBeginArgs{} } -func (p *FrontendServiceUpdateExportTaskStatusArgs) InitDefault() { +func (p *FrontendServiceLoadTxnBeginArgs) InitDefault() { } -var FrontendServiceUpdateExportTaskStatusArgs_Request_DEFAULT *TUpdateExportTaskStatusRequest +var FrontendServiceLoadTxnBeginArgs_Request_DEFAULT *TLoadTxnBeginRequest -func (p *FrontendServiceUpdateExportTaskStatusArgs) GetRequest() (v *TUpdateExportTaskStatusRequest) { +func (p *FrontendServiceLoadTxnBeginArgs) GetRequest() (v *TLoadTxnBeginRequest) { if !p.IsSetRequest() { - return FrontendServiceUpdateExportTaskStatusArgs_Request_DEFAULT + return FrontendServiceLoadTxnBeginArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceUpdateExportTaskStatusArgs) SetRequest(val *TUpdateExportTaskStatusRequest) { +func (p *FrontendServiceLoadTxnBeginArgs) SetRequest(val *TLoadTxnBeginRequest) { p.Request = val } -var fieldIDToName_FrontendServiceUpdateExportTaskStatusArgs = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnBeginArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceUpdateExportTaskStatusArgs) IsSetRequest() bool { +func (p *FrontendServiceLoadTxnBeginArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceUpdateExportTaskStatusArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnBeginArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -85799,7 +81115,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceUpdateExportTaskStatusArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnBeginArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -85809,8 +81125,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceUpdateExportTaskStatusArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTUpdateExportTaskStatusRequest() +func (p *FrontendServiceLoadTxnBeginArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTLoadTxnBeginRequest() if err := _field.Read(iprot); err != nil { return err } @@ -85818,9 +81134,9 @@ func (p *FrontendServiceUpdateExportTaskStatusArgs) ReadField1(iprot thrift.TPro return nil } -func (p *FrontendServiceUpdateExportTaskStatusArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnBeginArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("updateExportTaskStatus_args"); err != nil { + if err = oprot.WriteStructBegin("loadTxnBegin_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -85846,7 +81162,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceUpdateExportTaskStatusArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnBeginArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -85863,15 +81179,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceUpdateExportTaskStatusArgs) String() string { +func (p *FrontendServiceLoadTxnBeginArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceUpdateExportTaskStatusArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnBeginArgs(%+v)", *p) } -func (p *FrontendServiceUpdateExportTaskStatusArgs) DeepEqual(ano *FrontendServiceUpdateExportTaskStatusArgs) bool { +func (p *FrontendServiceLoadTxnBeginArgs) DeepEqual(ano *FrontendServiceLoadTxnBeginArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -85883,7 +81199,7 @@ func (p *FrontendServiceUpdateExportTaskStatusArgs) DeepEqual(ano *FrontendServi return true } -func (p *FrontendServiceUpdateExportTaskStatusArgs) Field1DeepEqual(src *TUpdateExportTaskStatusRequest) bool { +func (p *FrontendServiceLoadTxnBeginArgs) Field1DeepEqual(src *TLoadTxnBeginRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -85891,38 +81207,38 @@ func (p *FrontendServiceUpdateExportTaskStatusArgs) Field1DeepEqual(src *TUpdate return true } -type FrontendServiceUpdateExportTaskStatusResult struct { - Success *TFeResult_ `thrift:"success,0,optional" frugal:"0,optional,TFeResult_" json:"success,omitempty"` +type FrontendServiceLoadTxnBeginResult struct { + Success *TLoadTxnBeginResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnBeginResult_" json:"success,omitempty"` } -func NewFrontendServiceUpdateExportTaskStatusResult() *FrontendServiceUpdateExportTaskStatusResult { - return &FrontendServiceUpdateExportTaskStatusResult{} +func NewFrontendServiceLoadTxnBeginResult() *FrontendServiceLoadTxnBeginResult { + return &FrontendServiceLoadTxnBeginResult{} } -func (p *FrontendServiceUpdateExportTaskStatusResult) InitDefault() { +func (p *FrontendServiceLoadTxnBeginResult) InitDefault() { } -var FrontendServiceUpdateExportTaskStatusResult_Success_DEFAULT *TFeResult_ +var FrontendServiceLoadTxnBeginResult_Success_DEFAULT *TLoadTxnBeginResult_ -func (p *FrontendServiceUpdateExportTaskStatusResult) GetSuccess() (v *TFeResult_) { +func (p *FrontendServiceLoadTxnBeginResult) GetSuccess() (v *TLoadTxnBeginResult_) { if !p.IsSetSuccess() { - return FrontendServiceUpdateExportTaskStatusResult_Success_DEFAULT + return FrontendServiceLoadTxnBeginResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceUpdateExportTaskStatusResult) SetSuccess(x interface{}) { - p.Success = x.(*TFeResult_) +func (p *FrontendServiceLoadTxnBeginResult) SetSuccess(x interface{}) { + p.Success = x.(*TLoadTxnBeginResult_) } -var fieldIDToName_FrontendServiceUpdateExportTaskStatusResult = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnBeginResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceUpdateExportTaskStatusResult) IsSetSuccess() bool { +func (p *FrontendServiceLoadTxnBeginResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceUpdateExportTaskStatusResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnBeginResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -85968,7 +81284,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceUpdateExportTaskStatusResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnBeginResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -85978,8 +81294,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceUpdateExportTaskStatusResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTFeResult_() +func (p *FrontendServiceLoadTxnBeginResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTLoadTxnBeginResult_() if err := _field.Read(iprot); err != nil { return err } @@ -85987,9 +81303,9 @@ func (p *FrontendServiceUpdateExportTaskStatusResult) ReadField0(iprot thrift.TP return nil } -func (p *FrontendServiceUpdateExportTaskStatusResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnBeginResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("updateExportTaskStatus_result"); err != nil { + if err = oprot.WriteStructBegin("loadTxnBegin_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -86015,7 +81331,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceUpdateExportTaskStatusResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnBeginResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -86034,15 +81350,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceUpdateExportTaskStatusResult) String() string { +func (p *FrontendServiceLoadTxnBeginResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceUpdateExportTaskStatusResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnBeginResult(%+v)", *p) } -func (p *FrontendServiceUpdateExportTaskStatusResult) DeepEqual(ano *FrontendServiceUpdateExportTaskStatusResult) bool { +func (p *FrontendServiceLoadTxnBeginResult) DeepEqual(ano *FrontendServiceLoadTxnBeginResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -86054,7 +81370,7 @@ func (p *FrontendServiceUpdateExportTaskStatusResult) DeepEqual(ano *FrontendSer return true } -func (p *FrontendServiceUpdateExportTaskStatusResult) Field0DeepEqual(src *TFeResult_) bool { +func (p *FrontendServiceLoadTxnBeginResult) Field0DeepEqual(src *TLoadTxnBeginResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -86062,38 +81378,38 @@ func (p *FrontendServiceUpdateExportTaskStatusResult) Field0DeepEqual(src *TFeRe return true } -type FrontendServiceLoadTxnBeginArgs struct { - Request *TLoadTxnBeginRequest `thrift:"request,1" frugal:"1,default,TLoadTxnBeginRequest" json:"request"` +type FrontendServiceLoadTxnPreCommitArgs struct { + Request *TLoadTxnCommitRequest `thrift:"request,1" frugal:"1,default,TLoadTxnCommitRequest" json:"request"` } -func NewFrontendServiceLoadTxnBeginArgs() *FrontendServiceLoadTxnBeginArgs { - return &FrontendServiceLoadTxnBeginArgs{} +func NewFrontendServiceLoadTxnPreCommitArgs() *FrontendServiceLoadTxnPreCommitArgs { + return &FrontendServiceLoadTxnPreCommitArgs{} } -func (p *FrontendServiceLoadTxnBeginArgs) InitDefault() { +func (p *FrontendServiceLoadTxnPreCommitArgs) InitDefault() { } -var FrontendServiceLoadTxnBeginArgs_Request_DEFAULT *TLoadTxnBeginRequest +var FrontendServiceLoadTxnPreCommitArgs_Request_DEFAULT *TLoadTxnCommitRequest -func (p *FrontendServiceLoadTxnBeginArgs) GetRequest() (v *TLoadTxnBeginRequest) { +func (p *FrontendServiceLoadTxnPreCommitArgs) GetRequest() (v *TLoadTxnCommitRequest) { if !p.IsSetRequest() { - return FrontendServiceLoadTxnBeginArgs_Request_DEFAULT + return FrontendServiceLoadTxnPreCommitArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceLoadTxnBeginArgs) SetRequest(val *TLoadTxnBeginRequest) { +func (p *FrontendServiceLoadTxnPreCommitArgs) SetRequest(val *TLoadTxnCommitRequest) { p.Request = val } -var fieldIDToName_FrontendServiceLoadTxnBeginArgs = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnPreCommitArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceLoadTxnBeginArgs) IsSetRequest() bool { +func (p *FrontendServiceLoadTxnPreCommitArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceLoadTxnBeginArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnPreCommitArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -86139,7 +81455,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnBeginArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnPreCommitArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -86149,8 +81465,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnBeginArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTLoadTxnBeginRequest() +func (p *FrontendServiceLoadTxnPreCommitArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTLoadTxnCommitRequest() if err := _field.Read(iprot); err != nil { return err } @@ -86158,9 +81474,9 @@ func (p *FrontendServiceLoadTxnBeginArgs) ReadField1(iprot thrift.TProtocol) err return nil } -func (p *FrontendServiceLoadTxnBeginArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnPreCommitArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnBegin_args"); err != nil { + if err = oprot.WriteStructBegin("loadTxnPreCommit_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -86186,7 +81502,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnBeginArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnPreCommitArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -86203,15 +81519,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceLoadTxnBeginArgs) String() string { +func (p *FrontendServiceLoadTxnPreCommitArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnBeginArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnPreCommitArgs(%+v)", *p) } -func (p *FrontendServiceLoadTxnBeginArgs) DeepEqual(ano *FrontendServiceLoadTxnBeginArgs) bool { +func (p *FrontendServiceLoadTxnPreCommitArgs) DeepEqual(ano *FrontendServiceLoadTxnPreCommitArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -86223,7 +81539,7 @@ func (p *FrontendServiceLoadTxnBeginArgs) DeepEqual(ano *FrontendServiceLoadTxnB return true } -func (p *FrontendServiceLoadTxnBeginArgs) Field1DeepEqual(src *TLoadTxnBeginRequest) bool { +func (p *FrontendServiceLoadTxnPreCommitArgs) Field1DeepEqual(src *TLoadTxnCommitRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -86231,38 +81547,38 @@ func (p *FrontendServiceLoadTxnBeginArgs) Field1DeepEqual(src *TLoadTxnBeginRequ return true } -type FrontendServiceLoadTxnBeginResult struct { - Success *TLoadTxnBeginResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnBeginResult_" json:"success,omitempty"` +type FrontendServiceLoadTxnPreCommitResult struct { + Success *TLoadTxnCommitResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnCommitResult_" json:"success,omitempty"` } -func NewFrontendServiceLoadTxnBeginResult() *FrontendServiceLoadTxnBeginResult { - return &FrontendServiceLoadTxnBeginResult{} +func NewFrontendServiceLoadTxnPreCommitResult() *FrontendServiceLoadTxnPreCommitResult { + return &FrontendServiceLoadTxnPreCommitResult{} } -func (p *FrontendServiceLoadTxnBeginResult) InitDefault() { +func (p *FrontendServiceLoadTxnPreCommitResult) InitDefault() { } -var FrontendServiceLoadTxnBeginResult_Success_DEFAULT *TLoadTxnBeginResult_ +var FrontendServiceLoadTxnPreCommitResult_Success_DEFAULT *TLoadTxnCommitResult_ -func (p *FrontendServiceLoadTxnBeginResult) GetSuccess() (v *TLoadTxnBeginResult_) { +func (p *FrontendServiceLoadTxnPreCommitResult) GetSuccess() (v *TLoadTxnCommitResult_) { if !p.IsSetSuccess() { - return FrontendServiceLoadTxnBeginResult_Success_DEFAULT + return FrontendServiceLoadTxnPreCommitResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceLoadTxnBeginResult) SetSuccess(x interface{}) { - p.Success = x.(*TLoadTxnBeginResult_) +func (p *FrontendServiceLoadTxnPreCommitResult) SetSuccess(x interface{}) { + p.Success = x.(*TLoadTxnCommitResult_) } -var fieldIDToName_FrontendServiceLoadTxnBeginResult = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnPreCommitResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceLoadTxnBeginResult) IsSetSuccess() bool { +func (p *FrontendServiceLoadTxnPreCommitResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceLoadTxnBeginResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnPreCommitResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -86308,7 +81624,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnBeginResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnPreCommitResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -86318,8 +81634,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnBeginResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTLoadTxnBeginResult_() +func (p *FrontendServiceLoadTxnPreCommitResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTLoadTxnCommitResult_() if err := _field.Read(iprot); err != nil { return err } @@ -86327,9 +81643,9 @@ func (p *FrontendServiceLoadTxnBeginResult) ReadField0(iprot thrift.TProtocol) e return nil } -func (p *FrontendServiceLoadTxnBeginResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnPreCommitResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnBegin_result"); err != nil { + if err = oprot.WriteStructBegin("loadTxnPreCommit_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -86355,7 +81671,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnBeginResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnPreCommitResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -86374,15 +81690,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceLoadTxnBeginResult) String() string { +func (p *FrontendServiceLoadTxnPreCommitResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnBeginResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnPreCommitResult(%+v)", *p) } -func (p *FrontendServiceLoadTxnBeginResult) DeepEqual(ano *FrontendServiceLoadTxnBeginResult) bool { +func (p *FrontendServiceLoadTxnPreCommitResult) DeepEqual(ano *FrontendServiceLoadTxnPreCommitResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -86394,7 +81710,7 @@ func (p *FrontendServiceLoadTxnBeginResult) DeepEqual(ano *FrontendServiceLoadTx return true } -func (p *FrontendServiceLoadTxnBeginResult) Field0DeepEqual(src *TLoadTxnBeginResult_) bool { +func (p *FrontendServiceLoadTxnPreCommitResult) Field0DeepEqual(src *TLoadTxnCommitResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -86402,38 +81718,38 @@ func (p *FrontendServiceLoadTxnBeginResult) Field0DeepEqual(src *TLoadTxnBeginRe return true } -type FrontendServiceLoadTxnPreCommitArgs struct { - Request *TLoadTxnCommitRequest `thrift:"request,1" frugal:"1,default,TLoadTxnCommitRequest" json:"request"` +type FrontendServiceLoadTxn2PCArgs struct { + Request *TLoadTxn2PCRequest `thrift:"request,1" frugal:"1,default,TLoadTxn2PCRequest" json:"request"` } -func NewFrontendServiceLoadTxnPreCommitArgs() *FrontendServiceLoadTxnPreCommitArgs { - return &FrontendServiceLoadTxnPreCommitArgs{} +func NewFrontendServiceLoadTxn2PCArgs() *FrontendServiceLoadTxn2PCArgs { + return &FrontendServiceLoadTxn2PCArgs{} } -func (p *FrontendServiceLoadTxnPreCommitArgs) InitDefault() { +func (p *FrontendServiceLoadTxn2PCArgs) InitDefault() { } -var FrontendServiceLoadTxnPreCommitArgs_Request_DEFAULT *TLoadTxnCommitRequest +var FrontendServiceLoadTxn2PCArgs_Request_DEFAULT *TLoadTxn2PCRequest -func (p *FrontendServiceLoadTxnPreCommitArgs) GetRequest() (v *TLoadTxnCommitRequest) { +func (p *FrontendServiceLoadTxn2PCArgs) GetRequest() (v *TLoadTxn2PCRequest) { if !p.IsSetRequest() { - return FrontendServiceLoadTxnPreCommitArgs_Request_DEFAULT + return FrontendServiceLoadTxn2PCArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceLoadTxnPreCommitArgs) SetRequest(val *TLoadTxnCommitRequest) { +func (p *FrontendServiceLoadTxn2PCArgs) SetRequest(val *TLoadTxn2PCRequest) { p.Request = val } -var fieldIDToName_FrontendServiceLoadTxnPreCommitArgs = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxn2PCArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceLoadTxnPreCommitArgs) IsSetRequest() bool { +func (p *FrontendServiceLoadTxn2PCArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceLoadTxnPreCommitArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxn2PCArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -86479,7 +81795,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnPreCommitArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxn2PCArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -86489,8 +81805,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnPreCommitArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTLoadTxnCommitRequest() +func (p *FrontendServiceLoadTxn2PCArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTLoadTxn2PCRequest() if err := _field.Read(iprot); err != nil { return err } @@ -86498,9 +81814,9 @@ func (p *FrontendServiceLoadTxnPreCommitArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *FrontendServiceLoadTxnPreCommitArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxn2PCArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnPreCommit_args"); err != nil { + if err = oprot.WriteStructBegin("loadTxn2PC_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -86526,7 +81842,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnPreCommitArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxn2PCArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -86543,15 +81859,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceLoadTxnPreCommitArgs) String() string { +func (p *FrontendServiceLoadTxn2PCArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnPreCommitArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxn2PCArgs(%+v)", *p) } -func (p *FrontendServiceLoadTxnPreCommitArgs) DeepEqual(ano *FrontendServiceLoadTxnPreCommitArgs) bool { +func (p *FrontendServiceLoadTxn2PCArgs) DeepEqual(ano *FrontendServiceLoadTxn2PCArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -86563,7 +81879,7 @@ func (p *FrontendServiceLoadTxnPreCommitArgs) DeepEqual(ano *FrontendServiceLoad return true } -func (p *FrontendServiceLoadTxnPreCommitArgs) Field1DeepEqual(src *TLoadTxnCommitRequest) bool { +func (p *FrontendServiceLoadTxn2PCArgs) Field1DeepEqual(src *TLoadTxn2PCRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -86571,38 +81887,38 @@ func (p *FrontendServiceLoadTxnPreCommitArgs) Field1DeepEqual(src *TLoadTxnCommi return true } -type FrontendServiceLoadTxnPreCommitResult struct { - Success *TLoadTxnCommitResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnCommitResult_" json:"success,omitempty"` +type FrontendServiceLoadTxn2PCResult struct { + Success *TLoadTxn2PCResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxn2PCResult_" json:"success,omitempty"` } -func NewFrontendServiceLoadTxnPreCommitResult() *FrontendServiceLoadTxnPreCommitResult { - return &FrontendServiceLoadTxnPreCommitResult{} +func NewFrontendServiceLoadTxn2PCResult() *FrontendServiceLoadTxn2PCResult { + return &FrontendServiceLoadTxn2PCResult{} } -func (p *FrontendServiceLoadTxnPreCommitResult) InitDefault() { +func (p *FrontendServiceLoadTxn2PCResult) InitDefault() { } -var FrontendServiceLoadTxnPreCommitResult_Success_DEFAULT *TLoadTxnCommitResult_ +var FrontendServiceLoadTxn2PCResult_Success_DEFAULT *TLoadTxn2PCResult_ -func (p *FrontendServiceLoadTxnPreCommitResult) GetSuccess() (v *TLoadTxnCommitResult_) { +func (p *FrontendServiceLoadTxn2PCResult) GetSuccess() (v *TLoadTxn2PCResult_) { if !p.IsSetSuccess() { - return FrontendServiceLoadTxnPreCommitResult_Success_DEFAULT + return FrontendServiceLoadTxn2PCResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceLoadTxnPreCommitResult) SetSuccess(x interface{}) { - p.Success = x.(*TLoadTxnCommitResult_) +func (p *FrontendServiceLoadTxn2PCResult) SetSuccess(x interface{}) { + p.Success = x.(*TLoadTxn2PCResult_) } -var fieldIDToName_FrontendServiceLoadTxnPreCommitResult = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxn2PCResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceLoadTxnPreCommitResult) IsSetSuccess() bool { +func (p *FrontendServiceLoadTxn2PCResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceLoadTxnPreCommitResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxn2PCResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -86648,7 +81964,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnPreCommitResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxn2PCResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -86658,8 +81974,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnPreCommitResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTLoadTxnCommitResult_() +func (p *FrontendServiceLoadTxn2PCResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTLoadTxn2PCResult_() if err := _field.Read(iprot); err != nil { return err } @@ -86667,9 +81983,9 @@ func (p *FrontendServiceLoadTxnPreCommitResult) ReadField0(iprot thrift.TProtoco return nil } -func (p *FrontendServiceLoadTxnPreCommitResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxn2PCResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnPreCommit_result"); err != nil { + if err = oprot.WriteStructBegin("loadTxn2PC_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -86695,7 +82011,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnPreCommitResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxn2PCResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -86714,15 +82030,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceLoadTxnPreCommitResult) String() string { +func (p *FrontendServiceLoadTxn2PCResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnPreCommitResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxn2PCResult(%+v)", *p) } -func (p *FrontendServiceLoadTxnPreCommitResult) DeepEqual(ano *FrontendServiceLoadTxnPreCommitResult) bool { +func (p *FrontendServiceLoadTxn2PCResult) DeepEqual(ano *FrontendServiceLoadTxn2PCResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -86734,7 +82050,7 @@ func (p *FrontendServiceLoadTxnPreCommitResult) DeepEqual(ano *FrontendServiceLo return true } -func (p *FrontendServiceLoadTxnPreCommitResult) Field0DeepEqual(src *TLoadTxnCommitResult_) bool { +func (p *FrontendServiceLoadTxn2PCResult) Field0DeepEqual(src *TLoadTxn2PCResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -86742,38 +82058,38 @@ func (p *FrontendServiceLoadTxnPreCommitResult) Field0DeepEqual(src *TLoadTxnCom return true } -type FrontendServiceLoadTxn2PCArgs struct { - Request *TLoadTxn2PCRequest `thrift:"request,1" frugal:"1,default,TLoadTxn2PCRequest" json:"request"` +type FrontendServiceLoadTxnCommitArgs struct { + Request *TLoadTxnCommitRequest `thrift:"request,1" frugal:"1,default,TLoadTxnCommitRequest" json:"request"` } -func NewFrontendServiceLoadTxn2PCArgs() *FrontendServiceLoadTxn2PCArgs { - return &FrontendServiceLoadTxn2PCArgs{} +func NewFrontendServiceLoadTxnCommitArgs() *FrontendServiceLoadTxnCommitArgs { + return &FrontendServiceLoadTxnCommitArgs{} } -func (p *FrontendServiceLoadTxn2PCArgs) InitDefault() { +func (p *FrontendServiceLoadTxnCommitArgs) InitDefault() { } -var FrontendServiceLoadTxn2PCArgs_Request_DEFAULT *TLoadTxn2PCRequest +var FrontendServiceLoadTxnCommitArgs_Request_DEFAULT *TLoadTxnCommitRequest -func (p *FrontendServiceLoadTxn2PCArgs) GetRequest() (v *TLoadTxn2PCRequest) { +func (p *FrontendServiceLoadTxnCommitArgs) GetRequest() (v *TLoadTxnCommitRequest) { if !p.IsSetRequest() { - return FrontendServiceLoadTxn2PCArgs_Request_DEFAULT + return FrontendServiceLoadTxnCommitArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceLoadTxn2PCArgs) SetRequest(val *TLoadTxn2PCRequest) { +func (p *FrontendServiceLoadTxnCommitArgs) SetRequest(val *TLoadTxnCommitRequest) { p.Request = val } -var fieldIDToName_FrontendServiceLoadTxn2PCArgs = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnCommitArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceLoadTxn2PCArgs) IsSetRequest() bool { +func (p *FrontendServiceLoadTxnCommitArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceLoadTxn2PCArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnCommitArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -86819,7 +82135,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxn2PCArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnCommitArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -86829,8 +82145,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxn2PCArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTLoadTxn2PCRequest() +func (p *FrontendServiceLoadTxnCommitArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTLoadTxnCommitRequest() if err := _field.Read(iprot); err != nil { return err } @@ -86838,9 +82154,9 @@ func (p *FrontendServiceLoadTxn2PCArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *FrontendServiceLoadTxn2PCArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnCommitArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxn2PC_args"); err != nil { + if err = oprot.WriteStructBegin("loadTxnCommit_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -86866,7 +82182,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxn2PCArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnCommitArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -86883,15 +82199,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceLoadTxn2PCArgs) String() string { +func (p *FrontendServiceLoadTxnCommitArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxn2PCArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnCommitArgs(%+v)", *p) } -func (p *FrontendServiceLoadTxn2PCArgs) DeepEqual(ano *FrontendServiceLoadTxn2PCArgs) bool { +func (p *FrontendServiceLoadTxnCommitArgs) DeepEqual(ano *FrontendServiceLoadTxnCommitArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -86903,7 +82219,7 @@ func (p *FrontendServiceLoadTxn2PCArgs) DeepEqual(ano *FrontendServiceLoadTxn2PC return true } -func (p *FrontendServiceLoadTxn2PCArgs) Field1DeepEqual(src *TLoadTxn2PCRequest) bool { +func (p *FrontendServiceLoadTxnCommitArgs) Field1DeepEqual(src *TLoadTxnCommitRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -86911,38 +82227,38 @@ func (p *FrontendServiceLoadTxn2PCArgs) Field1DeepEqual(src *TLoadTxn2PCRequest) return true } -type FrontendServiceLoadTxn2PCResult struct { - Success *TLoadTxn2PCResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxn2PCResult_" json:"success,omitempty"` +type FrontendServiceLoadTxnCommitResult struct { + Success *TLoadTxnCommitResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnCommitResult_" json:"success,omitempty"` } -func NewFrontendServiceLoadTxn2PCResult() *FrontendServiceLoadTxn2PCResult { - return &FrontendServiceLoadTxn2PCResult{} +func NewFrontendServiceLoadTxnCommitResult() *FrontendServiceLoadTxnCommitResult { + return &FrontendServiceLoadTxnCommitResult{} } -func (p *FrontendServiceLoadTxn2PCResult) InitDefault() { +func (p *FrontendServiceLoadTxnCommitResult) InitDefault() { } -var FrontendServiceLoadTxn2PCResult_Success_DEFAULT *TLoadTxn2PCResult_ +var FrontendServiceLoadTxnCommitResult_Success_DEFAULT *TLoadTxnCommitResult_ -func (p *FrontendServiceLoadTxn2PCResult) GetSuccess() (v *TLoadTxn2PCResult_) { +func (p *FrontendServiceLoadTxnCommitResult) GetSuccess() (v *TLoadTxnCommitResult_) { if !p.IsSetSuccess() { - return FrontendServiceLoadTxn2PCResult_Success_DEFAULT + return FrontendServiceLoadTxnCommitResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceLoadTxn2PCResult) SetSuccess(x interface{}) { - p.Success = x.(*TLoadTxn2PCResult_) +func (p *FrontendServiceLoadTxnCommitResult) SetSuccess(x interface{}) { + p.Success = x.(*TLoadTxnCommitResult_) } -var fieldIDToName_FrontendServiceLoadTxn2PCResult = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnCommitResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceLoadTxn2PCResult) IsSetSuccess() bool { +func (p *FrontendServiceLoadTxnCommitResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceLoadTxn2PCResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnCommitResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -86988,7 +82304,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxn2PCResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnCommitResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -86998,8 +82314,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxn2PCResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTLoadTxn2PCResult_() +func (p *FrontendServiceLoadTxnCommitResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTLoadTxnCommitResult_() if err := _field.Read(iprot); err != nil { return err } @@ -87007,9 +82323,9 @@ func (p *FrontendServiceLoadTxn2PCResult) ReadField0(iprot thrift.TProtocol) err return nil } -func (p *FrontendServiceLoadTxn2PCResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnCommitResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxn2PC_result"); err != nil { + if err = oprot.WriteStructBegin("loadTxnCommit_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -87035,7 +82351,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxn2PCResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnCommitResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -87054,15 +82370,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceLoadTxn2PCResult) String() string { +func (p *FrontendServiceLoadTxnCommitResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxn2PCResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnCommitResult(%+v)", *p) } -func (p *FrontendServiceLoadTxn2PCResult) DeepEqual(ano *FrontendServiceLoadTxn2PCResult) bool { +func (p *FrontendServiceLoadTxnCommitResult) DeepEqual(ano *FrontendServiceLoadTxnCommitResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -87074,7 +82390,7 @@ func (p *FrontendServiceLoadTxn2PCResult) DeepEqual(ano *FrontendServiceLoadTxn2 return true } -func (p *FrontendServiceLoadTxn2PCResult) Field0DeepEqual(src *TLoadTxn2PCResult_) bool { +func (p *FrontendServiceLoadTxnCommitResult) Field0DeepEqual(src *TLoadTxnCommitResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -87082,38 +82398,38 @@ func (p *FrontendServiceLoadTxn2PCResult) Field0DeepEqual(src *TLoadTxn2PCResult return true } -type FrontendServiceLoadTxnCommitArgs struct { - Request *TLoadTxnCommitRequest `thrift:"request,1" frugal:"1,default,TLoadTxnCommitRequest" json:"request"` +type FrontendServiceLoadTxnRollbackArgs struct { + Request *TLoadTxnRollbackRequest `thrift:"request,1" frugal:"1,default,TLoadTxnRollbackRequest" json:"request"` } -func NewFrontendServiceLoadTxnCommitArgs() *FrontendServiceLoadTxnCommitArgs { - return &FrontendServiceLoadTxnCommitArgs{} +func NewFrontendServiceLoadTxnRollbackArgs() *FrontendServiceLoadTxnRollbackArgs { + return &FrontendServiceLoadTxnRollbackArgs{} } -func (p *FrontendServiceLoadTxnCommitArgs) InitDefault() { +func (p *FrontendServiceLoadTxnRollbackArgs) InitDefault() { } -var FrontendServiceLoadTxnCommitArgs_Request_DEFAULT *TLoadTxnCommitRequest +var FrontendServiceLoadTxnRollbackArgs_Request_DEFAULT *TLoadTxnRollbackRequest -func (p *FrontendServiceLoadTxnCommitArgs) GetRequest() (v *TLoadTxnCommitRequest) { +func (p *FrontendServiceLoadTxnRollbackArgs) GetRequest() (v *TLoadTxnRollbackRequest) { if !p.IsSetRequest() { - return FrontendServiceLoadTxnCommitArgs_Request_DEFAULT + return FrontendServiceLoadTxnRollbackArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceLoadTxnCommitArgs) SetRequest(val *TLoadTxnCommitRequest) { +func (p *FrontendServiceLoadTxnRollbackArgs) SetRequest(val *TLoadTxnRollbackRequest) { p.Request = val } -var fieldIDToName_FrontendServiceLoadTxnCommitArgs = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnRollbackArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceLoadTxnCommitArgs) IsSetRequest() bool { +func (p *FrontendServiceLoadTxnRollbackArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceLoadTxnCommitArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnRollbackArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -87159,7 +82475,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnCommitArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnRollbackArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -87169,8 +82485,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnCommitArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTLoadTxnCommitRequest() +func (p *FrontendServiceLoadTxnRollbackArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTLoadTxnRollbackRequest() if err := _field.Read(iprot); err != nil { return err } @@ -87178,9 +82494,9 @@ func (p *FrontendServiceLoadTxnCommitArgs) ReadField1(iprot thrift.TProtocol) er return nil } -func (p *FrontendServiceLoadTxnCommitArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnRollbackArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnCommit_args"); err != nil { + if err = oprot.WriteStructBegin("loadTxnRollback_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -87206,7 +82522,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnCommitArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnRollbackArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -87223,15 +82539,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceLoadTxnCommitArgs) String() string { +func (p *FrontendServiceLoadTxnRollbackArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnCommitArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnRollbackArgs(%+v)", *p) } -func (p *FrontendServiceLoadTxnCommitArgs) DeepEqual(ano *FrontendServiceLoadTxnCommitArgs) bool { +func (p *FrontendServiceLoadTxnRollbackArgs) DeepEqual(ano *FrontendServiceLoadTxnRollbackArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -87243,7 +82559,7 @@ func (p *FrontendServiceLoadTxnCommitArgs) DeepEqual(ano *FrontendServiceLoadTxn return true } -func (p *FrontendServiceLoadTxnCommitArgs) Field1DeepEqual(src *TLoadTxnCommitRequest) bool { +func (p *FrontendServiceLoadTxnRollbackArgs) Field1DeepEqual(src *TLoadTxnRollbackRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -87251,38 +82567,38 @@ func (p *FrontendServiceLoadTxnCommitArgs) Field1DeepEqual(src *TLoadTxnCommitRe return true } -type FrontendServiceLoadTxnCommitResult struct { - Success *TLoadTxnCommitResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnCommitResult_" json:"success,omitempty"` +type FrontendServiceLoadTxnRollbackResult struct { + Success *TLoadTxnRollbackResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnRollbackResult_" json:"success,omitempty"` } -func NewFrontendServiceLoadTxnCommitResult() *FrontendServiceLoadTxnCommitResult { - return &FrontendServiceLoadTxnCommitResult{} +func NewFrontendServiceLoadTxnRollbackResult() *FrontendServiceLoadTxnRollbackResult { + return &FrontendServiceLoadTxnRollbackResult{} } -func (p *FrontendServiceLoadTxnCommitResult) InitDefault() { +func (p *FrontendServiceLoadTxnRollbackResult) InitDefault() { } -var FrontendServiceLoadTxnCommitResult_Success_DEFAULT *TLoadTxnCommitResult_ +var FrontendServiceLoadTxnRollbackResult_Success_DEFAULT *TLoadTxnRollbackResult_ -func (p *FrontendServiceLoadTxnCommitResult) GetSuccess() (v *TLoadTxnCommitResult_) { +func (p *FrontendServiceLoadTxnRollbackResult) GetSuccess() (v *TLoadTxnRollbackResult_) { if !p.IsSetSuccess() { - return FrontendServiceLoadTxnCommitResult_Success_DEFAULT + return FrontendServiceLoadTxnRollbackResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceLoadTxnCommitResult) SetSuccess(x interface{}) { - p.Success = x.(*TLoadTxnCommitResult_) +func (p *FrontendServiceLoadTxnRollbackResult) SetSuccess(x interface{}) { + p.Success = x.(*TLoadTxnRollbackResult_) } -var fieldIDToName_FrontendServiceLoadTxnCommitResult = map[int16]string{ +var fieldIDToName_FrontendServiceLoadTxnRollbackResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceLoadTxnCommitResult) IsSetSuccess() bool { +func (p *FrontendServiceLoadTxnRollbackResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceLoadTxnCommitResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnRollbackResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -87328,7 +82644,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnCommitResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnRollbackResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -87338,8 +82654,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnCommitResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTLoadTxnCommitResult_() +func (p *FrontendServiceLoadTxnRollbackResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTLoadTxnRollbackResult_() if err := _field.Read(iprot); err != nil { return err } @@ -87347,9 +82663,9 @@ func (p *FrontendServiceLoadTxnCommitResult) ReadField0(iprot thrift.TProtocol) return nil } -func (p *FrontendServiceLoadTxnCommitResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnRollbackResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnCommit_result"); err != nil { + if err = oprot.WriteStructBegin("loadTxnRollback_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -87375,7 +82691,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnCommitResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLoadTxnRollbackResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -87394,15 +82710,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceLoadTxnCommitResult) String() string { +func (p *FrontendServiceLoadTxnRollbackResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnCommitResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceLoadTxnRollbackResult(%+v)", *p) } -func (p *FrontendServiceLoadTxnCommitResult) DeepEqual(ano *FrontendServiceLoadTxnCommitResult) bool { +func (p *FrontendServiceLoadTxnRollbackResult) DeepEqual(ano *FrontendServiceLoadTxnRollbackResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -87414,7 +82730,7 @@ func (p *FrontendServiceLoadTxnCommitResult) DeepEqual(ano *FrontendServiceLoadT return true } -func (p *FrontendServiceLoadTxnCommitResult) Field0DeepEqual(src *TLoadTxnCommitResult_) bool { +func (p *FrontendServiceLoadTxnRollbackResult) Field0DeepEqual(src *TLoadTxnRollbackResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -87422,38 +82738,38 @@ func (p *FrontendServiceLoadTxnCommitResult) Field0DeepEqual(src *TLoadTxnCommit return true } -type FrontendServiceLoadTxnRollbackArgs struct { - Request *TLoadTxnRollbackRequest `thrift:"request,1" frugal:"1,default,TLoadTxnRollbackRequest" json:"request"` +type FrontendServiceBeginTxnArgs struct { + Request *TBeginTxnRequest `thrift:"request,1" frugal:"1,default,TBeginTxnRequest" json:"request"` } -func NewFrontendServiceLoadTxnRollbackArgs() *FrontendServiceLoadTxnRollbackArgs { - return &FrontendServiceLoadTxnRollbackArgs{} +func NewFrontendServiceBeginTxnArgs() *FrontendServiceBeginTxnArgs { + return &FrontendServiceBeginTxnArgs{} } -func (p *FrontendServiceLoadTxnRollbackArgs) InitDefault() { +func (p *FrontendServiceBeginTxnArgs) InitDefault() { } -var FrontendServiceLoadTxnRollbackArgs_Request_DEFAULT *TLoadTxnRollbackRequest +var FrontendServiceBeginTxnArgs_Request_DEFAULT *TBeginTxnRequest -func (p *FrontendServiceLoadTxnRollbackArgs) GetRequest() (v *TLoadTxnRollbackRequest) { +func (p *FrontendServiceBeginTxnArgs) GetRequest() (v *TBeginTxnRequest) { if !p.IsSetRequest() { - return FrontendServiceLoadTxnRollbackArgs_Request_DEFAULT + return FrontendServiceBeginTxnArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceLoadTxnRollbackArgs) SetRequest(val *TLoadTxnRollbackRequest) { +func (p *FrontendServiceBeginTxnArgs) SetRequest(val *TBeginTxnRequest) { p.Request = val } -var fieldIDToName_FrontendServiceLoadTxnRollbackArgs = map[int16]string{ +var fieldIDToName_FrontendServiceBeginTxnArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceLoadTxnRollbackArgs) IsSetRequest() bool { +func (p *FrontendServiceBeginTxnArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceLoadTxnRollbackArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceBeginTxnArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -87499,7 +82815,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnRollbackArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceBeginTxnArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -87509,8 +82825,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnRollbackArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTLoadTxnRollbackRequest() +func (p *FrontendServiceBeginTxnArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTBeginTxnRequest() if err := _field.Read(iprot); err != nil { return err } @@ -87518,9 +82834,9 @@ func (p *FrontendServiceLoadTxnRollbackArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *FrontendServiceLoadTxnRollbackArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceBeginTxnArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnRollback_args"); err != nil { + if err = oprot.WriteStructBegin("beginTxn_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -87546,7 +82862,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnRollbackArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceBeginTxnArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -87563,15 +82879,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceLoadTxnRollbackArgs) String() string { +func (p *FrontendServiceBeginTxnArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnRollbackArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceBeginTxnArgs(%+v)", *p) } -func (p *FrontendServiceLoadTxnRollbackArgs) DeepEqual(ano *FrontendServiceLoadTxnRollbackArgs) bool { +func (p *FrontendServiceBeginTxnArgs) DeepEqual(ano *FrontendServiceBeginTxnArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -87583,7 +82899,7 @@ func (p *FrontendServiceLoadTxnRollbackArgs) DeepEqual(ano *FrontendServiceLoadT return true } -func (p *FrontendServiceLoadTxnRollbackArgs) Field1DeepEqual(src *TLoadTxnRollbackRequest) bool { +func (p *FrontendServiceBeginTxnArgs) Field1DeepEqual(src *TBeginTxnRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -87591,38 +82907,38 @@ func (p *FrontendServiceLoadTxnRollbackArgs) Field1DeepEqual(src *TLoadTxnRollba return true } -type FrontendServiceLoadTxnRollbackResult struct { - Success *TLoadTxnRollbackResult_ `thrift:"success,0,optional" frugal:"0,optional,TLoadTxnRollbackResult_" json:"success,omitempty"` +type FrontendServiceBeginTxnResult struct { + Success *TBeginTxnResult_ `thrift:"success,0,optional" frugal:"0,optional,TBeginTxnResult_" json:"success,omitempty"` } -func NewFrontendServiceLoadTxnRollbackResult() *FrontendServiceLoadTxnRollbackResult { - return &FrontendServiceLoadTxnRollbackResult{} +func NewFrontendServiceBeginTxnResult() *FrontendServiceBeginTxnResult { + return &FrontendServiceBeginTxnResult{} } -func (p *FrontendServiceLoadTxnRollbackResult) InitDefault() { +func (p *FrontendServiceBeginTxnResult) InitDefault() { } -var FrontendServiceLoadTxnRollbackResult_Success_DEFAULT *TLoadTxnRollbackResult_ +var FrontendServiceBeginTxnResult_Success_DEFAULT *TBeginTxnResult_ -func (p *FrontendServiceLoadTxnRollbackResult) GetSuccess() (v *TLoadTxnRollbackResult_) { +func (p *FrontendServiceBeginTxnResult) GetSuccess() (v *TBeginTxnResult_) { if !p.IsSetSuccess() { - return FrontendServiceLoadTxnRollbackResult_Success_DEFAULT + return FrontendServiceBeginTxnResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceLoadTxnRollbackResult) SetSuccess(x interface{}) { - p.Success = x.(*TLoadTxnRollbackResult_) +func (p *FrontendServiceBeginTxnResult) SetSuccess(x interface{}) { + p.Success = x.(*TBeginTxnResult_) } -var fieldIDToName_FrontendServiceLoadTxnRollbackResult = map[int16]string{ +var fieldIDToName_FrontendServiceBeginTxnResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceLoadTxnRollbackResult) IsSetSuccess() bool { +func (p *FrontendServiceBeginTxnResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceLoadTxnRollbackResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceBeginTxnResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -87668,7 +82984,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLoadTxnRollbackResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceBeginTxnResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -87678,8 +82994,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnRollbackResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTLoadTxnRollbackResult_() +func (p *FrontendServiceBeginTxnResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTBeginTxnResult_() if err := _field.Read(iprot); err != nil { return err } @@ -87687,9 +83003,9 @@ func (p *FrontendServiceLoadTxnRollbackResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *FrontendServiceLoadTxnRollbackResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceBeginTxnResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("loadTxnRollback_result"); err != nil { + if err = oprot.WriteStructBegin("beginTxn_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -87715,7 +83031,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceLoadTxnRollbackResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceBeginTxnResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -87734,15 +83050,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceLoadTxnRollbackResult) String() string { +func (p *FrontendServiceBeginTxnResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceLoadTxnRollbackResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceBeginTxnResult(%+v)", *p) } -func (p *FrontendServiceLoadTxnRollbackResult) DeepEqual(ano *FrontendServiceLoadTxnRollbackResult) bool { +func (p *FrontendServiceBeginTxnResult) DeepEqual(ano *FrontendServiceBeginTxnResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -87754,7 +83070,7 @@ func (p *FrontendServiceLoadTxnRollbackResult) DeepEqual(ano *FrontendServiceLoa return true } -func (p *FrontendServiceLoadTxnRollbackResult) Field0DeepEqual(src *TLoadTxnRollbackResult_) bool { +func (p *FrontendServiceBeginTxnResult) Field0DeepEqual(src *TBeginTxnResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -87762,38 +83078,38 @@ func (p *FrontendServiceLoadTxnRollbackResult) Field0DeepEqual(src *TLoadTxnRoll return true } -type FrontendServiceBeginTxnArgs struct { - Request *TBeginTxnRequest `thrift:"request,1" frugal:"1,default,TBeginTxnRequest" json:"request"` +type FrontendServiceCommitTxnArgs struct { + Request *TCommitTxnRequest `thrift:"request,1" frugal:"1,default,TCommitTxnRequest" json:"request"` } -func NewFrontendServiceBeginTxnArgs() *FrontendServiceBeginTxnArgs { - return &FrontendServiceBeginTxnArgs{} +func NewFrontendServiceCommitTxnArgs() *FrontendServiceCommitTxnArgs { + return &FrontendServiceCommitTxnArgs{} } -func (p *FrontendServiceBeginTxnArgs) InitDefault() { +func (p *FrontendServiceCommitTxnArgs) InitDefault() { } -var FrontendServiceBeginTxnArgs_Request_DEFAULT *TBeginTxnRequest +var FrontendServiceCommitTxnArgs_Request_DEFAULT *TCommitTxnRequest -func (p *FrontendServiceBeginTxnArgs) GetRequest() (v *TBeginTxnRequest) { +func (p *FrontendServiceCommitTxnArgs) GetRequest() (v *TCommitTxnRequest) { if !p.IsSetRequest() { - return FrontendServiceBeginTxnArgs_Request_DEFAULT + return FrontendServiceCommitTxnArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceBeginTxnArgs) SetRequest(val *TBeginTxnRequest) { +func (p *FrontendServiceCommitTxnArgs) SetRequest(val *TCommitTxnRequest) { p.Request = val } -var fieldIDToName_FrontendServiceBeginTxnArgs = map[int16]string{ +var fieldIDToName_FrontendServiceCommitTxnArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceBeginTxnArgs) IsSetRequest() bool { +func (p *FrontendServiceCommitTxnArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceBeginTxnArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceCommitTxnArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -87839,7 +83155,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceBeginTxnArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceCommitTxnArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -87849,8 +83165,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceBeginTxnArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTBeginTxnRequest() +func (p *FrontendServiceCommitTxnArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTCommitTxnRequest() if err := _field.Read(iprot); err != nil { return err } @@ -87858,9 +83174,9 @@ func (p *FrontendServiceBeginTxnArgs) ReadField1(iprot thrift.TProtocol) error { return nil } -func (p *FrontendServiceBeginTxnArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceCommitTxnArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("beginTxn_args"); err != nil { + if err = oprot.WriteStructBegin("commitTxn_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -87886,7 +83202,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceBeginTxnArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceCommitTxnArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -87903,15 +83219,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceBeginTxnArgs) String() string { +func (p *FrontendServiceCommitTxnArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceBeginTxnArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceCommitTxnArgs(%+v)", *p) } -func (p *FrontendServiceBeginTxnArgs) DeepEqual(ano *FrontendServiceBeginTxnArgs) bool { +func (p *FrontendServiceCommitTxnArgs) DeepEqual(ano *FrontendServiceCommitTxnArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -87923,7 +83239,7 @@ func (p *FrontendServiceBeginTxnArgs) DeepEqual(ano *FrontendServiceBeginTxnArgs return true } -func (p *FrontendServiceBeginTxnArgs) Field1DeepEqual(src *TBeginTxnRequest) bool { +func (p *FrontendServiceCommitTxnArgs) Field1DeepEqual(src *TCommitTxnRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -87931,38 +83247,38 @@ func (p *FrontendServiceBeginTxnArgs) Field1DeepEqual(src *TBeginTxnRequest) boo return true } -type FrontendServiceBeginTxnResult struct { - Success *TBeginTxnResult_ `thrift:"success,0,optional" frugal:"0,optional,TBeginTxnResult_" json:"success,omitempty"` +type FrontendServiceCommitTxnResult struct { + Success *TCommitTxnResult_ `thrift:"success,0,optional" frugal:"0,optional,TCommitTxnResult_" json:"success,omitempty"` } -func NewFrontendServiceBeginTxnResult() *FrontendServiceBeginTxnResult { - return &FrontendServiceBeginTxnResult{} +func NewFrontendServiceCommitTxnResult() *FrontendServiceCommitTxnResult { + return &FrontendServiceCommitTxnResult{} } -func (p *FrontendServiceBeginTxnResult) InitDefault() { +func (p *FrontendServiceCommitTxnResult) InitDefault() { } -var FrontendServiceBeginTxnResult_Success_DEFAULT *TBeginTxnResult_ +var FrontendServiceCommitTxnResult_Success_DEFAULT *TCommitTxnResult_ -func (p *FrontendServiceBeginTxnResult) GetSuccess() (v *TBeginTxnResult_) { +func (p *FrontendServiceCommitTxnResult) GetSuccess() (v *TCommitTxnResult_) { if !p.IsSetSuccess() { - return FrontendServiceBeginTxnResult_Success_DEFAULT + return FrontendServiceCommitTxnResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceBeginTxnResult) SetSuccess(x interface{}) { - p.Success = x.(*TBeginTxnResult_) +func (p *FrontendServiceCommitTxnResult) SetSuccess(x interface{}) { + p.Success = x.(*TCommitTxnResult_) } -var fieldIDToName_FrontendServiceBeginTxnResult = map[int16]string{ +var fieldIDToName_FrontendServiceCommitTxnResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceBeginTxnResult) IsSetSuccess() bool { +func (p *FrontendServiceCommitTxnResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceBeginTxnResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceCommitTxnResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -88008,7 +83324,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceBeginTxnResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceCommitTxnResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -88018,8 +83334,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceBeginTxnResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTBeginTxnResult_() +func (p *FrontendServiceCommitTxnResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTCommitTxnResult_() if err := _field.Read(iprot); err != nil { return err } @@ -88027,9 +83343,9 @@ func (p *FrontendServiceBeginTxnResult) ReadField0(iprot thrift.TProtocol) error return nil } -func (p *FrontendServiceBeginTxnResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceCommitTxnResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("beginTxn_result"); err != nil { + if err = oprot.WriteStructBegin("commitTxn_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -88055,7 +83371,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceBeginTxnResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceCommitTxnResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -88074,15 +83390,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceBeginTxnResult) String() string { +func (p *FrontendServiceCommitTxnResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceBeginTxnResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceCommitTxnResult(%+v)", *p) } -func (p *FrontendServiceBeginTxnResult) DeepEqual(ano *FrontendServiceBeginTxnResult) bool { +func (p *FrontendServiceCommitTxnResult) DeepEqual(ano *FrontendServiceCommitTxnResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -88094,7 +83410,7 @@ func (p *FrontendServiceBeginTxnResult) DeepEqual(ano *FrontendServiceBeginTxnRe return true } -func (p *FrontendServiceBeginTxnResult) Field0DeepEqual(src *TBeginTxnResult_) bool { +func (p *FrontendServiceCommitTxnResult) Field0DeepEqual(src *TCommitTxnResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -88102,38 +83418,38 @@ func (p *FrontendServiceBeginTxnResult) Field0DeepEqual(src *TBeginTxnResult_) b return true } -type FrontendServiceCommitTxnArgs struct { - Request *TCommitTxnRequest `thrift:"request,1" frugal:"1,default,TCommitTxnRequest" json:"request"` +type FrontendServiceRollbackTxnArgs struct { + Request *TRollbackTxnRequest `thrift:"request,1" frugal:"1,default,TRollbackTxnRequest" json:"request"` } -func NewFrontendServiceCommitTxnArgs() *FrontendServiceCommitTxnArgs { - return &FrontendServiceCommitTxnArgs{} +func NewFrontendServiceRollbackTxnArgs() *FrontendServiceRollbackTxnArgs { + return &FrontendServiceRollbackTxnArgs{} } -func (p *FrontendServiceCommitTxnArgs) InitDefault() { +func (p *FrontendServiceRollbackTxnArgs) InitDefault() { } -var FrontendServiceCommitTxnArgs_Request_DEFAULT *TCommitTxnRequest +var FrontendServiceRollbackTxnArgs_Request_DEFAULT *TRollbackTxnRequest -func (p *FrontendServiceCommitTxnArgs) GetRequest() (v *TCommitTxnRequest) { +func (p *FrontendServiceRollbackTxnArgs) GetRequest() (v *TRollbackTxnRequest) { if !p.IsSetRequest() { - return FrontendServiceCommitTxnArgs_Request_DEFAULT + return FrontendServiceRollbackTxnArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceCommitTxnArgs) SetRequest(val *TCommitTxnRequest) { +func (p *FrontendServiceRollbackTxnArgs) SetRequest(val *TRollbackTxnRequest) { p.Request = val } -var fieldIDToName_FrontendServiceCommitTxnArgs = map[int16]string{ +var fieldIDToName_FrontendServiceRollbackTxnArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceCommitTxnArgs) IsSetRequest() bool { +func (p *FrontendServiceRollbackTxnArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceCommitTxnArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRollbackTxnArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -88179,7 +83495,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceCommitTxnArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRollbackTxnArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -88189,8 +83505,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceCommitTxnArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTCommitTxnRequest() +func (p *FrontendServiceRollbackTxnArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTRollbackTxnRequest() if err := _field.Read(iprot); err != nil { return err } @@ -88198,9 +83514,9 @@ func (p *FrontendServiceCommitTxnArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *FrontendServiceCommitTxnArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRollbackTxnArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("commitTxn_args"); err != nil { + if err = oprot.WriteStructBegin("rollbackTxn_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -88226,7 +83542,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceCommitTxnArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRollbackTxnArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -88243,15 +83559,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceCommitTxnArgs) String() string { +func (p *FrontendServiceRollbackTxnArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceCommitTxnArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceRollbackTxnArgs(%+v)", *p) } -func (p *FrontendServiceCommitTxnArgs) DeepEqual(ano *FrontendServiceCommitTxnArgs) bool { +func (p *FrontendServiceRollbackTxnArgs) DeepEqual(ano *FrontendServiceRollbackTxnArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -88263,7 +83579,7 @@ func (p *FrontendServiceCommitTxnArgs) DeepEqual(ano *FrontendServiceCommitTxnAr return true } -func (p *FrontendServiceCommitTxnArgs) Field1DeepEqual(src *TCommitTxnRequest) bool { +func (p *FrontendServiceRollbackTxnArgs) Field1DeepEqual(src *TRollbackTxnRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -88271,38 +83587,38 @@ func (p *FrontendServiceCommitTxnArgs) Field1DeepEqual(src *TCommitTxnRequest) b return true } -type FrontendServiceCommitTxnResult struct { - Success *TCommitTxnResult_ `thrift:"success,0,optional" frugal:"0,optional,TCommitTxnResult_" json:"success,omitempty"` +type FrontendServiceRollbackTxnResult struct { + Success *TRollbackTxnResult_ `thrift:"success,0,optional" frugal:"0,optional,TRollbackTxnResult_" json:"success,omitempty"` } -func NewFrontendServiceCommitTxnResult() *FrontendServiceCommitTxnResult { - return &FrontendServiceCommitTxnResult{} +func NewFrontendServiceRollbackTxnResult() *FrontendServiceRollbackTxnResult { + return &FrontendServiceRollbackTxnResult{} } -func (p *FrontendServiceCommitTxnResult) InitDefault() { +func (p *FrontendServiceRollbackTxnResult) InitDefault() { } -var FrontendServiceCommitTxnResult_Success_DEFAULT *TCommitTxnResult_ +var FrontendServiceRollbackTxnResult_Success_DEFAULT *TRollbackTxnResult_ -func (p *FrontendServiceCommitTxnResult) GetSuccess() (v *TCommitTxnResult_) { +func (p *FrontendServiceRollbackTxnResult) GetSuccess() (v *TRollbackTxnResult_) { if !p.IsSetSuccess() { - return FrontendServiceCommitTxnResult_Success_DEFAULT + return FrontendServiceRollbackTxnResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceCommitTxnResult) SetSuccess(x interface{}) { - p.Success = x.(*TCommitTxnResult_) +func (p *FrontendServiceRollbackTxnResult) SetSuccess(x interface{}) { + p.Success = x.(*TRollbackTxnResult_) } -var fieldIDToName_FrontendServiceCommitTxnResult = map[int16]string{ +var fieldIDToName_FrontendServiceRollbackTxnResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceCommitTxnResult) IsSetSuccess() bool { +func (p *FrontendServiceRollbackTxnResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceCommitTxnResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRollbackTxnResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -88348,7 +83664,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceCommitTxnResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRollbackTxnResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -88358,8 +83674,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceCommitTxnResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTCommitTxnResult_() +func (p *FrontendServiceRollbackTxnResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTRollbackTxnResult_() if err := _field.Read(iprot); err != nil { return err } @@ -88367,9 +83683,9 @@ func (p *FrontendServiceCommitTxnResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *FrontendServiceCommitTxnResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRollbackTxnResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("commitTxn_result"); err != nil { + if err = oprot.WriteStructBegin("rollbackTxn_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -88395,7 +83711,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceCommitTxnResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRollbackTxnResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -88414,15 +83730,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceCommitTxnResult) String() string { +func (p *FrontendServiceRollbackTxnResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceCommitTxnResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceRollbackTxnResult(%+v)", *p) } -func (p *FrontendServiceCommitTxnResult) DeepEqual(ano *FrontendServiceCommitTxnResult) bool { +func (p *FrontendServiceRollbackTxnResult) DeepEqual(ano *FrontendServiceRollbackTxnResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -88434,7 +83750,7 @@ func (p *FrontendServiceCommitTxnResult) DeepEqual(ano *FrontendServiceCommitTxn return true } -func (p *FrontendServiceCommitTxnResult) Field0DeepEqual(src *TCommitTxnResult_) bool { +func (p *FrontendServiceRollbackTxnResult) Field0DeepEqual(src *TRollbackTxnResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -88442,38 +83758,38 @@ func (p *FrontendServiceCommitTxnResult) Field0DeepEqual(src *TCommitTxnResult_) return true } -type FrontendServiceRollbackTxnArgs struct { - Request *TRollbackTxnRequest `thrift:"request,1" frugal:"1,default,TRollbackTxnRequest" json:"request"` +type FrontendServiceGetBinlogArgs struct { + Request *TGetBinlogRequest `thrift:"request,1" frugal:"1,default,TGetBinlogRequest" json:"request"` } -func NewFrontendServiceRollbackTxnArgs() *FrontendServiceRollbackTxnArgs { - return &FrontendServiceRollbackTxnArgs{} +func NewFrontendServiceGetBinlogArgs() *FrontendServiceGetBinlogArgs { + return &FrontendServiceGetBinlogArgs{} } -func (p *FrontendServiceRollbackTxnArgs) InitDefault() { +func (p *FrontendServiceGetBinlogArgs) InitDefault() { } -var FrontendServiceRollbackTxnArgs_Request_DEFAULT *TRollbackTxnRequest +var FrontendServiceGetBinlogArgs_Request_DEFAULT *TGetBinlogRequest -func (p *FrontendServiceRollbackTxnArgs) GetRequest() (v *TRollbackTxnRequest) { +func (p *FrontendServiceGetBinlogArgs) GetRequest() (v *TGetBinlogRequest) { if !p.IsSetRequest() { - return FrontendServiceRollbackTxnArgs_Request_DEFAULT + return FrontendServiceGetBinlogArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceRollbackTxnArgs) SetRequest(val *TRollbackTxnRequest) { +func (p *FrontendServiceGetBinlogArgs) SetRequest(val *TGetBinlogRequest) { p.Request = val } -var fieldIDToName_FrontendServiceRollbackTxnArgs = map[int16]string{ +var fieldIDToName_FrontendServiceGetBinlogArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceRollbackTxnArgs) IsSetRequest() bool { +func (p *FrontendServiceGetBinlogArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceRollbackTxnArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetBinlogArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -88519,7 +83835,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRollbackTxnArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetBinlogArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -88529,8 +83845,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceRollbackTxnArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTRollbackTxnRequest() +func (p *FrontendServiceGetBinlogArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTGetBinlogRequest() if err := _field.Read(iprot); err != nil { return err } @@ -88538,9 +83854,9 @@ func (p *FrontendServiceRollbackTxnArgs) ReadField1(iprot thrift.TProtocol) erro return nil } -func (p *FrontendServiceRollbackTxnArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetBinlogArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("rollbackTxn_args"); err != nil { + if err = oprot.WriteStructBegin("getBinlog_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -88566,7 +83882,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceRollbackTxnArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetBinlogArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -88583,15 +83899,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceRollbackTxnArgs) String() string { +func (p *FrontendServiceGetBinlogArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceRollbackTxnArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceGetBinlogArgs(%+v)", *p) } -func (p *FrontendServiceRollbackTxnArgs) DeepEqual(ano *FrontendServiceRollbackTxnArgs) bool { +func (p *FrontendServiceGetBinlogArgs) DeepEqual(ano *FrontendServiceGetBinlogArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -88603,7 +83919,7 @@ func (p *FrontendServiceRollbackTxnArgs) DeepEqual(ano *FrontendServiceRollbackT return true } -func (p *FrontendServiceRollbackTxnArgs) Field1DeepEqual(src *TRollbackTxnRequest) bool { +func (p *FrontendServiceGetBinlogArgs) Field1DeepEqual(src *TGetBinlogRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -88611,38 +83927,38 @@ func (p *FrontendServiceRollbackTxnArgs) Field1DeepEqual(src *TRollbackTxnReques return true } -type FrontendServiceRollbackTxnResult struct { - Success *TRollbackTxnResult_ `thrift:"success,0,optional" frugal:"0,optional,TRollbackTxnResult_" json:"success,omitempty"` +type FrontendServiceGetBinlogResult struct { + Success *TGetBinlogResult_ `thrift:"success,0,optional" frugal:"0,optional,TGetBinlogResult_" json:"success,omitempty"` } -func NewFrontendServiceRollbackTxnResult() *FrontendServiceRollbackTxnResult { - return &FrontendServiceRollbackTxnResult{} +func NewFrontendServiceGetBinlogResult() *FrontendServiceGetBinlogResult { + return &FrontendServiceGetBinlogResult{} } -func (p *FrontendServiceRollbackTxnResult) InitDefault() { +func (p *FrontendServiceGetBinlogResult) InitDefault() { } -var FrontendServiceRollbackTxnResult_Success_DEFAULT *TRollbackTxnResult_ +var FrontendServiceGetBinlogResult_Success_DEFAULT *TGetBinlogResult_ -func (p *FrontendServiceRollbackTxnResult) GetSuccess() (v *TRollbackTxnResult_) { +func (p *FrontendServiceGetBinlogResult) GetSuccess() (v *TGetBinlogResult_) { if !p.IsSetSuccess() { - return FrontendServiceRollbackTxnResult_Success_DEFAULT + return FrontendServiceGetBinlogResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceRollbackTxnResult) SetSuccess(x interface{}) { - p.Success = x.(*TRollbackTxnResult_) +func (p *FrontendServiceGetBinlogResult) SetSuccess(x interface{}) { + p.Success = x.(*TGetBinlogResult_) } -var fieldIDToName_FrontendServiceRollbackTxnResult = map[int16]string{ +var fieldIDToName_FrontendServiceGetBinlogResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceRollbackTxnResult) IsSetSuccess() bool { +func (p *FrontendServiceGetBinlogResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceRollbackTxnResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetBinlogResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -88688,7 +84004,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRollbackTxnResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetBinlogResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -88698,8 +84014,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceRollbackTxnResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTRollbackTxnResult_() +func (p *FrontendServiceGetBinlogResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTGetBinlogResult_() if err := _field.Read(iprot); err != nil { return err } @@ -88707,9 +84023,9 @@ func (p *FrontendServiceRollbackTxnResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *FrontendServiceRollbackTxnResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetBinlogResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("rollbackTxn_result"); err != nil { + if err = oprot.WriteStructBegin("getBinlog_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -88735,7 +84051,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceRollbackTxnResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetBinlogResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -88754,15 +84070,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceRollbackTxnResult) String() string { +func (p *FrontendServiceGetBinlogResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceRollbackTxnResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceGetBinlogResult(%+v)", *p) } -func (p *FrontendServiceRollbackTxnResult) DeepEqual(ano *FrontendServiceRollbackTxnResult) bool { +func (p *FrontendServiceGetBinlogResult) DeepEqual(ano *FrontendServiceGetBinlogResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -88774,7 +84090,7 @@ func (p *FrontendServiceRollbackTxnResult) DeepEqual(ano *FrontendServiceRollbac return true } -func (p *FrontendServiceRollbackTxnResult) Field0DeepEqual(src *TRollbackTxnResult_) bool { +func (p *FrontendServiceGetBinlogResult) Field0DeepEqual(src *TGetBinlogResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -88782,38 +84098,38 @@ func (p *FrontendServiceRollbackTxnResult) Field0DeepEqual(src *TRollbackTxnResu return true } -type FrontendServiceGetBinlogArgs struct { - Request *TGetBinlogRequest `thrift:"request,1" frugal:"1,default,TGetBinlogRequest" json:"request"` +type FrontendServiceGetSnapshotArgs struct { + Request *TGetSnapshotRequest `thrift:"request,1" frugal:"1,default,TGetSnapshotRequest" json:"request"` } -func NewFrontendServiceGetBinlogArgs() *FrontendServiceGetBinlogArgs { - return &FrontendServiceGetBinlogArgs{} +func NewFrontendServiceGetSnapshotArgs() *FrontendServiceGetSnapshotArgs { + return &FrontendServiceGetSnapshotArgs{} } -func (p *FrontendServiceGetBinlogArgs) InitDefault() { +func (p *FrontendServiceGetSnapshotArgs) InitDefault() { } -var FrontendServiceGetBinlogArgs_Request_DEFAULT *TGetBinlogRequest +var FrontendServiceGetSnapshotArgs_Request_DEFAULT *TGetSnapshotRequest -func (p *FrontendServiceGetBinlogArgs) GetRequest() (v *TGetBinlogRequest) { +func (p *FrontendServiceGetSnapshotArgs) GetRequest() (v *TGetSnapshotRequest) { if !p.IsSetRequest() { - return FrontendServiceGetBinlogArgs_Request_DEFAULT + return FrontendServiceGetSnapshotArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceGetBinlogArgs) SetRequest(val *TGetBinlogRequest) { +func (p *FrontendServiceGetSnapshotArgs) SetRequest(val *TGetSnapshotRequest) { p.Request = val } -var fieldIDToName_FrontendServiceGetBinlogArgs = map[int16]string{ +var fieldIDToName_FrontendServiceGetSnapshotArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceGetBinlogArgs) IsSetRequest() bool { +func (p *FrontendServiceGetSnapshotArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceGetBinlogArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetSnapshotArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -88859,7 +84175,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetBinlogArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetSnapshotArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -88869,8 +84185,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceGetBinlogArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTGetBinlogRequest() +func (p *FrontendServiceGetSnapshotArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTGetSnapshotRequest() if err := _field.Read(iprot); err != nil { return err } @@ -88878,9 +84194,9 @@ func (p *FrontendServiceGetBinlogArgs) ReadField1(iprot thrift.TProtocol) error return nil } -func (p *FrontendServiceGetBinlogArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetSnapshotArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("getBinlog_args"); err != nil { + if err = oprot.WriteStructBegin("getSnapshot_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -88906,7 +84222,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceGetBinlogArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetSnapshotArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -88923,15 +84239,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceGetBinlogArgs) String() string { +func (p *FrontendServiceGetSnapshotArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceGetBinlogArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceGetSnapshotArgs(%+v)", *p) } -func (p *FrontendServiceGetBinlogArgs) DeepEqual(ano *FrontendServiceGetBinlogArgs) bool { +func (p *FrontendServiceGetSnapshotArgs) DeepEqual(ano *FrontendServiceGetSnapshotArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -88943,7 +84259,7 @@ func (p *FrontendServiceGetBinlogArgs) DeepEqual(ano *FrontendServiceGetBinlogAr return true } -func (p *FrontendServiceGetBinlogArgs) Field1DeepEqual(src *TGetBinlogRequest) bool { +func (p *FrontendServiceGetSnapshotArgs) Field1DeepEqual(src *TGetSnapshotRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -88951,38 +84267,38 @@ func (p *FrontendServiceGetBinlogArgs) Field1DeepEqual(src *TGetBinlogRequest) b return true } -type FrontendServiceGetBinlogResult struct { - Success *TGetBinlogResult_ `thrift:"success,0,optional" frugal:"0,optional,TGetBinlogResult_" json:"success,omitempty"` +type FrontendServiceGetSnapshotResult struct { + Success *TGetSnapshotResult_ `thrift:"success,0,optional" frugal:"0,optional,TGetSnapshotResult_" json:"success,omitempty"` } -func NewFrontendServiceGetBinlogResult() *FrontendServiceGetBinlogResult { - return &FrontendServiceGetBinlogResult{} +func NewFrontendServiceGetSnapshotResult() *FrontendServiceGetSnapshotResult { + return &FrontendServiceGetSnapshotResult{} } -func (p *FrontendServiceGetBinlogResult) InitDefault() { +func (p *FrontendServiceGetSnapshotResult) InitDefault() { } -var FrontendServiceGetBinlogResult_Success_DEFAULT *TGetBinlogResult_ +var FrontendServiceGetSnapshotResult_Success_DEFAULT *TGetSnapshotResult_ -func (p *FrontendServiceGetBinlogResult) GetSuccess() (v *TGetBinlogResult_) { +func (p *FrontendServiceGetSnapshotResult) GetSuccess() (v *TGetSnapshotResult_) { if !p.IsSetSuccess() { - return FrontendServiceGetBinlogResult_Success_DEFAULT + return FrontendServiceGetSnapshotResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceGetBinlogResult) SetSuccess(x interface{}) { - p.Success = x.(*TGetBinlogResult_) +func (p *FrontendServiceGetSnapshotResult) SetSuccess(x interface{}) { + p.Success = x.(*TGetSnapshotResult_) } -var fieldIDToName_FrontendServiceGetBinlogResult = map[int16]string{ +var fieldIDToName_FrontendServiceGetSnapshotResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceGetBinlogResult) IsSetSuccess() bool { +func (p *FrontendServiceGetSnapshotResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceGetBinlogResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetSnapshotResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -89028,7 +84344,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetBinlogResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetSnapshotResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -89038,8 +84354,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceGetBinlogResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTGetBinlogResult_() +func (p *FrontendServiceGetSnapshotResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTGetSnapshotResult_() if err := _field.Read(iprot); err != nil { return err } @@ -89047,9 +84363,9 @@ func (p *FrontendServiceGetBinlogResult) ReadField0(iprot thrift.TProtocol) erro return nil } -func (p *FrontendServiceGetBinlogResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetSnapshotResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("getBinlog_result"); err != nil { + if err = oprot.WriteStructBegin("getSnapshot_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -89075,7 +84391,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceGetBinlogResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceGetSnapshotResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -89094,15 +84410,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceGetBinlogResult) String() string { +func (p *FrontendServiceGetSnapshotResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceGetBinlogResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceGetSnapshotResult(%+v)", *p) } -func (p *FrontendServiceGetBinlogResult) DeepEqual(ano *FrontendServiceGetBinlogResult) bool { +func (p *FrontendServiceGetSnapshotResult) DeepEqual(ano *FrontendServiceGetSnapshotResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -89114,7 +84430,7 @@ func (p *FrontendServiceGetBinlogResult) DeepEqual(ano *FrontendServiceGetBinlog return true } -func (p *FrontendServiceGetBinlogResult) Field0DeepEqual(src *TGetBinlogResult_) bool { +func (p *FrontendServiceGetSnapshotResult) Field0DeepEqual(src *TGetSnapshotResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -89122,38 +84438,38 @@ func (p *FrontendServiceGetBinlogResult) Field0DeepEqual(src *TGetBinlogResult_) return true } -type FrontendServiceGetSnapshotArgs struct { - Request *TGetSnapshotRequest `thrift:"request,1" frugal:"1,default,TGetSnapshotRequest" json:"request"` +type FrontendServiceRestoreSnapshotArgs struct { + Request *TRestoreSnapshotRequest `thrift:"request,1" frugal:"1,default,TRestoreSnapshotRequest" json:"request"` } -func NewFrontendServiceGetSnapshotArgs() *FrontendServiceGetSnapshotArgs { - return &FrontendServiceGetSnapshotArgs{} +func NewFrontendServiceRestoreSnapshotArgs() *FrontendServiceRestoreSnapshotArgs { + return &FrontendServiceRestoreSnapshotArgs{} } -func (p *FrontendServiceGetSnapshotArgs) InitDefault() { +func (p *FrontendServiceRestoreSnapshotArgs) InitDefault() { } -var FrontendServiceGetSnapshotArgs_Request_DEFAULT *TGetSnapshotRequest +var FrontendServiceRestoreSnapshotArgs_Request_DEFAULT *TRestoreSnapshotRequest -func (p *FrontendServiceGetSnapshotArgs) GetRequest() (v *TGetSnapshotRequest) { +func (p *FrontendServiceRestoreSnapshotArgs) GetRequest() (v *TRestoreSnapshotRequest) { if !p.IsSetRequest() { - return FrontendServiceGetSnapshotArgs_Request_DEFAULT + return FrontendServiceRestoreSnapshotArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceGetSnapshotArgs) SetRequest(val *TGetSnapshotRequest) { +func (p *FrontendServiceRestoreSnapshotArgs) SetRequest(val *TRestoreSnapshotRequest) { p.Request = val } -var fieldIDToName_FrontendServiceGetSnapshotArgs = map[int16]string{ +var fieldIDToName_FrontendServiceRestoreSnapshotArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceGetSnapshotArgs) IsSetRequest() bool { +func (p *FrontendServiceRestoreSnapshotArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceGetSnapshotArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRestoreSnapshotArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -89199,7 +84515,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetSnapshotArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRestoreSnapshotArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -89209,8 +84525,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceGetSnapshotArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTGetSnapshotRequest() +func (p *FrontendServiceRestoreSnapshotArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTRestoreSnapshotRequest() if err := _field.Read(iprot); err != nil { return err } @@ -89218,9 +84534,9 @@ func (p *FrontendServiceGetSnapshotArgs) ReadField1(iprot thrift.TProtocol) erro return nil } -func (p *FrontendServiceGetSnapshotArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRestoreSnapshotArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("getSnapshot_args"); err != nil { + if err = oprot.WriteStructBegin("restoreSnapshot_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -89246,7 +84562,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceGetSnapshotArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRestoreSnapshotArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -89263,15 +84579,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceGetSnapshotArgs) String() string { +func (p *FrontendServiceRestoreSnapshotArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceGetSnapshotArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceRestoreSnapshotArgs(%+v)", *p) } -func (p *FrontendServiceGetSnapshotArgs) DeepEqual(ano *FrontendServiceGetSnapshotArgs) bool { +func (p *FrontendServiceRestoreSnapshotArgs) DeepEqual(ano *FrontendServiceRestoreSnapshotArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -89283,7 +84599,7 @@ func (p *FrontendServiceGetSnapshotArgs) DeepEqual(ano *FrontendServiceGetSnapsh return true } -func (p *FrontendServiceGetSnapshotArgs) Field1DeepEqual(src *TGetSnapshotRequest) bool { +func (p *FrontendServiceRestoreSnapshotArgs) Field1DeepEqual(src *TRestoreSnapshotRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -89291,38 +84607,38 @@ func (p *FrontendServiceGetSnapshotArgs) Field1DeepEqual(src *TGetSnapshotReques return true } -type FrontendServiceGetSnapshotResult struct { - Success *TGetSnapshotResult_ `thrift:"success,0,optional" frugal:"0,optional,TGetSnapshotResult_" json:"success,omitempty"` +type FrontendServiceRestoreSnapshotResult struct { + Success *TRestoreSnapshotResult_ `thrift:"success,0,optional" frugal:"0,optional,TRestoreSnapshotResult_" json:"success,omitempty"` } -func NewFrontendServiceGetSnapshotResult() *FrontendServiceGetSnapshotResult { - return &FrontendServiceGetSnapshotResult{} +func NewFrontendServiceRestoreSnapshotResult() *FrontendServiceRestoreSnapshotResult { + return &FrontendServiceRestoreSnapshotResult{} } -func (p *FrontendServiceGetSnapshotResult) InitDefault() { +func (p *FrontendServiceRestoreSnapshotResult) InitDefault() { } -var FrontendServiceGetSnapshotResult_Success_DEFAULT *TGetSnapshotResult_ +var FrontendServiceRestoreSnapshotResult_Success_DEFAULT *TRestoreSnapshotResult_ -func (p *FrontendServiceGetSnapshotResult) GetSuccess() (v *TGetSnapshotResult_) { +func (p *FrontendServiceRestoreSnapshotResult) GetSuccess() (v *TRestoreSnapshotResult_) { if !p.IsSetSuccess() { - return FrontendServiceGetSnapshotResult_Success_DEFAULT + return FrontendServiceRestoreSnapshotResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceGetSnapshotResult) SetSuccess(x interface{}) { - p.Success = x.(*TGetSnapshotResult_) +func (p *FrontendServiceRestoreSnapshotResult) SetSuccess(x interface{}) { + p.Success = x.(*TRestoreSnapshotResult_) } -var fieldIDToName_FrontendServiceGetSnapshotResult = map[int16]string{ +var fieldIDToName_FrontendServiceRestoreSnapshotResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceGetSnapshotResult) IsSetSuccess() bool { +func (p *FrontendServiceRestoreSnapshotResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceGetSnapshotResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRestoreSnapshotResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -89368,7 +84684,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetSnapshotResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRestoreSnapshotResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -89378,8 +84694,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceGetSnapshotResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTGetSnapshotResult_() +func (p *FrontendServiceRestoreSnapshotResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTRestoreSnapshotResult_() if err := _field.Read(iprot); err != nil { return err } @@ -89387,9 +84703,9 @@ func (p *FrontendServiceGetSnapshotResult) ReadField0(iprot thrift.TProtocol) er return nil } -func (p *FrontendServiceGetSnapshotResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRestoreSnapshotResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("getSnapshot_result"); err != nil { + if err = oprot.WriteStructBegin("restoreSnapshot_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -89415,7 +84731,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceGetSnapshotResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceRestoreSnapshotResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -89434,15 +84750,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceGetSnapshotResult) String() string { +func (p *FrontendServiceRestoreSnapshotResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceGetSnapshotResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceRestoreSnapshotResult(%+v)", *p) } -func (p *FrontendServiceGetSnapshotResult) DeepEqual(ano *FrontendServiceGetSnapshotResult) bool { +func (p *FrontendServiceRestoreSnapshotResult) DeepEqual(ano *FrontendServiceRestoreSnapshotResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -89454,7 +84770,7 @@ func (p *FrontendServiceGetSnapshotResult) DeepEqual(ano *FrontendServiceGetSnap return true } -func (p *FrontendServiceGetSnapshotResult) Field0DeepEqual(src *TGetSnapshotResult_) bool { +func (p *FrontendServiceRestoreSnapshotResult) Field0DeepEqual(src *TRestoreSnapshotResult_) bool { if !p.Success.DeepEqual(src) { return false @@ -89462,38 +84778,38 @@ func (p *FrontendServiceGetSnapshotResult) Field0DeepEqual(src *TGetSnapshotResu return true } -type FrontendServiceRestoreSnapshotArgs struct { - Request *TRestoreSnapshotRequest `thrift:"request,1" frugal:"1,default,TRestoreSnapshotRequest" json:"request"` +type FrontendServiceLockBinlogArgs struct { + Request *TLockBinlogRequest `thrift:"request,1" frugal:"1,default,TLockBinlogRequest" json:"request"` } -func NewFrontendServiceRestoreSnapshotArgs() *FrontendServiceRestoreSnapshotArgs { - return &FrontendServiceRestoreSnapshotArgs{} +func NewFrontendServiceLockBinlogArgs() *FrontendServiceLockBinlogArgs { + return &FrontendServiceLockBinlogArgs{} } -func (p *FrontendServiceRestoreSnapshotArgs) InitDefault() { +func (p *FrontendServiceLockBinlogArgs) InitDefault() { } -var FrontendServiceRestoreSnapshotArgs_Request_DEFAULT *TRestoreSnapshotRequest +var FrontendServiceLockBinlogArgs_Request_DEFAULT *TLockBinlogRequest -func (p *FrontendServiceRestoreSnapshotArgs) GetRequest() (v *TRestoreSnapshotRequest) { +func (p *FrontendServiceLockBinlogArgs) GetRequest() (v *TLockBinlogRequest) { if !p.IsSetRequest() { - return FrontendServiceRestoreSnapshotArgs_Request_DEFAULT + return FrontendServiceLockBinlogArgs_Request_DEFAULT } return p.Request } -func (p *FrontendServiceRestoreSnapshotArgs) SetRequest(val *TRestoreSnapshotRequest) { +func (p *FrontendServiceLockBinlogArgs) SetRequest(val *TLockBinlogRequest) { p.Request = val } -var fieldIDToName_FrontendServiceRestoreSnapshotArgs = map[int16]string{ +var fieldIDToName_FrontendServiceLockBinlogArgs = map[int16]string{ 1: "request", } -func (p *FrontendServiceRestoreSnapshotArgs) IsSetRequest() bool { +func (p *FrontendServiceLockBinlogArgs) IsSetRequest() bool { return p.Request != nil } -func (p *FrontendServiceRestoreSnapshotArgs) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLockBinlogArgs) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -89539,7 +84855,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRestoreSnapshotArgs[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLockBinlogArgs[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -89549,8 +84865,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceRestoreSnapshotArgs) ReadField1(iprot thrift.TProtocol) error { - _field := NewTRestoreSnapshotRequest() +func (p *FrontendServiceLockBinlogArgs) ReadField1(iprot thrift.TProtocol) error { + _field := NewTLockBinlogRequest() if err := _field.Read(iprot); err != nil { return err } @@ -89558,9 +84874,9 @@ func (p *FrontendServiceRestoreSnapshotArgs) ReadField1(iprot thrift.TProtocol) return nil } -func (p *FrontendServiceRestoreSnapshotArgs) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLockBinlogArgs) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("restoreSnapshot_args"); err != nil { + if err = oprot.WriteStructBegin("lockBinlog_args"); err != nil { goto WriteStructBeginError } if p != nil { @@ -89586,7 +84902,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceRestoreSnapshotArgs) writeField1(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLockBinlogArgs) writeField1(oprot thrift.TProtocol) (err error) { if err = oprot.WriteFieldBegin("request", thrift.STRUCT, 1); err != nil { goto WriteFieldBeginError } @@ -89603,15 +84919,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) } -func (p *FrontendServiceRestoreSnapshotArgs) String() string { +func (p *FrontendServiceLockBinlogArgs) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceRestoreSnapshotArgs(%+v)", *p) + return fmt.Sprintf("FrontendServiceLockBinlogArgs(%+v)", *p) } -func (p *FrontendServiceRestoreSnapshotArgs) DeepEqual(ano *FrontendServiceRestoreSnapshotArgs) bool { +func (p *FrontendServiceLockBinlogArgs) DeepEqual(ano *FrontendServiceLockBinlogArgs) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -89623,7 +84939,7 @@ func (p *FrontendServiceRestoreSnapshotArgs) DeepEqual(ano *FrontendServiceResto return true } -func (p *FrontendServiceRestoreSnapshotArgs) Field1DeepEqual(src *TRestoreSnapshotRequest) bool { +func (p *FrontendServiceLockBinlogArgs) Field1DeepEqual(src *TLockBinlogRequest) bool { if !p.Request.DeepEqual(src) { return false @@ -89631,38 +84947,38 @@ func (p *FrontendServiceRestoreSnapshotArgs) Field1DeepEqual(src *TRestoreSnapsh return true } -type FrontendServiceRestoreSnapshotResult struct { - Success *TRestoreSnapshotResult_ `thrift:"success,0,optional" frugal:"0,optional,TRestoreSnapshotResult_" json:"success,omitempty"` +type FrontendServiceLockBinlogResult struct { + Success *TLockBinlogResult_ `thrift:"success,0,optional" frugal:"0,optional,TLockBinlogResult_" json:"success,omitempty"` } -func NewFrontendServiceRestoreSnapshotResult() *FrontendServiceRestoreSnapshotResult { - return &FrontendServiceRestoreSnapshotResult{} +func NewFrontendServiceLockBinlogResult() *FrontendServiceLockBinlogResult { + return &FrontendServiceLockBinlogResult{} } -func (p *FrontendServiceRestoreSnapshotResult) InitDefault() { +func (p *FrontendServiceLockBinlogResult) InitDefault() { } -var FrontendServiceRestoreSnapshotResult_Success_DEFAULT *TRestoreSnapshotResult_ +var FrontendServiceLockBinlogResult_Success_DEFAULT *TLockBinlogResult_ -func (p *FrontendServiceRestoreSnapshotResult) GetSuccess() (v *TRestoreSnapshotResult_) { +func (p *FrontendServiceLockBinlogResult) GetSuccess() (v *TLockBinlogResult_) { if !p.IsSetSuccess() { - return FrontendServiceRestoreSnapshotResult_Success_DEFAULT + return FrontendServiceLockBinlogResult_Success_DEFAULT } return p.Success } -func (p *FrontendServiceRestoreSnapshotResult) SetSuccess(x interface{}) { - p.Success = x.(*TRestoreSnapshotResult_) +func (p *FrontendServiceLockBinlogResult) SetSuccess(x interface{}) { + p.Success = x.(*TLockBinlogResult_) } -var fieldIDToName_FrontendServiceRestoreSnapshotResult = map[int16]string{ +var fieldIDToName_FrontendServiceLockBinlogResult = map[int16]string{ 0: "success", } -func (p *FrontendServiceRestoreSnapshotResult) IsSetSuccess() bool { +func (p *FrontendServiceLockBinlogResult) IsSetSuccess() bool { return p.Success != nil } -func (p *FrontendServiceRestoreSnapshotResult) Read(iprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLockBinlogResult) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType var fieldId int16 @@ -89708,7 +85024,7 @@ ReadStructBeginError: ReadFieldBeginError: return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceRestoreSnapshotResult[fieldId]), err) + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLockBinlogResult[fieldId]), err) SkipFieldError: return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) @@ -89718,8 +85034,8 @@ ReadStructEndError: return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceRestoreSnapshotResult) ReadField0(iprot thrift.TProtocol) error { - _field := NewTRestoreSnapshotResult_() +func (p *FrontendServiceLockBinlogResult) ReadField0(iprot thrift.TProtocol) error { + _field := NewTLockBinlogResult_() if err := _field.Read(iprot); err != nil { return err } @@ -89727,9 +85043,9 @@ func (p *FrontendServiceRestoreSnapshotResult) ReadField0(iprot thrift.TProtocol return nil } -func (p *FrontendServiceRestoreSnapshotResult) Write(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLockBinlogResult) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 - if err = oprot.WriteStructBegin("restoreSnapshot_result"); err != nil { + if err = oprot.WriteStructBegin("lockBinlog_result"); err != nil { goto WriteStructBeginError } if p != nil { @@ -89755,7 +85071,7 @@ WriteStructEndError: return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) } -func (p *FrontendServiceRestoreSnapshotResult) writeField0(oprot thrift.TProtocol) (err error) { +func (p *FrontendServiceLockBinlogResult) writeField0(oprot thrift.TProtocol) (err error) { if p.IsSetSuccess() { if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil { goto WriteFieldBeginError @@ -89774,15 +85090,15 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err) } -func (p *FrontendServiceRestoreSnapshotResult) String() string { +func (p *FrontendServiceLockBinlogResult) String() string { if p == nil { return "" } - return fmt.Sprintf("FrontendServiceRestoreSnapshotResult(%+v)", *p) + return fmt.Sprintf("FrontendServiceLockBinlogResult(%+v)", *p) } -func (p *FrontendServiceRestoreSnapshotResult) DeepEqual(ano *FrontendServiceRestoreSnapshotResult) bool { +func (p *FrontendServiceLockBinlogResult) DeepEqual(ano *FrontendServiceLockBinlogResult) bool { if p == ano { return true } else if p == nil || ano == nil { @@ -89794,7 +85110,7 @@ func (p *FrontendServiceRestoreSnapshotResult) DeepEqual(ano *FrontendServiceRes return true } -func (p *FrontendServiceRestoreSnapshotResult) Field0DeepEqual(src *TRestoreSnapshotResult_) bool { +func (p *FrontendServiceLockBinlogResult) Field0DeepEqual(src *TLockBinlogResult_) bool { if !p.Success.DeepEqual(src) { return false diff --git a/pkg/rpc/kitex_gen/frontendservice/frontendservice/client.go b/pkg/rpc/kitex_gen/frontendservice/frontendservice/client.go index 92a89cb2..98018f5c 100644 --- a/pkg/rpc/kitex_gen/frontendservice/frontendservice/client.go +++ b/pkg/rpc/kitex_gen/frontendservice/frontendservice/client.go @@ -15,7 +15,6 @@ import ( type Client interface { GetDbNames(ctx context.Context, params *frontendservice.TGetDbsParams, callOptions ...callopt.Option) (r *frontendservice.TGetDbsResult_, err error) GetTableNames(ctx context.Context, params *frontendservice.TGetTablesParams, callOptions ...callopt.Option) (r *frontendservice.TGetTablesResult_, err error) - DescribeTable(ctx context.Context, params *frontendservice.TDescribeTableParams, callOptions ...callopt.Option) (r *frontendservice.TDescribeTableResult_, err error) DescribeTables(ctx context.Context, params *frontendservice.TDescribeTablesParams, callOptions ...callopt.Option) (r *frontendservice.TDescribeTablesResult_, err error) ShowVariables(ctx context.Context, params *frontendservice.TShowVariableRequest, callOptions ...callopt.Option) (r *frontendservice.TShowVariableResult_, err error) ReportExecStatus(ctx context.Context, params *frontendservice.TReportExecStatusParams, callOptions ...callopt.Option) (r *frontendservice.TReportExecStatusResult_, err error) @@ -40,6 +39,7 @@ type Client interface { GetBinlog(ctx context.Context, request *frontendservice.TGetBinlogRequest, callOptions ...callopt.Option) (r *frontendservice.TGetBinlogResult_, err error) GetSnapshot(ctx context.Context, request *frontendservice.TGetSnapshotRequest, callOptions ...callopt.Option) (r *frontendservice.TGetSnapshotResult_, err error) RestoreSnapshot(ctx context.Context, request *frontendservice.TRestoreSnapshotRequest, callOptions ...callopt.Option) (r *frontendservice.TRestoreSnapshotResult_, err error) + LockBinlog(ctx context.Context, request *frontendservice.TLockBinlogRequest, callOptions ...callopt.Option) (r *frontendservice.TLockBinlogResult_, err error) WaitingTxnStatus(ctx context.Context, request *frontendservice.TWaitingTxnStatusRequest, callOptions ...callopt.Option) (r *frontendservice.TWaitingTxnStatusResult_, err error) StreamLoadPut(ctx context.Context, request *frontendservice.TStreamLoadPutRequest, callOptions ...callopt.Option) (r *frontendservice.TStreamLoadPutResult_, err error) StreamLoadMultiTablePut(ctx context.Context, request *frontendservice.TStreamLoadPutRequest, callOptions ...callopt.Option) (r *frontendservice.TStreamLoadMultiTablePutResult_, err error) @@ -115,11 +115,6 @@ func (p *kFrontendServiceClient) GetTableNames(ctx context.Context, params *fron return p.kClient.GetTableNames(ctx, params) } -func (p *kFrontendServiceClient) DescribeTable(ctx context.Context, params *frontendservice.TDescribeTableParams, callOptions ...callopt.Option) (r *frontendservice.TDescribeTableResult_, err error) { - ctx = client.NewCtxWithCallOptions(ctx, callOptions) - return p.kClient.DescribeTable(ctx, params) -} - func (p *kFrontendServiceClient) DescribeTables(ctx context.Context, params *frontendservice.TDescribeTablesParams, callOptions ...callopt.Option) (r *frontendservice.TDescribeTablesResult_, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.DescribeTables(ctx, params) @@ -240,6 +235,11 @@ func (p *kFrontendServiceClient) RestoreSnapshot(ctx context.Context, request *f return p.kClient.RestoreSnapshot(ctx, request) } +func (p *kFrontendServiceClient) LockBinlog(ctx context.Context, request *frontendservice.TLockBinlogRequest, callOptions ...callopt.Option) (r *frontendservice.TLockBinlogResult_, err error) { + ctx = client.NewCtxWithCallOptions(ctx, callOptions) + return p.kClient.LockBinlog(ctx, request) +} + func (p *kFrontendServiceClient) WaitingTxnStatus(ctx context.Context, request *frontendservice.TWaitingTxnStatusRequest, callOptions ...callopt.Option) (r *frontendservice.TWaitingTxnStatusResult_, err error) { ctx = client.NewCtxWithCallOptions(ctx, callOptions) return p.kClient.WaitingTxnStatus(ctx, request) diff --git a/pkg/rpc/kitex_gen/frontendservice/frontendservice/frontendservice.go b/pkg/rpc/kitex_gen/frontendservice/frontendservice/frontendservice.go index e50e899d..a7e34835 100644 --- a/pkg/rpc/kitex_gen/frontendservice/frontendservice/frontendservice.go +++ b/pkg/rpc/kitex_gen/frontendservice/frontendservice/frontendservice.go @@ -23,7 +23,6 @@ func NewServiceInfo() *kitex.ServiceInfo { methods := map[string]kitex.MethodInfo{ "getDbNames": kitex.NewMethodInfo(getDbNamesHandler, newFrontendServiceGetDbNamesArgs, newFrontendServiceGetDbNamesResult, false), "getTableNames": kitex.NewMethodInfo(getTableNamesHandler, newFrontendServiceGetTableNamesArgs, newFrontendServiceGetTableNamesResult, false), - "describeTable": kitex.NewMethodInfo(describeTableHandler, newFrontendServiceDescribeTableArgs, newFrontendServiceDescribeTableResult, false), "describeTables": kitex.NewMethodInfo(describeTablesHandler, newFrontendServiceDescribeTablesArgs, newFrontendServiceDescribeTablesResult, false), "showVariables": kitex.NewMethodInfo(showVariablesHandler, newFrontendServiceShowVariablesArgs, newFrontendServiceShowVariablesResult, false), "reportExecStatus": kitex.NewMethodInfo(reportExecStatusHandler, newFrontendServiceReportExecStatusArgs, newFrontendServiceReportExecStatusResult, false), @@ -48,6 +47,7 @@ func NewServiceInfo() *kitex.ServiceInfo { "getBinlog": kitex.NewMethodInfo(getBinlogHandler, newFrontendServiceGetBinlogArgs, newFrontendServiceGetBinlogResult, false), "getSnapshot": kitex.NewMethodInfo(getSnapshotHandler, newFrontendServiceGetSnapshotArgs, newFrontendServiceGetSnapshotResult, false), "restoreSnapshot": kitex.NewMethodInfo(restoreSnapshotHandler, newFrontendServiceRestoreSnapshotArgs, newFrontendServiceRestoreSnapshotResult, false), + "lockBinlog": kitex.NewMethodInfo(lockBinlogHandler, newFrontendServiceLockBinlogArgs, newFrontendServiceLockBinlogResult, false), "waitingTxnStatus": kitex.NewMethodInfo(waitingTxnStatusHandler, newFrontendServiceWaitingTxnStatusArgs, newFrontendServiceWaitingTxnStatusResult, false), "streamLoadPut": kitex.NewMethodInfo(streamLoadPutHandler, newFrontendServiceStreamLoadPutArgs, newFrontendServiceStreamLoadPutResult, false), "streamLoadMultiTablePut": kitex.NewMethodInfo(streamLoadMultiTablePutHandler, newFrontendServiceStreamLoadMultiTablePutArgs, newFrontendServiceStreamLoadMultiTablePutResult, false), @@ -134,24 +134,6 @@ func newFrontendServiceGetTableNamesResult() interface{} { return frontendservice.NewFrontendServiceGetTableNamesResult() } -func describeTableHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { - realArg := arg.(*frontendservice.FrontendServiceDescribeTableArgs) - realResult := result.(*frontendservice.FrontendServiceDescribeTableResult) - success, err := handler.(frontendservice.FrontendService).DescribeTable(ctx, realArg.Params) - if err != nil { - return err - } - realResult.Success = success - return nil -} -func newFrontendServiceDescribeTableArgs() interface{} { - return frontendservice.NewFrontendServiceDescribeTableArgs() -} - -func newFrontendServiceDescribeTableResult() interface{} { - return frontendservice.NewFrontendServiceDescribeTableResult() -} - func describeTablesHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*frontendservice.FrontendServiceDescribeTablesArgs) realResult := result.(*frontendservice.FrontendServiceDescribeTablesResult) @@ -584,6 +566,24 @@ func newFrontendServiceRestoreSnapshotResult() interface{} { return frontendservice.NewFrontendServiceRestoreSnapshotResult() } +func lockBinlogHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { + realArg := arg.(*frontendservice.FrontendServiceLockBinlogArgs) + realResult := result.(*frontendservice.FrontendServiceLockBinlogResult) + success, err := handler.(frontendservice.FrontendService).LockBinlog(ctx, realArg.Request) + if err != nil { + return err + } + realResult.Success = success + return nil +} +func newFrontendServiceLockBinlogArgs() interface{} { + return frontendservice.NewFrontendServiceLockBinlogArgs() +} + +func newFrontendServiceLockBinlogResult() interface{} { + return frontendservice.NewFrontendServiceLockBinlogResult() +} + func waitingTxnStatusHandler(ctx context.Context, handler interface{}, arg, result interface{}) error { realArg := arg.(*frontendservice.FrontendServiceWaitingTxnStatusArgs) realResult := result.(*frontendservice.FrontendServiceWaitingTxnStatusResult) @@ -1226,16 +1226,6 @@ func (p *kClient) GetTableNames(ctx context.Context, params *frontendservice.TGe return _result.GetSuccess(), nil } -func (p *kClient) DescribeTable(ctx context.Context, params *frontendservice.TDescribeTableParams) (r *frontendservice.TDescribeTableResult_, err error) { - var _args frontendservice.FrontendServiceDescribeTableArgs - _args.Params = params - var _result frontendservice.FrontendServiceDescribeTableResult - if err = p.c.Call(ctx, "describeTable", &_args, &_result); err != nil { - return - } - return _result.GetSuccess(), nil -} - func (p *kClient) DescribeTables(ctx context.Context, params *frontendservice.TDescribeTablesParams) (r *frontendservice.TDescribeTablesResult_, err error) { var _args frontendservice.FrontendServiceDescribeTablesArgs _args.Params = params @@ -1475,6 +1465,16 @@ func (p *kClient) RestoreSnapshot(ctx context.Context, request *frontendservice. return _result.GetSuccess(), nil } +func (p *kClient) LockBinlog(ctx context.Context, request *frontendservice.TLockBinlogRequest) (r *frontendservice.TLockBinlogResult_, err error) { + var _args frontendservice.FrontendServiceLockBinlogArgs + _args.Request = request + var _result frontendservice.FrontendServiceLockBinlogResult + if err = p.c.Call(ctx, "lockBinlog", &_args, &_result); err != nil { + return + } + return _result.GetSuccess(), nil +} + func (p *kClient) WaitingTxnStatus(ctx context.Context, request *frontendservice.TWaitingTxnStatusRequest) (r *frontendservice.TWaitingTxnStatusResult_, err error) { var _args frontendservice.FrontendServiceWaitingTxnStatusArgs _args.Request = request diff --git a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go index 4a21708c..7b70a664 100644 --- a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go @@ -50,337 +50,6 @@ var ( _ = types.KitexUnusedProtection ) -func (p *TSetSessionParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetUser bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetUser = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetUser { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSetSessionParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSetSessionParams[fieldId])) -} - -func (p *TSetSessionParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.User = v - - } - return offset, nil -} - -// for compatibility -func (p *TSetSessionParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TSetSessionParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSetSessionParams") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TSetSessionParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TSetSessionParams") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TSetSessionParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.User) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TSetSessionParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.User) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TAuthenticateParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetUser bool = false - var issetPasswd bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetUser = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetPasswd = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetUser { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetPasswd { - fieldId = 2 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TAuthenticateParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TAuthenticateParams[fieldId])) -} - -func (p *TAuthenticateParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.User = v - - } - return offset, nil -} - -func (p *TAuthenticateParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.Passwd = v - - } - return offset, nil -} - -// for compatibility -func (p *TAuthenticateParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TAuthenticateParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TAuthenticateParams") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TAuthenticateParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TAuthenticateParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TAuthenticateParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.User) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TAuthenticateParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "passwd", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Passwd) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TAuthenticateParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.User) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TAuthenticateParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("passwd", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.Passwd) - - l += bthrift.Binary.FieldEndLength() - return l -} - func (p *TColumnDesc) FastRead(buf []byte) (int, error) { var err error var offset int @@ -519,6 +188,20 @@ func (p *TColumnDesc) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 9: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -685,6 +368,19 @@ func (p *TColumnDesc) FastReadField8(buf []byte) (int, error) { return offset, nil } +func (p *TColumnDesc) FastReadField9(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.DefaultValue = &v + + } + return offset, nil +} + // for compatibility func (p *TColumnDesc) FastWrite(buf []byte) int { return 0 @@ -702,6 +398,7 @@ func (p *TColumnDesc) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWri offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField7(buf[offset:], binaryWriter) offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -720,6 +417,7 @@ func (p *TColumnDesc) BLength() int { l += p.field6Length() l += p.field7Length() l += p.field8Length() + l += p.field9Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -817,6 +515,17 @@ func (p *TColumnDesc) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWri return offset } +func (p *TColumnDesc) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDefaultValue() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "defaultValue", thrift.STRING, 9) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.DefaultValue) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TColumnDesc) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("columnName", thrift.STRING, 1) @@ -904,6 +613,17 @@ func (p *TColumnDesc) field8Length() int { return l } +func (p *TColumnDesc) field9Length() int { + l := 0 + if p.IsSetDefaultValue() { + l += bthrift.Binary.FieldBeginLength("defaultValue", thrift.STRING, 9) + l += bthrift.Binary.StringLengthNocopy(*p.DefaultValue) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TColumnDef) FastRead(buf []byte) (int, error) { var err error var offset int @@ -1090,13 +810,13 @@ func (p *TColumnDef) field2Length() int { return l } -func (p *TDescribeTableParams) FastRead(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetTableName bool = false + var issetTablesName bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -1128,13 +848,13 @@ func (p *TDescribeTableParams) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetTableName = true + issetTablesName = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -1232,7 +952,7 @@ func (p *TDescribeTableParams) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetTableName { + if !issetTablesName { fieldId = 2 goto RequiredFieldNotSetError } @@ -1242,7 +962,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTableParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesParams[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -1250,10 +970,10 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTableParams[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesParams[fieldId])) } -func (p *TDescribeTableParams) FastReadField1(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -1266,21 +986,37 @@ func (p *TDescribeTableParams) FastReadField1(buf []byte) (int, error) { return offset, nil } -func (p *TDescribeTableParams) FastReadField2(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l + } + p.TablesName = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l - p.TableName = v + _elem = v + + } + p.TablesName = append(p.TablesName, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } return offset, nil } -func (p *TDescribeTableParams) FastReadField3(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -1293,7 +1029,7 @@ func (p *TDescribeTableParams) FastReadField3(buf []byte) (int, error) { return offset, nil } -func (p *TDescribeTableParams) FastReadField4(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastReadField4(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -1306,7 +1042,7 @@ func (p *TDescribeTableParams) FastReadField4(buf []byte) (int, error) { return offset, nil } -func (p *TDescribeTableParams) FastReadField5(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastReadField5(buf []byte) (int, error) { offset := 0 tmp := types.NewTUserIdentity() @@ -1319,7 +1055,7 @@ func (p *TDescribeTableParams) FastReadField5(buf []byte) (int, error) { return offset, nil } -func (p *TDescribeTableParams) FastReadField6(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastReadField6(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { @@ -1333,7 +1069,7 @@ func (p *TDescribeTableParams) FastReadField6(buf []byte) (int, error) { return offset, nil } -func (p *TDescribeTableParams) FastReadField7(buf []byte) (int, error) { +func (p *TDescribeTablesParams) FastReadField7(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -1347,13 +1083,13 @@ func (p *TDescribeTableParams) FastReadField7(buf []byte) (int, error) { } // for compatibility -func (p *TDescribeTableParams) FastWrite(buf []byte) int { +func (p *TDescribeTablesParams) FastWrite(buf []byte) int { return 0 } -func (p *TDescribeTableParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDescribeTableParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDescribeTablesParams") if p != nil { offset += p.fastWriteField6(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) @@ -1368,9 +1104,9 @@ func (p *TDescribeTableParams) FastWriteNocopy(buf []byte, binaryWriter bthrift. return offset } -func (p *TDescribeTableParams) BLength() int { +func (p *TDescribeTablesParams) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TDescribeTableParams") + l += bthrift.Binary.StructBeginLength("TDescribeTablesParams") if p != nil { l += p.field1Length() l += p.field2Length() @@ -1385,7 +1121,7 @@ func (p *TDescribeTableParams) BLength() int { return l } -func (p *TDescribeTableParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetDb() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 1) @@ -1396,16 +1132,24 @@ func (p *TDescribeTableParams) fastWriteField1(buf []byte, binaryWriter bthrift. return offset } -func (p *TDescribeTableParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_name", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.TableName) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables_name", thrift.LIST, 2) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + var length int + for _, v := range p.TablesName { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TDescribeTableParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetUser() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 3) @@ -1416,7 +1160,7 @@ func (p *TDescribeTableParams) fastWriteField3(buf []byte, binaryWriter bthrift. return offset } -func (p *TDescribeTableParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetUserIp() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 4) @@ -1427,7 +1171,7 @@ func (p *TDescribeTableParams) fastWriteField4(buf []byte, binaryWriter bthrift. return offset } -func (p *TDescribeTableParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetCurrentUserIdent() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 5) @@ -1437,7 +1181,7 @@ func (p *TDescribeTableParams) fastWriteField5(buf []byte, binaryWriter bthrift. return offset } -func (p *TDescribeTableParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetShowHiddenColumns() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "show_hidden_columns", thrift.BOOL, 6) @@ -1448,7 +1192,7 @@ func (p *TDescribeTableParams) fastWriteField6(buf []byte, binaryWriter bthrift. return offset } -func (p *TDescribeTableParams) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesParams) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetCatalog() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 7) @@ -1459,7 +1203,7 @@ func (p *TDescribeTableParams) fastWriteField7(buf []byte, binaryWriter bthrift. return offset } -func (p *TDescribeTableParams) field1Length() int { +func (p *TDescribeTablesParams) field1Length() int { l := 0 if p.IsSetDb() { l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 1) @@ -1470,16 +1214,20 @@ func (p *TDescribeTableParams) field1Length() int { return l } -func (p *TDescribeTableParams) field2Length() int { +func (p *TDescribeTablesParams) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("table_name", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.TableName) + l += bthrift.Binary.FieldBeginLength("tables_name", thrift.LIST, 2) + l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.TablesName)) + for _, v := range p.TablesName { + l += bthrift.Binary.StringLengthNocopy(v) + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() return l } -func (p *TDescribeTableParams) field3Length() int { +func (p *TDescribeTablesParams) field3Length() int { l := 0 if p.IsSetUser() { l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 3) @@ -1490,7 +1238,7 @@ func (p *TDescribeTableParams) field3Length() int { return l } -func (p *TDescribeTableParams) field4Length() int { +func (p *TDescribeTablesParams) field4Length() int { l := 0 if p.IsSetUserIp() { l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 4) @@ -1501,7 +1249,7 @@ func (p *TDescribeTableParams) field4Length() int { return l } -func (p *TDescribeTableParams) field5Length() int { +func (p *TDescribeTablesParams) field5Length() int { l := 0 if p.IsSetCurrentUserIdent() { l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 5) @@ -1511,7 +1259,7 @@ func (p *TDescribeTableParams) field5Length() int { return l } -func (p *TDescribeTableParams) field6Length() int { +func (p *TDescribeTablesParams) field6Length() int { l := 0 if p.IsSetShowHiddenColumns() { l += bthrift.Binary.FieldBeginLength("show_hidden_columns", thrift.BOOL, 6) @@ -1522,7 +1270,7 @@ func (p *TDescribeTableParams) field6Length() int { return l } -func (p *TDescribeTableParams) field7Length() int { +func (p *TDescribeTablesParams) field7Length() int { l := 0 if p.IsSetCatalog() { l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 7) @@ -1533,12 +1281,13 @@ func (p *TDescribeTableParams) field7Length() int { return l } -func (p *TDescribeTableResult_) FastRead(buf []byte) (int, error) { +func (p *TDescribeTablesResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 + var issetTablesOffset bool = false var issetColumns bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l @@ -1563,6 +1312,21 @@ func (p *TDescribeTableResult_) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } + issetTablesOffset = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } issetColumns = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) @@ -1591,17 +1355,22 @@ func (p *TDescribeTableResult_) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetColumns { + if !issetTablesOffset { fieldId = 1 goto RequiredFieldNotSetError } + + if !issetColumns { + fieldId = 2 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTableResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -1609,10 +1378,40 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTableResult_[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesResult_[fieldId])) +} + +func (p *TDescribeTablesResult_) FastReadField1(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.TablesOffset = make([]int32, 0, size) + for i := 0; i < size; i++ { + var _elem int32 + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.TablesOffset = append(p.TablesOffset, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil } -func (p *TDescribeTableResult_) FastReadField1(buf []byte) (int, error) { +func (p *TDescribeTablesResult_) FastReadField2(buf []byte) (int, error) { offset := 0 _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) @@ -1640,35 +1439,54 @@ func (p *TDescribeTableResult_) FastReadField1(buf []byte) (int, error) { } // for compatibility -func (p *TDescribeTableResult_) FastWrite(buf []byte) int { +func (p *TDescribeTablesResult_) FastWrite(buf []byte) int { return 0 } -func (p *TDescribeTableResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDescribeTableResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDescribeTablesResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TDescribeTableResult_) BLength() int { +func (p *TDescribeTablesResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TDescribeTableResult") + l += bthrift.Binary.StructBeginLength("TDescribeTablesResult") if p != nil { l += p.field1Length() + l += p.field2Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TDescribeTableResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDescribeTablesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columns", thrift.LIST, 1) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables_offset", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.I32, 0) + var length int + for _, v := range p.TablesOffset { + length++ + offset += bthrift.Binary.WriteI32(buf[offset:], v) + + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I32, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TDescribeTablesResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columns", thrift.LIST, 2) listBeginOffset := offset offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) var length int @@ -1682,9 +1500,20 @@ func (p *TDescribeTableResult_) fastWriteField1(buf []byte, binaryWriter bthrift return offset } -func (p *TDescribeTableResult_) field1Length() int { +func (p *TDescribeTablesResult_) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("columns", thrift.LIST, 1) + l += bthrift.Binary.FieldBeginLength("tables_offset", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.I32, len(p.TablesOffset)) + var tmpV int32 + l += bthrift.Binary.I32Length(int32(tmpV)) * len(p.TablesOffset) + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TDescribeTablesResult_) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("columns", thrift.LIST, 2) l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Columns)) for _, v := range p.Columns { l += v.BLength() @@ -1694,13 +1523,14 @@ func (p *TDescribeTableResult_) field1Length() int { return l } -func (p *TDescribeTablesParams) FastRead(buf []byte) (int, error) { +func (p *TShowVariableRequest) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetTablesName bool = false + var issetThreadId bool = false + var issetVarType bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -1718,12 +1548,13 @@ func (p *TDescribeTablesParams) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetThreadId = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -1732,83 +1563,13 @@ func (p *TDescribeTablesParams) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetTablesName = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.BOOL { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField7(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } + issetVarType = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -1836,7 +1597,12 @@ func (p *TDescribeTablesParams) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetTablesName { + if !issetThreadId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetVarType { fieldId = 2 goto RequiredFieldNotSetError } @@ -1846,7 +1612,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -1854,189 +1620,566 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesParams[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableRequest[fieldId])) } -func (p *TDescribeTablesParams) FastReadField1(buf []byte) (int, error) { +func (p *TShowVariableRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Db = &v + + p.ThreadId = v } return offset, nil } -func (p *TDescribeTablesParams) FastReadField2(buf []byte) (int, error) { +func (p *TShowVariableRequest) FastReadField2(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.TablesName = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.TablesName = append(p.TablesName, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l + + p.VarType = types.TVarType(v) + } return offset, nil } -func (p *TDescribeTablesParams) FastReadField3(buf []byte) (int, error) { - offset := 0 +// for compatibility +func (p *TShowVariableRequest) FastWrite(buf []byte) int { + return 0 +} - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.User = &v +func (p *TShowVariableRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TShowVariableRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} +func (p *TShowVariableRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TShowVariableRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() } - return offset, nil + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l } -func (p *TDescribeTablesParams) FastReadField4(buf []byte) (int, error) { +func (p *TShowVariableRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "threadId", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.ThreadId) - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.UserIp = &v - - } - return offset, nil + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset } -func (p *TDescribeTablesParams) FastReadField5(buf []byte) (int, error) { +func (p *TShowVariableRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "varType", thrift.I32, 2) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.VarType)) - tmp := types.NewTUserIdentity() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TShowVariableRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("threadId", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.ThreadId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TShowVariableRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("varType", thrift.I32, 2) + l += bthrift.Binary.I32Length(int32(p.VarType)) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TShowVariableResult_) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetVariables bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetVariables = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetVariables { + fieldId = 1 + goto RequiredFieldNotSetError } - p.CurrentUserIdent = tmp return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableResult_[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableResult_[fieldId])) } -func (p *TDescribeTablesParams) FastReadField6(buf []byte) (int, error) { +func (p *TShowVariableResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { + } + p.Variables = make([][]string, 0, size) + for i := 0; i < size; i++ { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) offset += l + if err != nil { + return offset, err + } + _elem := make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem1 string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l - p.ShowHiddenColumns = v + _elem1 = v - } - return offset, nil -} + } -func (p *TDescribeTablesParams) FastReadField7(buf []byte) (int, error) { - offset := 0 + _elem = append(_elem, _elem1) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + p.Variables = append(p.Variables, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Catalog = &v - } return offset, nil } // for compatibility -func (p *TDescribeTablesParams) FastWrite(buf []byte) int { +func (p *TShowVariableResult_) FastWrite(buf []byte) int { return 0 } -func (p *TDescribeTablesParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TShowVariableResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDescribeTablesParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TShowVariableResult") if p != nil { - offset += p.fastWriteField6(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TDescribeTablesParams) BLength() int { +func (p *TShowVariableResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TDescribeTablesParams") + l += bthrift.Binary.StructBeginLength("TShowVariableResult") if p != nil { l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TDescribeTablesParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TShowVariableResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDb() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Db) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "variables", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.LIST, 0) + var length int + for _, v := range p.Variables { + length++ + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + var length int + for _, v := range v { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.LIST, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TDescribeTablesParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TShowVariableResult_) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("variables", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.LIST, len(p.Variables)) + for _, v := range p.Variables { + l += bthrift.Binary.ListBeginLength(thrift.STRING, len(v)) + for _, v := range v { + l += bthrift.Binary.StringLengthNocopy(v) + + } + l += bthrift.Binary.ListEndLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TGetDbsParams) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetDbsParams[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *TGetDbsParams) FastReadField1(buf []byte) (int, error) { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables_name", thrift.LIST, 2) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) - var length int - for _, v := range p.TablesName { - length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Pattern = &v } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset, nil +} + +func (p *TGetDbsParams) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.User = &v + + } + return offset, nil +} + +func (p *TGetDbsParams) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.UserIp = &v + + } + return offset, nil +} + +func (p *TGetDbsParams) FastReadField4(buf []byte) (int, error) { + offset := 0 + + tmp := types.NewTUserIdentity() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CurrentUserIdent = tmp + return offset, nil +} + +func (p *TGetDbsParams) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Catalog = &v + + } + return offset, nil +} + +func (p *TGetDbsParams) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.GetNullCatalog = &v + + } + return offset, nil +} + +// for compatibility +func (p *TGetDbsParams) FastWrite(buf []byte) int { + return 0 +} + +func (p *TGetDbsParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetDbsParams") + if p != nil { + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TDescribeTablesParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsParams) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TGetDbsParams") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TGetDbsParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPattern() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pattern", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Pattern) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetDbsParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetUser() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 3) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 2) offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.User) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) @@ -2044,10 +2187,10 @@ func (p *TDescribeTablesParams) fastWriteField3(buf []byte, binaryWriter bthrift return offset } -func (p *TDescribeTablesParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetUserIp() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 4) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 3) offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.UserIp) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) @@ -2055,66 +2198,53 @@ func (p *TDescribeTablesParams) fastWriteField4(buf []byte, binaryWriter bthrift return offset } -func (p *TDescribeTablesParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetCurrentUserIdent() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 5) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 4) offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TDescribeTablesParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetShowHiddenColumns() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "show_hidden_columns", thrift.BOOL, 6) - offset += bthrift.Binary.WriteBool(buf[offset:], p.ShowHiddenColumns) + if p.IsSetCatalog() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 5) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TDescribeTablesParams) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCatalog() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 7) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) + if p.IsSetGetNullCatalog() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "get_null_catalog", thrift.BOOL, 6) + offset += bthrift.Binary.WriteBool(buf[offset:], *p.GetNullCatalog) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TDescribeTablesParams) field1Length() int { +func (p *TGetDbsParams) field1Length() int { l := 0 - if p.IsSetDb() { - l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.Db) + if p.IsSetPattern() { + l += bthrift.Binary.FieldBeginLength("pattern", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.Pattern) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TDescribeTablesParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("tables_name", thrift.LIST, 2) - l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.TablesName)) - for _, v := range p.TablesName { - l += bthrift.Binary.StringLengthNocopy(v) - - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TDescribeTablesParams) field3Length() int { +func (p *TGetDbsParams) field2Length() int { l := 0 if p.IsSetUser() { - l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 3) + l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 2) l += bthrift.Binary.StringLengthNocopy(*p.User) l += bthrift.Binary.FieldEndLength() @@ -2122,10 +2252,10 @@ func (p *TDescribeTablesParams) field3Length() int { return l } -func (p *TDescribeTablesParams) field4Length() int { +func (p *TGetDbsParams) field3Length() int { l := 0 if p.IsSetUserIp() { - l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 4) + l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 3) l += bthrift.Binary.StringLengthNocopy(*p.UserIp) l += bthrift.Binary.FieldEndLength() @@ -2133,46 +2263,44 @@ func (p *TDescribeTablesParams) field4Length() int { return l } -func (p *TDescribeTablesParams) field5Length() int { +func (p *TGetDbsParams) field4Length() int { l := 0 if p.IsSetCurrentUserIdent() { - l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 5) + l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 4) l += p.CurrentUserIdent.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TDescribeTablesParams) field6Length() int { +func (p *TGetDbsParams) field5Length() int { l := 0 - if p.IsSetShowHiddenColumns() { - l += bthrift.Binary.FieldBeginLength("show_hidden_columns", thrift.BOOL, 6) - l += bthrift.Binary.BoolLength(p.ShowHiddenColumns) + if p.IsSetCatalog() { + l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 5) + l += bthrift.Binary.StringLengthNocopy(*p.Catalog) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TDescribeTablesParams) field7Length() int { +func (p *TGetDbsParams) field6Length() int { l := 0 - if p.IsSetCatalog() { - l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 7) - l += bthrift.Binary.StringLengthNocopy(*p.Catalog) + if p.IsSetGetNullCatalog() { + l += bthrift.Binary.FieldBeginLength("get_null_catalog", thrift.BOOL, 6) + l += bthrift.Binary.BoolLength(*p.GetNullCatalog) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TDescribeTablesResult_) FastRead(buf []byte) (int, error) { +func (p *TGetDbsResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetTablesOffset bool = false - var issetColumns bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -2196,7 +2324,6 @@ func (p *TDescribeTablesResult_) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetTablesOffset = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2211,7 +2338,34 @@ func (p *TDescribeTablesResult_) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetColumns = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2239,33 +2393,22 @@ func (p *TDescribeTablesResult_) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetTablesOffset { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetColumns { - fieldId = 2 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDescribeTablesResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetDbsResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDescribeTablesResult_[fieldId])) } -func (p *TDescribeTablesResult_) FastReadField1(buf []byte) (int, error) { +func (p *TGetDbsResult_) FastReadField1(buf []byte) (int, error) { offset := 0 _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) @@ -2273,10 +2416,10 @@ func (p *TDescribeTablesResult_) FastReadField1(buf []byte) (int, error) { if err != nil { return offset, err } - p.TablesOffset = make([]int32, 0, size) + p.Dbs = make([]string, 0, size) for i := 0; i < size; i++ { - var _elem int32 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l @@ -2285,7 +2428,7 @@ func (p *TDescribeTablesResult_) FastReadField1(buf []byte) (int, error) { } - p.TablesOffset = append(p.TablesOffset, _elem) + p.Dbs = append(p.Dbs, _elem) } if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err @@ -2295,7 +2438,7 @@ func (p *TDescribeTablesResult_) FastReadField1(buf []byte) (int, error) { return offset, nil } -func (p *TDescribeTablesResult_) FastReadField2(buf []byte) (int, error) { +func (p *TGetDbsResult_) FastReadField2(buf []byte) (int, error) { offset := 0 _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) @@ -2303,16 +2446,19 @@ func (p *TDescribeTablesResult_) FastReadField2(buf []byte) (int, error) { if err != nil { return offset, err } - p.Columns = make([]*TColumnDef, 0, size) + p.Catalogs = make([]string, 0, size) for i := 0; i < size; i++ { - _elem := NewTColumnDef() - if l, err := _elem.FastRead(buf[offset:]); err != nil { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l + + _elem = v + } - p.Columns = append(p.Columns, _elem) + p.Catalogs = append(p.Catalogs, _elem) } if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err @@ -2322,99 +2468,237 @@ func (p *TDescribeTablesResult_) FastReadField2(buf []byte) (int, error) { return offset, nil } -// for compatibility -func (p *TDescribeTablesResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TDescribeTablesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsResult_) FastReadField3(buf []byte) (int, error) { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDescribeTablesResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} + p.DbIds = make([]int64, 0, size) + for i := 0; i < size; i++ { + var _elem int64 + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l -func (p *TDescribeTablesResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TDescribeTablesResult") - if p != nil { - l += p.field1Length() - l += p.field2Length() + _elem = v + + } + + p.DbIds = append(p.DbIds, _elem) } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil } -func (p *TDescribeTablesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsResult_) FastReadField4(buf []byte) (int, error) { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables_offset", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I32, 0) - var length int - for _, v := range p.TablesOffset { - length++ - offset += bthrift.Binary.WriteI32(buf[offset:], v) + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I32, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + p.CatalogIds = make([]int64, 0, size) + for i := 0; i < size; i++ { + var _elem int64 + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.CatalogIds = append(p.CatalogIds, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil +} + +// for compatibility +func (p *TGetDbsResult_) FastWrite(buf []byte) int { + return 0 +} + +func (p *TGetDbsResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetDbsResult") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TDescribeTablesResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetDbsResult_) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TGetDbsResult") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TGetDbsResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columns", thrift.LIST, 2) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.Columns { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetDbs() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dbs", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + var length int + for _, v := range p.Dbs { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TDescribeTablesResult_) field1Length() int { +func (p *TGetDbsResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCatalogs() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalogs", thrift.LIST, 2) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + var length int + for _, v := range p.Catalogs { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetDbsResult_) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDbIds() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db_ids", thrift.LIST, 3) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) + var length int + for _, v := range p.DbIds { + length++ + offset += bthrift.Binary.WriteI64(buf[offset:], v) + + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetDbsResult_) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCatalogIds() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog_ids", thrift.LIST, 4) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) + var length int + for _, v := range p.CatalogIds { + length++ + offset += bthrift.Binary.WriteI64(buf[offset:], v) + + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetDbsResult_) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("tables_offset", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.I32, len(p.TablesOffset)) - var tmpV int32 - l += bthrift.Binary.I32Length(int32(tmpV)) * len(p.TablesOffset) - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() + if p.IsSetDbs() { + l += bthrift.Binary.FieldBeginLength("dbs", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.Dbs)) + for _, v := range p.Dbs { + l += bthrift.Binary.StringLengthNocopy(v) + + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TDescribeTablesResult_) field2Length() int { +func (p *TGetDbsResult_) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("columns", thrift.LIST, 2) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Columns)) - for _, v := range p.Columns { - l += v.BLength() + if p.IsSetCatalogs() { + l += bthrift.Binary.FieldBeginLength("catalogs", thrift.LIST, 2) + l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.Catalogs)) + for _, v := range p.Catalogs { + l += bthrift.Binary.StringLengthNocopy(v) + + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() return l } -func (p *TShowVariableRequest) FastRead(buf []byte) (int, error) { +func (p *TGetDbsResult_) field3Length() int { + l := 0 + if p.IsSetDbIds() { + l += bthrift.Binary.FieldBeginLength("db_ids", thrift.LIST, 3) + l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.DbIds)) + var tmpV int64 + l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.DbIds) + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TGetDbsResult_) field4Length() int { + l := 0 + if p.IsSetCatalogIds() { + l += bthrift.Binary.FieldBeginLength("catalog_ids", thrift.LIST, 4) + l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.CatalogIds)) + var tmpV int64 + l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.CatalogIds) + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetThreadId bool = false - var issetVarType bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -2432,13 +2716,12 @@ func (p *TShowVariableRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetThreadId = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2447,13 +2730,82 @@ func (p *TShowVariableRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetVarType = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2481,324 +2833,312 @@ func (p *TShowVariableRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetThreadId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetVarType { - fieldId = 2 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetTablesParams[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableRequest[fieldId])) } -func (p *TShowVariableRequest) FastReadField1(buf []byte) (int, error) { +func (p *TGetTablesParams) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l + p.Db = &v - p.ThreadId = v + } + return offset, nil +} + +func (p *TGetTablesParams) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Pattern = &v } return offset, nil } -func (p *TShowVariableRequest) FastReadField2(buf []byte) (int, error) { +func (p *TGetTablesParams) FastReadField3(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l + p.User = &v - p.VarType = types.TVarType(v) + } + return offset, nil +} + +func (p *TGetTablesParams) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.UserIp = &v + + } + return offset, nil +} + +func (p *TGetTablesParams) FastReadField5(buf []byte) (int, error) { + offset := 0 + + tmp := types.NewTUserIdentity() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CurrentUserIdent = tmp + return offset, nil +} + +func (p *TGetTablesParams) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Type = &v + + } + return offset, nil +} + +func (p *TGetTablesParams) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Catalog = &v } return offset, nil } // for compatibility -func (p *TShowVariableRequest) FastWrite(buf []byte) int { +func (p *TGetTablesParams) FastWrite(buf []byte) int { return 0 } -func (p *TShowVariableRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetTablesParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TShowVariableRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetTablesParams") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TShowVariableRequest) BLength() int { +func (p *TGetTablesParams) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TShowVariableRequest") + l += bthrift.Binary.StructBeginLength("TGetTablesParams") if p != nil { l += p.field1Length() l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TShowVariableRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetTablesParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "threadId", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], p.ThreadId) + if p.IsSetDb() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Db) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TShowVariableRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetTablesParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "varType", thrift.I32, 2) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.VarType)) + if p.IsSetPattern() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pattern", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Pattern) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TShowVariableRequest) field1Length() int { +func (p *TGetTablesParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetUser() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.User) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetTablesParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetUserIp() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.UserIp) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetTablesParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCurrentUserIdent() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 5) + offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetTablesParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.STRING, 6) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Type) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetTablesParams) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCatalog() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 7) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TGetTablesParams) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("threadId", thrift.I64, 1) - l += bthrift.Binary.I64Length(p.ThreadId) + if p.IsSetDb() { + l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.Db) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TShowVariableRequest) field2Length() int { +func (p *TGetTablesParams) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("varType", thrift.I32, 2) - l += bthrift.Binary.I32Length(int32(p.VarType)) + if p.IsSetPattern() { + l += bthrift.Binary.FieldBeginLength("pattern", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.Pattern) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TShowVariableResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetVariables bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError +func (p *TGetTablesParams) field3Length() int { + l := 0 + if p.IsSetUser() { + l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.User) + + l += bthrift.Binary.FieldEndLength() } + return l +} - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetVariables = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetVariables { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TShowVariableResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TShowVariableResult_[fieldId])) -} - -func (p *TShowVariableResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Variables = make([][]string, 0, size) - for i := 0; i < size; i++ { - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _elem := make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem1 string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem1 = v - - } - - _elem = append(_elem, _elem1) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.Variables = append(p.Variables, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TShowVariableResult_) FastWrite(buf []byte) int { - return 0 -} +func (p *TGetTablesParams) field4Length() int { + l := 0 + if p.IsSetUserIp() { + l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.UserIp) -func (p *TShowVariableResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TShowVariableResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) + l += bthrift.Binary.FieldEndLength() } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset + return l } -func (p *TShowVariableResult_) BLength() int { +func (p *TGetTablesParams) field5Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TShowVariableResult") - if p != nil { - l += p.field1Length() + if p.IsSetCurrentUserIdent() { + l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 5) + l += p.CurrentUserIdent.BLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TShowVariableResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "variables", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.LIST, 0) - var length int - for _, v := range p.Variables { - length++ - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) - var length int - for _, v := range v { - length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) +func (p *TGetTablesParams) field6Length() int { + l := 0 + if p.IsSetType() { + l += bthrift.Binary.FieldBeginLength("type", thrift.STRING, 6) + l += bthrift.Binary.StringLengthNocopy(*p.Type) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) + l += bthrift.Binary.FieldEndLength() } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.LIST, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset + return l } -func (p *TShowVariableResult_) field1Length() int { +func (p *TGetTablesParams) field7Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("variables", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.LIST, len(p.Variables)) - for _, v := range p.Variables { - l += bthrift.Binary.ListBeginLength(thrift.STRING, len(v)) - for _, v := range v { - l += bthrift.Binary.StringLengthNocopy(v) + if p.IsSetCatalog() { + l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 7) + l += bthrift.Binary.StringLengthNocopy(*p.Catalog) - } - l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() return l } -func (p *TTableRowFormat) FastRead(buf []byte) (int, error) { +func (p *TTableStatus) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 + var issetName bool = false + var issetType bool = false + var issetComment bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -2822,6 +3162,7 @@ func (p *TTableRowFormat) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } + issetName = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2836,6 +3177,7 @@ func (p *TTableRowFormat) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } + issetType = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2850,6 +3192,161 @@ func (p *TTableRowFormat) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } + issetComment = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 13: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 14: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField14(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2877,204 +3374,602 @@ func (p *TTableRowFormat) FastRead(buf []byte) (int, error) { goto ReadStructEndError } + if !issetName { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetType { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetComment { + fieldId = 3 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableRowFormat[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableStatus[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTableStatus[fieldId])) } -func (p *TTableRowFormat) FastReadField1(buf []byte) (int, error) { +func (p *TTableStatus) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.FieldTerminator = &v + + p.Name = v } return offset, nil } -func (p *TTableRowFormat) FastReadField2(buf []byte) (int, error) { +func (p *TTableStatus) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.LineTerminator = &v + + p.Type = v } return offset, nil } -func (p *TTableRowFormat) FastReadField3(buf []byte) (int, error) { +func (p *TTableStatus) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.EscapedBy = &v + + p.Comment = v } return offset, nil } -// for compatibility -func (p *TTableRowFormat) FastWrite(buf []byte) int { - return 0 +func (p *TTableStatus) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Engine = &v + + } + return offset, nil } -func (p *TTableRowFormat) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableStatus) FastReadField5(buf []byte) (int, error) { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableRowFormat") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.LastCheckTime = &v + } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset + return offset, nil } -func (p *TTableRowFormat) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTableRowFormat") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() +func (p *TTableStatus) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.CreateTime = &v + } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l + return offset, nil } -func (p *TTableRowFormat) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableStatus) FastReadField7(buf []byte) (int, error) { offset := 0 - if p.IsSetFieldTerminator() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "field_terminator", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.FieldTerminator) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.DdlSql = &v + } - return offset + return offset, nil } -func (p *TTableRowFormat) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableStatus) FastReadField8(buf []byte) (int, error) { offset := 0 - if p.IsSetLineTerminator() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "line_terminator", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.LineTerminator) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.UpdateTime = &v + } - return offset + return offset, nil } -func (p *TTableRowFormat) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableStatus) FastReadField9(buf []byte) (int, error) { offset := 0 - if p.IsSetEscapedBy() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "escaped_by", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.EscapedBy) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.CheckTime = &v + } - return offset + return offset, nil } -func (p *TTableRowFormat) field1Length() int { - l := 0 - if p.IsSetFieldTerminator() { - l += bthrift.Binary.FieldBeginLength("field_terminator", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.FieldTerminator) +func (p *TTableStatus) FastReadField10(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Collation = &v - l += bthrift.Binary.FieldEndLength() } - return l + return offset, nil } -func (p *TTableRowFormat) field2Length() int { - l := 0 - if p.IsSetLineTerminator() { - l += bthrift.Binary.FieldBeginLength("line_terminator", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.LineTerminator) +func (p *TTableStatus) FastReadField11(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Rows = &v - l += bthrift.Binary.FieldEndLength() } - return l + return offset, nil } -func (p *TTableRowFormat) field3Length() int { - l := 0 - if p.IsSetEscapedBy() { - l += bthrift.Binary.FieldBeginLength("escaped_by", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(*p.EscapedBy) +func (p *TTableStatus) FastReadField12(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.AvgRowLength = &v - l += bthrift.Binary.FieldEndLength() } - return l + return offset, nil } -func (p *TPartitionKeyValue) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetName bool = false - var issetValue bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError +func (p *TTableStatus) FastReadField13(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.DataLength = &v + } + return offset, nil +} - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) +func (p *TTableStatus) FastReadField14(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { offset += l - if err != nil { - goto ReadFieldBeginError - } + p.IndexLength = &v + + } + return offset, nil +} + +// for compatibility +func (p *TTableStatus) FastWrite(buf []byte) int { + return 0 +} + +func (p *TTableStatus) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableStatus") + if p != nil { + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) + offset += p.fastWriteField12(buf[offset:], binaryWriter) + offset += p.fastWriteField13(buf[offset:], binaryWriter) + offset += p.fastWriteField14(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *TTableStatus) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TTableStatus") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + l += p.field8Length() + l += p.field9Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + l += p.field13Length() + l += p.field14Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TTableStatus) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Name) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TTableStatus) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Type) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TTableStatus) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "comment", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Comment) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TTableStatus) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetEngine() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "engine", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Engine) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLastCheckTime() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "last_check_time", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LastCheckTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCreateTime() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "create_time", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.CreateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDdlSql() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "ddl_sql", thrift.STRING, 7) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.DdlSql) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetUpdateTime() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "update_time", thrift.I64, 8) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.UpdateTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCheckTime() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "check_time", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.CheckTime) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCollation() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "collation", thrift.STRING, 10) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Collation) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRows() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "rows", thrift.I64, 11) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.Rows) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetAvgRowLength() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "avg_row_length", thrift.I64, 12) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.AvgRowLength) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField13(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDataLength() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "data_length", thrift.I64, 13) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.DataLength) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) fastWriteField14(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetIndexLength() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "index_length", thrift.I64, 14) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.IndexLength) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableStatus) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(p.Name) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TTableStatus) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("type", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Type) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TTableStatus) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("comment", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.Comment) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TTableStatus) field4Length() int { + l := 0 + if p.IsSetEngine() { + l += bthrift.Binary.FieldBeginLength("engine", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.Engine) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field5Length() int { + l := 0 + if p.IsSetLastCheckTime() { + l += bthrift.Binary.FieldBeginLength("last_check_time", thrift.I64, 5) + l += bthrift.Binary.I64Length(*p.LastCheckTime) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field6Length() int { + l := 0 + if p.IsSetCreateTime() { + l += bthrift.Binary.FieldBeginLength("create_time", thrift.I64, 6) + l += bthrift.Binary.I64Length(*p.CreateTime) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field7Length() int { + l := 0 + if p.IsSetDdlSql() { + l += bthrift.Binary.FieldBeginLength("ddl_sql", thrift.STRING, 7) + l += bthrift.Binary.StringLengthNocopy(*p.DdlSql) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field8Length() int { + l := 0 + if p.IsSetUpdateTime() { + l += bthrift.Binary.FieldBeginLength("update_time", thrift.I64, 8) + l += bthrift.Binary.I64Length(*p.UpdateTime) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field9Length() int { + l := 0 + if p.IsSetCheckTime() { + l += bthrift.Binary.FieldBeginLength("check_time", thrift.I64, 9) + l += bthrift.Binary.I64Length(*p.CheckTime) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field10Length() int { + l := 0 + if p.IsSetCollation() { + l += bthrift.Binary.FieldBeginLength("collation", thrift.STRING, 10) + l += bthrift.Binary.StringLengthNocopy(*p.Collation) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field11Length() int { + l := 0 + if p.IsSetRows() { + l += bthrift.Binary.FieldBeginLength("rows", thrift.I64, 11) + l += bthrift.Binary.I64Length(*p.Rows) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field12Length() int { + l := 0 + if p.IsSetAvgRowLength() { + l += bthrift.Binary.FieldBeginLength("avg_row_length", thrift.I64, 12) + l += bthrift.Binary.I64Length(*p.AvgRowLength) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field13Length() int { + l := 0 + if p.IsSetDataLength() { + l += bthrift.Binary.FieldBeginLength("data_length", thrift.I64, 13) + l += bthrift.Binary.I64Length(*p.DataLength) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTableStatus) field14Length() int { + l := 0 + if p.IsSetIndexLength() { + l += bthrift.Binary.FieldBeginLength("index_length", thrift.I64, 14) + l += bthrift.Binary.I64Length(*p.IndexLength) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TListTableStatusResult_) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetTables bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } if fieldTypeId == thrift.STOP { break } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetName = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetValue = true + issetTables = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3102,22 +3997,17 @@ func (p *TPartitionKeyValue) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetName { + if !issetTables { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetValue { - fieldId = 2 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPartitionKeyValue[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TListTableStatusResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -3125,111 +4015,97 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TPartitionKeyValue[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TListTableStatusResult_[fieldId])) } -func (p *TPartitionKeyValue) FastReadField1(buf []byte) (int, error) { +func (p *TListTableStatusResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l - - p.Name = v - } - return offset, nil -} - -func (p *TPartitionKeyValue) FastReadField2(buf []byte) (int, error) { - offset := 0 + p.Tables = make([]*TTableStatus, 0, size) + for i := 0; i < size; i++ { + _elem := NewTTableStatus() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + p.Tables = append(p.Tables, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.Value = v - } return offset, nil } // for compatibility -func (p *TPartitionKeyValue) FastWrite(buf []byte) int { +func (p *TListTableStatusResult_) FastWrite(buf []byte) int { return 0 } -func (p *TPartitionKeyValue) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TListTableStatusResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TPartitionKeyValue") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TListTableStatusResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TPartitionKeyValue) BLength() int { +func (p *TListTableStatusResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TPartitionKeyValue") + l += bthrift.Binary.StructBeginLength("TListTableStatusResult") if p != nil { l += p.field1Length() - l += p.field2Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TPartitionKeyValue) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Name) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TPartitionKeyValue) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TListTableStatusResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "value", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Value) - + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.Tables { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TPartitionKeyValue) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.Name) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TPartitionKeyValue) field2Length() int { +func (p *TListTableStatusResult_) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("value", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.Value) - + l += bthrift.Binary.FieldBeginLength("tables", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Tables)) + for _, v := range p.Tables { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() return l } -func (p *TSessionState) FastRead(buf []byte) (int, error) { +func (p *TTableMetadataNameIds) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetDatabase bool = false - var issetUser bool = false - var issetConnectionId bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -3253,7 +4129,6 @@ func (p *TSessionState) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetDatabase = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3262,28 +4137,12 @@ func (p *TSessionState) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetUser = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: if fieldTypeId == thrift.I64 { - l, err = p.FastReadField3(buf[offset:]) + l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetConnectionId = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3311,173 +4170,126 @@ func (p *TSessionState) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetDatabase { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetUser { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetConnectionId { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSessionState[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableMetadataNameIds[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSessionState[fieldId])) } -func (p *TSessionState) FastReadField1(buf []byte) (int, error) { +func (p *TTableMetadataNameIds) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.Database = v + p.Name = &v } return offset, nil } -func (p *TSessionState) FastReadField2(buf []byte) (int, error) { +func (p *TTableMetadataNameIds) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.User = v + p.Id = &v } return offset, nil } -func (p *TSessionState) FastReadField3(buf []byte) (int, error) { - offset := 0 +// for compatibility +func (p *TTableMetadataNameIds) FastWrite(buf []byte) int { + return 0 +} - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.ConnectionId = v - - } - return offset, nil -} - -// for compatibility -func (p *TSessionState) FastWrite(buf []byte) int { - return 0 -} - -func (p *TSessionState) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableMetadataNameIds) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSessionState") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableMetadataNameIds") if p != nil { - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TSessionState) BLength() int { +func (p *TTableMetadataNameIds) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TSessionState") + l += bthrift.Binary.StructBeginLength("TTableMetadataNameIds") if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field3Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TSessionState) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "database", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Database) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TSessionState) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableMetadataNameIds) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.User) + if p.IsSetName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Name) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TSessionState) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableMetadataNameIds) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "connection_id", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], p.ConnectionId) + if p.IsSetId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.Id) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TSessionState) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("database", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.Database) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TSessionState) field2Length() int { +func (p *TTableMetadataNameIds) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.User) + if p.IsSetName() { + l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.Name) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TSessionState) field3Length() int { +func (p *TTableMetadataNameIds) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("connection_id", thrift.I64, 3) - l += bthrift.Binary.I64Length(p.ConnectionId) + if p.IsSetId() { + l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.Id) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TClientRequest) FastRead(buf []byte) (int, error) { +func (p *TListTableMetadataNameIdsResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetStmt bool = false - var issetQueryOptions bool = false - var issetSessionState bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -3495,43 +4307,12 @@ func (p *TClientRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetStmt = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetQueryOptions = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetSessionState = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3559,165 +4340,113 @@ func (p *TClientRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetStmt { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetQueryOptions { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetSessionState { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TClientRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TListTableMetadataNameIdsResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TClientRequest[fieldId])) } -func (p *TClientRequest) FastReadField1(buf []byte) (int, error) { +func (p *TListTableMetadataNameIdsResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l - - p.Stmt = v - } - return offset, nil -} - -func (p *TClientRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 + p.Tables = make([]*TTableMetadataNameIds, 0, size) + for i := 0; i < size; i++ { + _elem := NewTTableMetadataNameIds() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } - tmp := palointernalservice.NewTQueryOptions() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + p.Tables = append(p.Tables, _elem) } - p.QueryOptions = tmp - return offset, nil -} - -func (p *TClientRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 - - tmp := NewTSessionState() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.SessionState = tmp return offset, nil } // for compatibility -func (p *TClientRequest) FastWrite(buf []byte) int { +func (p *TListTableMetadataNameIdsResult_) FastWrite(buf []byte) int { return 0 } -func (p *TClientRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TListTableMetadataNameIdsResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TClientRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TListTableMetadataNameIdsResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TClientRequest) BLength() int { +func (p *TListTableMetadataNameIdsResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TClientRequest") + l += bthrift.Binary.StructBeginLength("TListTableMetadataNameIdsResult") if p != nil { l += p.field1Length() - l += p.field2Length() - l += p.field3Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TClientRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "stmt", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Stmt) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TClientRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "queryOptions", thrift.STRUCT, 2) - offset += p.QueryOptions.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TClientRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TListTableMetadataNameIdsResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "sessionState", thrift.STRUCT, 3) - offset += p.SessionState.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if p.IsSetTables() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.Tables { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TClientRequest) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("stmt", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.Stmt) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TClientRequest) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("queryOptions", thrift.STRUCT, 2) - l += p.QueryOptions.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TClientRequest) field3Length() int { +func (p *TListTableMetadataNameIdsResult_) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("sessionState", thrift.STRUCT, 3) - l += p.SessionState.BLength() - l += bthrift.Binary.FieldEndLength() + if p.IsSetTables() { + l += bthrift.Binary.FieldBeginLength("tables", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Tables)) + for _, v := range p.Tables { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TExplainParams) FastRead(buf []byte) (int, error) { +func (p *TGetTablesResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetExplain bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -3735,13 +4464,12 @@ func (p *TExplainParams) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetExplain = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3769,49 +4497,59 @@ func (p *TExplainParams) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetExplain { - fieldId = 1 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExplainParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetTablesResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExplainParams[fieldId])) } -func (p *TExplainParams) FastReadField1(buf []byte) (int, error) { +func (p *TGetTablesResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l + } + p.Tables = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v - p.Explain = v + } + p.Tables = append(p.Tables, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } return offset, nil } // for compatibility -func (p *TExplainParams) FastWrite(buf []byte) int { +func (p *TGetTablesResult_) FastWrite(buf []byte) int { return 0 } -func (p *TExplainParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetTablesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TExplainParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetTablesResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) } @@ -3820,9 +4558,9 @@ func (p *TExplainParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.Binary return offset } -func (p *TExplainParams) BLength() int { +func (p *TGetTablesResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TExplainParams") + l += bthrift.Binary.StructBeginLength("TGetTablesResult") if p != nil { l += p.field1Length() } @@ -3831,33 +4569,42 @@ func (p *TExplainParams) BLength() int { return l } -func (p *TExplainParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetTablesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "explain", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Explain) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + var length int + for _, v := range p.Tables { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TExplainParams) field1Length() int { +func (p *TGetTablesResult_) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("explain", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.Explain) + l += bthrift.Binary.FieldBeginLength("tables", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.Tables)) + for _, v := range p.Tables { + l += bthrift.Binary.StringLengthNocopy(v) + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() return l } -func (p *TSetVar) FastRead(buf []byte) (int, error) { +func (p *TPrivilegeStatus) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetType bool = false - var issetVariable bool = false - var issetValue bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -3875,13 +4622,12 @@ func (p *TSetVar) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetType = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3896,7 +4642,6 @@ func (p *TSetVar) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetVariable = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3905,13 +4650,40 @@ func (p *TSetVar) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetValue = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -3939,168 +4711,238 @@ func (p *TSetVar) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetType { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetVariable { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetValue { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSetVar[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPrivilegeStatus[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSetVar[fieldId])) } -func (p *TSetVar) FastReadField1(buf []byte) (int, error) { +func (p *TPrivilegeStatus) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l + p.TableName = &v + + } + return offset, nil +} + +func (p *TPrivilegeStatus) FastReadField2(buf []byte) (int, error) { + offset := 0 - p.Type = TSetType(v) + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.PrivilegeType = &v } return offset, nil } -func (p *TSetVar) FastReadField2(buf []byte) (int, error) { +func (p *TPrivilegeStatus) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l + p.Grantee = &v + + } + return offset, nil +} + +func (p *TPrivilegeStatus) FastReadField4(buf []byte) (int, error) { + offset := 0 - p.Variable = v + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Schema = &v } return offset, nil } -func (p *TSetVar) FastReadField3(buf []byte) (int, error) { +func (p *TPrivilegeStatus) FastReadField5(buf []byte) (int, error) { offset := 0 - tmp := exprs.NewTExpr() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l + p.IsGrantable = &v + } - p.Value = tmp return offset, nil } // for compatibility -func (p *TSetVar) FastWrite(buf []byte) int { +func (p *TPrivilegeStatus) FastWrite(buf []byte) int { return 0 } -func (p *TSetVar) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPrivilegeStatus) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSetVar") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TPrivilegeStatus") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TSetVar) BLength() int { +func (p *TPrivilegeStatus) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TSetVar") + l += bthrift.Binary.StructBeginLength("TPrivilegeStatus") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TSetVar) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPrivilegeStatus) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.Type)) + if p.IsSetTableName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_name", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.TableName) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TSetVar) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPrivilegeStatus) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "variable", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Variable) + if p.IsSetPrivilegeType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "privilege_type", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.PrivilegeType) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TSetVar) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPrivilegeStatus) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "value", thrift.STRUCT, 3) - offset += p.Value.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if p.IsSetGrantee() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "grantee", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Grantee) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TPrivilegeStatus) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSchema() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "schema", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Schema) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TPrivilegeStatus) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetIsGrantable() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_grantable", thrift.STRING, 5) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.IsGrantable) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TSetVar) field1Length() int { +func (p *TPrivilegeStatus) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("type", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(p.Type)) + if p.IsSetTableName() { + l += bthrift.Binary.FieldBeginLength("table_name", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.TableName) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TSetVar) field2Length() int { +func (p *TPrivilegeStatus) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("variable", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.Variable) + if p.IsSetPrivilegeType() { + l += bthrift.Binary.FieldBeginLength("privilege_type", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.PrivilegeType) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TSetVar) field3Length() int { +func (p *TPrivilegeStatus) field3Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("value", thrift.STRUCT, 3) - l += p.Value.BLength() - l += bthrift.Binary.FieldEndLength() + if p.IsSetGrantee() { + l += bthrift.Binary.FieldBeginLength("grantee", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.Grantee) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TPrivilegeStatus) field4Length() int { + l := 0 + if p.IsSetSchema() { + l += bthrift.Binary.FieldBeginLength("schema", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.Schema) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TPrivilegeStatus) field5Length() int { + l := 0 + if p.IsSetIsGrantable() { + l += bthrift.Binary.FieldBeginLength("is_grantable", thrift.STRING, 5) + l += bthrift.Binary.StringLengthNocopy(*p.IsGrantable) + + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TSetParams) FastRead(buf []byte) (int, error) { +func (p *TListPrivilegesResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetSetVars bool = false + var issetPrivileges bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -4124,7 +4966,7 @@ func (p *TSetParams) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetSetVars = true + issetPrivileges = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4152,7 +4994,7 @@ func (p *TSetParams) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetSetVars { + if !issetPrivileges { fieldId = 1 goto RequiredFieldNotSetError } @@ -4162,7 +5004,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSetParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TListPrivilegesResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -4170,10 +5012,10 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSetParams[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TListPrivilegesResult_[fieldId])) } -func (p *TSetParams) FastReadField1(buf []byte) (int, error) { +func (p *TListPrivilegesResult_) FastReadField1(buf []byte) (int, error) { offset := 0 _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) @@ -4181,16 +5023,16 @@ func (p *TSetParams) FastReadField1(buf []byte) (int, error) { if err != nil { return offset, err } - p.SetVars = make([]*TSetVar, 0, size) + p.Privileges = make([]*TPrivilegeStatus, 0, size) for i := 0; i < size; i++ { - _elem := NewTSetVar() + _elem := NewTPrivilegeStatus() if l, err := _elem.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.SetVars = append(p.SetVars, _elem) + p.Privileges = append(p.Privileges, _elem) } if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err @@ -4201,13 +5043,13 @@ func (p *TSetParams) FastReadField1(buf []byte) (int, error) { } // for compatibility -func (p *TSetParams) FastWrite(buf []byte) int { +func (p *TListPrivilegesResult_) FastWrite(buf []byte) int { return 0 } -func (p *TSetParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TListPrivilegesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSetParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TListPrivilegesResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) } @@ -4216,9 +5058,9 @@ func (p *TSetParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWrit return offset } -func (p *TSetParams) BLength() int { +func (p *TListPrivilegesResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TSetParams") + l += bthrift.Binary.StructBeginLength("TListPrivilegesResult") if p != nil { l += p.field1Length() } @@ -4227,13 +5069,13 @@ func (p *TSetParams) BLength() int { return l } -func (p *TSetParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TListPrivilegesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "set_vars", thrift.LIST, 1) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "privileges", thrift.LIST, 1) listBeginOffset := offset offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) var length int - for _, v := range p.SetVars { + for _, v := range p.Privileges { length++ offset += v.FastWriteNocopy(buf[offset:], binaryWriter) } @@ -4243,11 +5085,11 @@ func (p *TSetParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWrit return offset } -func (p *TSetParams) field1Length() int { +func (p *TListPrivilegesResult_) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("set_vars", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.SetVars)) - for _, v := range p.SetVars { + l += bthrift.Binary.FieldBeginLength("privileges", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Privileges)) + for _, v := range p.Privileges { l += v.BLength() } l += bthrift.Binary.ListEndLength() @@ -4255,14 +5097,12 @@ func (p *TSetParams) field1Length() int { return l } -func (p *TKillParams) FastRead(buf []byte) (int, error) { +func (p *TReportExecStatusResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetIsKillConnection bool = false - var issetConnectionId bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -4280,28 +5120,12 @@ func (p *TKillParams) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.BOOL { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetIsKillConnection = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetConnectionId = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4329,209 +5153,87 @@ func (p *TKillParams) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetIsKillConnection { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetConnectionId { - fieldId = 2 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TKillParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TReportExecStatusResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TKillParams[fieldId])) -} - -func (p *TKillParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.IsKillConnection = v - - } - return offset, nil } -func (p *TKillParams) FastReadField2(buf []byte) (int, error) { +func (p *TReportExecStatusResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + tmp := status.NewTStatus() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.ConnectionId = v - } + p.Status = tmp return offset, nil } // for compatibility -func (p *TKillParams) FastWrite(buf []byte) int { +func (p *TReportExecStatusResult_) FastWrite(buf []byte) int { return 0 } -func (p *TKillParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TKillParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TReportExecStatusResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TKillParams) BLength() int { +func (p *TReportExecStatusResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TKillParams") + l += bthrift.Binary.StructBeginLength("TReportExecStatusResult") if p != nil { l += p.field1Length() - l += p.field2Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TKillParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_kill_connection", thrift.BOOL, 1) - offset += bthrift.Binary.WriteBool(buf[offset:], p.IsKillConnection) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TKillParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "connection_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], p.ConnectionId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TKillParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("is_kill_connection", thrift.BOOL, 1) - l += bthrift.Binary.BoolLength(p.IsKillConnection) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TKillParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("connection_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(p.ConnectionId) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TCommonDdlParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -// for compatibility -func (p *TCommonDdlParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TCommonDdlParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TCommonDdlParams") - if p != nil { + if p.IsSetStatus() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) + offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TCommonDdlParams) BLength() int { +func (p *TReportExecStatusResult_) field1Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TCommonDdlParams") - if p != nil { + if p.IsSetStatus() { + l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) + l += p.Status.BLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TUseDbParams) FastRead(buf []byte) (int, error) { +func (p *TDetailedReportParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetDb bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -4549,13 +5251,54 @@ func (p *TUseDbParams) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetDb = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4583,256 +5326,194 @@ func (p *TUseDbParams) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetDb { - fieldId = 1 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TUseDbParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDetailedReportParams[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TUseDbParams[fieldId])) } -func (p *TUseDbParams) FastReadField1(buf []byte) (int, error) { +func (p *TDetailedReportParams) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + tmp := types.NewTUniqueId() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l + } + p.FragmentInstanceId = tmp + return offset, nil +} - p.Db = v +func (p *TDetailedReportParams) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := runtimeprofile.NewTRuntimeProfileTree() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Profile = tmp + return offset, nil +} + +func (p *TDetailedReportParams) FastReadField3(buf []byte) (int, error) { + offset := 0 + + tmp := runtimeprofile.NewTRuntimeProfileTree() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.LoadChannelProfile = tmp + return offset, nil +} + +func (p *TDetailedReportParams) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.IsFragmentLevel = &v } return offset, nil } // for compatibility -func (p *TUseDbParams) FastWrite(buf []byte) int { +func (p *TDetailedReportParams) FastWrite(buf []byte) int { return 0 } -func (p *TUseDbParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDetailedReportParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TUseDbParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDetailedReportParams") if p != nil { + offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TUseDbParams) BLength() int { +func (p *TDetailedReportParams) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TUseDbParams") + l += bthrift.Binary.StructBeginLength("TDetailedReportParams") if p != nil { l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TUseDbParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDetailedReportParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Db) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if p.IsSetFragmentInstanceId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_instance_id", thrift.STRUCT, 1) + offset += p.FragmentInstanceId.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TUseDbParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.Db) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TResultSetMetadata) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetColumnDescs bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetColumnDescs = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError +func (p *TDetailedReportParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetProfile() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "profile", thrift.STRUCT, 2) + offset += p.Profile.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } + return offset +} - if !issetColumnDescs { - fieldId = 1 - goto RequiredFieldNotSetError +func (p *TDetailedReportParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLoadChannelProfile() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "loadChannelProfile", thrift.STRUCT, 3) + offset += p.LoadChannelProfile.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TResultSetMetadata[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TResultSetMetadata[fieldId])) + return offset } -func (p *TResultSetMetadata) FastReadField1(buf []byte) (int, error) { +func (p *TDetailedReportParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetIsFragmentLevel() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_fragment_level", thrift.BOOL, 4) + offset += bthrift.Binary.WriteBool(buf[offset:], *p.IsFragmentLevel) - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ColumnDescs = make([]*TColumnDesc, 0, size) - for i := 0; i < size; i++ { - _elem := NewTColumnDesc() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.ColumnDescs = append(p.ColumnDescs, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return offset, nil -} - -// for compatibility -func (p *TResultSetMetadata) FastWrite(buf []byte) int { - return 0 + return offset } -func (p *TResultSetMetadata) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TResultSetMetadata") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) +func (p *TDetailedReportParams) field1Length() int { + l := 0 + if p.IsSetFragmentInstanceId() { + l += bthrift.Binary.FieldBeginLength("fragment_instance_id", thrift.STRUCT, 1) + l += p.FragmentInstanceId.BLength() + l += bthrift.Binary.FieldEndLength() } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset + return l } -func (p *TResultSetMetadata) BLength() int { +func (p *TDetailedReportParams) field2Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TResultSetMetadata") - if p != nil { - l += p.field1Length() + if p.IsSetProfile() { + l += bthrift.Binary.FieldBeginLength("profile", thrift.STRUCT, 2) + l += p.Profile.BLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TResultSetMetadata) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columnDescs", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.ColumnDescs { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) +func (p *TDetailedReportParams) field3Length() int { + l := 0 + if p.IsSetLoadChannelProfile() { + l += bthrift.Binary.FieldBeginLength("loadChannelProfile", thrift.STRUCT, 3) + l += p.LoadChannelProfile.BLength() + l += bthrift.Binary.FieldEndLength() } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset + return l } -func (p *TResultSetMetadata) field1Length() int { +func (p *TDetailedReportParams) field4Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("columnDescs", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.ColumnDescs)) - for _, v := range p.ColumnDescs { - l += v.BLength() + if p.IsSetIsFragmentLevel() { + l += bthrift.Binary.FieldBeginLength("is_fragment_level", thrift.BOOL, 4) + l += bthrift.Binary.BoolLength(*p.IsFragmentLevel) + + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() return l } -func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { +func (p *TQueryStatistics) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetFragments bool = false - var issetQueryGlobals bool = false - var issetStmtType bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -4850,7 +5531,7 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -4864,13 +5545,12 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetFragments = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4879,7 +5559,7 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -4893,7 +5573,7 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { } } case 4: - if fieldTypeId == thrift.MAP { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { @@ -4907,7 +5587,7 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { } } case 5: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField5(buf[offset:]) offset += l if err != nil { @@ -4920,14 +5600,41 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 7: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField7(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetQueryGlobals = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4936,13 +5643,12 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { } } case 9: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField9(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetStmtType = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4951,7 +5657,7 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { } } case 10: - if fieldTypeId == thrift.BOOL { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField10(buf[offset:]) offset += l if err != nil { @@ -4964,6 +5670,20 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 11: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -4984,466 +5704,459 @@ func (p *TQueryExecRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetFragments { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetQueryGlobals { - fieldId = 7 - goto RequiredFieldNotSetError - } - - if !issetStmtType { - fieldId = 9 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryExecRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryStatistics[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TQueryExecRequest[fieldId])) } -func (p *TQueryExecRequest) FastReadField1(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := descriptors.NewTDescriptorTable() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + p.ScanRows = &v + } - p.DescTbl = tmp return offset, nil } -func (p *TQueryExecRequest) FastReadField2(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField2(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err - } - p.Fragments = make([]*planner.TPlanFragment, 0, size) - for i := 0; i < size; i++ { - _elem := planner.NewTPlanFragment() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } + } else { + offset += l + p.ScanBytes = &v - p.Fragments = append(p.Fragments, _elem) } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, nil +} + +func (p *TQueryStatistics) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + p.ReturnedRows = &v + } return offset, nil } -func (p *TQueryExecRequest) FastReadField3(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField4(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err - } - p.DestFragmentIdx = make([]int32, 0, size) - for i := 0; i < size; i++ { - var _elem int32 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + } else { + offset += l + p.CpuMs = &v - _elem = v + } + return offset, nil +} - } +func (p *TQueryStatistics) FastReadField5(buf []byte) (int, error) { + offset := 0 - p.DestFragmentIdx = append(p.DestFragmentIdx, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + p.MaxPeakMemoryBytes = &v + } return offset, nil } -func (p *TQueryExecRequest) FastReadField4(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField6(buf []byte) (int, error) { offset := 0 - _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err - } - p.PerNodeScanRanges = make(map[types.TPlanNodeId][]*planner.TScanRangeLocations, size) - for i := 0; i < size; i++ { - var _key types.TPlanNodeId - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _key = v - - } - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + } else { offset += l - if err != nil { - return offset, err - } - _val := make([]*planner.TScanRangeLocations, 0, size) - for i := 0; i < size; i++ { - _elem := planner.NewTScanRangeLocations() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - _val = append(_val, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } + p.CurrentUsedMemoryBytes = &v - p.PerNodeScanRanges[_key] = _val } - if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { + return offset, nil +} + +func (p *TQueryStatistics) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + p.WorkloadGroupId = &v + } return offset, nil } -func (p *TQueryExecRequest) FastReadField5(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField8(buf []byte) (int, error) { offset := 0 - tmp := NewTResultSetMetadata() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + p.ShuffleSendBytes = &v + } - p.ResultSetMetadata = tmp return offset, nil } -func (p *TQueryExecRequest) FastReadField7(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField9(buf []byte) (int, error) { offset := 0 - tmp := palointernalservice.NewTQueryGlobals() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + p.ShuffleSendRows = &v + } - p.QueryGlobals = tmp return offset, nil } -func (p *TQueryExecRequest) FastReadField9(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField10(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.StmtType = types.TStmtType(v) + p.ScanBytesFromLocalStorage = &v } return offset, nil } -func (p *TQueryExecRequest) FastReadField10(buf []byte) (int, error) { +func (p *TQueryStatistics) FastReadField11(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.IsBlockQuery = &v + p.ScanBytesFromRemoteStorage = &v } return offset, nil } // for compatibility -func (p *TQueryExecRequest) FastWrite(buf []byte) int { +func (p *TQueryStatistics) FastWrite(buf []byte) int { return 0 } -func (p *TQueryExecRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TQueryExecRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TQueryStatistics") if p != nil { - offset += p.fastWriteField10(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TQueryExecRequest) BLength() int { +func (p *TQueryStatistics) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TQueryExecRequest") + l += bthrift.Binary.StructBeginLength("TQueryStatistics") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() l += p.field4Length() l += p.field5Length() + l += p.field6Length() l += p.field7Length() + l += p.field8Length() l += p.field9Length() l += p.field10Length() + l += p.field11Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TQueryExecRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDescTbl() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "desc_tbl", thrift.STRUCT, 1) - offset += p.DescTbl.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetScanRows() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_rows", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanRows) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TQueryExecRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragments", thrift.LIST, 2) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.Fragments { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetScanBytes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_bytes", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanBytes) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TQueryExecRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDestFragmentIdx() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dest_fragment_idx", thrift.LIST, 3) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I32, 0) - var length int - for _, v := range p.DestFragmentIdx { - length++ - offset += bthrift.Binary.WriteI32(buf[offset:], v) + if p.IsSetReturnedRows() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "returned_rows", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ReturnedRows) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I32, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TQueryExecRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetPerNodeScanRanges() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "per_node_scan_ranges", thrift.MAP, 4) - mapBeginOffset := offset - offset += bthrift.Binary.MapBeginLength(thrift.I32, thrift.LIST, 0) - var length int - for k, v := range p.PerNodeScanRanges { - length++ + if p.IsSetCpuMs() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cpu_ms", thrift.I64, 4) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.CpuMs) - offset += bthrift.Binary.WriteI32(buf[offset:], k) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryStatistics) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetMaxPeakMemoryBytes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "max_peak_memory_bytes", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.MaxPeakMemoryBytes) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range v { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - } - bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.I32, thrift.LIST, length) - offset += bthrift.Binary.WriteMapEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TQueryExecRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetResultSetMetadata() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "result_set_metadata", thrift.STRUCT, 5) - offset += p.ResultSetMetadata.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetCurrentUsedMemoryBytes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_used_memory_bytes", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.CurrentUsedMemoryBytes) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TQueryExecRequest) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_globals", thrift.STRUCT, 7) - offset += p.QueryGlobals.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if p.IsSetWorkloadGroupId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "workload_group_id", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.WorkloadGroupId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryStatistics) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetShuffleSendBytes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "shuffle_send_bytes", thrift.I64, 8) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ShuffleSendBytes) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TQueryExecRequest) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "stmt_type", thrift.I32, 9) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.StmtType)) + if p.IsSetShuffleSendRows() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "shuffle_send_rows", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ShuffleSendRows) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TQueryExecRequest) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatistics) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetScanBytesFromLocalStorage() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_bytes_from_local_storage", thrift.I64, 10) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanBytesFromLocalStorage) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryStatistics) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetIsBlockQuery() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_block_query", thrift.BOOL, 10) - offset += bthrift.Binary.WriteBool(buf[offset:], *p.IsBlockQuery) + if p.IsSetScanBytesFromRemoteStorage() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_bytes_from_remote_storage", thrift.I64, 11) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanBytesFromRemoteStorage) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TQueryExecRequest) field1Length() int { +func (p *TQueryStatistics) field1Length() int { l := 0 - if p.IsSetDescTbl() { - l += bthrift.Binary.FieldBeginLength("desc_tbl", thrift.STRUCT, 1) - l += p.DescTbl.BLength() + if p.IsSetScanRows() { + l += bthrift.Binary.FieldBeginLength("scan_rows", thrift.I64, 1) + l += bthrift.Binary.I64Length(*p.ScanRows) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TQueryExecRequest) field2Length() int { +func (p *TQueryStatistics) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("fragments", thrift.LIST, 2) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Fragments)) - for _, v := range p.Fragments { - l += v.BLength() + if p.IsSetScanBytes() { + l += bthrift.Binary.FieldBeginLength("scan_bytes", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.ScanBytes) + + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() return l } -func (p *TQueryExecRequest) field3Length() int { +func (p *TQueryStatistics) field3Length() int { l := 0 - if p.IsSetDestFragmentIdx() { - l += bthrift.Binary.FieldBeginLength("dest_fragment_idx", thrift.LIST, 3) - l += bthrift.Binary.ListBeginLength(thrift.I32, len(p.DestFragmentIdx)) - var tmpV int32 - l += bthrift.Binary.I32Length(int32(tmpV)) * len(p.DestFragmentIdx) - l += bthrift.Binary.ListEndLength() + if p.IsSetReturnedRows() { + l += bthrift.Binary.FieldBeginLength("returned_rows", thrift.I64, 3) + l += bthrift.Binary.I64Length(*p.ReturnedRows) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TQueryExecRequest) field4Length() int { +func (p *TQueryStatistics) field4Length() int { l := 0 - if p.IsSetPerNodeScanRanges() { - l += bthrift.Binary.FieldBeginLength("per_node_scan_ranges", thrift.MAP, 4) - l += bthrift.Binary.MapBeginLength(thrift.I32, thrift.LIST, len(p.PerNodeScanRanges)) - for k, v := range p.PerNodeScanRanges { + if p.IsSetCpuMs() { + l += bthrift.Binary.FieldBeginLength("cpu_ms", thrift.I64, 4) + l += bthrift.Binary.I64Length(*p.CpuMs) - l += bthrift.Binary.I32Length(k) + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryStatistics) field5Length() int { + l := 0 + if p.IsSetMaxPeakMemoryBytes() { + l += bthrift.Binary.FieldBeginLength("max_peak_memory_bytes", thrift.I64, 5) + l += bthrift.Binary.I64Length(*p.MaxPeakMemoryBytes) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(v)) - for _, v := range v { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - } - l += bthrift.Binary.MapEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TQueryExecRequest) field5Length() int { +func (p *TQueryStatistics) field6Length() int { l := 0 - if p.IsSetResultSetMetadata() { - l += bthrift.Binary.FieldBeginLength("result_set_metadata", thrift.STRUCT, 5) - l += p.ResultSetMetadata.BLength() + if p.IsSetCurrentUsedMemoryBytes() { + l += bthrift.Binary.FieldBeginLength("current_used_memory_bytes", thrift.I64, 6) + l += bthrift.Binary.I64Length(*p.CurrentUsedMemoryBytes) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TQueryExecRequest) field7Length() int { +func (p *TQueryStatistics) field7Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("query_globals", thrift.STRUCT, 7) - l += p.QueryGlobals.BLength() - l += bthrift.Binary.FieldEndLength() + if p.IsSetWorkloadGroupId() { + l += bthrift.Binary.FieldBeginLength("workload_group_id", thrift.I64, 7) + l += bthrift.Binary.I64Length(*p.WorkloadGroupId) + + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TQueryExecRequest) field9Length() int { +func (p *TQueryStatistics) field8Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("stmt_type", thrift.I32, 9) - l += bthrift.Binary.I32Length(int32(p.StmtType)) + if p.IsSetShuffleSendBytes() { + l += bthrift.Binary.FieldBeginLength("shuffle_send_bytes", thrift.I64, 8) + l += bthrift.Binary.I64Length(*p.ShuffleSendBytes) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryStatistics) field9Length() int { + l := 0 + if p.IsSetShuffleSendRows() { + l += bthrift.Binary.FieldBeginLength("shuffle_send_rows", thrift.I64, 9) + l += bthrift.Binary.I64Length(*p.ShuffleSendRows) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryStatistics) field10Length() int { + l := 0 + if p.IsSetScanBytesFromLocalStorage() { + l += bthrift.Binary.FieldBeginLength("scan_bytes_from_local_storage", thrift.I64, 10) + l += bthrift.Binary.I64Length(*p.ScanBytesFromLocalStorage) + + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TQueryExecRequest) field10Length() int { +func (p *TQueryStatistics) field11Length() int { l := 0 - if p.IsSetIsBlockQuery() { - l += bthrift.Binary.FieldBeginLength("is_block_query", thrift.BOOL, 10) - l += bthrift.Binary.BoolLength(*p.IsBlockQuery) + if p.IsSetScanBytesFromRemoteStorage() { + l += bthrift.Binary.FieldBeginLength("scan_bytes_from_remote_storage", thrift.I64, 11) + l += bthrift.Binary.I64Length(*p.ScanBytesFromRemoteStorage) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TDdlExecRequest) FastRead(buf []byte) (int, error) { +func (p *TReportWorkloadRuntimeStatusParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetDdlType bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -5461,13 +6174,12 @@ func (p *TDdlExecRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetDdlType = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -5476,7 +6188,7 @@ func (p *TDdlExecRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.MAP { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -5489,62 +6201,6 @@ func (p *TDdlExecRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 3: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 10: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField10(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 11: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField11(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 12: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField12(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -5565,268 +6221,165 @@ func (p *TDdlExecRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetDdlType { - fieldId = 1 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDdlExecRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TReportWorkloadRuntimeStatusParams[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDdlExecRequest[fieldId])) } -func (p *TDdlExecRequest) FastReadField1(buf []byte) (int, error) { +func (p *TReportWorkloadRuntimeStatusParams) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + p.BackendId = &v - p.DdlType = TDdlType(v) - - } - return offset, nil -} - -func (p *TDdlExecRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 - - tmp := NewTUseDbParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l } - p.UseDbParams = tmp return offset, nil } -func (p *TDdlExecRequest) FastReadField3(buf []byte) (int, error) { +func (p *TReportWorkloadRuntimeStatusParams) FastReadField2(buf []byte) (int, error) { offset := 0 - tmp := NewTDescribeTableParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l } - p.DescribeTableParams = tmp - return offset, nil -} - -func (p *TDdlExecRequest) FastReadField10(buf []byte) (int, error) { - offset := 0 + p.QueryStatisticsMap = make(map[string]*TQueryStatistics, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l - tmp := NewTExplainParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.ExplainParams = tmp - return offset, nil -} + _key = v -func (p *TDdlExecRequest) FastReadField11(buf []byte) (int, error) { - offset := 0 + } + _val := NewTQueryStatistics() + if l, err := _val.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } - tmp := NewTSetParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + p.QueryStatisticsMap[_key] = _val } - p.SetParams = tmp - return offset, nil -} - -func (p *TDdlExecRequest) FastReadField12(buf []byte) (int, error) { - offset := 0 - - tmp := NewTKillParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.KillParams = tmp return offset, nil } // for compatibility -func (p *TDdlExecRequest) FastWrite(buf []byte) int { +func (p *TReportWorkloadRuntimeStatusParams) FastWrite(buf []byte) int { return 0 } -func (p *TDdlExecRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportWorkloadRuntimeStatusParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDdlExecRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TReportWorkloadRuntimeStatusParams") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField10(buf[offset:], binaryWriter) - offset += p.fastWriteField11(buf[offset:], binaryWriter) - offset += p.fastWriteField12(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TDdlExecRequest) BLength() int { +func (p *TReportWorkloadRuntimeStatusParams) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TDdlExecRequest") + l += bthrift.Binary.StructBeginLength("TReportWorkloadRuntimeStatusParams") if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field3Length() - l += p.field10Length() - l += p.field11Length() - l += p.field12Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TDdlExecRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "ddl_type", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.DdlType)) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TDdlExecRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportWorkloadRuntimeStatusParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetUseDbParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "use_db_params", thrift.STRUCT, 2) - offset += p.UseDbParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + if p.IsSetBackendId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "backend_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.BackendId) -func (p *TDdlExecRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetDescribeTableParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "describe_table_params", thrift.STRUCT, 3) - offset += p.DescribeTableParams.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TDdlExecRequest) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportWorkloadRuntimeStatusParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetExplainParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "explain_params", thrift.STRUCT, 10) - offset += p.ExplainParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + if p.IsSetQueryStatisticsMap() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_statistics_map", thrift.MAP, 2) + mapBeginOffset := offset + offset += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.STRUCT, 0) + var length int + for k, v := range p.QueryStatisticsMap { + length++ -func (p *TDdlExecRequest) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetSetParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "set_params", thrift.STRUCT, 11) - offset += p.SetParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, k) -func (p *TDdlExecRequest) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetKillParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "kill_params", thrift.STRUCT, 12) - offset += p.KillParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) + offset += bthrift.Binary.WriteMapEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TDdlExecRequest) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("ddl_type", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(p.DdlType)) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TDdlExecRequest) field2Length() int { +func (p *TReportWorkloadRuntimeStatusParams) field1Length() int { l := 0 - if p.IsSetUseDbParams() { - l += bthrift.Binary.FieldBeginLength("use_db_params", thrift.STRUCT, 2) - l += p.UseDbParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} + if p.IsSetBackendId() { + l += bthrift.Binary.FieldBeginLength("backend_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(*p.BackendId) -func (p *TDdlExecRequest) field3Length() int { - l := 0 - if p.IsSetDescribeTableParams() { - l += bthrift.Binary.FieldBeginLength("describe_table_params", thrift.STRUCT, 3) - l += p.DescribeTableParams.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TDdlExecRequest) field10Length() int { +func (p *TReportWorkloadRuntimeStatusParams) field2Length() int { l := 0 - if p.IsSetExplainParams() { - l += bthrift.Binary.FieldBeginLength("explain_params", thrift.STRUCT, 10) - l += p.ExplainParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} + if p.IsSetQueryStatisticsMap() { + l += bthrift.Binary.FieldBeginLength("query_statistics_map", thrift.MAP, 2) + l += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.STRUCT, len(p.QueryStatisticsMap)) + for k, v := range p.QueryStatisticsMap { -func (p *TDdlExecRequest) field11Length() int { - l := 0 - if p.IsSetSetParams() { - l += bthrift.Binary.FieldBeginLength("set_params", thrift.STRUCT, 11) - l += p.SetParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} + l += bthrift.Binary.StringLengthNocopy(k) -func (p *TDdlExecRequest) field12Length() int { - l := 0 - if p.IsSetKillParams() { - l += bthrift.Binary.FieldBeginLength("kill_params", thrift.STRUCT, 12) - l += p.KillParams.BLength() + l += v.BLength() + } + l += bthrift.Binary.MapEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TExplainResult_) FastRead(buf []byte) (int, error) { +func (p *TQueryProfile) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetResults bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -5844,13 +6397,12 @@ func (p *TExplainResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetResults = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -5858,191 +6410,27 @@ func (p *TExplainResult_) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetResults { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExplainResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExplainResult_[fieldId])) -} - -func (p *TExplainResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Results = make([]*data.TResultRow, 0, size) - for i := 0; i < size; i++ { - _elem := data.NewTResultRow() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.Results = append(p.Results, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TExplainResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TExplainResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TExplainResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TExplainResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TExplainResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TExplainResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "results", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.Results { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TExplainResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("results", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Results)) - for _, v := range p.Results { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TExecRequest) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetStmtType bool = false - var issetRequestId bool = false - var issetQueryOptions bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetStmtType = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } + case 2: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } } case 3: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetRequestId = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -6051,13 +6439,12 @@ func (p *TExecRequest) FastRead(buf []byte) (int, error) { } } case 4: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetQueryOptions = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -6066,7 +6453,7 @@ func (p *TExecRequest) FastRead(buf []byte) (int, error) { } } case 5: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField5(buf[offset:]) offset += l if err != nil { @@ -6079,48 +6466,6 @@ func (p *TExecRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 6: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField7(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 8: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField8(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -6141,336 +6486,369 @@ func (p *TExecRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetStmtType { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetRequestId { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetQueryOptions { - fieldId = 4 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExecRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryProfile[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExecRequest[fieldId])) } -func (p *TExecRequest) FastReadField1(buf []byte) (int, error) { +func (p *TQueryProfile) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + tmp := types.NewTUniqueId() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.StmtType = types.TStmtType(v) - } + p.QueryId = tmp return offset, nil } -func (p *TExecRequest) FastReadField2(buf []byte) (int, error) { +func (p *TQueryProfile) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l - p.SqlStmt = &v - } - return offset, nil -} + p.FragmentIdToProfile = make(map[int32][]*TDetailedReportParams, size) + for i := 0; i < size; i++ { + var _key int32 + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l -func (p *TExecRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 + _key = v - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { + } + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) offset += l - } - p.RequestId = tmp - return offset, nil -} + if err != nil { + return offset, err + } + _val := make([]*TDetailedReportParams, 0, size) + for i := 0; i < size; i++ { + _elem := NewTDetailedReportParams() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } -func (p *TExecRequest) FastReadField4(buf []byte) (int, error) { - offset := 0 + _val = append(_val, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } - tmp := palointernalservice.NewTQueryOptions() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + p.FragmentIdToProfile[_key] = _val + } + if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.QueryOptions = tmp return offset, nil } -func (p *TExecRequest) FastReadField5(buf []byte) (int, error) { +func (p *TQueryProfile) FastReadField3(buf []byte) (int, error) { offset := 0 - tmp := NewTQueryExecRequest() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l } - p.QueryExecRequest = tmp - return offset, nil -} - -func (p *TExecRequest) FastReadField6(buf []byte) (int, error) { - offset := 0 + p.FragmentInstanceIds = make([]*types.TUniqueId, 0, size) + for i := 0; i < size; i++ { + _elem := types.NewTUniqueId() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } - tmp := NewTDdlExecRequest() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + p.FragmentInstanceIds = append(p.FragmentInstanceIds, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.DdlExecRequest = tmp return offset, nil } -func (p *TExecRequest) FastReadField7(buf []byte) (int, error) { +func (p *TQueryProfile) FastReadField4(buf []byte) (int, error) { offset := 0 - tmp := NewTResultSetMetadata() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.InstanceProfiles = make([]*runtimeprofile.TRuntimeProfileTree, 0, size) + for i := 0; i < size; i++ { + _elem := runtimeprofile.NewTRuntimeProfileTree() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.InstanceProfiles = append(p.InstanceProfiles, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.ResultSetMetadata = tmp return offset, nil } -func (p *TExecRequest) FastReadField8(buf []byte) (int, error) { +func (p *TQueryProfile) FastReadField5(buf []byte) (int, error) { offset := 0 - tmp := NewTExplainResult_() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.LoadChannelProfiles = make([]*runtimeprofile.TRuntimeProfileTree, 0, size) + for i := 0; i < size; i++ { + _elem := runtimeprofile.NewTRuntimeProfileTree() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.LoadChannelProfiles = append(p.LoadChannelProfiles, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.ExplainResult_ = tmp return offset, nil } // for compatibility -func (p *TExecRequest) FastWrite(buf []byte) int { +func (p *TQueryProfile) FastWrite(buf []byte) int { return 0 } -func (p *TExecRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryProfile) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TExecRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TQueryProfile") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField8(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TExecRequest) BLength() int { +func (p *TQueryProfile) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TExecRequest") + l += bthrift.Binary.StructBeginLength("TQueryProfile") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() l += p.field4Length() l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - l += p.field8Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TExecRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "stmt_type", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.StmtType)) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TExecRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryProfile) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetSqlStmt() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "sql_stmt", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.SqlStmt) - + if p.IsSetQueryId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_id", thrift.STRUCT, 1) + offset += p.QueryId.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TExecRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryProfile) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "request_id", thrift.STRUCT, 3) - offset += p.RequestId.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} + if p.IsSetFragmentIdToProfile() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_id_to_profile", thrift.MAP, 2) + mapBeginOffset := offset + offset += bthrift.Binary.MapBeginLength(thrift.I32, thrift.LIST, 0) + var length int + for k, v := range p.FragmentIdToProfile { + length++ -func (p *TExecRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_options", thrift.STRUCT, 4) - offset += p.QueryOptions.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} + offset += bthrift.Binary.WriteI32(buf[offset:], k) -func (p *TExecRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetQueryExecRequest() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_exec_request", thrift.STRUCT, 5) - offset += p.QueryExecRequest.FastWriteNocopy(buf[offset:], binaryWriter) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range v { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + } + bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.I32, thrift.LIST, length) + offset += bthrift.Binary.WriteMapEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TExecRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryProfile) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDdlExecRequest() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "ddl_exec_request", thrift.STRUCT, 6) - offset += p.DdlExecRequest.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetFragmentInstanceIds() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_instance_ids", thrift.LIST, 3) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.FragmentInstanceIds { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TExecRequest) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryProfile) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetResultSetMetadata() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "result_set_metadata", thrift.STRUCT, 7) - offset += p.ResultSetMetadata.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetInstanceProfiles() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "instance_profiles", thrift.LIST, 4) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.InstanceProfiles { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TExecRequest) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryProfile) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetExplainResult_() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "explain_result", thrift.STRUCT, 8) - offset += p.ExplainResult_.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetLoadChannelProfiles() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "load_channel_profiles", thrift.LIST, 5) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.LoadChannelProfiles { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TExecRequest) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("stmt_type", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(p.StmtType)) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TExecRequest) field2Length() int { +func (p *TQueryProfile) field1Length() int { l := 0 - if p.IsSetSqlStmt() { - l += bthrift.Binary.FieldBeginLength("sql_stmt", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.SqlStmt) - + if p.IsSetQueryId() { + l += bthrift.Binary.FieldBeginLength("query_id", thrift.STRUCT, 1) + l += p.QueryId.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TExecRequest) field3Length() int { +func (p *TQueryProfile) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("request_id", thrift.STRUCT, 3) - l += p.RequestId.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} + if p.IsSetFragmentIdToProfile() { + l += bthrift.Binary.FieldBeginLength("fragment_id_to_profile", thrift.MAP, 2) + l += bthrift.Binary.MapBeginLength(thrift.I32, thrift.LIST, len(p.FragmentIdToProfile)) + for k, v := range p.FragmentIdToProfile { -func (p *TExecRequest) field4Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("query_options", thrift.STRUCT, 4) - l += p.QueryOptions.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} + l += bthrift.Binary.I32Length(k) -func (p *TExecRequest) field5Length() int { - l := 0 - if p.IsSetQueryExecRequest() { - l += bthrift.Binary.FieldBeginLength("query_exec_request", thrift.STRUCT, 5) - l += p.QueryExecRequest.BLength() + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(v)) + for _, v := range v { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + } + l += bthrift.Binary.MapEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TExecRequest) field6Length() int { +func (p *TQueryProfile) field3Length() int { l := 0 - if p.IsSetDdlExecRequest() { - l += bthrift.Binary.FieldBeginLength("ddl_exec_request", thrift.STRUCT, 6) - l += p.DdlExecRequest.BLength() + if p.IsSetFragmentInstanceIds() { + l += bthrift.Binary.FieldBeginLength("fragment_instance_ids", thrift.LIST, 3) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.FragmentInstanceIds)) + for _, v := range p.FragmentInstanceIds { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TExecRequest) field7Length() int { +func (p *TQueryProfile) field4Length() int { l := 0 - if p.IsSetResultSetMetadata() { - l += bthrift.Binary.FieldBeginLength("result_set_metadata", thrift.STRUCT, 7) - l += p.ResultSetMetadata.BLength() + if p.IsSetInstanceProfiles() { + l += bthrift.Binary.FieldBeginLength("instance_profiles", thrift.LIST, 4) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.InstanceProfiles)) + for _, v := range p.InstanceProfiles { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TExecRequest) field8Length() int { +func (p *TQueryProfile) field5Length() int { l := 0 - if p.IsSetExplainResult_() { - l += bthrift.Binary.FieldBeginLength("explain_result", thrift.STRUCT, 8) - l += p.ExplainResult_.BLength() + if p.IsSetLoadChannelProfiles() { + l += bthrift.Binary.FieldBeginLength("load_channel_profiles", thrift.LIST, 5) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.LoadChannelProfiles)) + for _, v := range p.LoadChannelProfiles { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetDbsParams) FastRead(buf []byte) (int, error) { +func (p *TFragmentInstanceReport) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -6493,7 +6871,7 @@ func (p *TGetDbsParams) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -6507,7 +6885,7 @@ func (p *TGetDbsParams) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -6521,7 +6899,7 @@ func (p *TGetDbsParams) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -6535,7 +6913,7 @@ func (p *TGetDbsParams) FastRead(buf []byte) (int, error) { } } case 4: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { @@ -6548,34 +6926,6 @@ func (p *TGetDbsParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 5: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.BOOL { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -6602,7 +6952,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetDbsParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFragmentInstanceReport[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -6611,257 +6961,184 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TGetDbsParams) FastReadField1(buf []byte) (int, error) { +func (p *TFragmentInstanceReport) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + tmp := types.NewTUniqueId() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Pattern = &v - } + p.FragmentInstanceId = tmp return offset, nil } -func (p *TGetDbsParams) FastReadField2(buf []byte) (int, error) { +func (p *TFragmentInstanceReport) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l - p.User = &v + p.NumFinishedRange = &v } return offset, nil } -func (p *TGetDbsParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.UserIp = &v - - } - return offset, nil -} - -func (p *TGetDbsParams) FastReadField4(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUserIdentity() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.CurrentUserIdent = tmp - return offset, nil -} - -func (p *TGetDbsParams) FastReadField5(buf []byte) (int, error) { +func (p *TFragmentInstanceReport) FastReadField3(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Catalog = &v + p.LoadedRows = &v } return offset, nil } -func (p *TGetDbsParams) FastReadField6(buf []byte) (int, error) { +func (p *TFragmentInstanceReport) FastReadField4(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.GetNullCatalog = &v + p.LoadedBytes = &v } return offset, nil } // for compatibility -func (p *TGetDbsParams) FastWrite(buf []byte) int { +func (p *TFragmentInstanceReport) FastWrite(buf []byte) int { return 0 } -func (p *TGetDbsParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFragmentInstanceReport) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetDbsParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFragmentInstanceReport") if p != nil { - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TGetDbsParams) BLength() int { +func (p *TFragmentInstanceReport) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TGetDbsParams") + l += bthrift.Binary.StructBeginLength("TFragmentInstanceReport") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() l += p.field4Length() - l += p.field5Length() - l += p.field6Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TGetDbsParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetPattern() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pattern", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Pattern) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetDbsParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFragmentInstanceReport) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetUser() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.User) - + if p.IsSetFragmentInstanceId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_instance_id", thrift.STRUCT, 1) + offset += p.FragmentInstanceId.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetDbsParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFragmentInstanceReport) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetUserIp() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.UserIp) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + if p.IsSetNumFinishedRange() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "num_finished_range", thrift.I32, 2) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.NumFinishedRange) -func (p *TGetDbsParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCurrentUserIdent() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 4) - offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetDbsParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFragmentInstanceReport) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCatalog() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 5) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) + if p.IsSetLoadedRows() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "loaded_rows", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LoadedRows) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetDbsParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFragmentInstanceReport) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetGetNullCatalog() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "get_null_catalog", thrift.BOOL, 6) - offset += bthrift.Binary.WriteBool(buf[offset:], *p.GetNullCatalog) + if p.IsSetLoadedBytes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "loaded_bytes", thrift.I64, 4) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LoadedBytes) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetDbsParams) field1Length() int { - l := 0 - if p.IsSetPattern() { - l += bthrift.Binary.FieldBeginLength("pattern", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.Pattern) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetDbsParams) field2Length() int { +func (p *TFragmentInstanceReport) field1Length() int { l := 0 - if p.IsSetUser() { - l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.User) - + if p.IsSetFragmentInstanceId() { + l += bthrift.Binary.FieldBeginLength("fragment_instance_id", thrift.STRUCT, 1) + l += p.FragmentInstanceId.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetDbsParams) field3Length() int { +func (p *TFragmentInstanceReport) field2Length() int { l := 0 - if p.IsSetUserIp() { - l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(*p.UserIp) - - l += bthrift.Binary.FieldEndLength() - } - return l -} + if p.IsSetNumFinishedRange() { + l += bthrift.Binary.FieldBeginLength("num_finished_range", thrift.I32, 2) + l += bthrift.Binary.I32Length(*p.NumFinishedRange) -func (p *TGetDbsParams) field4Length() int { - l := 0 - if p.IsSetCurrentUserIdent() { - l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 4) - l += p.CurrentUserIdent.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetDbsParams) field5Length() int { +func (p *TFragmentInstanceReport) field3Length() int { l := 0 - if p.IsSetCatalog() { - l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 5) - l += bthrift.Binary.StringLengthNocopy(*p.Catalog) + if p.IsSetLoadedRows() { + l += bthrift.Binary.FieldBeginLength("loaded_rows", thrift.I64, 3) + l += bthrift.Binary.I64Length(*p.LoadedRows) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetDbsParams) field6Length() int { +func (p *TFragmentInstanceReport) field4Length() int { l := 0 - if p.IsSetGetNullCatalog() { - l += bthrift.Binary.FieldBeginLength("get_null_catalog", thrift.BOOL, 6) - l += bthrift.Binary.BoolLength(*p.GetNullCatalog) + if p.IsSetLoadedBytes() { + l += bthrift.Binary.FieldBeginLength("loaded_bytes", thrift.I64, 4) + l += bthrift.Binary.I64Length(*p.LoadedBytes) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetDbsResult_) FastRead(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 + var issetProtocolVersion bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -6879,12 +7156,13 @@ func (p *TGetDbsResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetProtocolVersion = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -6893,7 +7171,7 @@ func (p *TGetDbsResult_) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -6907,7 +7185,7 @@ func (p *TGetDbsResult_) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -6921,7 +7199,7 @@ func (p *TGetDbsResult_) FastRead(buf []byte) (int, error) { } } case 4: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { @@ -6934,351 +7212,23 @@ func (p *TGetDbsResult_) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError + case 5: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetDbsResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TGetDbsResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Dbs = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.Dbs = append(p.Dbs, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TGetDbsResult_) FastReadField2(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Catalogs = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.Catalogs = append(p.Catalogs, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TGetDbsResult_) FastReadField3(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.DbIds = make([]int64, 0, size) - for i := 0; i < size; i++ { - var _elem int64 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.DbIds = append(p.DbIds, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TGetDbsResult_) FastReadField4(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.CatalogIds = make([]int64, 0, size) - for i := 0; i < size; i++ { - var _elem int64 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.CatalogIds = append(p.CatalogIds, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TGetDbsResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TGetDbsResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetDbsResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TGetDbsResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TGetDbsResult") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TGetDbsResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetDbs() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dbs", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) - var length int - for _, v := range p.Dbs { - length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetDbsResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCatalogs() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalogs", thrift.LIST, 2) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) - var length int - for _, v := range p.Catalogs { - length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetDbsResult_) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetDbIds() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db_ids", thrift.LIST, 3) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) - var length int - for _, v := range p.DbIds { - length++ - offset += bthrift.Binary.WriteI64(buf[offset:], v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetDbsResult_) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCatalogIds() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog_ids", thrift.LIST, 4) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) - var length int - for _, v := range p.CatalogIds { - length++ - offset += bthrift.Binary.WriteI64(buf[offset:], v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetDbsResult_) field1Length() int { - l := 0 - if p.IsSetDbs() { - l += bthrift.Binary.FieldBeginLength("dbs", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.Dbs)) - for _, v := range p.Dbs { - l += bthrift.Binary.StringLengthNocopy(v) - - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetDbsResult_) field2Length() int { - l := 0 - if p.IsSetCatalogs() { - l += bthrift.Binary.FieldBeginLength("catalogs", thrift.LIST, 2) - l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.Catalogs)) - for _, v := range p.Catalogs { - l += bthrift.Binary.StringLengthNocopy(v) - - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetDbsResult_) field3Length() int { - l := 0 - if p.IsSetDbIds() { - l += bthrift.Binary.FieldBeginLength("db_ids", thrift.LIST, 3) - l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.DbIds)) - var tmpV int64 - l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.DbIds) - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetDbsResult_) field4Length() int { - l := 0 - if p.IsSetCatalogIds() { - l += bthrift.Binary.FieldBeginLength("catalog_ids", thrift.LIST, 4) - l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.CatalogIds)) - var tmpV int64 - l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.CatalogIds) - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) + case 6: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField6(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7290,9 +7240,9 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) + case 7: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField7(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7304,9 +7254,9 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) + case 9: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField9(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7318,9 +7268,9 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 4: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField4(buf[offset:]) + case 10: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField10(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7332,9 +7282,9 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) + case 11: + if fieldTypeId == thrift.MAP { + l, err = p.FastReadField11(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7346,9 +7296,9 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 6: + case 12: if fieldTypeId == thrift.STRING { - l, err = p.FastReadField6(buf[offset:]) + l, err = p.FastReadField12(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7360,9 +7310,9 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 7: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField7(buf[offset:]) + case 13: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField13(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7374,356 +7324,27 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError + case 14: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField14(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetTablesParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TGetTablesParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Db = &v - - } - return offset, nil -} - -func (p *TGetTablesParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Pattern = &v - - } - return offset, nil -} - -func (p *TGetTablesParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.User = &v - - } - return offset, nil -} - -func (p *TGetTablesParams) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.UserIp = &v - - } - return offset, nil -} - -func (p *TGetTablesParams) FastReadField5(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUserIdentity() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.CurrentUserIdent = tmp - return offset, nil -} - -func (p *TGetTablesParams) FastReadField6(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Type = &v - - } - return offset, nil -} - -func (p *TGetTablesParams) FastReadField7(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Catalog = &v - - } - return offset, nil -} - -// for compatibility -func (p *TGetTablesParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TGetTablesParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetTablesParams") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TGetTablesParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TGetTablesParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TGetTablesParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetDb() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Db) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetTablesParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetPattern() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "pattern", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Pattern) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetTablesParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetUser() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.User) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetTablesParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetUserIp() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 4) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.UserIp) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetTablesParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCurrentUserIdent() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 5) - offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetTablesParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetType() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.STRING, 6) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Type) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetTablesParams) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCatalog() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 7) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TGetTablesParams) field1Length() int { - l := 0 - if p.IsSetDb() { - l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.Db) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesParams) field2Length() int { - l := 0 - if p.IsSetPattern() { - l += bthrift.Binary.FieldBeginLength("pattern", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.Pattern) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesParams) field3Length() int { - l := 0 - if p.IsSetUser() { - l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(*p.User) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesParams) field4Length() int { - l := 0 - if p.IsSetUserIp() { - l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 4) - l += bthrift.Binary.StringLengthNocopy(*p.UserIp) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesParams) field5Length() int { - l := 0 - if p.IsSetCurrentUserIdent() { - l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 5) - l += p.CurrentUserIdent.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesParams) field6Length() int { - l := 0 - if p.IsSetType() { - l += bthrift.Binary.FieldBeginLength("type", thrift.STRING, 6) - l += bthrift.Binary.StringLengthNocopy(*p.Type) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesParams) field7Length() int { - l := 0 - if p.IsSetCatalog() { - l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 7) - l += bthrift.Binary.StringLengthNocopy(*p.Catalog) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetName bool = false - var issetType bool = false - var issetComment bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) + case 15: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField15(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetName = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -7731,14 +7352,13 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) + case 16: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField16(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetType = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -7746,14 +7366,13 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) + case 17: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField17(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetComment = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -7761,9 +7380,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 4: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField4(buf[offset:]) + case 18: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField18(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7775,9 +7394,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 5: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField5(buf[offset:]) + case 19: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField19(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7789,9 +7408,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 6: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField6(buf[offset:]) + case 20: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField20(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7803,9 +7422,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 7: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField7(buf[offset:]) + case 21: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField21(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7817,9 +7436,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 8: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField8(buf[offset:]) + case 22: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField22(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7831,9 +7450,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 9: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField9(buf[offset:]) + case 23: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField23(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7845,9 +7464,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 10: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField10(buf[offset:]) + case 24: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField24(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7859,9 +7478,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 11: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField11(buf[offset:]) + case 25: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField25(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7873,9 +7492,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 12: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField12(buf[offset:]) + case 26: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField26(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7887,9 +7506,9 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 13: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField13(buf[offset:]) + case 27: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField27(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -7901,15 +7520,71 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError + case 28: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField28(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + case 29: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField29(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 30: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField30(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 31: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField31(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) offset += l if err != nil { goto ReadFieldEndError @@ -7921,27 +7596,17 @@ func (p *TTableStatus) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetName { + if !issetProtocolVersion { fieldId = 1 goto RequiredFieldNotSetError } - - if !issetType { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetComment { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableStatus[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TReportExecStatusParams[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -7949,4660 +7614,485 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTableStatus[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TReportExecStatusParams[fieldId])) } -func (p *TTableStatus) FastReadField1(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Name = v + p.ProtocolVersion = FrontendServiceVersion(v) } return offset, nil } -func (p *TTableStatus) FastReadField2(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + tmp := types.NewTUniqueId() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l + } + p.QueryId = tmp + return offset, nil +} - p.Type = v +func (p *TReportExecStatusParams) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.BackendNum = &v } return offset, nil } -func (p *TTableStatus) FastReadField3(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField4(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + tmp := types.NewTUniqueId() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l + } + p.FragmentInstanceId = tmp + return offset, nil +} - p.Comment = v +func (p *TReportExecStatusParams) FastReadField5(buf []byte) (int, error) { + offset := 0 + tmp := status.NewTStatus() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } + p.Status = tmp return offset, nil } -func (p *TTableStatus) FastReadField4(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField6(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Engine = &v + p.Done = &v } return offset, nil } -func (p *TTableStatus) FastReadField5(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField7(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + tmp := runtimeprofile.NewTRuntimeProfileTree() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - p.LastCheckTime = &v - } + p.Profile = tmp return offset, nil } -func (p *TTableStatus) FastReadField6(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField9(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.ErrorLog = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.ErrorLog = append(p.ErrorLog, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.CreateTime = &v - } return offset, nil } -func (p *TTableStatus) FastReadField7(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField10(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.DeltaUrls = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.DeltaUrls = append(p.DeltaUrls, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.DdlSql = &v - } return offset, nil } -func (p *TTableStatus) FastReadField8(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField11(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.LoadCounters = make(map[string]string, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _key = v + + } + + var _val string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _val = v + + } + + p.LoadCounters[_key] = _val + } + if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.UpdateTime = &v - } return offset, nil } -func (p *TTableStatus) FastReadField9(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField12(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.CheckTime = &v + p.TrackingUrl = &v } return offset, nil } -func (p *TTableStatus) FastReadField10(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField13(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.ExportFiles = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.ExportFiles = append(p.ExportFiles, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Collation = &v + } + return offset, nil +} + +func (p *TReportExecStatusParams) FastReadField14(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.CommitInfos = make([]*types.TTabletCommitInfo, 0, size) + for i := 0; i < size; i++ { + _elem := types.NewTTabletCommitInfo() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.CommitInfos = append(p.CommitInfos, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } return offset, nil } -func (p *TTableStatus) FastReadField11(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField15(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Rows = &v + p.LoadedRows = &v } return offset, nil } -func (p *TTableStatus) FastReadField12(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField16(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.AvgRowLength = &v + p.BackendId = &v } return offset, nil } -func (p *TTableStatus) FastReadField13(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField17(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.DataLength = &v + p.LoadedBytes = &v } return offset, nil } -// for compatibility -func (p *TTableStatus) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTableStatus) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField18(buf []byte) (int, error) { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableStatus") - if p != nil { - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField8(buf[offset:], binaryWriter) - offset += p.fastWriteField9(buf[offset:], binaryWriter) - offset += p.fastWriteField11(buf[offset:], binaryWriter) - offset += p.fastWriteField12(buf[offset:], binaryWriter) - offset += p.fastWriteField13(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField10(buf[offset:], binaryWriter) + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} + p.ErrorTabletInfos = make([]*types.TErrorTabletInfo, 0, size) + for i := 0; i < size; i++ { + _elem := types.NewTErrorTabletInfo() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } -func (p *TTableStatus) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTableStatus") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - l += p.field8Length() - l += p.field9Length() - l += p.field10Length() - l += p.field11Length() - l += p.field12Length() - l += p.field13Length() + p.ErrorTabletInfos = append(p.ErrorTabletInfos, _elem) } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil } -func (p *TTableStatus) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField19(buf []byte) (int, error) { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Name) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} -func (p *TTableStatus) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Type) + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.FragmentId = &v - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset + } + return offset, nil } -func (p *TTableStatus) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField20(buf []byte) (int, error) { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "comment", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Comment) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l -func (p *TTableStatus) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetEngine() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "engine", thrift.STRING, 4) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Engine) + tmp := palointernalservice.TQueryType(v) + p.QueryType = &tmp - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return offset + return offset, nil } -func (p *TTableStatus) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField21(buf []byte) (int, error) { offset := 0 - if p.IsSetLastCheckTime() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "last_check_time", thrift.I64, 5) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.LastCheckTime) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + tmp := runtimeprofile.NewTRuntimeProfileTree() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } - return offset + p.LoadChannelProfile = tmp + return offset, nil } -func (p *TTableStatus) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField22(buf []byte) (int, error) { offset := 0 - if p.IsSetCreateTime() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "create_time", thrift.I64, 6) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.CreateTime) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.FinishedScanRanges = &v + } - return offset + return offset, nil } -func (p *TTableStatus) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField23(buf []byte) (int, error) { offset := 0 - if p.IsSetDdlSql() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "ddl_sql", thrift.STRING, 7) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.DdlSql) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err } - return offset + p.DetailedReport = make([]*TDetailedReportParams, 0, size) + for i := 0; i < size; i++ { + _elem := NewTDetailedReportParams() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.DetailedReport = append(p.DetailedReport, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil } -func (p *TTableStatus) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField24(buf []byte) (int, error) { offset := 0 - if p.IsSetUpdateTime() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "update_time", thrift.I64, 8) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.UpdateTime) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + tmp := NewTQueryStatistics() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } - return offset + p.QueryStatistics = tmp + return offset, nil } -func (p *TTableStatus) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField25(buf []byte) (int, error) { offset := 0 - if p.IsSetCheckTime() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "check_time", thrift.I64, 9) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.CheckTime) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + tmp := NewTReportWorkloadRuntimeStatusParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } - return offset + p.ReportWorkloadRuntimeStatus = tmp + return offset, nil } -func (p *TTableStatus) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField26(buf []byte) (int, error) { offset := 0 - if p.IsSetCollation() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "collation", thrift.STRING, 10) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Collation) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err } - return offset + p.HivePartitionUpdates = make([]*datasinks.THivePartitionUpdate, 0, size) + for i := 0; i < size; i++ { + _elem := datasinks.NewTHivePartitionUpdate() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.HivePartitionUpdates = append(p.HivePartitionUpdates, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil } -func (p *TTableStatus) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TReportExecStatusParams) FastReadField27(buf []byte) (int, error) { offset := 0 - if p.IsSetRows() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "rows", thrift.I64, 11) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.Rows) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + tmp := NewTQueryProfile() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } - return offset + p.QueryProfile = tmp + return offset, nil } -func (p *TTableStatus) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetAvgRowLength() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "avg_row_length", thrift.I64, 12) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.AvgRowLength) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TTableStatus) fastWriteField13(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetDataLength() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "data_length", thrift.I64, 13) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.DataLength) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TTableStatus) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.Name) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTableStatus) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("type", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.Type) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTableStatus) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("comment", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(p.Comment) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTableStatus) field4Length() int { - l := 0 - if p.IsSetEngine() { - l += bthrift.Binary.FieldBeginLength("engine", thrift.STRING, 4) - l += bthrift.Binary.StringLengthNocopy(*p.Engine) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field5Length() int { - l := 0 - if p.IsSetLastCheckTime() { - l += bthrift.Binary.FieldBeginLength("last_check_time", thrift.I64, 5) - l += bthrift.Binary.I64Length(*p.LastCheckTime) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field6Length() int { - l := 0 - if p.IsSetCreateTime() { - l += bthrift.Binary.FieldBeginLength("create_time", thrift.I64, 6) - l += bthrift.Binary.I64Length(*p.CreateTime) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field7Length() int { - l := 0 - if p.IsSetDdlSql() { - l += bthrift.Binary.FieldBeginLength("ddl_sql", thrift.STRING, 7) - l += bthrift.Binary.StringLengthNocopy(*p.DdlSql) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field8Length() int { - l := 0 - if p.IsSetUpdateTime() { - l += bthrift.Binary.FieldBeginLength("update_time", thrift.I64, 8) - l += bthrift.Binary.I64Length(*p.UpdateTime) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field9Length() int { - l := 0 - if p.IsSetCheckTime() { - l += bthrift.Binary.FieldBeginLength("check_time", thrift.I64, 9) - l += bthrift.Binary.I64Length(*p.CheckTime) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field10Length() int { - l := 0 - if p.IsSetCollation() { - l += bthrift.Binary.FieldBeginLength("collation", thrift.STRING, 10) - l += bthrift.Binary.StringLengthNocopy(*p.Collation) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field11Length() int { - l := 0 - if p.IsSetRows() { - l += bthrift.Binary.FieldBeginLength("rows", thrift.I64, 11) - l += bthrift.Binary.I64Length(*p.Rows) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field12Length() int { - l := 0 - if p.IsSetAvgRowLength() { - l += bthrift.Binary.FieldBeginLength("avg_row_length", thrift.I64, 12) - l += bthrift.Binary.I64Length(*p.AvgRowLength) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableStatus) field13Length() int { - l := 0 - if p.IsSetDataLength() { - l += bthrift.Binary.FieldBeginLength("data_length", thrift.I64, 13) - l += bthrift.Binary.I64Length(*p.DataLength) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TListTableStatusResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetTables bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetTables = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetTables { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TListTableStatusResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TListTableStatusResult_[fieldId])) -} - -func (p *TListTableStatusResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Tables = make([]*TTableStatus, 0, size) - for i := 0; i < size; i++ { - _elem := NewTTableStatus() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.Tables = append(p.Tables, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TListTableStatusResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TListTableStatusResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TListTableStatusResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TListTableStatusResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TListTableStatusResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TListTableStatusResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.Tables { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TListTableStatusResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("tables", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Tables)) - for _, v := range p.Tables { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTableMetadataNameIds) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableMetadataNameIds[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TTableMetadataNameIds) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Name = &v - - } - return offset, nil -} - -func (p *TTableMetadataNameIds) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Id = &v - - } - return offset, nil -} - -// for compatibility -func (p *TTableMetadataNameIds) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTableMetadataNameIds) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableMetadataNameIds") - if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTableMetadataNameIds) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTableMetadataNameIds") - if p != nil { - l += p.field1Length() - l += p.field2Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTableMetadataNameIds) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetName() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "name", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Name) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TTableMetadataNameIds) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.Id) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TTableMetadataNameIds) field1Length() int { - l := 0 - if p.IsSetName() { - l += bthrift.Binary.FieldBeginLength("name", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.Name) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TTableMetadataNameIds) field2Length() int { - l := 0 - if p.IsSetId() { - l += bthrift.Binary.FieldBeginLength("id", thrift.I64, 2) - l += bthrift.Binary.I64Length(*p.Id) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TListTableMetadataNameIdsResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TListTableMetadataNameIdsResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TListTableMetadataNameIdsResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Tables = make([]*TTableMetadataNameIds, 0, size) - for i := 0; i < size; i++ { - _elem := NewTTableMetadataNameIds() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.Tables = append(p.Tables, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TListTableMetadataNameIdsResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TListTableMetadataNameIdsResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TListTableMetadataNameIdsResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TListTableMetadataNameIdsResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TListTableMetadataNameIdsResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TListTableMetadataNameIdsResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetTables() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.Tables { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TListTableMetadataNameIdsResult_) field1Length() int { - l := 0 - if p.IsSetTables() { - l += bthrift.Binary.FieldBeginLength("tables", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Tables)) - for _, v := range p.Tables { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TGetTablesResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetTablesResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TGetTablesResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Tables = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.Tables = append(p.Tables, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TGetTablesResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TGetTablesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetTablesResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TGetTablesResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TGetTablesResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TGetTablesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tables", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) - var length int - for _, v := range p.Tables { - length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TGetTablesResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("tables", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.Tables)) - for _, v := range p.Tables { - l += bthrift.Binary.StringLengthNocopy(v) - - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TPrivilegeStatus) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPrivilegeStatus[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TPrivilegeStatus) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.TableName = &v - - } - return offset, nil -} - -func (p *TPrivilegeStatus) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.PrivilegeType = &v - - } - return offset, nil -} - -func (p *TPrivilegeStatus) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Grantee = &v - - } - return offset, nil -} - -func (p *TPrivilegeStatus) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Schema = &v - - } - return offset, nil -} - -func (p *TPrivilegeStatus) FastReadField5(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.IsGrantable = &v - - } - return offset, nil -} - -// for compatibility -func (p *TPrivilegeStatus) FastWrite(buf []byte) int { - return 0 -} - -func (p *TPrivilegeStatus) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TPrivilegeStatus") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TPrivilegeStatus) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TPrivilegeStatus") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TPrivilegeStatus) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetTableName() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_name", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.TableName) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TPrivilegeStatus) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetPrivilegeType() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "privilege_type", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.PrivilegeType) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TPrivilegeStatus) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetGrantee() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "grantee", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Grantee) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TPrivilegeStatus) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetSchema() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "schema", thrift.STRING, 4) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Schema) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TPrivilegeStatus) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetIsGrantable() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_grantable", thrift.STRING, 5) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.IsGrantable) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TPrivilegeStatus) field1Length() int { - l := 0 - if p.IsSetTableName() { - l += bthrift.Binary.FieldBeginLength("table_name", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.TableName) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TPrivilegeStatus) field2Length() int { - l := 0 - if p.IsSetPrivilegeType() { - l += bthrift.Binary.FieldBeginLength("privilege_type", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.PrivilegeType) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TPrivilegeStatus) field3Length() int { - l := 0 - if p.IsSetGrantee() { - l += bthrift.Binary.FieldBeginLength("grantee", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(*p.Grantee) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TPrivilegeStatus) field4Length() int { - l := 0 - if p.IsSetSchema() { - l += bthrift.Binary.FieldBeginLength("schema", thrift.STRING, 4) - l += bthrift.Binary.StringLengthNocopy(*p.Schema) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TPrivilegeStatus) field5Length() int { - l := 0 - if p.IsSetIsGrantable() { - l += bthrift.Binary.FieldBeginLength("is_grantable", thrift.STRING, 5) - l += bthrift.Binary.StringLengthNocopy(*p.IsGrantable) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TListPrivilegesResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetPrivileges bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetPrivileges = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetPrivileges { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TListPrivilegesResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TListPrivilegesResult_[fieldId])) -} - -func (p *TListPrivilegesResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Privileges = make([]*TPrivilegeStatus, 0, size) - for i := 0; i < size; i++ { - _elem := NewTPrivilegeStatus() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.Privileges = append(p.Privileges, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TListPrivilegesResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TListPrivilegesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TListPrivilegesResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TListPrivilegesResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TListPrivilegesResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TListPrivilegesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "privileges", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.Privileges { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TListPrivilegesResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("privileges", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Privileges)) - for _, v := range p.Privileges { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TReportExecStatusResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TReportExecStatusResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TReportExecStatusResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Status = tmp - return offset, nil -} - -// for compatibility -func (p *TReportExecStatusResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TReportExecStatusResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TReportExecStatusResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TReportExecStatusResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TReportExecStatusResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TReportExecStatusResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetStatus() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TReportExecStatusResult_) field1Length() int { - l := 0 - if p.IsSetStatus() { - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TDetailedReportParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.BOOL { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDetailedReportParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TDetailedReportParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.FragmentInstanceId = tmp - return offset, nil -} - -func (p *TDetailedReportParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - tmp := runtimeprofile.NewTRuntimeProfileTree() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Profile = tmp - return offset, nil -} - -func (p *TDetailedReportParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - tmp := runtimeprofile.NewTRuntimeProfileTree() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.LoadChannelProfile = tmp - return offset, nil -} - -func (p *TDetailedReportParams) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.IsFragmentLevel = &v - - } - return offset, nil -} - -// for compatibility -func (p *TDetailedReportParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TDetailedReportParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDetailedReportParams") - if p != nil { - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TDetailedReportParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TDetailedReportParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TDetailedReportParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetFragmentInstanceId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_instance_id", thrift.STRUCT, 1) - offset += p.FragmentInstanceId.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TDetailedReportParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetProfile() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "profile", thrift.STRUCT, 2) - offset += p.Profile.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TDetailedReportParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetLoadChannelProfile() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "loadChannelProfile", thrift.STRUCT, 3) - offset += p.LoadChannelProfile.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TDetailedReportParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetIsFragmentLevel() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "is_fragment_level", thrift.BOOL, 4) - offset += bthrift.Binary.WriteBool(buf[offset:], *p.IsFragmentLevel) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TDetailedReportParams) field1Length() int { - l := 0 - if p.IsSetFragmentInstanceId() { - l += bthrift.Binary.FieldBeginLength("fragment_instance_id", thrift.STRUCT, 1) - l += p.FragmentInstanceId.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TDetailedReportParams) field2Length() int { - l := 0 - if p.IsSetProfile() { - l += bthrift.Binary.FieldBeginLength("profile", thrift.STRUCT, 2) - l += p.Profile.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TDetailedReportParams) field3Length() int { - l := 0 - if p.IsSetLoadChannelProfile() { - l += bthrift.Binary.FieldBeginLength("loadChannelProfile", thrift.STRUCT, 3) - l += p.LoadChannelProfile.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TDetailedReportParams) field4Length() int { - l := 0 - if p.IsSetIsFragmentLevel() { - l += bthrift.Binary.FieldBeginLength("is_fragment_level", thrift.BOOL, 4) - l += bthrift.Binary.BoolLength(*p.IsFragmentLevel) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField7(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 8: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField8(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 9: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField9(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 10: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField10(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 11: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField11(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryStatistics[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TQueryStatistics) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ScanRows = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ScanBytes = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ReturnedRows = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.CpuMs = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField5(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.MaxPeakMemoryBytes = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField6(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.CurrentUsedMemoryBytes = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField7(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.WorkloadGroupId = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField8(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ShuffleSendBytes = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField9(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ShuffleSendRows = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField10(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ScanBytesFromLocalStorage = &v - - } - return offset, nil -} - -func (p *TQueryStatistics) FastReadField11(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ScanBytesFromRemoteStorage = &v - - } - return offset, nil -} - -// for compatibility -func (p *TQueryStatistics) FastWrite(buf []byte) int { - return 0 -} - -func (p *TQueryStatistics) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TQueryStatistics") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField8(buf[offset:], binaryWriter) - offset += p.fastWriteField9(buf[offset:], binaryWriter) - offset += p.fastWriteField10(buf[offset:], binaryWriter) - offset += p.fastWriteField11(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TQueryStatistics) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TQueryStatistics") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - l += p.field8Length() - l += p.field9Length() - l += p.field10Length() - l += p.field11Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TQueryStatistics) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetScanRows() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_rows", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanRows) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetScanBytes() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_bytes", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanBytes) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetReturnedRows() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "returned_rows", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ReturnedRows) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCpuMs() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cpu_ms", thrift.I64, 4) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.CpuMs) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetMaxPeakMemoryBytes() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "max_peak_memory_bytes", thrift.I64, 5) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.MaxPeakMemoryBytes) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCurrentUsedMemoryBytes() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_used_memory_bytes", thrift.I64, 6) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.CurrentUsedMemoryBytes) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetWorkloadGroupId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "workload_group_id", thrift.I64, 7) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.WorkloadGroupId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetShuffleSendBytes() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "shuffle_send_bytes", thrift.I64, 8) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ShuffleSendBytes) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetShuffleSendRows() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "shuffle_send_rows", thrift.I64, 9) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ShuffleSendRows) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetScanBytesFromLocalStorage() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_bytes_from_local_storage", thrift.I64, 10) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanBytesFromLocalStorage) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetScanBytesFromRemoteStorage() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "scan_bytes_from_remote_storage", thrift.I64, 11) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ScanBytesFromRemoteStorage) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatistics) field1Length() int { - l := 0 - if p.IsSetScanRows() { - l += bthrift.Binary.FieldBeginLength("scan_rows", thrift.I64, 1) - l += bthrift.Binary.I64Length(*p.ScanRows) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field2Length() int { - l := 0 - if p.IsSetScanBytes() { - l += bthrift.Binary.FieldBeginLength("scan_bytes", thrift.I64, 2) - l += bthrift.Binary.I64Length(*p.ScanBytes) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field3Length() int { - l := 0 - if p.IsSetReturnedRows() { - l += bthrift.Binary.FieldBeginLength("returned_rows", thrift.I64, 3) - l += bthrift.Binary.I64Length(*p.ReturnedRows) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field4Length() int { - l := 0 - if p.IsSetCpuMs() { - l += bthrift.Binary.FieldBeginLength("cpu_ms", thrift.I64, 4) - l += bthrift.Binary.I64Length(*p.CpuMs) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field5Length() int { - l := 0 - if p.IsSetMaxPeakMemoryBytes() { - l += bthrift.Binary.FieldBeginLength("max_peak_memory_bytes", thrift.I64, 5) - l += bthrift.Binary.I64Length(*p.MaxPeakMemoryBytes) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field6Length() int { - l := 0 - if p.IsSetCurrentUsedMemoryBytes() { - l += bthrift.Binary.FieldBeginLength("current_used_memory_bytes", thrift.I64, 6) - l += bthrift.Binary.I64Length(*p.CurrentUsedMemoryBytes) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field7Length() int { - l := 0 - if p.IsSetWorkloadGroupId() { - l += bthrift.Binary.FieldBeginLength("workload_group_id", thrift.I64, 7) - l += bthrift.Binary.I64Length(*p.WorkloadGroupId) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field8Length() int { - l := 0 - if p.IsSetShuffleSendBytes() { - l += bthrift.Binary.FieldBeginLength("shuffle_send_bytes", thrift.I64, 8) - l += bthrift.Binary.I64Length(*p.ShuffleSendBytes) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field9Length() int { - l := 0 - if p.IsSetShuffleSendRows() { - l += bthrift.Binary.FieldBeginLength("shuffle_send_rows", thrift.I64, 9) - l += bthrift.Binary.I64Length(*p.ShuffleSendRows) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field10Length() int { - l := 0 - if p.IsSetScanBytesFromLocalStorage() { - l += bthrift.Binary.FieldBeginLength("scan_bytes_from_local_storage", thrift.I64, 10) - l += bthrift.Binary.I64Length(*p.ScanBytesFromLocalStorage) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatistics) field11Length() int { - l := 0 - if p.IsSetScanBytesFromRemoteStorage() { - l += bthrift.Binary.FieldBeginLength("scan_bytes_from_remote_storage", thrift.I64, 11) - l += bthrift.Binary.I64Length(*p.ScanBytesFromRemoteStorage) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TReportWorkloadRuntimeStatusParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TReportWorkloadRuntimeStatusParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TReportWorkloadRuntimeStatusParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.BackendId = &v - - } - return offset, nil -} - -func (p *TReportWorkloadRuntimeStatusParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.QueryStatisticsMap = make(map[string]*TQueryStatistics, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _key = v - - } - _val := NewTQueryStatistics() - if l, err := _val.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.QueryStatisticsMap[_key] = _val - } - if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TReportWorkloadRuntimeStatusParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TReportWorkloadRuntimeStatusParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TReportWorkloadRuntimeStatusParams") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TReportWorkloadRuntimeStatusParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TReportWorkloadRuntimeStatusParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TReportWorkloadRuntimeStatusParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetBackendId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "backend_id", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.BackendId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TReportWorkloadRuntimeStatusParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetQueryStatisticsMap() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_statistics_map", thrift.MAP, 2) - mapBeginOffset := offset - offset += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.STRUCT, 0) - var length int - for k, v := range p.QueryStatisticsMap { - length++ - - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, k) - - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) - offset += bthrift.Binary.WriteMapEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TReportWorkloadRuntimeStatusParams) field1Length() int { - l := 0 - if p.IsSetBackendId() { - l += bthrift.Binary.FieldBeginLength("backend_id", thrift.I64, 1) - l += bthrift.Binary.I64Length(*p.BackendId) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TReportWorkloadRuntimeStatusParams) field2Length() int { - l := 0 - if p.IsSetQueryStatisticsMap() { - l += bthrift.Binary.FieldBeginLength("query_statistics_map", thrift.MAP, 2) - l += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.STRUCT, len(p.QueryStatisticsMap)) - for k, v := range p.QueryStatisticsMap { - - l += bthrift.Binary.StringLengthNocopy(k) - - l += v.BLength() - } - l += bthrift.Binary.MapEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryProfile) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryProfile[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TQueryProfile) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.QueryId = tmp - return offset, nil -} - -func (p *TQueryProfile) FastReadField2(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.FragmentIdToProfile = make(map[int32][]*TDetailedReportParams, size) - for i := 0; i < size; i++ { - var _key int32 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _key = v - - } - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - _val := make([]*TDetailedReportParams, 0, size) - for i := 0; i < size; i++ { - _elem := NewTDetailedReportParams() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - _val = append(_val, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.FragmentIdToProfile[_key] = _val - } - if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TQueryProfile) FastReadField3(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.FragmentInstanceIds = make([]*types.TUniqueId, 0, size) - for i := 0; i < size; i++ { - _elem := types.NewTUniqueId() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.FragmentInstanceIds = append(p.FragmentInstanceIds, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TQueryProfile) FastReadField4(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.InstanceProfiles = make([]*runtimeprofile.TRuntimeProfileTree, 0, size) - for i := 0; i < size; i++ { - _elem := runtimeprofile.NewTRuntimeProfileTree() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.InstanceProfiles = append(p.InstanceProfiles, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TQueryProfile) FastReadField5(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.LoadChannelProfiles = make([]*runtimeprofile.TRuntimeProfileTree, 0, size) - for i := 0; i < size; i++ { - _elem := runtimeprofile.NewTRuntimeProfileTree() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.LoadChannelProfiles = append(p.LoadChannelProfiles, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TQueryProfile) FastWrite(buf []byte) int { - return 0 -} - -func (p *TQueryProfile) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TQueryProfile") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TQueryProfile) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TQueryProfile") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TQueryProfile) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetQueryId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_id", thrift.STRUCT, 1) - offset += p.QueryId.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryProfile) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetFragmentIdToProfile() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_id_to_profile", thrift.MAP, 2) - mapBeginOffset := offset - offset += bthrift.Binary.MapBeginLength(thrift.I32, thrift.LIST, 0) - var length int - for k, v := range p.FragmentIdToProfile { - length++ - - offset += bthrift.Binary.WriteI32(buf[offset:], k) - - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range v { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - } - bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.I32, thrift.LIST, length) - offset += bthrift.Binary.WriteMapEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryProfile) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetFragmentInstanceIds() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_instance_ids", thrift.LIST, 3) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.FragmentInstanceIds { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryProfile) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetInstanceProfiles() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "instance_profiles", thrift.LIST, 4) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.InstanceProfiles { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryProfile) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetLoadChannelProfiles() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "load_channel_profiles", thrift.LIST, 5) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.LoadChannelProfiles { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryProfile) field1Length() int { - l := 0 - if p.IsSetQueryId() { - l += bthrift.Binary.FieldBeginLength("query_id", thrift.STRUCT, 1) - l += p.QueryId.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryProfile) field2Length() int { - l := 0 - if p.IsSetFragmentIdToProfile() { - l += bthrift.Binary.FieldBeginLength("fragment_id_to_profile", thrift.MAP, 2) - l += bthrift.Binary.MapBeginLength(thrift.I32, thrift.LIST, len(p.FragmentIdToProfile)) - for k, v := range p.FragmentIdToProfile { - - l += bthrift.Binary.I32Length(k) - - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(v)) - for _, v := range v { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - } - l += bthrift.Binary.MapEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryProfile) field3Length() int { - l := 0 - if p.IsSetFragmentInstanceIds() { - l += bthrift.Binary.FieldBeginLength("fragment_instance_ids", thrift.LIST, 3) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.FragmentInstanceIds)) - for _, v := range p.FragmentInstanceIds { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryProfile) field4Length() int { - l := 0 - if p.IsSetInstanceProfiles() { - l += bthrift.Binary.FieldBeginLength("instance_profiles", thrift.LIST, 4) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.InstanceProfiles)) - for _, v := range p.InstanceProfiles { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryProfile) field5Length() int { - l := 0 - if p.IsSetLoadChannelProfiles() { - l += bthrift.Binary.FieldBeginLength("load_channel_profiles", thrift.LIST, 5) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.LoadChannelProfiles)) - for _, v := range p.LoadChannelProfiles { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TFragmentInstanceReport) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFragmentInstanceReport[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TFragmentInstanceReport) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.FragmentInstanceId = tmp - return offset, nil -} - -func (p *TFragmentInstanceReport) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.NumFinishedRange = &v - - } - return offset, nil -} - -func (p *TFragmentInstanceReport) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.LoadedRows = &v - - } - return offset, nil -} - -func (p *TFragmentInstanceReport) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.LoadedBytes = &v - - } - return offset, nil -} - -// for compatibility -func (p *TFragmentInstanceReport) FastWrite(buf []byte) int { - return 0 -} - -func (p *TFragmentInstanceReport) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFragmentInstanceReport") - if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TFragmentInstanceReport) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TFragmentInstanceReport") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TFragmentInstanceReport) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetFragmentInstanceId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_instance_id", thrift.STRUCT, 1) - offset += p.FragmentInstanceId.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TFragmentInstanceReport) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetNumFinishedRange() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "num_finished_range", thrift.I32, 2) - offset += bthrift.Binary.WriteI32(buf[offset:], *p.NumFinishedRange) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TFragmentInstanceReport) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetLoadedRows() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "loaded_rows", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.LoadedRows) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TFragmentInstanceReport) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetLoadedBytes() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "loaded_bytes", thrift.I64, 4) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.LoadedBytes) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TFragmentInstanceReport) field1Length() int { - l := 0 - if p.IsSetFragmentInstanceId() { - l += bthrift.Binary.FieldBeginLength("fragment_instance_id", thrift.STRUCT, 1) - l += p.FragmentInstanceId.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TFragmentInstanceReport) field2Length() int { - l := 0 - if p.IsSetNumFinishedRange() { - l += bthrift.Binary.FieldBeginLength("num_finished_range", thrift.I32, 2) - l += bthrift.Binary.I32Length(*p.NumFinishedRange) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TFragmentInstanceReport) field3Length() int { - l := 0 - if p.IsSetLoadedRows() { - l += bthrift.Binary.FieldBeginLength("loaded_rows", thrift.I64, 3) - l += bthrift.Binary.I64Length(*p.LoadedRows) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TFragmentInstanceReport) field4Length() int { - l := 0 - if p.IsSetLoadedBytes() { - l += bthrift.Binary.FieldBeginLength("loaded_bytes", thrift.I64, 4) - l += bthrift.Binary.I64Length(*p.LoadedBytes) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TReportExecStatusParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetProtocolVersion bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetProtocolVersion = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.BOOL { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField7(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 9: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField9(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 10: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField10(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 11: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField11(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 12: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField12(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 13: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField13(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 14: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField14(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 15: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField15(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 16: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField16(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 17: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField17(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 18: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField18(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 19: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField19(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 20: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField20(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 21: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField21(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 22: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField22(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 23: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField23(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 24: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField24(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 25: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField25(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 26: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField26(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 27: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField27(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 28: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField28(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 29: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField29(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 30: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField30(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 31: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField31(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetProtocolVersion { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TReportExecStatusParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TReportExecStatusParams[fieldId])) -} - -func (p *TReportExecStatusParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.ProtocolVersion = FrontendServiceVersion(v) - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.QueryId = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.BackendNum = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField4(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.FragmentInstanceId = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField5(buf []byte) (int, error) { - offset := 0 - - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Status = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField6(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Done = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField7(buf []byte) (int, error) { - offset := 0 - - tmp := runtimeprofile.NewTRuntimeProfileTree() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Profile = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField9(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ErrorLog = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.ErrorLog = append(p.ErrorLog, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField10(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.DeltaUrls = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.DeltaUrls = append(p.DeltaUrls, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField11(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.LoadCounters = make(map[string]string, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _key = v - - } - - var _val string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _val = v - - } - - p.LoadCounters[_key] = _val - } - if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField12(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.TrackingUrl = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField13(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ExportFiles = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.ExportFiles = append(p.ExportFiles, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField14(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.CommitInfos = make([]*types.TTabletCommitInfo, 0, size) - for i := 0; i < size; i++ { - _elem := types.NewTTabletCommitInfo() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.CommitInfos = append(p.CommitInfos, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField15(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.LoadedRows = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField16(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.BackendId = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField17(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.LoadedBytes = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField18(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ErrorTabletInfos = make([]*types.TErrorTabletInfo, 0, size) - for i := 0; i < size; i++ { - _elem := types.NewTErrorTabletInfo() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.ErrorTabletInfos = append(p.ErrorTabletInfos, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField19(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.FragmentId = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField20(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - tmp := palointernalservice.TQueryType(v) - p.QueryType = &tmp - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField21(buf []byte) (int, error) { - offset := 0 - - tmp := runtimeprofile.NewTRuntimeProfileTree() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.LoadChannelProfile = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField22(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.FinishedScanRanges = &v - - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField23(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.DetailedReport = make([]*TDetailedReportParams, 0, size) - for i := 0; i < size; i++ { - _elem := NewTDetailedReportParams() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.DetailedReport = append(p.DetailedReport, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField24(buf []byte) (int, error) { - offset := 0 - - tmp := NewTQueryStatistics() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.QueryStatistics = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField25(buf []byte) (int, error) { - offset := 0 - - tmp := NewTReportWorkloadRuntimeStatusParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.ReportWorkloadRuntimeStatus = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField26(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.HivePartitionUpdates = make([]*datasinks.THivePartitionUpdate, 0, size) - for i := 0; i < size; i++ { - _elem := datasinks.NewTHivePartitionUpdate() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.HivePartitionUpdates = append(p.HivePartitionUpdates, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField27(buf []byte) (int, error) { - offset := 0 - - tmp := NewTQueryProfile() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.QueryProfile = tmp - return offset, nil -} - -func (p *TReportExecStatusParams) FastReadField28(buf []byte) (int, error) { +func (p *TReportExecStatusParams) FastReadField28(buf []byte) (int, error) { offset := 0 _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) @@ -30949,7 +26439,493 @@ func (p *TLoadTxnRollbackResult_) FastRead(buf []byte) (int, error) { var l int var fieldTypeId thrift.TType var fieldId int16 - var issetStatus bool = false + var issetStatus bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStatus = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetStatus { + fieldId = 1 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TLoadTxnRollbackResult_[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TLoadTxnRollbackResult_[fieldId])) +} + +func (p *TLoadTxnRollbackResult_) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := status.NewTStatus() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Status = tmp + return offset, nil +} + +// for compatibility +func (p *TLoadTxnRollbackResult_) FastWrite(buf []byte) int { + return 0 +} + +func (p *TLoadTxnRollbackResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TLoadTxnRollbackResult") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *TLoadTxnRollbackResult_) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TLoadTxnRollbackResult") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TLoadTxnRollbackResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) + offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TLoadTxnRollbackResult_) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) + l += p.Status.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetJobId bool = false + var issetTaskId bool = false + var issetTaskType bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetJobId = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetTaskId = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetTaskType = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetJobId { + fieldId = 1 + goto RequiredFieldNotSetError + } + + if !issetTaskId { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetTaskType { + fieldId = 3 + goto RequiredFieldNotSetError + } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSnapshotLoaderReportRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSnapshotLoaderReportRequest[fieldId])) +} + +func (p *TSnapshotLoaderReportRequest) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.JobId = v + + } + return offset, nil +} + +func (p *TSnapshotLoaderReportRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.TaskId = v + + } + return offset, nil +} + +func (p *TSnapshotLoaderReportRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.TaskType = types.TTaskType(v) + + } + return offset, nil +} + +func (p *TSnapshotLoaderReportRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.FinishedNum = &v + + } + return offset, nil +} + +func (p *TSnapshotLoaderReportRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.TotalNum = &v + + } + return offset, nil +} + +// for compatibility +func (p *TSnapshotLoaderReportRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *TSnapshotLoaderReportRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSnapshotLoaderReportRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *TSnapshotLoaderReportRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TSnapshotLoaderReportRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TSnapshotLoaderReportRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "job_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], p.JobId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TSnapshotLoaderReportRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "task_id", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], p.TaskId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TSnapshotLoaderReportRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "task_type", thrift.I32, 3) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.TaskType)) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TSnapshotLoaderReportRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetFinishedNum() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "finished_num", thrift.I32, 4) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.FinishedNum) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TSnapshotLoaderReportRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTotalNum() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "total_num", thrift.I32, 5) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.TotalNum) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TSnapshotLoaderReportRequest) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("job_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(p.JobId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TSnapshotLoaderReportRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("task_id", thrift.I64, 2) + l += bthrift.Binary.I64Length(p.TaskId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TSnapshotLoaderReportRequest) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("task_type", thrift.I32, 3) + l += bthrift.Binary.I32Length(int32(p.TaskType)) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TSnapshotLoaderReportRequest) field4Length() int { + l := 0 + if p.IsSetFinishedNum() { + l += bthrift.Binary.FieldBeginLength("finished_num", thrift.I32, 4) + l += bthrift.Binary.I32Length(*p.FinishedNum) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TSnapshotLoaderReportRequest) field5Length() int { + l := 0 + if p.IsSetTotalNum() { + l += bthrift.Binary.FieldBeginLength("total_num", thrift.I32, 5) + l += bthrift.Binary.I32Length(*p.TotalNum) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TFrontendPingFrontendRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetClusterId bool = false + var issetToken bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -30967,13 +26943,42 @@ func (p *TLoadTxnRollbackResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetStatus = true + issetClusterId = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetToken = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31001,17 +27006,22 @@ func (p *TLoadTxnRollbackResult_) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetStatus { + if !issetClusterId { fieldId = 1 goto RequiredFieldNotSetError } + + if !issetToken { + fieldId = 2 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TLoadTxnRollbackResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFrontendPingFrontendRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -31019,74 +27029,153 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TLoadTxnRollbackResult_[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFrontendPingFrontendRequest[fieldId])) } -func (p *TLoadTxnRollbackResult_) FastReadField1(buf []byte) (int, error) { +func (p *TFrontendPingFrontendRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l + + p.ClusterId = v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Token = v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.DeployMode = &v + } - p.Status = tmp return offset, nil } // for compatibility -func (p *TLoadTxnRollbackResult_) FastWrite(buf []byte) int { +func (p *TFrontendPingFrontendRequest) FastWrite(buf []byte) int { return 0 } -func (p *TLoadTxnRollbackResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFrontendPingFrontendRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TLoadTxnRollbackResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFrontendPingFrontendRequest") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TLoadTxnRollbackResult_) BLength() int { +func (p *TFrontendPingFrontendRequest) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TLoadTxnRollbackResult") + l += bthrift.Binary.StructBeginLength("TFrontendPingFrontendRequest") if p != nil { l += p.field1Length() + l += p.field2Length() + l += p.field3Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TLoadTxnRollbackResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFrontendPingFrontendRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "clusterId", thrift.I32, 1) + offset += bthrift.Binary.WriteI32(buf[offset:], p.ClusterId) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TLoadTxnRollbackResult_) field1Length() int { +func (p *TFrontendPingFrontendRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TFrontendPingFrontendRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDeployMode() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "deployMode", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.DeployMode) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TFrontendPingFrontendRequest) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() + l += bthrift.Binary.FieldBeginLength("clusterId", thrift.I32, 1) + l += bthrift.Binary.I32Length(p.ClusterId) + l += bthrift.Binary.FieldEndLength() return l } -func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { +func (p *TFrontendPingFrontendRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Token) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TFrontendPingFrontendRequest) field3Length() int { + l := 0 + if p.IsSetDeployMode() { + l += bthrift.Binary.FieldBeginLength("deployMode", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.DeployMode) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TDiskInfo) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetJobId bool = false - var issetTaskId bool = false - var issetTaskType bool = false + var issetDirType bool = false + var issetDir bool = false + var issetFilesystem bool = false + var issetBlocks bool = false + var issetUsed bool = false + var issetAvailable bool = false + var issetUseRate bool = false + var issetMountedOn bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -31104,13 +27193,13 @@ func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetJobId = true + issetDirType = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31119,13 +27208,13 @@ func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetTaskId = true + issetDir = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31134,13 +27223,13 @@ func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetTaskType = true + issetFilesystem = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31149,12 +27238,13 @@ func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { } } case 4: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetBlocks = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31163,12 +27253,58 @@ func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { } } case 5: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField5(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetUsed = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetAvailable = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetUseRate = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetMountedOn = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31196,27 +27332,52 @@ func (p *TSnapshotLoaderReportRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetJobId { + if !issetDirType { fieldId = 1 goto RequiredFieldNotSetError } - if !issetTaskId { + if !issetDir { fieldId = 2 goto RequiredFieldNotSetError } - if !issetTaskType { + if !issetFilesystem { fieldId = 3 goto RequiredFieldNotSetError } + + if !issetBlocks { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetUsed { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetAvailable { + fieldId = 6 + goto RequiredFieldNotSetError + } + + if !issetUseRate { + fieldId = 7 + goto RequiredFieldNotSetError + } + + if !issetMountedOn { + fieldId = 8 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSnapshotLoaderReportRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDiskInfo[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -31224,10 +27385,52 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TSnapshotLoaderReportRequest[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDiskInfo[fieldId])) } -func (p *TSnapshotLoaderReportRequest) FastReadField1(buf []byte) (int, error) { +func (p *TDiskInfo) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.DirType = v + + } + return offset, nil +} + +func (p *TDiskInfo) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Dir = v + + } + return offset, nil +} + +func (p *TDiskInfo) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Filesystem = v + + } + return offset, nil +} + +func (p *TDiskInfo) FastReadField4(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -31235,13 +27438,13 @@ func (p *TSnapshotLoaderReportRequest) FastReadField1(buf []byte) (int, error) { } else { offset += l - p.JobId = v + p.Blocks = v } return offset, nil } -func (p *TSnapshotLoaderReportRequest) FastReadField2(buf []byte) (int, error) { +func (p *TDiskInfo) FastReadField5(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { @@ -31249,193 +27452,251 @@ func (p *TSnapshotLoaderReportRequest) FastReadField2(buf []byte) (int, error) { } else { offset += l - p.TaskId = v + p.Used = v } return offset, nil } -func (p *TSnapshotLoaderReportRequest) FastReadField3(buf []byte) (int, error) { +func (p *TDiskInfo) FastReadField6(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.TaskType = types.TTaskType(v) + p.Available = v } return offset, nil } -func (p *TSnapshotLoaderReportRequest) FastReadField4(buf []byte) (int, error) { +func (p *TDiskInfo) FastReadField7(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l - p.FinishedNum = &v + + p.UseRate = v } return offset, nil } -func (p *TSnapshotLoaderReportRequest) FastReadField5(buf []byte) (int, error) { +func (p *TDiskInfo) FastReadField8(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.TotalNum = &v + + p.MountedOn = v } return offset, nil } // for compatibility -func (p *TSnapshotLoaderReportRequest) FastWrite(buf []byte) int { +func (p *TDiskInfo) FastWrite(buf []byte) int { return 0 } -func (p *TSnapshotLoaderReportRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDiskInfo) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSnapshotLoaderReportRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDiskInfo") if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TSnapshotLoaderReportRequest) BLength() int { +func (p *TDiskInfo) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TSnapshotLoaderReportRequest") + l += bthrift.Binary.StructBeginLength("TDiskInfo") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() l += p.field4Length() l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + l += p.field8Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TSnapshotLoaderReportRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDiskInfo) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "job_id", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], p.JobId) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dirType", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.DirType) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TSnapshotLoaderReportRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDiskInfo) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "task_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], p.TaskId) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dir", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Dir) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TSnapshotLoaderReportRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDiskInfo) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "task_type", thrift.I32, 3) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.TaskType)) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "filesystem", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Filesystem) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TSnapshotLoaderReportRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDiskInfo) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetFinishedNum() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "finished_num", thrift.I32, 4) - offset += bthrift.Binary.WriteI32(buf[offset:], *p.FinishedNum) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "blocks", thrift.I64, 4) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Blocks) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TSnapshotLoaderReportRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TDiskInfo) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetTotalNum() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "total_num", thrift.I32, 5) - offset += bthrift.Binary.WriteI32(buf[offset:], *p.TotalNum) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "used", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Used) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TSnapshotLoaderReportRequest) field1Length() int { +func (p *TDiskInfo) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "available", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], p.Available) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TDiskInfo) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "useRate", thrift.I32, 7) + offset += bthrift.Binary.WriteI32(buf[offset:], p.UseRate) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TDiskInfo) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "mountedOn", thrift.STRING, 8) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.MountedOn) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TDiskInfo) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("job_id", thrift.I64, 1) - l += bthrift.Binary.I64Length(p.JobId) + l += bthrift.Binary.FieldBeginLength("dirType", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(p.DirType) l += bthrift.Binary.FieldEndLength() return l } -func (p *TSnapshotLoaderReportRequest) field2Length() int { +func (p *TDiskInfo) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("task_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(p.TaskId) + l += bthrift.Binary.FieldBeginLength("dir", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Dir) l += bthrift.Binary.FieldEndLength() return l } -func (p *TSnapshotLoaderReportRequest) field3Length() int { +func (p *TDiskInfo) field3Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("task_type", thrift.I32, 3) - l += bthrift.Binary.I32Length(int32(p.TaskType)) + l += bthrift.Binary.FieldBeginLength("filesystem", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.Filesystem) l += bthrift.Binary.FieldEndLength() return l } -func (p *TSnapshotLoaderReportRequest) field4Length() int { +func (p *TDiskInfo) field4Length() int { l := 0 - if p.IsSetFinishedNum() { - l += bthrift.Binary.FieldBeginLength("finished_num", thrift.I32, 4) - l += bthrift.Binary.I32Length(*p.FinishedNum) + l += bthrift.Binary.FieldBeginLength("blocks", thrift.I64, 4) + l += bthrift.Binary.I64Length(p.Blocks) - l += bthrift.Binary.FieldEndLength() - } + l += bthrift.Binary.FieldEndLength() return l } -func (p *TSnapshotLoaderReportRequest) field5Length() int { +func (p *TDiskInfo) field5Length() int { l := 0 - if p.IsSetTotalNum() { - l += bthrift.Binary.FieldBeginLength("total_num", thrift.I32, 5) - l += bthrift.Binary.I32Length(*p.TotalNum) + l += bthrift.Binary.FieldBeginLength("used", thrift.I64, 5) + l += bthrift.Binary.I64Length(p.Used) - l += bthrift.Binary.FieldEndLength() - } + l += bthrift.Binary.FieldEndLength() return l } -func (p *TFrontendPingFrontendRequest) FastRead(buf []byte) (int, error) { +func (p *TDiskInfo) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("available", thrift.I64, 6) + l += bthrift.Binary.I64Length(p.Available) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TDiskInfo) field7Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("useRate", thrift.I32, 7) + l += bthrift.Binary.I32Length(p.UseRate) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TDiskInfo) field8Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("mountedOn", thrift.STRING, 8) + l += bthrift.Binary.StringLengthNocopy(p.MountedOn) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TFrontendPingFrontendResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetClusterId bool = false - var issetToken bool = false + var issetStatus bool = false + var issetMsg bool = false + var issetQueryPort bool = false + var issetRpcPort bool = false + var issetReplayedJournalId bool = false + var issetVersion bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -31454,12 +27715,42 @@ func (p *TFrontendPingFrontendRequest) FastRead(buf []byte) (int, error) { switch fieldId { case 1: if fieldTypeId == thrift.I32 { - l, err = p.FastReadField1(buf[offset:]) + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStatus = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetMsg = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetClusterId = true + issetQueryPort = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31467,14 +27758,14 @@ func (p *TFrontendPingFrontendRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) + case 4: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetToken = true + issetRpcPort = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31482,9 +27773,81 @@ func (p *TFrontendPingFrontendRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 3: + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetReplayedJournalId = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetVersion = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField10(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -31516,22 +27879,42 @@ func (p *TFrontendPingFrontendRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetClusterId { + if !issetStatus { fieldId = 1 goto RequiredFieldNotSetError } - if !issetToken { + if !issetMsg { fieldId = 2 goto RequiredFieldNotSetError } + + if !issetQueryPort { + fieldId = 3 + goto RequiredFieldNotSetError + } + + if !issetRpcPort { + fieldId = 4 + goto RequiredFieldNotSetError + } + + if !issetReplayedJournalId { + fieldId = 5 + goto RequiredFieldNotSetError + } + + if !issetVersion { + fieldId = 6 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFrontendPingFrontendRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFrontendPingFrontendResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -31539,10 +27922,10 @@ ReadFieldEndError: ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFrontendPingFrontendRequest[fieldId])) + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFrontendPingFrontendResult_[fieldId])) } -func (p *TFrontendPingFrontendRequest) FastReadField1(buf []byte) (int, error) { +func (p *TFrontendPingFrontendResult_) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { @@ -31550,13 +27933,13 @@ func (p *TFrontendPingFrontendRequest) FastReadField1(buf []byte) (int, error) { } else { offset += l - p.ClusterId = v + p.Status = TFrontendPingFrontendStatusCode(v) } return offset, nil } -func (p *TFrontendPingFrontendRequest) FastReadField2(buf []byte) (int, error) { +func (p *TFrontendPingFrontendResult_) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -31564,197 +27947,414 @@ func (p *TFrontendPingFrontendRequest) FastReadField2(buf []byte) (int, error) { } else { offset += l - p.Token = v + p.Msg = v } return offset, nil } -func (p *TFrontendPingFrontendRequest) FastReadField3(buf []byte) (int, error) { +func (p *TFrontendPingFrontendResult_) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.QueryPort = v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendResult_) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.RpcPort = v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendResult_) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ReplayedJournalId = v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendResult_) FastReadField6(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.DeployMode = &v + + p.Version = v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendResult_) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.LastStartupTime = &v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendResult_) FastReadField8(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.DiskInfos = make([]*TDiskInfo, 0, size) + for i := 0; i < size; i++ { + _elem := NewTDiskInfo() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.DiskInfos = append(p.DiskInfos, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil +} + +func (p *TFrontendPingFrontendResult_) FastReadField9(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ProcessUUID = &v + + } + return offset, nil +} + +func (p *TFrontendPingFrontendResult_) FastReadField10(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ArrowFlightSqlPort = &v } return offset, nil } // for compatibility -func (p *TFrontendPingFrontendRequest) FastWrite(buf []byte) int { +func (p *TFrontendPingFrontendResult_) FastWrite(buf []byte) int { return 0 } -func (p *TFrontendPingFrontendRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFrontendPingFrontendResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFrontendPingFrontendRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFrontendPingFrontendResult") if p != nil { + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TFrontendPingFrontendRequest) BLength() int { +func (p *TFrontendPingFrontendResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TFrontendPingFrontendRequest") + l += bthrift.Binary.StructBeginLength("TFrontendPingFrontendResult") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + l += p.field8Length() + l += p.field9Length() + l += p.field10Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TFrontendPingFrontendRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFrontendPingFrontendResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "clusterId", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], p.ClusterId) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.I32, 1) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.Status)) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TFrontendPingFrontendRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFrontendPingFrontendResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Token) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "msg", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Msg) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TFrontendPingFrontendRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFrontendPingFrontendResult_) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDeployMode() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "deployMode", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.DeployMode) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "queryPort", thrift.I32, 3) + offset += bthrift.Binary.WriteI32(buf[offset:], p.QueryPort) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TFrontendPingFrontendResult_) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "rpcPort", thrift.I32, 4) + offset += bthrift.Binary.WriteI32(buf[offset:], p.RpcPort) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TFrontendPingFrontendResult_) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replayedJournalId", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], p.ReplayedJournalId) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TFrontendPingFrontendResult_) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "version", thrift.STRING, 6) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Version) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TFrontendPingFrontendResult_) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLastStartupTime() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "lastStartupTime", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LastStartupTime) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TFrontendPingFrontendRequest) field1Length() int { +func (p *TFrontendPingFrontendResult_) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDiskInfos() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "diskInfos", thrift.LIST, 8) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.DiskInfos { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TFrontendPingFrontendResult_) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetProcessUUID() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "processUUID", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ProcessUUID) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TFrontendPingFrontendResult_) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetArrowFlightSqlPort() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "arrowFlightSqlPort", thrift.I32, 10) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.ArrowFlightSqlPort) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TFrontendPingFrontendResult_) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("clusterId", thrift.I32, 1) - l += bthrift.Binary.I32Length(p.ClusterId) + l += bthrift.Binary.FieldBeginLength("status", thrift.I32, 1) + l += bthrift.Binary.I32Length(int32(p.Status)) l += bthrift.Binary.FieldEndLength() return l } -func (p *TFrontendPingFrontendRequest) field2Length() int { +func (p *TFrontendPingFrontendResult_) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.Token) + l += bthrift.Binary.FieldBeginLength("msg", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.Msg) l += bthrift.Binary.FieldEndLength() return l } -func (p *TFrontendPingFrontendRequest) field3Length() int { +func (p *TFrontendPingFrontendResult_) field3Length() int { l := 0 - if p.IsSetDeployMode() { - l += bthrift.Binary.FieldBeginLength("deployMode", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(*p.DeployMode) + l += bthrift.Binary.FieldBeginLength("queryPort", thrift.I32, 3) + l += bthrift.Binary.I32Length(p.QueryPort) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TFrontendPingFrontendResult_) field4Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("rpcPort", thrift.I32, 4) + l += bthrift.Binary.I32Length(p.RpcPort) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TFrontendPingFrontendResult_) field5Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("replayedJournalId", thrift.I64, 5) + l += bthrift.Binary.I64Length(p.ReplayedJournalId) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TFrontendPingFrontendResult_) field6Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("version", thrift.STRING, 6) + l += bthrift.Binary.StringLengthNocopy(p.Version) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TFrontendPingFrontendResult_) field7Length() int { + l := 0 + if p.IsSetLastStartupTime() { + l += bthrift.Binary.FieldBeginLength("lastStartupTime", thrift.I64, 7) + l += bthrift.Binary.I64Length(*p.LastStartupTime) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TDiskInfo) FastRead(buf []byte) (int, error) { +func (p *TFrontendPingFrontendResult_) field8Length() int { + l := 0 + if p.IsSetDiskInfos() { + l += bthrift.Binary.FieldBeginLength("diskInfos", thrift.LIST, 8) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.DiskInfos)) + for _, v := range p.DiskInfos { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TFrontendPingFrontendResult_) field9Length() int { + l := 0 + if p.IsSetProcessUUID() { + l += bthrift.Binary.FieldBeginLength("processUUID", thrift.I64, 9) + l += bthrift.Binary.I64Length(*p.ProcessUUID) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TFrontendPingFrontendResult_) field10Length() int { + l := 0 + if p.IsSetArrowFlightSqlPort() { + l += bthrift.Binary.FieldBeginLength("arrowFlightSqlPort", thrift.I32, 10) + l += bthrift.Binary.I32Length(*p.ArrowFlightSqlPort) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TPropertyVal) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetDirType bool = false - var issetDir bool = false - var issetFilesystem bool = false - var issetBlocks bool = false - var issetUsed bool = false - var issetAvailable bool = false - var issetUseRate bool = false - var issetMountedOn bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetDirType = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetDir = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetFilesystem = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField4(buf[offset:]) + l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetBlocks = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31762,14 +28362,13 @@ func (p *TDiskInfo) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 5: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField5(buf[offset:]) + case 2: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetUsed = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31777,29 +28376,13 @@ func (p *TDiskInfo) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 6: + case 3: if fieldTypeId == thrift.I64 { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetAvailable = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField7(buf[offset:]) + l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetUseRate = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31807,14 +28390,13 @@ func (p *TDiskInfo) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 8: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField8(buf[offset:]) + case 4: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetMountedOn = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -31842,371 +28424,200 @@ func (p *TDiskInfo) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetDirType { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetDir { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetFilesystem { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetBlocks { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetUsed { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetAvailable { - fieldId = 6 - goto RequiredFieldNotSetError - } - - if !issetUseRate { - fieldId = 7 - goto RequiredFieldNotSetError - } - - if !issetMountedOn { - fieldId = 8 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TDiskInfo[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPropertyVal[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TDiskInfo[fieldId])) -} - -func (p *TDiskInfo) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.DirType = v - - } - return offset, nil -} - -func (p *TDiskInfo) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.Dir = v - - } - return offset, nil } -func (p *TDiskInfo) FastReadField3(buf []byte) (int, error) { +func (p *TPropertyVal) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.Filesystem = v - - } - return offset, nil -} - -func (p *TDiskInfo) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.Blocks = v + p.StrVal = &v } return offset, nil } -func (p *TDiskInfo) FastReadField5(buf []byte) (int, error) { +func (p *TPropertyVal) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.Used = v + p.IntVal = &v } return offset, nil } -func (p *TDiskInfo) FastReadField6(buf []byte) (int, error) { +func (p *TPropertyVal) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.Available = v - - } - return offset, nil -} - -func (p *TDiskInfo) FastReadField7(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.UseRate = v + p.LongVal = &v } return offset, nil } -func (p *TDiskInfo) FastReadField8(buf []byte) (int, error) { +func (p *TPropertyVal) FastReadField4(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.MountedOn = v + p.BoolVal = &v } return offset, nil } // for compatibility -func (p *TDiskInfo) FastWrite(buf []byte) int { +func (p *TPropertyVal) FastWrite(buf []byte) int { return 0 } -func (p *TDiskInfo) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPropertyVal) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDiskInfo") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TPropertyVal") if p != nil { - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TDiskInfo) BLength() int { +func (p *TPropertyVal) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TDiskInfo") + l += bthrift.Binary.StructBeginLength("TPropertyVal") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - l += p.field8Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TDiskInfo) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dirType", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.DirType) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TDiskInfo) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dir", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Dir) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TDiskInfo) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "filesystem", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Filesystem) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TDiskInfo) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "blocks", thrift.I64, 4) - offset += bthrift.Binary.WriteI64(buf[offset:], p.Blocks) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TDiskInfo) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPropertyVal) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "used", thrift.I64, 5) - offset += bthrift.Binary.WriteI64(buf[offset:], p.Used) + if p.IsSetStrVal() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "strVal", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.StrVal) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TDiskInfo) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPropertyVal) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "available", thrift.I64, 6) - offset += bthrift.Binary.WriteI64(buf[offset:], p.Available) + if p.IsSetIntVal() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "intVal", thrift.I32, 2) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.IntVal) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TDiskInfo) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPropertyVal) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "useRate", thrift.I32, 7) - offset += bthrift.Binary.WriteI32(buf[offset:], p.UseRate) + if p.IsSetLongVal() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "longVal", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LongVal) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TDiskInfo) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPropertyVal) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "mountedOn", thrift.STRING, 8) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.MountedOn) + if p.IsSetBoolVal() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "boolVal", thrift.BOOL, 4) + offset += bthrift.Binary.WriteBool(buf[offset:], *p.BoolVal) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TDiskInfo) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("dirType", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(p.DirType) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TDiskInfo) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("dir", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.Dir) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TDiskInfo) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("filesystem", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(p.Filesystem) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TDiskInfo) field4Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("blocks", thrift.I64, 4) - l += bthrift.Binary.I64Length(p.Blocks) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TDiskInfo) field5Length() int { +func (p *TPropertyVal) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("used", thrift.I64, 5) - l += bthrift.Binary.I64Length(p.Used) + if p.IsSetStrVal() { + l += bthrift.Binary.FieldBeginLength("strVal", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.StrVal) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TDiskInfo) field6Length() int { +func (p *TPropertyVal) field2Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("available", thrift.I64, 6) - l += bthrift.Binary.I64Length(p.Available) + if p.IsSetIntVal() { + l += bthrift.Binary.FieldBeginLength("intVal", thrift.I32, 2) + l += bthrift.Binary.I32Length(*p.IntVal) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TDiskInfo) field7Length() int { +func (p *TPropertyVal) field3Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("useRate", thrift.I32, 7) - l += bthrift.Binary.I32Length(p.UseRate) + if p.IsSetLongVal() { + l += bthrift.Binary.FieldBeginLength("longVal", thrift.I64, 3) + l += bthrift.Binary.I64Length(*p.LongVal) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TDiskInfo) field8Length() int { +func (p *TPropertyVal) field4Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("mountedOn", thrift.STRING, 8) - l += bthrift.Binary.StringLengthNocopy(p.MountedOn) + if p.IsSetBoolVal() { + l += bthrift.Binary.FieldBeginLength("boolVal", thrift.BOOL, 4) + l += bthrift.Binary.BoolLength(*p.BoolVal) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TFrontendPingFrontendResult_) FastRead(buf []byte) (int, error) { +func (p *TWaitingTxnStatusRequest) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetStatus bool = false - var issetMsg bool = false - var issetQueryPort bool = false - var issetRpcPort bool = false - var issetReplayedJournalId bool = false - var issetVersion bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -32224,13 +28635,12 @@ func (p *TFrontendPingFrontendResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetStatus = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -32239,13 +28649,12 @@ func (p *TFrontendPingFrontendResult_) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetMsg = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -32254,110 +28663,8 @@ func (p *TFrontendPingFrontendResult_) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetQueryPort = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetRpcPort = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetReplayedJournalId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: if fieldTypeId == thrift.STRING { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetVersion = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField7(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 8: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField8(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 9: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField9(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 10: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField10(buf[offset:]) + l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -32385,458 +28692,579 @@ func (p *TFrontendPingFrontendResult_) FastRead(buf []byte) (int, error) { } l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetMsg { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetQueryPort { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetRpcPort { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetReplayedJournalId { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetVersion { - fieldId = 6 - goto RequiredFieldNotSetError + if err != nil { + goto ReadStructEndError } + return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFrontendPingFrontendResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TWaitingTxnStatusRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFrontendPingFrontendResult_[fieldId])) } -func (p *TFrontendPingFrontendResult_) FastReadField1(buf []byte) (int, error) { +func (p *TWaitingTxnStatusRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.Status = TFrontendPingFrontendStatusCode(v) + p.DbId = &v } return offset, nil } -func (p *TFrontendPingFrontendResult_) FastReadField2(buf []byte) (int, error) { +func (p *TWaitingTxnStatusRequest) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.Msg = v + p.TxnId = &v } return offset, nil } -func (p *TFrontendPingFrontendResult_) FastReadField3(buf []byte) (int, error) { +func (p *TWaitingTxnStatusRequest) FastReadField3(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - - p.QueryPort = v + p.Label = &v } return offset, nil } -func (p *TFrontendPingFrontendResult_) FastReadField4(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l +// for compatibility +func (p *TWaitingTxnStatusRequest) FastWrite(buf []byte) int { + return 0 +} - p.RpcPort = v +func (p *TWaitingTxnStatusRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TWaitingTxnStatusRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} +func (p *TWaitingTxnStatusRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TWaitingTxnStatusRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() } - return offset, nil + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l } -func (p *TFrontendPingFrontendResult_) FastReadField5(buf []byte) (int, error) { +func (p *TWaitingTxnStatusRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetDbId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.DbId) - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} - p.ReplayedJournalId = v +func (p *TWaitingTxnStatusRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTxnId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "txn_id", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.TxnId) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return offset, nil + return offset } -func (p *TFrontendPingFrontendResult_) FastReadField6(buf []byte) (int, error) { +func (p *TWaitingTxnStatusRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetLabel() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "label", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Label) - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} - p.Version = v +func (p *TWaitingTxnStatusRequest) field1Length() int { + l := 0 + if p.IsSetDbId() { + l += bthrift.Binary.FieldBeginLength("db_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(*p.DbId) + l += bthrift.Binary.FieldEndLength() } - return offset, nil + return l } -func (p *TFrontendPingFrontendResult_) FastReadField7(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.LastStartupTime = &v +func (p *TWaitingTxnStatusRequest) field2Length() int { + l := 0 + if p.IsSetTxnId() { + l += bthrift.Binary.FieldBeginLength("txn_id", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.TxnId) + l += bthrift.Binary.FieldEndLength() } - return offset, nil + return l } -func (p *TFrontendPingFrontendResult_) FastReadField8(buf []byte) (int, error) { - offset := 0 +func (p *TWaitingTxnStatusRequest) field3Length() int { + l := 0 + if p.IsSetLabel() { + l += bthrift.Binary.FieldBeginLength("label", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.Label) - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TWaitingTxnStatusResult_) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { - return offset, err + goto ReadStructBeginError } - p.DiskInfos = make([]*TDiskInfo, 0, size) - for i := 0; i < size; i++ { - _elem := NewTDiskInfo() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l + if err != nil { + goto SkipFieldError + } } - p.DiskInfos = append(p.DiskInfos, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError } + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TWaitingTxnStatusResult_[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TFrontendPingFrontendResult_) FastReadField9(buf []byte) (int, error) { +func (p *TWaitingTxnStatusResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + tmp := status.NewTStatus() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - p.ProcessUUID = &v - } + p.Status = tmp return offset, nil } -func (p *TFrontendPingFrontendResult_) FastReadField10(buf []byte) (int, error) { +func (p *TWaitingTxnStatusResult_) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l - p.ArrowFlightSqlPort = &v + p.TxnStatusId = &v } return offset, nil } // for compatibility -func (p *TFrontendPingFrontendResult_) FastWrite(buf []byte) int { +func (p *TWaitingTxnStatusResult_) FastWrite(buf []byte) int { return 0 } -func (p *TFrontendPingFrontendResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TWaitingTxnStatusResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFrontendPingFrontendResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TWaitingTxnStatusResult") if p != nil { - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField9(buf[offset:], binaryWriter) - offset += p.fastWriteField10(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TFrontendPingFrontendResult_) BLength() int { +func (p *TWaitingTxnStatusResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TFrontendPingFrontendResult") + l += bthrift.Binary.StructBeginLength("TWaitingTxnStatusResult") if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - l += p.field8Length() - l += p.field9Length() - l += p.field10Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TFrontendPingFrontendResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TWaitingTxnStatusResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.Status)) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if p.IsSetStatus() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) + offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TFrontendPingFrontendResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TWaitingTxnStatusResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "msg", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Msg) + if p.IsSetTxnStatusId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "txn_status_id", thrift.I32, 2) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.TxnStatusId) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TFrontendPingFrontendResult_) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "queryPort", thrift.I32, 3) - offset += bthrift.Binary.WriteI32(buf[offset:], p.QueryPort) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset +func (p *TWaitingTxnStatusResult_) field1Length() int { + l := 0 + if p.IsSetStatus() { + l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) + l += p.Status.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l } -func (p *TFrontendPingFrontendResult_) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "rpcPort", thrift.I32, 4) - offset += bthrift.Binary.WriteI32(buf[offset:], p.RpcPort) +func (p *TWaitingTxnStatusResult_) field2Length() int { + l := 0 + if p.IsSetTxnStatusId() { + l += bthrift.Binary.FieldBeginLength("txn_status_id", thrift.I32, 2) + l += bthrift.Binary.I32Length(*p.TxnStatusId) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset + l += bthrift.Binary.FieldEndLength() + } + return l } -func (p *TFrontendPingFrontendResult_) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replayedJournalId", thrift.I64, 5) - offset += bthrift.Binary.WriteI64(buf[offset:], p.ReplayedJournalId) +func (p *TInitExternalCtlMetaRequest) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } -func (p *TFrontendPingFrontendResult_) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "version", thrift.STRING, 6) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Version) + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TInitExternalCtlMetaRequest[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TFrontendPingFrontendResult_) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TInitExternalCtlMetaRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - if p.IsSetLastStartupTime() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "lastStartupTime", thrift.I64, 7) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.LastStartupTime) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.CatalogId = &v -func (p *TFrontendPingFrontendResult_) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetDiskInfos() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "diskInfos", thrift.LIST, 8) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.DiskInfos { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return offset + return offset, nil } -func (p *TFrontendPingFrontendResult_) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TInitExternalCtlMetaRequest) FastReadField2(buf []byte) (int, error) { offset := 0 - if p.IsSetProcessUUID() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "processUUID", thrift.I64, 9) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ProcessUUID) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.DbId = &v + } - return offset + return offset, nil } -func (p *TFrontendPingFrontendResult_) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TInitExternalCtlMetaRequest) FastReadField3(buf []byte) (int, error) { offset := 0 - if p.IsSetArrowFlightSqlPort() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "arrowFlightSqlPort", thrift.I32, 10) - offset += bthrift.Binary.WriteI32(buf[offset:], *p.ArrowFlightSqlPort) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} -func (p *TFrontendPingFrontendResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("status", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(p.Status)) + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.TableId = &v - l += bthrift.Binary.FieldEndLength() - return l + } + return offset, nil } -func (p *TFrontendPingFrontendResult_) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("msg", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.Msg) - - l += bthrift.Binary.FieldEndLength() - return l +// for compatibility +func (p *TInitExternalCtlMetaRequest) FastWrite(buf []byte) int { + return 0 } -func (p *TFrontendPingFrontendResult_) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("queryPort", thrift.I32, 3) - l += bthrift.Binary.I32Length(p.QueryPort) - - l += bthrift.Binary.FieldEndLength() - return l +func (p *TInitExternalCtlMetaRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TInitExternalCtlMetaRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset } -func (p *TFrontendPingFrontendResult_) field4Length() int { +func (p *TInitExternalCtlMetaRequest) BLength() int { l := 0 - l += bthrift.Binary.FieldBeginLength("rpcPort", thrift.I32, 4) - l += bthrift.Binary.I32Length(p.RpcPort) - - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.StructBeginLength("TInitExternalCtlMetaRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() return l } -func (p *TFrontendPingFrontendResult_) field5Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("replayedJournalId", thrift.I64, 5) - l += bthrift.Binary.I64Length(p.ReplayedJournalId) +func (p *TInitExternalCtlMetaRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCatalogId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalogId", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.CatalogId) - l += bthrift.Binary.FieldEndLength() - return l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset } -func (p *TFrontendPingFrontendResult_) field6Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("version", thrift.STRING, 6) - l += bthrift.Binary.StringLengthNocopy(p.Version) +func (p *TInitExternalCtlMetaRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDbId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dbId", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.DbId) - l += bthrift.Binary.FieldEndLength() - return l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset } -func (p *TFrontendPingFrontendResult_) field7Length() int { - l := 0 - if p.IsSetLastStartupTime() { - l += bthrift.Binary.FieldBeginLength("lastStartupTime", thrift.I64, 7) - l += bthrift.Binary.I64Length(*p.LastStartupTime) +func (p *TInitExternalCtlMetaRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTableId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tableId", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.TableId) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TFrontendPingFrontendResult_) field8Length() int { +func (p *TInitExternalCtlMetaRequest) field1Length() int { l := 0 - if p.IsSetDiskInfos() { - l += bthrift.Binary.FieldBeginLength("diskInfos", thrift.LIST, 8) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.DiskInfos)) - for _, v := range p.DiskInfos { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() + if p.IsSetCatalogId() { + l += bthrift.Binary.FieldBeginLength("catalogId", thrift.I64, 1) + l += bthrift.Binary.I64Length(*p.CatalogId) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TFrontendPingFrontendResult_) field9Length() int { +func (p *TInitExternalCtlMetaRequest) field2Length() int { l := 0 - if p.IsSetProcessUUID() { - l += bthrift.Binary.FieldBeginLength("processUUID", thrift.I64, 9) - l += bthrift.Binary.I64Length(*p.ProcessUUID) + if p.IsSetDbId() { + l += bthrift.Binary.FieldBeginLength("dbId", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.DbId) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TFrontendPingFrontendResult_) field10Length() int { +func (p *TInitExternalCtlMetaRequest) field3Length() int { l := 0 - if p.IsSetArrowFlightSqlPort() { - l += bthrift.Binary.FieldBeginLength("arrowFlightSqlPort", thrift.I32, 10) - l += bthrift.Binary.I32Length(*p.ArrowFlightSqlPort) + if p.IsSetTableId() { + l += bthrift.Binary.FieldBeginLength("tableId", thrift.I64, 3) + l += bthrift.Binary.I64Length(*p.TableId) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TPropertyVal) FastRead(buf []byte) (int, error) { +func (p *TInitExternalCtlMetaResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -32859,7 +29287,7 @@ func (p *TPropertyVal) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -32873,7 +29301,7 @@ func (p *TPropertyVal) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -32886,34 +29314,6 @@ func (p *TPropertyVal) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 3: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.BOOL { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -32940,7 +29340,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPropertyVal[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TInitExternalCtlMetaResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -32949,180 +29349,106 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TPropertyVal) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.StrVal = &v - - } - return offset, nil -} - -func (p *TPropertyVal) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.IntVal = &v - - } - return offset, nil -} - -func (p *TPropertyVal) FastReadField3(buf []byte) (int, error) { +func (p *TInitExternalCtlMetaResult_) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.LongVal = &v + p.MaxJournalId = &v } return offset, nil } -func (p *TPropertyVal) FastReadField4(buf []byte) (int, error) { +func (p *TInitExternalCtlMetaResult_) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.BoolVal = &v + p.Status = &v } return offset, nil } // for compatibility -func (p *TPropertyVal) FastWrite(buf []byte) int { +func (p *TInitExternalCtlMetaResult_) FastWrite(buf []byte) int { return 0 } -func (p *TPropertyVal) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TInitExternalCtlMetaResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TPropertyVal") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TInitExternalCtlMetaResult") if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TPropertyVal) BLength() int { +func (p *TInitExternalCtlMetaResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TPropertyVal") + l += bthrift.Binary.StructBeginLength("TInitExternalCtlMetaResult") if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field3Length() - l += p.field4Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TPropertyVal) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetStrVal() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "strVal", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.StrVal) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TPropertyVal) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetIntVal() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "intVal", thrift.I32, 2) - offset += bthrift.Binary.WriteI32(buf[offset:], *p.IntVal) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TPropertyVal) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TInitExternalCtlMetaResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetLongVal() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "longVal", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.LongVal) + if p.IsSetMaxJournalId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "maxJournalId", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.MaxJournalId) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TPropertyVal) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TInitExternalCtlMetaResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetBoolVal() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "boolVal", thrift.BOOL, 4) - offset += bthrift.Binary.WriteBool(buf[offset:], *p.BoolVal) + if p.IsSetStatus() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Status) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TPropertyVal) field1Length() int { - l := 0 - if p.IsSetStrVal() { - l += bthrift.Binary.FieldBeginLength("strVal", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.StrVal) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TPropertyVal) field2Length() int { - l := 0 - if p.IsSetIntVal() { - l += bthrift.Binary.FieldBeginLength("intVal", thrift.I32, 2) - l += bthrift.Binary.I32Length(*p.IntVal) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TPropertyVal) field3Length() int { +func (p *TInitExternalCtlMetaResult_) field1Length() int { l := 0 - if p.IsSetLongVal() { - l += bthrift.Binary.FieldBeginLength("longVal", thrift.I64, 3) - l += bthrift.Binary.I64Length(*p.LongVal) + if p.IsSetMaxJournalId() { + l += bthrift.Binary.FieldBeginLength("maxJournalId", thrift.I64, 1) + l += bthrift.Binary.I64Length(*p.MaxJournalId) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TPropertyVal) field4Length() int { +func (p *TInitExternalCtlMetaResult_) field2Length() int { l := 0 - if p.IsSetBoolVal() { - l += bthrift.Binary.FieldBeginLength("boolVal", thrift.BOOL, 4) - l += bthrift.Binary.BoolLength(*p.BoolVal) + if p.IsSetStatus() { + l += bthrift.Binary.FieldBeginLength("status", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.Status) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TWaitingTxnStatusRequest) FastRead(buf []byte) (int, error) { +func (p *TMetadataTableRequestParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -33145,7 +29471,7 @@ func (p *TWaitingTxnStatusRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -33159,7 +29485,7 @@ func (p *TWaitingTxnStatusRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -33173,7 +29499,7 @@ func (p *TWaitingTxnStatusRequest) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -33186,6 +29512,160 @@ func (p *TWaitingTxnStatusRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 4: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 10: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 11: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 12: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 13: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 14: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField14(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -33194,352 +29674,584 @@ func (p *TWaitingTxnStatusRequest) FastRead(buf []byte) (int, error) { } } - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TMetadataTableRequestParams[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *TMetadataTableRequestParams) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := types.TMetadataType(v) + p.MetadataType = &tmp + + } + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField2(buf []byte) (int, error) { + offset := 0 + + tmp := plannodes.NewTIcebergMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.IcebergMetadataParams = tmp + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField3(buf []byte) (int, error) { + offset := 0 + + tmp := plannodes.NewTBackendsMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.BackendsMetadataParams = tmp + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField4(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.ColumnsName = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.ColumnsName = append(p.ColumnsName, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField5(buf []byte) (int, error) { + offset := 0 + + tmp := plannodes.NewTFrontendsMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { offset += l - if err != nil { - goto ReadFieldEndError - } } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError + p.FrontendsMetadataParams = tmp + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField6(buf []byte) (int, error) { + offset := 0 + + tmp := types.NewTUserIdentity() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } + p.CurrentUserIdent = tmp + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField7(buf []byte) (int, error) { + offset := 0 + tmp := plannodes.NewTQueriesMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.QueriesMetadataParams = tmp return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TWaitingTxnStatusRequest[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TWaitingTxnStatusRequest) FastReadField1(buf []byte) (int, error) { +func (p *TMetadataTableRequestParams) FastReadField8(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + tmp := plannodes.NewTMaterializedViewsMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - p.DbId = &v + } + p.MaterializedViewsMetadataParams = tmp + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField9(buf []byte) (int, error) { + offset := 0 + tmp := plannodes.NewTJobsMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } + p.JobsMetadataParams = tmp return offset, nil } -func (p *TWaitingTxnStatusRequest) FastReadField2(buf []byte) (int, error) { +func (p *TMetadataTableRequestParams) FastReadField10(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + tmp := plannodes.NewTTasksMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - p.TxnId = &v + } + p.TasksMetadataParams = tmp + return offset, nil +} +func (p *TMetadataTableRequestParams) FastReadField11(buf []byte) (int, error) { + offset := 0 + + tmp := plannodes.NewTPartitionsMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } + p.PartitionsMetadataParams = tmp return offset, nil } -func (p *TWaitingTxnStatusRequest) FastReadField3(buf []byte) (int, error) { +func (p *TMetadataTableRequestParams) FastReadField12(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + tmp := plannodes.NewTMetaCacheStatsParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Label = &v + } + p.MetaCacheStatsParams = tmp + return offset, nil +} + +func (p *TMetadataTableRequestParams) FastReadField13(buf []byte) (int, error) { + offset := 0 + + tmp := plannodes.NewTPartitionValuesMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.PartitionValuesMetadataParams = tmp + return offset, nil +} +func (p *TMetadataTableRequestParams) FastReadField14(buf []byte) (int, error) { + offset := 0 + + tmp := plannodes.NewTHudiMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } + p.HudiMetadataParams = tmp return offset, nil } // for compatibility -func (p *TWaitingTxnStatusRequest) FastWrite(buf []byte) int { +func (p *TMetadataTableRequestParams) FastWrite(buf []byte) int { return 0 } -func (p *TWaitingTxnStatusRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TMetadataTableRequestParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TWaitingTxnStatusRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TMetadataTableRequestParams") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) + offset += p.fastWriteField12(buf[offset:], binaryWriter) + offset += p.fastWriteField13(buf[offset:], binaryWriter) + offset += p.fastWriteField14(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TWaitingTxnStatusRequest) BLength() int { +func (p *TMetadataTableRequestParams) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TWaitingTxnStatusRequest") + l += bthrift.Binary.StructBeginLength("TMetadataTableRequestParams") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + l += p.field8Length() + l += p.field9Length() + l += p.field10Length() + l += p.field11Length() + l += p.field12Length() + l += p.field13Length() + l += p.field14Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TWaitingTxnStatusRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TMetadataTableRequestParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDbId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db_id", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.DbId) + if p.IsSetMetadataType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "metadata_type", thrift.I32, 1) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.MetadataType)) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TWaitingTxnStatusRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TMetadataTableRequestParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetTxnId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "txn_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.TxnId) + if p.IsSetIcebergMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "iceberg_metadata_params", thrift.STRUCT, 2) + offset += p.IcebergMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} +func (p *TMetadataTableRequestParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetBackendsMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "backends_metadata_params", thrift.STRUCT, 3) + offset += p.BackendsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TWaitingTxnStatusRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TMetadataTableRequestParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetLabel() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "label", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Label) + if p.IsSetColumnsName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columns_name", thrift.LIST, 4) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + var length int + for _, v := range p.ColumnsName { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TWaitingTxnStatusRequest) field1Length() int { - l := 0 - if p.IsSetDbId() { - l += bthrift.Binary.FieldBeginLength("db_id", thrift.I64, 1) - l += bthrift.Binary.I64Length(*p.DbId) +func (p *TMetadataTableRequestParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetFrontendsMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "frontends_metadata_params", thrift.STRUCT, 5) + offset += p.FrontendsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} - l += bthrift.Binary.FieldEndLength() +func (p *TMetadataTableRequestParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCurrentUserIdent() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 6) + offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TWaitingTxnStatusRequest) field2Length() int { +func (p *TMetadataTableRequestParams) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetQueriesMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "queries_metadata_params", thrift.STRUCT, 7) + offset += p.QueriesMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetMaterializedViewsMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "materialized_views_metadata_params", thrift.STRUCT, 8) + offset += p.MaterializedViewsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetJobsMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "jobs_metadata_params", thrift.STRUCT, 9) + offset += p.JobsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTasksMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tasks_metadata_params", thrift.STRUCT, 10) + offset += p.TasksMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPartitionsMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "partitions_metadata_params", thrift.STRUCT, 11) + offset += p.PartitionsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetMetaCacheStatsParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "meta_cache_stats_params", thrift.STRUCT, 12) + offset += p.MetaCacheStatsParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) fastWriteField13(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPartitionValuesMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "partition_values_metadata_params", thrift.STRUCT, 13) + offset += p.PartitionValuesMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) fastWriteField14(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetHudiMetadataParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "hudi_metadata_params", thrift.STRUCT, 14) + offset += p.HudiMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMetadataTableRequestParams) field1Length() int { l := 0 - if p.IsSetTxnId() { - l += bthrift.Binary.FieldBeginLength("txn_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(*p.TxnId) + if p.IsSetMetadataType() { + l += bthrift.Binary.FieldBeginLength("metadata_type", thrift.I32, 1) + l += bthrift.Binary.I32Length(int32(*p.MetadataType)) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TWaitingTxnStatusRequest) field3Length() int { +func (p *TMetadataTableRequestParams) field2Length() int { l := 0 - if p.IsSetLabel() { - l += bthrift.Binary.FieldBeginLength("label", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(*p.Label) - + if p.IsSetIcebergMetadataParams() { + l += bthrift.Binary.FieldBeginLength("iceberg_metadata_params", thrift.STRUCT, 2) + l += p.IcebergMetadataParams.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TWaitingTxnStatusResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError +func (p *TMetadataTableRequestParams) field3Length() int { + l := 0 + if p.IsSetBackendsMetadataParams() { + l += bthrift.Binary.FieldBeginLength("backends_metadata_params", thrift.STRUCT, 3) + l += p.BackendsMetadataParams.BLength() + l += bthrift.Binary.FieldEndLength() } + return l +} - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } +func (p *TMetadataTableRequestParams) field4Length() int { + l := 0 + if p.IsSetColumnsName() { + l += bthrift.Binary.FieldBeginLength("columns_name", thrift.LIST, 4) + l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.ColumnsName)) + for _, v := range p.ColumnsName { + l += bthrift.Binary.StringLengthNocopy(v) - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TWaitingTxnStatusResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + return l } -func (p *TWaitingTxnStatusResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l +func (p *TMetadataTableRequestParams) field5Length() int { + l := 0 + if p.IsSetFrontendsMetadataParams() { + l += bthrift.Binary.FieldBeginLength("frontends_metadata_params", thrift.STRUCT, 5) + l += p.FrontendsMetadataParams.BLength() + l += bthrift.Binary.FieldEndLength() } - p.Status = tmp - return offset, nil + return l } -func (p *TWaitingTxnStatusResult_) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.TxnStatusId = &v - +func (p *TMetadataTableRequestParams) field6Length() int { + l := 0 + if p.IsSetCurrentUserIdent() { + l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 6) + l += p.CurrentUserIdent.BLength() + l += bthrift.Binary.FieldEndLength() } - return offset, nil + return l } -// for compatibility -func (p *TWaitingTxnStatusResult_) FastWrite(buf []byte) int { - return 0 +func (p *TMetadataTableRequestParams) field7Length() int { + l := 0 + if p.IsSetQueriesMetadataParams() { + l += bthrift.Binary.FieldBeginLength("queries_metadata_params", thrift.STRUCT, 7) + l += p.QueriesMetadataParams.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l } -func (p *TWaitingTxnStatusResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TWaitingTxnStatusResult") - if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) +func (p *TMetadataTableRequestParams) field8Length() int { + l := 0 + if p.IsSetMaterializedViewsMetadataParams() { + l += bthrift.Binary.FieldBeginLength("materialized_views_metadata_params", thrift.STRUCT, 8) + l += p.MaterializedViewsMetadataParams.BLength() + l += bthrift.Binary.FieldEndLength() } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset + return l } -func (p *TWaitingTxnStatusResult_) BLength() int { +func (p *TMetadataTableRequestParams) field9Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TWaitingTxnStatusResult") - if p != nil { - l += p.field1Length() - l += p.field2Length() + if p.IsSetJobsMetadataParams() { + l += bthrift.Binary.FieldBeginLength("jobs_metadata_params", thrift.STRUCT, 9) + l += p.JobsMetadataParams.BLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TWaitingTxnStatusResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetStatus() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TMetadataTableRequestParams) field10Length() int { + l := 0 + if p.IsSetTasksMetadataParams() { + l += bthrift.Binary.FieldBeginLength("tasks_metadata_params", thrift.STRUCT, 10) + l += p.TasksMetadataParams.BLength() + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TWaitingTxnStatusResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetTxnStatusId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "txn_status_id", thrift.I32, 2) - offset += bthrift.Binary.WriteI32(buf[offset:], *p.TxnStatusId) +func (p *TMetadataTableRequestParams) field11Length() int { + l := 0 + if p.IsSetPartitionsMetadataParams() { + l += bthrift.Binary.FieldBeginLength("partitions_metadata_params", thrift.STRUCT, 11) + l += p.PartitionsMetadataParams.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TMetadataTableRequestParams) field12Length() int { + l := 0 + if p.IsSetMetaCacheStatsParams() { + l += bthrift.Binary.FieldBeginLength("meta_cache_stats_params", thrift.STRUCT, 12) + l += p.MetaCacheStatsParams.BLength() + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TWaitingTxnStatusResult_) field1Length() int { +func (p *TMetadataTableRequestParams) field13Length() int { l := 0 - if p.IsSetStatus() { - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() + if p.IsSetPartitionValuesMetadataParams() { + l += bthrift.Binary.FieldBeginLength("partition_values_metadata_params", thrift.STRUCT, 13) + l += p.PartitionValuesMetadataParams.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TWaitingTxnStatusResult_) field2Length() int { +func (p *TMetadataTableRequestParams) field14Length() int { l := 0 - if p.IsSetTxnStatusId() { - l += bthrift.Binary.FieldBeginLength("txn_status_id", thrift.I32, 2) - l += bthrift.Binary.I32Length(*p.TxnStatusId) - + if p.IsSetHudiMetadataParams() { + l += bthrift.Binary.FieldBeginLength("hudi_metadata_params", thrift.STRUCT, 14) + l += p.HudiMetadataParams.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TInitExternalCtlMetaRequest) FastRead(buf []byte) (int, error) { +func (p *TSchemaTableRequestParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -33562,7 +30274,7 @@ func (p *TInitExternalCtlMetaRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -33576,7 +30288,7 @@ func (p *TInitExternalCtlMetaRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -33590,7 +30302,7 @@ func (p *TInitExternalCtlMetaRequest) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.BOOL { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -33603,6 +30315,34 @@ func (p *TInitExternalCtlMetaRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -33629,7 +30369,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TInitExternalCtlMetaRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSchemaTableRequestParams[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -33638,327 +30378,244 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TInitExternalCtlMetaRequest) FastReadField1(buf []byte) (int, error) { +func (p *TSchemaTableRequestParams) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.ColumnsName = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.ColumnsName = append(p.ColumnsName, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.CatalogId = &v + } + return offset, nil +} + +func (p *TSchemaTableRequestParams) FastReadField2(buf []byte) (int, error) { + offset := 0 + tmp := types.NewTUserIdentity() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } + p.CurrentUserIdent = tmp return offset, nil } -func (p *TInitExternalCtlMetaRequest) FastReadField2(buf []byte) (int, error) { +func (p *TSchemaTableRequestParams) FastReadField3(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { return offset, err } else { offset += l - p.DbId = &v + p.ReplayToOtherFe = &v } return offset, nil } -func (p *TInitExternalCtlMetaRequest) FastReadField3(buf []byte) (int, error) { +func (p *TSchemaTableRequestParams) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Catalog = &v + + } + return offset, nil +} + +func (p *TSchemaTableRequestParams) FastReadField5(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.TableId = &v + p.DbId = &v } return offset, nil } // for compatibility -func (p *TInitExternalCtlMetaRequest) FastWrite(buf []byte) int { +func (p *TSchemaTableRequestParams) FastWrite(buf []byte) int { return 0 } -func (p *TInitExternalCtlMetaRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TSchemaTableRequestParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TInitExternalCtlMetaRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSchemaTableRequestParams") if p != nil { + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TInitExternalCtlMetaRequest) BLength() int { +func (p *TSchemaTableRequestParams) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TInitExternalCtlMetaRequest") + l += bthrift.Binary.StructBeginLength("TSchemaTableRequestParams") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TInitExternalCtlMetaRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TSchemaTableRequestParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCatalogId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalogId", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.CatalogId) + if p.IsSetColumnsName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columns_name", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + var length int + for _, v := range p.ColumnsName { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TInitExternalCtlMetaRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TSchemaTableRequestParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDbId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dbId", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.DbId) - + if p.IsSetCurrentUserIdent() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 2) + offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TInitExternalCtlMetaRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TSchemaTableRequestParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetTableId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tableId", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.TableId) + if p.IsSetReplayToOtherFe() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replay_to_other_fe", thrift.BOOL, 3) + offset += bthrift.Binary.WriteBool(buf[offset:], *p.ReplayToOtherFe) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TInitExternalCtlMetaRequest) field1Length() int { - l := 0 - if p.IsSetCatalogId() { - l += bthrift.Binary.FieldBeginLength("catalogId", thrift.I64, 1) - l += bthrift.Binary.I64Length(*p.CatalogId) +func (p *TSchemaTableRequestParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCatalog() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TInitExternalCtlMetaRequest) field2Length() int { - l := 0 +func (p *TSchemaTableRequestParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 if p.IsSetDbId() { - l += bthrift.Binary.FieldBeginLength("dbId", thrift.I64, 2) - l += bthrift.Binary.I64Length(*p.DbId) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dbId", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.DbId) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TInitExternalCtlMetaRequest) field3Length() int { +func (p *TSchemaTableRequestParams) field1Length() int { l := 0 - if p.IsSetTableId() { - l += bthrift.Binary.FieldBeginLength("tableId", thrift.I64, 3) - l += bthrift.Binary.I64Length(*p.TableId) + if p.IsSetColumnsName() { + l += bthrift.Binary.FieldBeginLength("columns_name", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.ColumnsName)) + for _, v := range p.ColumnsName { + l += bthrift.Binary.StringLengthNocopy(v) + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TInitExternalCtlMetaResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TInitExternalCtlMetaResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TInitExternalCtlMetaResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.MaxJournalId = &v - - } - return offset, nil -} - -func (p *TInitExternalCtlMetaResult_) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Status = &v - - } - return offset, nil -} - -// for compatibility -func (p *TInitExternalCtlMetaResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TInitExternalCtlMetaResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TInitExternalCtlMetaResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TInitExternalCtlMetaResult_) BLength() int { +func (p *TSchemaTableRequestParams) field2Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TInitExternalCtlMetaResult") - if p != nil { - l += p.field1Length() - l += p.field2Length() + if p.IsSetCurrentUserIdent() { + l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 2) + l += p.CurrentUserIdent.BLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TInitExternalCtlMetaResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetMaxJournalId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "maxJournalId", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.MaxJournalId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TInitExternalCtlMetaResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetStatus() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Status) +func (p *TSchemaTableRequestParams) field3Length() int { + l := 0 + if p.IsSetReplayToOtherFe() { + l += bthrift.Binary.FieldBeginLength("replay_to_other_fe", thrift.BOOL, 3) + l += bthrift.Binary.BoolLength(*p.ReplayToOtherFe) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TInitExternalCtlMetaResult_) field1Length() int { +func (p *TSchemaTableRequestParams) field4Length() int { l := 0 - if p.IsSetMaxJournalId() { - l += bthrift.Binary.FieldBeginLength("maxJournalId", thrift.I64, 1) - l += bthrift.Binary.I64Length(*p.MaxJournalId) + if p.IsSetCatalog() { + l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.Catalog) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TInitExternalCtlMetaResult_) field2Length() int { +func (p *TSchemaTableRequestParams) field5Length() int { l := 0 - if p.IsSetStatus() { - l += bthrift.Binary.FieldBeginLength("status", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.Status) + if p.IsSetDbId() { + l += bthrift.Binary.FieldBeginLength("dbId", thrift.I64, 5) + l += bthrift.Binary.I64Length(*p.DbId) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TMetadataTableRequestParams) FastRead(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -33981,7 +30638,7 @@ func (p *TMetadataTableRequestParams) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -33994,135 +30651,9 @@ func (p *TMetadataTableRequestParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField7(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 8: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField8(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 9: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField9(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 10: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField10(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 11: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField11(buf[offset:]) + case 2: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -34134,9 +30665,9 @@ func (p *TMetadataTableRequestParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 12: + case 3: if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField12(buf[offset:]) + l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -34148,9 +30679,9 @@ func (p *TMetadataTableRequestParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 13: + case 4: if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField13(buf[offset:]) + l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -34188,7 +30719,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TMetadataTableRequestParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFetchSchemaTableDataRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -34197,522 +30728,570 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TMetadataTableRequestParams) FastReadField1(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - - tmp := types.TMetadataType(v) - p.MetadataType = &tmp + p.ClusterName = &v } return offset, nil } -func (p *TMetadataTableRequestParams) FastReadField2(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) FastReadField2(buf []byte) (int, error) { offset := 0 - tmp := plannodes.NewTIcebergMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l + + tmp := TSchemaTableName(v) + p.SchemaTableName = &tmp + } - p.IcebergMetadataParams = tmp return offset, nil } -func (p *TMetadataTableRequestParams) FastReadField3(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) FastReadField3(buf []byte) (int, error) { offset := 0 - tmp := plannodes.NewTBackendsMetadataParams() + tmp := NewTMetadataTableRequestParams() if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.BackendsMetadataParams = tmp + p.MetadaTableParams = tmp return offset, nil } -func (p *TMetadataTableRequestParams) FastReadField4(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) FastReadField4(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ColumnsName = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.ColumnsName = append(p.ColumnsName, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + tmp := NewTSchemaTableRequestParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } + p.SchemaTableParams = tmp return offset, nil } -func (p *TMetadataTableRequestParams) FastReadField5(buf []byte) (int, error) { +// for compatibility +func (p *TFetchSchemaTableDataRequest) FastWrite(buf []byte) int { + return 0 +} + +func (p *TFetchSchemaTableDataRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFetchSchemaTableDataRequest") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} - tmp := plannodes.NewTFrontendsMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l +func (p *TFetchSchemaTableDataRequest) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TFetchSchemaTableDataRequest") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() } - p.FrontendsMetadataParams = tmp - return offset, nil + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l } -func (p *TMetadataTableRequestParams) FastReadField6(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetClusterName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cluster_name", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.ClusterName) - tmp := types.NewTUserIdentity() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - p.CurrentUserIdent = tmp - return offset, nil + return offset } -func (p *TMetadataTableRequestParams) FastReadField7(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetSchemaTableName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "schema_table_name", thrift.I32, 2) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.SchemaTableName)) - tmp := plannodes.NewTQueriesMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - p.QueriesMetadataParams = tmp - return offset, nil + return offset } -func (p *TMetadataTableRequestParams) FastReadField8(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - - tmp := plannodes.NewTMaterializedViewsMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + if p.IsSetMetadaTableParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "metada_table_params", thrift.STRUCT, 3) + offset += p.MetadaTableParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - p.MaterializedViewsMetadataParams = tmp - return offset, nil + return offset } -func (p *TMetadataTableRequestParams) FastReadField9(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetSchemaTableParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "schema_table_params", thrift.STRUCT, 4) + offset += p.SchemaTableParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} - tmp := plannodes.NewTJobsMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l +func (p *TFetchSchemaTableDataRequest) field1Length() int { + l := 0 + if p.IsSetClusterName() { + l += bthrift.Binary.FieldBeginLength("cluster_name", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.ClusterName) + + l += bthrift.Binary.FieldEndLength() } - p.JobsMetadataParams = tmp - return offset, nil + return l } -func (p *TMetadataTableRequestParams) FastReadField10(buf []byte) (int, error) { - offset := 0 +func (p *TFetchSchemaTableDataRequest) field2Length() int { + l := 0 + if p.IsSetSchemaTableName() { + l += bthrift.Binary.FieldBeginLength("schema_table_name", thrift.I32, 2) + l += bthrift.Binary.I32Length(int32(*p.SchemaTableName)) - tmp := plannodes.NewTTasksMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + l += bthrift.Binary.FieldEndLength() } - p.TasksMetadataParams = tmp - return offset, nil + return l } -func (p *TMetadataTableRequestParams) FastReadField11(buf []byte) (int, error) { - offset := 0 +func (p *TFetchSchemaTableDataRequest) field3Length() int { + l := 0 + if p.IsSetMetadaTableParams() { + l += bthrift.Binary.FieldBeginLength("metada_table_params", thrift.STRUCT, 3) + l += p.MetadaTableParams.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} - tmp := plannodes.NewTPartitionsMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { +func (p *TFetchSchemaTableDataRequest) field4Length() int { + l := 0 + if p.IsSetSchemaTableParams() { + l += bthrift.Binary.FieldBeginLength("schema_table_params", thrift.STRUCT, 4) + l += p.SchemaTableParams.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TFetchSchemaTableDataResult_) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + var issetStatus bool = false + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetStatus = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + if !issetStatus { + fieldId = 1 + goto RequiredFieldNotSetError } - p.PartitionsMetadataParams = tmp return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFetchSchemaTableDataResult_[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFetchSchemaTableDataResult_[fieldId])) } -func (p *TMetadataTableRequestParams) FastReadField12(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := plannodes.NewTMetaCacheStatsParams() + tmp := status.NewTStatus() if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.MetaCacheStatsParams = tmp + p.Status = tmp return offset, nil } -func (p *TMetadataTableRequestParams) FastReadField13(buf []byte) (int, error) { +func (p *TFetchSchemaTableDataResult_) FastReadField2(buf []byte) (int, error) { offset := 0 - tmp := plannodes.NewTPartitionValuesMetadataParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.DataBatch = make([]*data.TRow, 0, size) + for i := 0; i < size; i++ { + _elem := data.NewTRow() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.DataBatch = append(p.DataBatch, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.PartitionValuesMetadataParams = tmp return offset, nil } // for compatibility -func (p *TMetadataTableRequestParams) FastWrite(buf []byte) int { +func (p *TFetchSchemaTableDataResult_) FastWrite(buf []byte) int { return 0 } -func (p *TMetadataTableRequestParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFetchSchemaTableDataResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TMetadataTableRequestParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFetchSchemaTableDataResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField8(buf[offset:], binaryWriter) - offset += p.fastWriteField9(buf[offset:], binaryWriter) - offset += p.fastWriteField10(buf[offset:], binaryWriter) - offset += p.fastWriteField11(buf[offset:], binaryWriter) - offset += p.fastWriteField12(buf[offset:], binaryWriter) - offset += p.fastWriteField13(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TMetadataTableRequestParams) BLength() int { +func (p *TFetchSchemaTableDataResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TMetadataTableRequestParams") + l += bthrift.Binary.StructBeginLength("TFetchSchemaTableDataResult") if p != nil { l += p.field1Length() l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() - l += p.field8Length() - l += p.field9Length() - l += p.field10Length() - l += p.field11Length() - l += p.field12Length() - l += p.field13Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TMetadataTableRequestParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetMetadataType() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "metadata_type", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.MetadataType)) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TMetadataTableRequestParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetIcebergMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "iceberg_metadata_params", thrift.STRUCT, 2) - offset += p.IcebergMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TMetadataTableRequestParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFetchSchemaTableDataResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetBackendsMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "backends_metadata_params", thrift.STRUCT, 3) - offset += p.BackendsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) + offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TMetadataTableRequestParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TFetchSchemaTableDataResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetColumnsName() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columns_name", thrift.LIST, 4) + if p.IsSetDataBatch() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "data_batch", thrift.LIST, 2) listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) var length int - for _, v := range p.ColumnsName { + for _, v := range p.DataBatch { length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) - + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TMetadataTableRequestParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetFrontendsMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "frontends_metadata_params", thrift.STRUCT, 5) - offset += p.FrontendsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TMetadataTableRequestParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCurrentUserIdent() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 6) - offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset +func (p *TFetchSchemaTableDataResult_) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) + l += p.Status.BLength() + l += bthrift.Binary.FieldEndLength() + return l } -func (p *TMetadataTableRequestParams) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetQueriesMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "queries_metadata_params", thrift.STRUCT, 7) - offset += p.QueriesMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TFetchSchemaTableDataResult_) field2Length() int { + l := 0 + if p.IsSetDataBatch() { + l += bthrift.Binary.FieldBeginLength("data_batch", thrift.LIST, 2) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.DataBatch)) + for _, v := range p.DataBatch { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TMetadataTableRequestParams) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetMaterializedViewsMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "materialized_views_metadata_params", thrift.STRUCT, 8) - offset += p.MaterializedViewsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TMySqlLoadAcquireTokenResult_) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError } - return offset -} -func (p *TMetadataTableRequestParams) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetJobsMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "jobs_metadata_params", thrift.STRUCT, 9) - offset += p.JobsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } -func (p *TMetadataTableRequestParams) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetTasksMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tasks_metadata_params", thrift.STRUCT, 10) - offset += p.TasksMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } } - return offset -} - -func (p *TMetadataTableRequestParams) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetPartitionsMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "partitions_metadata_params", thrift.STRUCT, 11) - offset += p.PartitionsMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError } - return offset -} -func (p *TMetadataTableRequestParams) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetMetaCacheStatsParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "meta_cache_stats_params", thrift.STRUCT, 12) - offset += p.MetaCacheStatsParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TMySqlLoadAcquireTokenResult_[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TMetadataTableRequestParams) fastWriteField13(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TMySqlLoadAcquireTokenResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if p.IsSetPartitionValuesMetadataParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "partition_values_metadata_params", thrift.STRUCT, 13) - offset += p.PartitionValuesMetadataParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TMetadataTableRequestParams) field1Length() int { - l := 0 - if p.IsSetMetadataType() { - l += bthrift.Binary.FieldBeginLength("metadata_type", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(*p.MetadataType)) - - l += bthrift.Binary.FieldEndLength() - } - return l -} -func (p *TMetadataTableRequestParams) field2Length() int { - l := 0 - if p.IsSetIcebergMetadataParams() { - l += bthrift.Binary.FieldBeginLength("iceberg_metadata_params", thrift.STRUCT, 2) - l += p.IcebergMetadataParams.BLength() - l += bthrift.Binary.FieldEndLength() + tmp := status.NewTStatus() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l } - return l + p.Status = tmp + return offset, nil } -func (p *TMetadataTableRequestParams) field3Length() int { - l := 0 - if p.IsSetBackendsMetadataParams() { - l += bthrift.Binary.FieldBeginLength("backends_metadata_params", thrift.STRUCT, 3) - l += p.BackendsMetadataParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} +func (p *TMySqlLoadAcquireTokenResult_) FastReadField2(buf []byte) (int, error) { + offset := 0 -func (p *TMetadataTableRequestParams) field4Length() int { - l := 0 - if p.IsSetColumnsName() { - l += bthrift.Binary.FieldBeginLength("columns_name", thrift.LIST, 4) - l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.ColumnsName)) - for _, v := range p.ColumnsName { - l += bthrift.Binary.StringLengthNocopy(v) + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Token = &v - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() } - return l + return offset, nil } -func (p *TMetadataTableRequestParams) field5Length() int { - l := 0 - if p.IsSetFrontendsMetadataParams() { - l += bthrift.Binary.FieldBeginLength("frontends_metadata_params", thrift.STRUCT, 5) - l += p.FrontendsMetadataParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l +// for compatibility +func (p *TMySqlLoadAcquireTokenResult_) FastWrite(buf []byte) int { + return 0 } -func (p *TMetadataTableRequestParams) field6Length() int { - l := 0 - if p.IsSetCurrentUserIdent() { - l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 6) - l += p.CurrentUserIdent.BLength() - l += bthrift.Binary.FieldEndLength() +func (p *TMySqlLoadAcquireTokenResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TMySqlLoadAcquireTokenResult") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) } - return l + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset } -func (p *TMetadataTableRequestParams) field7Length() int { +func (p *TMySqlLoadAcquireTokenResult_) BLength() int { l := 0 - if p.IsSetQueriesMetadataParams() { - l += bthrift.Binary.FieldBeginLength("queries_metadata_params", thrift.STRUCT, 7) - l += p.QueriesMetadataParams.BLength() - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.StructBeginLength("TMySqlLoadAcquireTokenResult") + if p != nil { + l += p.field1Length() + l += p.field2Length() } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() return l } -func (p *TMetadataTableRequestParams) field8Length() int { - l := 0 - if p.IsSetMaterializedViewsMetadataParams() { - l += bthrift.Binary.FieldBeginLength("materialized_views_metadata_params", thrift.STRUCT, 8) - l += p.MaterializedViewsMetadataParams.BLength() - l += bthrift.Binary.FieldEndLength() +func (p *TMySqlLoadAcquireTokenResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetStatus() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) + offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TMetadataTableRequestParams) field9Length() int { - l := 0 - if p.IsSetJobsMetadataParams() { - l += bthrift.Binary.FieldBeginLength("jobs_metadata_params", thrift.STRUCT, 9) - l += p.JobsMetadataParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} +func (p *TMySqlLoadAcquireTokenResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetToken() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Token) -func (p *TMetadataTableRequestParams) field10Length() int { - l := 0 - if p.IsSetTasksMetadataParams() { - l += bthrift.Binary.FieldBeginLength("tasks_metadata_params", thrift.STRUCT, 10) - l += p.TasksMetadataParams.BLength() - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TMetadataTableRequestParams) field11Length() int { +func (p *TMySqlLoadAcquireTokenResult_) field1Length() int { l := 0 - if p.IsSetPartitionsMetadataParams() { - l += bthrift.Binary.FieldBeginLength("partitions_metadata_params", thrift.STRUCT, 11) - l += p.PartitionsMetadataParams.BLength() + if p.IsSetStatus() { + l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) + l += p.Status.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TMetadataTableRequestParams) field12Length() int { +func (p *TMySqlLoadAcquireTokenResult_) field2Length() int { l := 0 - if p.IsSetMetaCacheStatsParams() { - l += bthrift.Binary.FieldBeginLength("meta_cache_stats_params", thrift.STRUCT, 12) - l += p.MetaCacheStatsParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} + if p.IsSetToken() { + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.Token) -func (p *TMetadataTableRequestParams) field13Length() int { - l := 0 - if p.IsSetPartitionValuesMetadataParams() { - l += bthrift.Binary.FieldBeginLength("partition_values_metadata_params", thrift.STRUCT, 13) - l += p.PartitionValuesMetadataParams.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TSchemaTableRequestParams) FastRead(buf []byte) (int, error) { +func (p *TTabletCooldownInfo) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -34735,7 +31314,7 @@ func (p *TSchemaTableRequestParams) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -34749,7 +31328,7 @@ func (p *TSchemaTableRequestParams) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -34763,7 +31342,7 @@ func (p *TSchemaTableRequestParams) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.BOOL { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -34776,34 +31355,6 @@ func (p *TSchemaTableRequestParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 4: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -34830,7 +31381,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TSchemaTableRequestParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletCooldownInfo[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -34839,244 +31390,141 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TSchemaTableRequestParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ColumnsName = make([]string, 0, size) - for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.ColumnsName = append(p.ColumnsName, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TSchemaTableRequestParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUserIdentity() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.CurrentUserIdent = tmp - return offset, nil -} - -func (p *TSchemaTableRequestParams) FastReadField3(buf []byte) (int, error) { +func (p *TTabletCooldownInfo) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.ReplayToOtherFe = &v + p.TabletId = &v } return offset, nil } -func (p *TSchemaTableRequestParams) FastReadField4(buf []byte) (int, error) { +func (p *TTabletCooldownInfo) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Catalog = &v + p.CooldownReplicaId = &v } return offset, nil } -func (p *TSchemaTableRequestParams) FastReadField5(buf []byte) (int, error) { +func (p *TTabletCooldownInfo) FastReadField3(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + tmp := types.NewTUniqueId() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - p.DbId = &v - } + p.CooldownMetaId = tmp return offset, nil } // for compatibility -func (p *TSchemaTableRequestParams) FastWrite(buf []byte) int { +func (p *TTabletCooldownInfo) FastWrite(buf []byte) int { return 0 } -func (p *TSchemaTableRequestParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTabletCooldownInfo) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TSchemaTableRequestParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletCooldownInfo") if p != nil { - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TSchemaTableRequestParams) BLength() int { +func (p *TTabletCooldownInfo) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TSchemaTableRequestParams") + l += bthrift.Binary.StructBeginLength("TTabletCooldownInfo") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() - l += p.field4Length() - l += p.field5Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TSchemaTableRequestParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetColumnsName() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "columns_name", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRING, 0) - var length int - for _, v := range p.ColumnsName { - length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRING, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TSchemaTableRequestParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCurrentUserIdent() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "current_user_ident", thrift.STRUCT, 2) - offset += p.CurrentUserIdent.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TSchemaTableRequestParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTabletCooldownInfo) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetReplayToOtherFe() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replay_to_other_fe", thrift.BOOL, 3) - offset += bthrift.Binary.WriteBool(buf[offset:], *p.ReplayToOtherFe) + if p.IsSetTabletId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tablet_id", thrift.I64, 1) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.TabletId) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TSchemaTableRequestParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTabletCooldownInfo) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCatalog() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 4) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) + if p.IsSetCooldownReplicaId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cooldown_replica_id", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.CooldownReplicaId) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TSchemaTableRequestParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTabletCooldownInfo) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDbId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "dbId", thrift.I64, 5) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.DbId) - + if p.IsSetCooldownMetaId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cooldown_meta_id", thrift.STRUCT, 3) + offset += p.CooldownMetaId.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TSchemaTableRequestParams) field1Length() int { - l := 0 - if p.IsSetColumnsName() { - l += bthrift.Binary.FieldBeginLength("columns_name", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRING, len(p.ColumnsName)) - for _, v := range p.ColumnsName { - l += bthrift.Binary.StringLengthNocopy(v) - - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TSchemaTableRequestParams) field2Length() int { - l := 0 - if p.IsSetCurrentUserIdent() { - l += bthrift.Binary.FieldBeginLength("current_user_ident", thrift.STRUCT, 2) - l += p.CurrentUserIdent.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TSchemaTableRequestParams) field3Length() int { +func (p *TTabletCooldownInfo) field1Length() int { l := 0 - if p.IsSetReplayToOtherFe() { - l += bthrift.Binary.FieldBeginLength("replay_to_other_fe", thrift.BOOL, 3) - l += bthrift.Binary.BoolLength(*p.ReplayToOtherFe) + if p.IsSetTabletId() { + l += bthrift.Binary.FieldBeginLength("tablet_id", thrift.I64, 1) + l += bthrift.Binary.I64Length(*p.TabletId) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TSchemaTableRequestParams) field4Length() int { +func (p *TTabletCooldownInfo) field2Length() int { l := 0 - if p.IsSetCatalog() { - l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 4) - l += bthrift.Binary.StringLengthNocopy(*p.Catalog) + if p.IsSetCooldownReplicaId() { + l += bthrift.Binary.FieldBeginLength("cooldown_replica_id", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.CooldownReplicaId) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TSchemaTableRequestParams) field5Length() int { +func (p *TTabletCooldownInfo) field3Length() int { l := 0 - if p.IsSetDbId() { - l += bthrift.Binary.FieldBeginLength("dbId", thrift.I64, 5) - l += bthrift.Binary.I64Length(*p.DbId) - + if p.IsSetCooldownMetaId() { + l += bthrift.Binary.FieldBeginLength("cooldown_meta_id", thrift.STRUCT, 3) + l += p.CooldownMetaId.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TFetchSchemaTableDataRequest) FastRead(buf []byte) (int, error) { +func (p *TConfirmUnusedRemoteFilesRequest) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -35099,7 +31547,7 @@ func (p *TFetchSchemaTableDataRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -35112,48 +31560,6 @@ func (p *TFetchSchemaTableDataRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 2: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -35180,193 +31586,107 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFetchSchemaTableDataRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TConfirmUnusedRemoteFilesRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TFetchSchemaTableDataRequest) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.ClusterName = &v - - } - return offset, nil -} - -func (p *TFetchSchemaTableDataRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - tmp := TSchemaTableName(v) - p.SchemaTableName = &tmp - - } - return offset, nil +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TFetchSchemaTableDataRequest) FastReadField3(buf []byte) (int, error) { +func (p *TConfirmUnusedRemoteFilesRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := NewTMetadataTableRequestParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l } - p.MetadaTableParams = tmp - return offset, nil -} - -func (p *TFetchSchemaTableDataRequest) FastReadField4(buf []byte) (int, error) { - offset := 0 + p.ConfirmList = make([]*TTabletCooldownInfo, 0, size) + for i := 0; i < size; i++ { + _elem := NewTTabletCooldownInfo() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } - tmp := NewTSchemaTableRequestParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + p.ConfirmList = append(p.ConfirmList, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.SchemaTableParams = tmp return offset, nil } // for compatibility -func (p *TFetchSchemaTableDataRequest) FastWrite(buf []byte) int { +func (p *TConfirmUnusedRemoteFilesRequest) FastWrite(buf []byte) int { return 0 } -func (p *TFetchSchemaTableDataRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TConfirmUnusedRemoteFilesRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFetchSchemaTableDataRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TConfirmUnusedRemoteFilesRequest") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TFetchSchemaTableDataRequest) BLength() int { +func (p *TConfirmUnusedRemoteFilesRequest) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TFetchSchemaTableDataRequest") + l += bthrift.Binary.StructBeginLength("TConfirmUnusedRemoteFilesRequest") if p != nil { l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TFetchSchemaTableDataRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetClusterName() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cluster_name", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.ClusterName) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TFetchSchemaTableDataRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetSchemaTableName() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "schema_table_name", thrift.I32, 2) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.SchemaTableName)) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TFetchSchemaTableDataRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetMetadaTableParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "metada_table_params", thrift.STRUCT, 3) - offset += p.MetadaTableParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TFetchSchemaTableDataRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TConfirmUnusedRemoteFilesRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetSchemaTableParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "schema_table_params", thrift.STRUCT, 4) - offset += p.SchemaTableParams.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetConfirmList() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "confirm_list", thrift.LIST, 1) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.ConfirmList { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TFetchSchemaTableDataRequest) field1Length() int { - l := 0 - if p.IsSetClusterName() { - l += bthrift.Binary.FieldBeginLength("cluster_name", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.ClusterName) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TFetchSchemaTableDataRequest) field2Length() int { - l := 0 - if p.IsSetSchemaTableName() { - l += bthrift.Binary.FieldBeginLength("schema_table_name", thrift.I32, 2) - l += bthrift.Binary.I32Length(int32(*p.SchemaTableName)) - - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TFetchSchemaTableDataRequest) field3Length() int { - l := 0 - if p.IsSetMetadaTableParams() { - l += bthrift.Binary.FieldBeginLength("metada_table_params", thrift.STRUCT, 3) - l += p.MetadaTableParams.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TFetchSchemaTableDataRequest) field4Length() int { +func (p *TConfirmUnusedRemoteFilesRequest) field1Length() int { l := 0 - if p.IsSetSchemaTableParams() { - l += bthrift.Binary.FieldBeginLength("schema_table_params", thrift.STRUCT, 4) - l += p.SchemaTableParams.BLength() + if p.IsSetConfirmList() { + l += bthrift.Binary.FieldBeginLength("confirm_list", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.ConfirmList)) + for _, v := range p.ConfirmList { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TFetchSchemaTableDataResult_) FastRead(buf []byte) (int, error) { +func (p *TConfirmUnusedRemoteFilesResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetStatus bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -35384,23 +31704,8 @@ func (p *TFetchSchemaTableDataResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetStatus = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: if fieldTypeId == thrift.LIST { - l, err = p.FastReadField2(buf[offset:]) + l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -35432,41 +31737,22 @@ func (p *TFetchSchemaTableDataResult_) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFetchSchemaTableDataResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TConfirmUnusedRemoteFilesResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFetchSchemaTableDataResult_[fieldId])) -} - -func (p *TFetchSchemaTableDataResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Status = tmp - return offset, nil } -func (p *TFetchSchemaTableDataResult_) FastReadField2(buf []byte) (int, error) { +func (p *TConfirmUnusedRemoteFilesResult_) FastReadField1(buf []byte) (int, error) { offset := 0 _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) @@ -35474,16 +31760,19 @@ func (p *TFetchSchemaTableDataResult_) FastReadField2(buf []byte) (int, error) { if err != nil { return offset, err } - p.DataBatch = make([]*data.TRow, 0, size) + p.ConfirmedTablets = make([]types.TTabletId, 0, size) for i := 0; i < size; i++ { - _elem := data.NewTRow() - if l, err := _elem.FastRead(buf[offset:]); err != nil { + var _elem types.TTabletId + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l + + _elem = v + } - p.DataBatch = append(p.DataBatch, _elem) + p.ConfirmedTablets = append(p.ConfirmedTablets, _elem) } if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err @@ -35494,88 +31783,71 @@ func (p *TFetchSchemaTableDataResult_) FastReadField2(buf []byte) (int, error) { } // for compatibility -func (p *TFetchSchemaTableDataResult_) FastWrite(buf []byte) int { +func (p *TConfirmUnusedRemoteFilesResult_) FastWrite(buf []byte) int { return 0 } -func (p *TFetchSchemaTableDataResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TConfirmUnusedRemoteFilesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFetchSchemaTableDataResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TConfirmUnusedRemoteFilesResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TFetchSchemaTableDataResult_) BLength() int { +func (p *TConfirmUnusedRemoteFilesResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TFetchSchemaTableDataResult") + l += bthrift.Binary.StructBeginLength("TConfirmUnusedRemoteFilesResult") if p != nil { l += p.field1Length() - l += p.field2Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TFetchSchemaTableDataResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TFetchSchemaTableDataResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TConfirmUnusedRemoteFilesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetDataBatch() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "data_batch", thrift.LIST, 2) + if p.IsSetConfirmedTablets() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "confirmed_tablets", thrift.LIST, 1) listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) var length int - for _, v := range p.DataBatch { + for _, v := range p.ConfirmedTablets { length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteI64(buf[offset:], v) + } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TFetchSchemaTableDataResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TFetchSchemaTableDataResult_) field2Length() int { +func (p *TConfirmUnusedRemoteFilesResult_) field1Length() int { l := 0 - if p.IsSetDataBatch() { - l += bthrift.Binary.FieldBeginLength("data_batch", thrift.LIST, 2) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.DataBatch)) - for _, v := range p.DataBatch { - l += v.BLength() - } + if p.IsSetConfirmedTablets() { + l += bthrift.Binary.FieldBeginLength("confirmed_tablets", thrift.LIST, 1) + l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.ConfirmedTablets)) + var tmpV types.TTabletId + l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.ConfirmedTablets) l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TMySqlLoadAcquireTokenResult_) FastRead(buf []byte) (int, error) { +func (p *TPrivilegeCtrl) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 + var issetPrivHier bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -35593,12 +31865,13 @@ func (p *TMySqlLoadAcquireTokenResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.I32 { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetPrivHier = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -35620,6 +31893,62 @@ func (p *TMySqlLoadAcquireTokenResult_) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.SET { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -35640,124 +31969,334 @@ func (p *TMySqlLoadAcquireTokenResult_) FastRead(buf []byte) (int, error) { goto ReadStructEndError } + if !issetPrivHier { + fieldId = 1 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TMySqlLoadAcquireTokenResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPrivilegeCtrl[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TPrivilegeCtrl[fieldId])) } -func (p *TMySqlLoadAcquireTokenResult_) FastReadField1(buf []byte) (int, error) { +func (p *TPrivilegeCtrl) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { return offset, err } else { offset += l + + p.PrivHier = TPrivilegeHier(v) + } - p.Status = tmp return offset, nil } -func (p *TMySqlLoadAcquireTokenResult_) FastReadField2(buf []byte) (int, error) { +func (p *TPrivilegeCtrl) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Token = &v + p.Ctl = &v + + } + return offset, nil +} + +func (p *TPrivilegeCtrl) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Db = &v + + } + return offset, nil +} + +func (p *TPrivilegeCtrl) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Tbl = &v + + } + return offset, nil +} + +func (p *TPrivilegeCtrl) FastReadField5(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadSetBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.Cols = make([]string, 0, size) + for i := 0; i < size; i++ { + var _elem string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _elem = v + + } + + p.Cols = append(p.Cols, _elem) + } + if l, err := bthrift.Binary.ReadSetEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil +} + +func (p *TPrivilegeCtrl) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Res = &v } return offset, nil } // for compatibility -func (p *TMySqlLoadAcquireTokenResult_) FastWrite(buf []byte) int { +func (p *TPrivilegeCtrl) FastWrite(buf []byte) int { return 0 } -func (p *TMySqlLoadAcquireTokenResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TPrivilegeCtrl) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TMySqlLoadAcquireTokenResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TPrivilegeCtrl") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *TPrivilegeCtrl) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TPrivilegeCtrl") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TPrivilegeCtrl) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "priv_hier", thrift.I32, 1) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.PrivHier)) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TPrivilegeCtrl) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCtl() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "ctl", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Ctl) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TPrivilegeCtrl) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDb() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Db) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TPrivilegeCtrl) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTbl() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tbl", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Tbl) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TPrivilegeCtrl) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCols() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cols", thrift.SET, 5) + setBeginOffset := offset + offset += bthrift.Binary.SetBeginLength(thrift.STRING, 0) + + for i := 0; i < len(p.Cols); i++ { + for j := i + 1; j < len(p.Cols); j++ { + if func(tgt, src string) bool { + if strings.Compare(tgt, src) != 0 { + return false + } + return true + }(p.Cols[i], p.Cols[j]) { + panic(fmt.Errorf("%T error writing set field: slice is not unique", p.Cols[i])) + } + } + } + var length int + for _, v := range p.Cols { + length++ + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + + } + bthrift.Binary.WriteSetBegin(buf[setBeginOffset:], thrift.STRING, length) + offset += bthrift.Binary.WriteSetEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TPrivilegeCtrl) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "res", thrift.STRING, 6) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Res) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TMySqlLoadAcquireTokenResult_) BLength() int { +func (p *TPrivilegeCtrl) field1Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TMySqlLoadAcquireTokenResult") - if p != nil { - l += p.field1Length() - l += p.field2Length() + l += bthrift.Binary.FieldBeginLength("priv_hier", thrift.I32, 1) + l += bthrift.Binary.I32Length(int32(p.PrivHier)) + + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *TPrivilegeCtrl) field2Length() int { + l := 0 + if p.IsSetCtl() { + l += bthrift.Binary.FieldBeginLength("ctl", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.Ctl) + + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TMySqlLoadAcquireTokenResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetStatus() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TPrivilegeCtrl) field3Length() int { + l := 0 + if p.IsSetDb() { + l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.Db) + + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TMySqlLoadAcquireTokenResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetToken() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Token) +func (p *TPrivilegeCtrl) field4Length() int { + l := 0 + if p.IsSetTbl() { + l += bthrift.Binary.FieldBeginLength("tbl", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.Tbl) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TMySqlLoadAcquireTokenResult_) field1Length() int { +func (p *TPrivilegeCtrl) field5Length() int { l := 0 - if p.IsSetStatus() { - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() + if p.IsSetCols() { + l += bthrift.Binary.FieldBeginLength("cols", thrift.SET, 5) + l += bthrift.Binary.SetBeginLength(thrift.STRING, len(p.Cols)) + + for i := 0; i < len(p.Cols); i++ { + for j := i + 1; j < len(p.Cols); j++ { + if func(tgt, src string) bool { + if strings.Compare(tgt, src) != 0 { + return false + } + return true + }(p.Cols[i], p.Cols[j]) { + panic(fmt.Errorf("%T error writing set field: slice is not unique", p.Cols[i])) + } + } + } + for _, v := range p.Cols { + l += bthrift.Binary.StringLengthNocopy(v) + + } + l += bthrift.Binary.SetEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TMySqlLoadAcquireTokenResult_) field2Length() int { +func (p *TPrivilegeCtrl) field6Length() int { l := 0 - if p.IsSetToken() { - l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.Token) + if p.IsSetRes() { + l += bthrift.Binary.FieldBeginLength("res", thrift.STRING, 6) + l += bthrift.Binary.StringLengthNocopy(*p.Res) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TTabletCooldownInfo) FastRead(buf []byte) (int, error) { +func (p *TCheckAuthRequest) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 + var issetUser bool = false + var issetPasswd bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -35775,7 +32314,7 @@ func (p *TTabletCooldownInfo) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -35789,12 +32328,13 @@ func (p *TTabletCooldownInfo) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetUser = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -35803,12 +32343,69 @@ func (p *TTabletCooldownInfo) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetPasswd = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -35836,318 +32433,317 @@ func (p *TTabletCooldownInfo) FastRead(buf []byte) (int, error) { goto ReadStructEndError } + if !issetUser { + fieldId = 2 + goto RequiredFieldNotSetError + } + + if !issetPasswd { + fieldId = 3 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletCooldownInfo[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthRequest[fieldId])) } -func (p *TTabletCooldownInfo) FastReadField1(buf []byte) (int, error) { +func (p *TCheckAuthRequest) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.TabletId = &v + p.Cluster = &v } return offset, nil } -func (p *TTabletCooldownInfo) FastReadField2(buf []byte) (int, error) { +func (p *TCheckAuthRequest) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.CooldownReplicaId = &v + + p.User = v } return offset, nil } -func (p *TTabletCooldownInfo) FastReadField3(buf []byte) (int, error) { +func (p *TCheckAuthRequest) FastReadField3(buf []byte) (int, error) { offset := 0 - tmp := types.NewTUniqueId() + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.Passwd = v + + } + return offset, nil +} + +func (p *TCheckAuthRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.UserIp = &v + + } + return offset, nil +} + +func (p *TCheckAuthRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + tmp := NewTPrivilegeCtrl() if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.CooldownMetaId = tmp + p.PrivCtrl = tmp + return offset, nil +} + +func (p *TCheckAuthRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := TPrivilegeType(v) + p.PrivType = &tmp + + } + return offset, nil +} + +func (p *TCheckAuthRequest) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ThriftRpcTimeoutMs = &v + + } return offset, nil } // for compatibility -func (p *TTabletCooldownInfo) FastWrite(buf []byte) int { +func (p *TCheckAuthRequest) FastWrite(buf []byte) int { return 0 } -func (p *TTabletCooldownInfo) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TCheckAuthRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletCooldownInfo") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TCheckAuthRequest") if p != nil { + offset += p.fastWriteField7(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TTabletCooldownInfo) BLength() int { +func (p *TCheckAuthRequest) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TTabletCooldownInfo") + l += bthrift.Binary.StructBeginLength("TCheckAuthRequest") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TTabletCooldownInfo) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TCheckAuthRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetTabletId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tablet_id", thrift.I64, 1) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.TabletId) + if p.IsSetCluster() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cluster", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Cluster) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TTabletCooldownInfo) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TCheckAuthRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCooldownReplicaId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cooldown_replica_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.CooldownReplicaId) + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.User) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TCheckAuthRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "passwd", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Passwd) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *TCheckAuthRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetUserIp() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.UserIp) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TTabletCooldownInfo) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TCheckAuthRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCooldownMetaId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cooldown_meta_id", thrift.STRUCT, 3) - offset += p.CooldownMetaId.FastWriteNocopy(buf[offset:], binaryWriter) + if p.IsSetPrivCtrl() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "priv_ctrl", thrift.STRUCT, 5) + offset += p.PrivCtrl.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TTabletCooldownInfo) field1Length() int { - l := 0 - if p.IsSetTabletId() { - l += bthrift.Binary.FieldBeginLength("tablet_id", thrift.I64, 1) - l += bthrift.Binary.I64Length(*p.TabletId) +func (p *TCheckAuthRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetPrivType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "priv_type", thrift.I32, 6) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.PrivType)) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TTabletCooldownInfo) field2Length() int { - l := 0 - if p.IsSetCooldownReplicaId() { - l += bthrift.Binary.FieldBeginLength("cooldown_replica_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(*p.CooldownReplicaId) +func (p *TCheckAuthRequest) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetThriftRpcTimeoutMs() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "thrift_rpc_timeout_ms", thrift.I64, 7) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ThriftRpcTimeoutMs) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TTabletCooldownInfo) field3Length() int { +func (p *TCheckAuthRequest) field1Length() int { l := 0 - if p.IsSetCooldownMetaId() { - l += bthrift.Binary.FieldBeginLength("cooldown_meta_id", thrift.STRUCT, 3) - l += p.CooldownMetaId.BLength() + if p.IsSetCluster() { + l += bthrift.Binary.FieldBeginLength("cluster", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.Cluster) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TConfirmUnusedRemoteFilesRequest) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } +func (p *TCheckAuthRequest) field2Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(p.User) - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TConfirmUnusedRemoteFilesRequest[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + l += bthrift.Binary.FieldEndLength() + return l } -func (p *TConfirmUnusedRemoteFilesRequest) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ConfirmList = make([]*TTabletCooldownInfo, 0, size) - for i := 0; i < size; i++ { - _elem := NewTTabletCooldownInfo() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } +func (p *TCheckAuthRequest) field3Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("passwd", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(p.Passwd) - p.ConfirmList = append(p.ConfirmList, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil + l += bthrift.Binary.FieldEndLength() + return l } -// for compatibility -func (p *TConfirmUnusedRemoteFilesRequest) FastWrite(buf []byte) int { - return 0 -} +func (p *TCheckAuthRequest) field4Length() int { + l := 0 + if p.IsSetUserIp() { + l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.UserIp) -func (p *TConfirmUnusedRemoteFilesRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TConfirmUnusedRemoteFilesRequest") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) + l += bthrift.Binary.FieldEndLength() } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset + return l } -func (p *TConfirmUnusedRemoteFilesRequest) BLength() int { +func (p *TCheckAuthRequest) field5Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TConfirmUnusedRemoteFilesRequest") - if p != nil { - l += p.field1Length() + if p.IsSetPrivCtrl() { + l += bthrift.Binary.FieldBeginLength("priv_ctrl", thrift.STRUCT, 5) + l += p.PrivCtrl.BLength() + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TConfirmUnusedRemoteFilesRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetConfirmList() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "confirm_list", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.ConfirmList { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TCheckAuthRequest) field6Length() int { + l := 0 + if p.IsSetPrivType() { + l += bthrift.Binary.FieldBeginLength("priv_type", thrift.I32, 6) + l += bthrift.Binary.I32Length(int32(*p.PrivType)) + + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TConfirmUnusedRemoteFilesRequest) field1Length() int { +func (p *TCheckAuthRequest) field7Length() int { l := 0 - if p.IsSetConfirmList() { - l += bthrift.Binary.FieldBeginLength("confirm_list", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.ConfirmList)) - for _, v := range p.ConfirmList { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() + if p.IsSetThriftRpcTimeoutMs() { + l += bthrift.Binary.FieldBeginLength("thrift_rpc_timeout_ms", thrift.I64, 7) + l += bthrift.Binary.I64Length(*p.ThriftRpcTimeoutMs) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TConfirmUnusedRemoteFilesResult_) FastRead(buf []byte) (int, error) { +func (p *TCheckAuthResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 + var issetStatus bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -36165,12 +32761,13 @@ func (p *TConfirmUnusedRemoteFilesResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } + issetStatus = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -36198,59 +32795,48 @@ func (p *TConfirmUnusedRemoteFilesResult_) FastRead(buf []byte) (int, error) { goto ReadStructEndError } + if !issetStatus { + fieldId = 1 + goto RequiredFieldNotSetError + } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TConfirmUnusedRemoteFilesResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +RequiredFieldNotSetError: + return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthResult_[fieldId])) } -func (p *TConfirmUnusedRemoteFilesResult_) FastReadField1(buf []byte) (int, error) { +func (p *TCheckAuthResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ConfirmedTablets = make([]types.TTabletId, 0, size) - for i := 0; i < size; i++ { - var _elem types.TTabletId - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.ConfirmedTablets = append(p.ConfirmedTablets, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + tmp := status.NewTStatus() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } + p.Status = tmp return offset, nil } // for compatibility -func (p *TConfirmUnusedRemoteFilesResult_) FastWrite(buf []byte) int { +func (p *TCheckAuthResult_) FastWrite(buf []byte) int { return 0 } -func (p *TConfirmUnusedRemoteFilesResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TCheckAuthResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TConfirmUnusedRemoteFilesResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TCheckAuthResult") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) } @@ -36259,9 +32845,9 @@ func (p *TConfirmUnusedRemoteFilesResult_) FastWriteNocopy(buf []byte, binaryWri return offset } -func (p *TConfirmUnusedRemoteFilesResult_) BLength() int { +func (p *TCheckAuthResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TConfirmUnusedRemoteFilesResult") + l += bthrift.Binary.StructBeginLength("TCheckAuthResult") if p != nil { l += p.field1Length() } @@ -36270,45 +32856,28 @@ func (p *TConfirmUnusedRemoteFilesResult_) BLength() int { return l } -func (p *TConfirmUnusedRemoteFilesResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TCheckAuthResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetConfirmedTablets() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "confirmed_tablets", thrift.LIST, 1) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) - var length int - for _, v := range p.ConfirmedTablets { - length++ - offset += bthrift.Binary.WriteI64(buf[offset:], v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) + offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) return offset } -func (p *TConfirmUnusedRemoteFilesResult_) field1Length() int { +func (p *TCheckAuthResult_) field1Length() int { l := 0 - if p.IsSetConfirmedTablets() { - l += bthrift.Binary.FieldBeginLength("confirmed_tablets", thrift.LIST, 1) - l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.ConfirmedTablets)) - var tmpV types.TTabletId - l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.ConfirmedTablets) - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } + l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) + l += p.Status.BLength() + l += bthrift.Binary.FieldEndLength() return l } -func (p *TPrivilegeCtrl) FastRead(buf []byte) (int, error) { +func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetPrivHier bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -36332,7 +32901,6 @@ func (p *TPrivilegeCtrl) FastRead(buf []byte) (int, error) { if err != nil { goto ReadFieldError } - issetPrivHier = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -36383,7 +32951,7 @@ func (p *TPrivilegeCtrl) FastRead(buf []byte) (int, error) { } } case 5: - if fieldTypeId == thrift.SET { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField5(buf[offset:]) offset += l if err != nil { @@ -36397,7 +32965,7 @@ func (p *TPrivilegeCtrl) FastRead(buf []byte) (int, error) { } } case 6: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField6(buf[offset:]) offset += l if err != nil { @@ -36430,28 +32998,22 @@ func (p *TPrivilegeCtrl) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetPrivHier { - fieldId = 1 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TPrivilegeCtrl[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetQueryStatsRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TPrivilegeCtrl[fieldId])) } -func (p *TPrivilegeCtrl) FastReadField1(buf []byte) (int, error) { +func (p *TGetQueryStatsRequest) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { @@ -36459,26 +33021,27 @@ func (p *TPrivilegeCtrl) FastReadField1(buf []byte) (int, error) { } else { offset += l - p.PrivHier = TPrivilegeHier(v) + tmp := TQueryStatsType(v) + p.Type = &tmp } return offset, nil } -func (p *TPrivilegeCtrl) FastReadField2(buf []byte) (int, error) { +func (p *TGetQueryStatsRequest) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Ctl = &v + p.Catalog = &v } return offset, nil } -func (p *TPrivilegeCtrl) FastReadField3(buf []byte) (int, error) { +func (p *TGetQueryStatsRequest) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -36491,7 +33054,7 @@ func (p *TPrivilegeCtrl) FastReadField3(buf []byte) (int, error) { return offset, nil } -func (p *TPrivilegeCtrl) FastReadField4(buf []byte) (int, error) { +func (p *TGetQueryStatsRequest) FastReadField4(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -36504,18 +33067,31 @@ func (p *TPrivilegeCtrl) FastReadField4(buf []byte) (int, error) { return offset, nil } -func (p *TPrivilegeCtrl) FastReadField5(buf []byte) (int, error) { +func (p *TGetQueryStatsRequest) FastReadField5(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadSetBegin(buf[offset:]) + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ReplicaId = &v + + } + return offset, nil +} + +func (p *TGetQueryStatsRequest) FastReadField6(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) offset += l if err != nil { return offset, err } - p.Cols = make([]string, 0, size) + p.ReplicaIds = make([]int64, 0, size) for i := 0; i < size; i++ { - var _elem string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + var _elem int64 + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l @@ -36524,43 +33100,30 @@ func (p *TPrivilegeCtrl) FastReadField5(buf []byte) (int, error) { } - p.Cols = append(p.Cols, _elem) - } - if l, err := bthrift.Binary.ReadSetEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + p.ReplicaIds = append(p.ReplicaIds, _elem) } - return offset, nil -} - -func (p *TPrivilegeCtrl) FastReadField6(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Res = &v - } return offset, nil } // for compatibility -func (p *TPrivilegeCtrl) FastWrite(buf []byte) int { +func (p *TGetQueryStatsRequest) FastWrite(buf []byte) int { return 0 } -func (p *TPrivilegeCtrl) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetQueryStatsRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TPrivilegeCtrl") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetQueryStatsRequest") if p != nil { + offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField6(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) @@ -36568,9 +33131,9 @@ func (p *TPrivilegeCtrl) FastWriteNocopy(buf []byte, binaryWriter bthrift.Binary return offset } -func (p *TPrivilegeCtrl) BLength() int { +func (p *TGetQueryStatsRequest) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TPrivilegeCtrl") + l += bthrift.Binary.StructBeginLength("TGetQueryStatsRequest") if p != nil { l += p.field1Length() l += p.field2Length() @@ -36584,27 +33147,29 @@ func (p *TPrivilegeCtrl) BLength() int { return l } -func (p *TPrivilegeCtrl) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetQueryStatsRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "priv_hier", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.PrivHier)) + if p.IsSetType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.I32, 1) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.Type)) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TPrivilegeCtrl) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetQueryStatsRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCtl() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "ctl", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Ctl) + if p.IsSetCatalog() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TPrivilegeCtrl) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetQueryStatsRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetDb() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 3) @@ -36615,7 +33180,7 @@ func (p *TPrivilegeCtrl) fastWriteField3(buf []byte, binaryWriter bthrift.Binary return offset } -func (p *TPrivilegeCtrl) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetQueryStatsRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetTbl() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tbl", thrift.STRING, 4) @@ -36626,70 +33191,59 @@ func (p *TPrivilegeCtrl) fastWriteField4(buf []byte, binaryWriter bthrift.Binary return offset } -func (p *TPrivilegeCtrl) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetQueryStatsRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCols() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cols", thrift.SET, 5) - setBeginOffset := offset - offset += bthrift.Binary.SetBeginLength(thrift.STRING, 0) - - for i := 0; i < len(p.Cols); i++ { - for j := i + 1; j < len(p.Cols); j++ { - if func(tgt, src string) bool { - if strings.Compare(tgt, src) != 0 { - return false - } - return true - }(p.Cols[i], p.Cols[j]) { - panic(fmt.Errorf("%T error writing set field: slice is not unique", p.Cols[i])) - } - } - } - var length int - for _, v := range p.Cols { - length++ - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, v) + if p.IsSetReplicaId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replica_id", thrift.I64, 5) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.ReplicaId) - } - bthrift.Binary.WriteSetBegin(buf[setBeginOffset:], thrift.STRING, length) - offset += bthrift.Binary.WriteSetEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TPrivilegeCtrl) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TGetQueryStatsRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetRes() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "res", thrift.STRING, 6) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Res) + if p.IsSetReplicaIds() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replica_ids", thrift.LIST, 6) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) + var length int + for _, v := range p.ReplicaIds { + length++ + offset += bthrift.Binary.WriteI64(buf[offset:], v) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TPrivilegeCtrl) field1Length() int { +func (p *TGetQueryStatsRequest) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("priv_hier", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(p.PrivHier)) + if p.IsSetType() { + l += bthrift.Binary.FieldBeginLength("type", thrift.I32, 1) + l += bthrift.Binary.I32Length(int32(*p.Type)) - l += bthrift.Binary.FieldEndLength() + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TPrivilegeCtrl) field2Length() int { +func (p *TGetQueryStatsRequest) field2Length() int { l := 0 - if p.IsSetCtl() { - l += bthrift.Binary.FieldBeginLength("ctl", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.Ctl) + if p.IsSetCatalog() { + l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.Catalog) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TPrivilegeCtrl) field3Length() int { +func (p *TGetQueryStatsRequest) field3Length() int { l := 0 if p.IsSetDb() { l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 3) @@ -36700,7 +33254,7 @@ func (p *TPrivilegeCtrl) field3Length() int { return l } -func (p *TPrivilegeCtrl) field4Length() int { +func (p *TGetQueryStatsRequest) field4Length() int { l := 0 if p.IsSetTbl() { l += bthrift.Binary.FieldBeginLength("tbl", thrift.STRING, 4) @@ -36711,53 +33265,36 @@ func (p *TPrivilegeCtrl) field4Length() int { return l } -func (p *TPrivilegeCtrl) field5Length() int { +func (p *TGetQueryStatsRequest) field5Length() int { l := 0 - if p.IsSetCols() { - l += bthrift.Binary.FieldBeginLength("cols", thrift.SET, 5) - l += bthrift.Binary.SetBeginLength(thrift.STRING, len(p.Cols)) - - for i := 0; i < len(p.Cols); i++ { - for j := i + 1; j < len(p.Cols); j++ { - if func(tgt, src string) bool { - if strings.Compare(tgt, src) != 0 { - return false - } - return true - }(p.Cols[i], p.Cols[j]) { - panic(fmt.Errorf("%T error writing set field: slice is not unique", p.Cols[i])) - } - } - } - for _, v := range p.Cols { - l += bthrift.Binary.StringLengthNocopy(v) + if p.IsSetReplicaId() { + l += bthrift.Binary.FieldBeginLength("replica_id", thrift.I64, 5) + l += bthrift.Binary.I64Length(*p.ReplicaId) - } - l += bthrift.Binary.SetEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TPrivilegeCtrl) field6Length() int { +func (p *TGetQueryStatsRequest) field6Length() int { l := 0 - if p.IsSetRes() { - l += bthrift.Binary.FieldBeginLength("res", thrift.STRING, 6) - l += bthrift.Binary.StringLengthNocopy(*p.Res) - + if p.IsSetReplicaIds() { + l += bthrift.Binary.FieldBeginLength("replica_ids", thrift.LIST, 6) + l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.ReplicaIds)) + var tmpV int64 + l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.ReplicaIds) + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TCheckAuthRequest) FastRead(buf []byte) (int, error) { +func (p *TTableQueryStats) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetUser bool = false - var issetPasswd bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -36789,13 +33326,12 @@ func (p *TCheckAuthRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetUser = true } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -36804,65 +33340,8 @@ func (p *TCheckAuthRequest) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetPasswd = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 7: if fieldTypeId == thrift.I64 { - l, err = p.FastReadField7(buf[offset:]) + l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { goto ReadFieldError @@ -36894,317 +33373,163 @@ func (p *TCheckAuthRequest) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetUser { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetPasswd { - fieldId = 3 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableQueryStats[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthRequest[fieldId])) -} - -func (p *TCheckAuthRequest) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.Cluster = &v - - } - return offset, nil -} - -func (p *TCheckAuthRequest) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.User = v - - } - return offset, nil -} - -func (p *TCheckAuthRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.Passwd = v - - } - return offset, nil } -func (p *TCheckAuthRequest) FastReadField4(buf []byte) (int, error) { +func (p *TTableQueryStats) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.UserIp = &v - - } - return offset, nil -} - -func (p *TCheckAuthRequest) FastReadField5(buf []byte) (int, error) { - offset := 0 + p.Field = &v - tmp := NewTPrivilegeCtrl() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l } - p.PrivCtrl = tmp return offset, nil } -func (p *TCheckAuthRequest) FastReadField6(buf []byte) (int, error) { +func (p *TTableQueryStats) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - - tmp := TPrivilegeType(v) - p.PrivType = &tmp + p.QueryStats = &v } return offset, nil } -func (p *TCheckAuthRequest) FastReadField7(buf []byte) (int, error) { +func (p *TTableQueryStats) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.ThriftRpcTimeoutMs = &v + p.FilterStats = &v } return offset, nil } // for compatibility -func (p *TCheckAuthRequest) FastWrite(buf []byte) int { +func (p *TTableQueryStats) FastWrite(buf []byte) int { return 0 } -func (p *TCheckAuthRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableQueryStats) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TCheckAuthRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableQueryStats") if p != nil { - offset += p.fastWriteField7(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TCheckAuthRequest) BLength() int { +func (p *TTableQueryStats) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TCheckAuthRequest") + l += bthrift.Binary.StructBeginLength("TTableQueryStats") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - l += p.field7Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TCheckAuthRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetCluster() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cluster", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Cluster) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TCheckAuthRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.User) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TCheckAuthRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "passwd", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, p.Passwd) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TCheckAuthRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetUserIp() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user_ip", thrift.STRING, 4) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.UserIp) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TCheckAuthRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetPrivCtrl() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "priv_ctrl", thrift.STRUCT, 5) - offset += p.PrivCtrl.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TCheckAuthRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableQueryStats) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetPrivType() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "priv_type", thrift.I32, 6) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.PrivType)) + if p.IsSetField() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "field", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Field) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TCheckAuthRequest) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableQueryStats) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetThriftRpcTimeoutMs() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "thrift_rpc_timeout_ms", thrift.I64, 7) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ThriftRpcTimeoutMs) + if p.IsSetQueryStats() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_stats", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.QueryStats) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TCheckAuthRequest) field1Length() int { - l := 0 - if p.IsSetCluster() { - l += bthrift.Binary.FieldBeginLength("cluster", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.Cluster) +func (p *TTableQueryStats) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetFilterStats() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "filter_stats", thrift.I64, 3) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.FilterStats) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l -} - -func (p *TCheckAuthRequest) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(p.User) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TCheckAuthRequest) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("passwd", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(p.Passwd) - - l += bthrift.Binary.FieldEndLength() - return l + return offset } -func (p *TCheckAuthRequest) field4Length() int { +func (p *TTableQueryStats) field1Length() int { l := 0 - if p.IsSetUserIp() { - l += bthrift.Binary.FieldBeginLength("user_ip", thrift.STRING, 4) - l += bthrift.Binary.StringLengthNocopy(*p.UserIp) - - l += bthrift.Binary.FieldEndLength() - } - return l -} + if p.IsSetField() { + l += bthrift.Binary.FieldBeginLength("field", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.Field) -func (p *TCheckAuthRequest) field5Length() int { - l := 0 - if p.IsSetPrivCtrl() { - l += bthrift.Binary.FieldBeginLength("priv_ctrl", thrift.STRUCT, 5) - l += p.PrivCtrl.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TCheckAuthRequest) field6Length() int { +func (p *TTableQueryStats) field2Length() int { l := 0 - if p.IsSetPrivType() { - l += bthrift.Binary.FieldBeginLength("priv_type", thrift.I32, 6) - l += bthrift.Binary.I32Length(int32(*p.PrivType)) + if p.IsSetQueryStats() { + l += bthrift.Binary.FieldBeginLength("query_stats", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.QueryStats) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TCheckAuthRequest) field7Length() int { +func (p *TTableQueryStats) field3Length() int { l := 0 - if p.IsSetThriftRpcTimeoutMs() { - l += bthrift.Binary.FieldBeginLength("thrift_rpc_timeout_ms", thrift.I64, 7) - l += bthrift.Binary.I64Length(*p.ThriftRpcTimeoutMs) + if p.IsSetFilterStats() { + l += bthrift.Binary.FieldBeginLength("filter_stats", thrift.I64, 3) + l += bthrift.Binary.I64Length(*p.FilterStats) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TCheckAuthResult_) FastRead(buf []byte) (int, error) { +func (p *TTableIndexQueryStats) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 - var issetStatus bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -37222,13 +33547,26 @@ func (p *TCheckAuthResult_) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.STRUCT { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { goto ReadFieldError } - issetStatus = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } } else { l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -37256,84 +33594,145 @@ func (p *TCheckAuthResult_) FastRead(buf []byte) (int, error) { goto ReadStructEndError } - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } return offset, nil ReadStructBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TCheckAuthResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableIndexQueryStats[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TCheckAuthResult_[fieldId])) } -func (p *TCheckAuthResult_) FastReadField1(buf []byte) (int, error) { +func (p *TTableIndexQueryStats) FastReadField1(buf []byte) (int, error) { offset := 0 - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.IndexName = &v + + } + return offset, nil +} + +func (p *TTableIndexQueryStats) FastReadField2(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.TableStats = make([]*TTableQueryStats, 0, size) + for i := 0; i < size; i++ { + _elem := NewTTableQueryStats() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.TableStats = append(p.TableStats, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l } - p.Status = tmp return offset, nil } // for compatibility -func (p *TCheckAuthResult_) FastWrite(buf []byte) int { +func (p *TTableIndexQueryStats) FastWrite(buf []byte) int { return 0 } -func (p *TCheckAuthResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableIndexQueryStats) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TCheckAuthResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableIndexQueryStats") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TCheckAuthResult_) BLength() int { +func (p *TTableIndexQueryStats) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TCheckAuthResult") + l += bthrift.Binary.StructBeginLength("TTableIndexQueryStats") if p != nil { l += p.field1Length() + l += p.field2Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TCheckAuthResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TTableIndexQueryStats) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + if p.IsSetIndexName() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "index_name", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.IndexName) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } return offset } -func (p *TCheckAuthResult_) field1Length() int { +func (p *TTableIndexQueryStats) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTableStats() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_stats", thrift.LIST, 2) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.TableStats { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTableIndexQueryStats) field1Length() int { l := 0 - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() - l += bthrift.Binary.FieldEndLength() + if p.IsSetIndexName() { + l += bthrift.Binary.FieldBeginLength("index_name", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.IndexName) + + l += bthrift.Binary.FieldEndLength() + } return l } -func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { +func (p *TTableIndexQueryStats) field2Length() int { + l := 0 + if p.IsSetTableStats() { + l += bthrift.Binary.FieldBeginLength("table_stats", thrift.LIST, 2) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.TableStats)) + for _, v := range p.TableStats { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryStatsResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -37356,7 +33755,7 @@ func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { } switch fieldId { case 1: - if fieldTypeId == thrift.I32 { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField1(buf[offset:]) offset += l if err != nil { @@ -37370,7 +33769,7 @@ func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.MAP { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -37384,7 +33783,7 @@ func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -37398,7 +33797,7 @@ func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { } } case 4: - if fieldTypeId == thrift.STRING { + if fieldTypeId == thrift.LIST { l, err = p.FastReadField4(buf[offset:]) offset += l if err != nil { @@ -37412,7 +33811,7 @@ func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { } } case 5: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.MAP { l, err = p.FastReadField5(buf[offset:]) offset += l if err != nil { @@ -37425,20 +33824,6 @@ func (p *TGetQueryStatsRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 6: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -37465,7 +33850,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TGetQueryStatsRequest[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryStatsResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -37474,96 +33859,146 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TGetQueryStatsRequest) FastReadField1(buf []byte) (int, error) { +func (p *TQueryStatsResult_) FastReadField1(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + tmp := status.NewTStatus() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l - - tmp := TQueryStatsType(v) - p.Type = &tmp - } + p.Status = tmp return offset, nil } -func (p *TGetQueryStatsRequest) FastReadField2(buf []byte) (int, error) { +func (p *TQueryStatsResult_) FastReadField2(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) + offset += l + if err != nil { return offset, err - } else { - offset += l - p.Catalog = &v - } - return offset, nil -} + p.SimpleResult_ = make(map[string]int64, size) + for i := 0; i < size; i++ { + var _key string + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l -func (p *TGetQueryStatsRequest) FastReadField3(buf []byte) (int, error) { - offset := 0 + _key = v - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + } + + var _val int64 + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _val = v + + } + + p.SimpleResult_[_key] = _val + } + if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Db = &v - } return offset, nil } -func (p *TGetQueryStatsRequest) FastReadField4(buf []byte) (int, error) { +func (p *TQueryStatsResult_) FastReadField3(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.TableStats = make([]*TTableQueryStats, 0, size) + for i := 0; i < size; i++ { + _elem := NewTTableQueryStats() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.TableStats = append(p.TableStats, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Tbl = &v - } return offset, nil } -func (p *TGetQueryStatsRequest) FastReadField5(buf []byte) (int, error) { +func (p *TQueryStatsResult_) FastReadField4(buf []byte) (int, error) { offset := 0 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.TableVerbosStats = make([]*TTableIndexQueryStats, 0, size) + for i := 0; i < size; i++ { + _elem := NewTTableIndexQueryStats() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.TableVerbosStats = append(p.TableVerbosStats, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { return offset, err } else { offset += l - p.ReplicaId = &v - } return offset, nil } -func (p *TGetQueryStatsRequest) FastReadField6(buf []byte) (int, error) { +func (p *TQueryStatsResult_) FastReadField5(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) offset += l if err != nil { return offset, err } - p.ReplicaIds = make([]int64, 0, size) + p.TabletStats = make(map[int64]int64, size) for i := 0; i < size; i++ { - var _elem int64 + var _key int64 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - _elem = v + _key = v } - p.ReplicaIds = append(p.ReplicaIds, _elem) + var _val int64 + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + _val = v + + } + + p.TabletStats[_key] = _val } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { return offset, err } else { offset += l @@ -37572,185 +34007,201 @@ func (p *TGetQueryStatsRequest) FastReadField6(buf []byte) (int, error) { } // for compatibility -func (p *TGetQueryStatsRequest) FastWrite(buf []byte) int { +func (p *TQueryStatsResult_) FastWrite(buf []byte) int { return 0 } -func (p *TGetQueryStatsRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatsResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TGetQueryStatsRequest") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TQueryStatsResult") if p != nil { - offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TGetQueryStatsRequest) BLength() int { +func (p *TQueryStatsResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TGetQueryStatsRequest") + l += bthrift.Binary.StructBeginLength("TQueryStatsResult") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() l += p.field4Length() l += p.field5Length() - l += p.field6Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TGetQueryStatsRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatsResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetType() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.Type)) - + if p.IsSetStatus() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) + offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetQueryStatsRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatsResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetCatalog() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 2) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) + if p.IsSetSimpleResult_() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "simple_result", thrift.MAP, 2) + mapBeginOffset := offset + offset += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.I64, 0) + var length int + for k, v := range p.SimpleResult_ { + length++ - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, k) -func (p *TGetQueryStatsRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetDb() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 3) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Db) + offset += bthrift.Binary.WriteI64(buf[offset:], v) + } + bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.I64, length) + offset += bthrift.Binary.WriteMapEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetQueryStatsRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatsResult_) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetTbl() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tbl", thrift.STRING, 4) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Tbl) - + if p.IsSetTableStats() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_stats", thrift.LIST, 3) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.TableStats { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetQueryStatsRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatsResult_) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetReplicaId() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replica_id", thrift.I64, 5) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.ReplicaId) - + if p.IsSetTableVerbosStats() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_verbos_stats", thrift.LIST, 4) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.TableVerbosStats { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetQueryStatsRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TQueryStatsResult_) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetReplicaIds() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "replica_ids", thrift.LIST, 6) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) + if p.IsSetTabletStats() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tablet_stats", thrift.MAP, 5) + mapBeginOffset := offset + offset += bthrift.Binary.MapBeginLength(thrift.I64, thrift.I64, 0) var length int - for _, v := range p.ReplicaIds { + for k, v := range p.TabletStats { length++ + + offset += bthrift.Binary.WriteI64(buf[offset:], k) + offset += bthrift.Binary.WriteI64(buf[offset:], v) } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) + bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.I64, thrift.I64, length) + offset += bthrift.Binary.WriteMapEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TGetQueryStatsRequest) field1Length() int { +func (p *TQueryStatsResult_) field1Length() int { l := 0 - if p.IsSetType() { - l += bthrift.Binary.FieldBeginLength("type", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(*p.Type)) - + if p.IsSetStatus() { + l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) + l += p.Status.BLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetQueryStatsRequest) field2Length() int { +func (p *TQueryStatsResult_) field2Length() int { l := 0 - if p.IsSetCatalog() { - l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 2) - l += bthrift.Binary.StringLengthNocopy(*p.Catalog) + if p.IsSetSimpleResult_() { + l += bthrift.Binary.FieldBeginLength("simple_result", thrift.MAP, 2) + l += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.I64, len(p.SimpleResult_)) + for k, v := range p.SimpleResult_ { - l += bthrift.Binary.FieldEndLength() - } - return l -} + l += bthrift.Binary.StringLengthNocopy(k) -func (p *TGetQueryStatsRequest) field3Length() int { - l := 0 - if p.IsSetDb() { - l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 3) - l += bthrift.Binary.StringLengthNocopy(*p.Db) + l += bthrift.Binary.I64Length(v) + } + l += bthrift.Binary.MapEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetQueryStatsRequest) field4Length() int { +func (p *TQueryStatsResult_) field3Length() int { l := 0 - if p.IsSetTbl() { - l += bthrift.Binary.FieldBeginLength("tbl", thrift.STRING, 4) - l += bthrift.Binary.StringLengthNocopy(*p.Tbl) - + if p.IsSetTableStats() { + l += bthrift.Binary.FieldBeginLength("table_stats", thrift.LIST, 3) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.TableStats)) + for _, v := range p.TableStats { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetQueryStatsRequest) field5Length() int { +func (p *TQueryStatsResult_) field4Length() int { l := 0 - if p.IsSetReplicaId() { - l += bthrift.Binary.FieldBeginLength("replica_id", thrift.I64, 5) - l += bthrift.Binary.I64Length(*p.ReplicaId) - + if p.IsSetTableVerbosStats() { + l += bthrift.Binary.FieldBeginLength("table_verbos_stats", thrift.LIST, 4) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.TableVerbosStats)) + for _, v := range p.TableVerbosStats { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TGetQueryStatsRequest) field6Length() int { +func (p *TQueryStatsResult_) field5Length() int { l := 0 - if p.IsSetReplicaIds() { - l += bthrift.Binary.FieldBeginLength("replica_ids", thrift.LIST, 6) - l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.ReplicaIds)) + if p.IsSetTabletStats() { + l += bthrift.Binary.FieldBeginLength("tablet_stats", thrift.MAP, 5) + l += bthrift.Binary.MapBeginLength(thrift.I64, thrift.I64, len(p.TabletStats)) + var tmpK int64 var tmpV int64 - l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.ReplicaIds) - l += bthrift.Binary.ListEndLength() + l += (bthrift.Binary.I64Length(int64(tmpK)) + bthrift.Binary.I64Length(int64(tmpV))) * len(p.TabletStats) + l += bthrift.Binary.MapEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TTableQueryStats) FastRead(buf []byte) (int, error) { +func (p *TLockBinlogRequest) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -37787,7 +34238,7 @@ func (p *TTableQueryStats) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -37801,7 +34252,7 @@ func (p *TTableQueryStats) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.I64 { + if fieldTypeId == thrift.STRING { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -37814,6 +34265,90 @@ func (p *TTableQueryStats) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 7: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField7(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 8: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 9: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField9(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -37840,7 +34375,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableQueryStats[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TLockBinlogRequest[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -37849,351 +34384,365 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TTableQueryStats) FastReadField1(buf []byte) (int, error) { +func (p *TLockBinlogRequest) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { return offset, err } else { offset += l - p.Field = &v + p.Cluster = &v } return offset, nil } -func (p *TTableQueryStats) FastReadField2(buf []byte) (int, error) { +func (p *TLockBinlogRequest) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.User = &v + + } + return offset, nil +} + +func (p *TLockBinlogRequest) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Passwd = &v + + } + return offset, nil +} + +func (p *TLockBinlogRequest) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Db = &v + + } + return offset, nil +} + +func (p *TLockBinlogRequest) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Table = &v + + } + return offset, nil +} + +func (p *TLockBinlogRequest) FastReadField6(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.QueryStats = &v + p.TableId = &v } return offset, nil } -func (p *TTableQueryStats) FastReadField3(buf []byte) (int, error) { +func (p *TLockBinlogRequest) FastReadField7(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Token = &v + + } + return offset, nil +} + +func (p *TLockBinlogRequest) FastReadField8(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.JobUniqueId = &v + + } + return offset, nil +} + +func (p *TLockBinlogRequest) FastReadField9(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - p.FilterStats = &v + p.LockCommitSeq = &v } return offset, nil } // for compatibility -func (p *TTableQueryStats) FastWrite(buf []byte) int { +func (p *TLockBinlogRequest) FastWrite(buf []byte) int { return 0 } -func (p *TTableQueryStats) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableQueryStats") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TLockBinlogRequest") if p != nil { + offset += p.fastWriteField6(buf[offset:], binaryWriter) + offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TTableQueryStats) BLength() int { +func (p *TLockBinlogRequest) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TTableQueryStats") + l += bthrift.Binary.StructBeginLength("TLockBinlogRequest") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() + l += p.field7Length() + l += p.field8Length() + l += p.field9Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TTableQueryStats) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogRequest) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetField() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "field", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Field) + if p.IsSetCluster() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "cluster", thrift.STRING, 1) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Cluster) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TTableQueryStats) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogRequest) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetQueryStats() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "query_stats", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.QueryStats) + if p.IsSetUser() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "user", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.User) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TTableQueryStats) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogRequest) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetFilterStats() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "filter_stats", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], *p.FilterStats) + if p.IsSetPasswd() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "passwd", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Passwd) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TTableQueryStats) field1Length() int { - l := 0 - if p.IsSetField() { - l += bthrift.Binary.FieldBeginLength("field", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.Field) +func (p *TLockBinlogRequest) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetDb() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "db", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Db) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TTableQueryStats) field2Length() int { - l := 0 - if p.IsSetQueryStats() { - l += bthrift.Binary.FieldBeginLength("query_stats", thrift.I64, 2) - l += bthrift.Binary.I64Length(*p.QueryStats) +func (p *TLockBinlogRequest) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTable() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table", thrift.STRING, 5) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Table) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TTableQueryStats) field3Length() int { - l := 0 - if p.IsSetFilterStats() { - l += bthrift.Binary.FieldBeginLength("filter_stats", thrift.I64, 3) - l += bthrift.Binary.I64Length(*p.FilterStats) +func (p *TLockBinlogRequest) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTableId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_id", thrift.I64, 6) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.TableId) - l += bthrift.Binary.FieldEndLength() + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return l + return offset } -func (p *TTableIndexQueryStats) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRING { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } +func (p *TLockBinlogRequest) fastWriteField7(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetToken() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "token", thrift.STRING, 7) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Token) - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTableIndexQueryStats[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) + return offset } -func (p *TTableIndexQueryStats) FastReadField1(buf []byte) (int, error) { +func (p *TLockBinlogRequest) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetJobUniqueId() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "job_unique_id", thrift.STRING, 8) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.JobUniqueId) - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - p.IndexName = &v - + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - return offset, nil + return offset } -func (p *TTableIndexQueryStats) FastReadField2(buf []byte) (int, error) { +func (p *TLockBinlogRequest) fastWriteField9(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetLockCommitSeq() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "lock_commit_seq", thrift.I64, 9) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LockCommitSeq) - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - p.TableStats = make([]*TTableQueryStats, 0, size) - for i := 0; i < size; i++ { - _elem := NewTTableQueryStats() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } + return offset +} - p.TableStats = append(p.TableStats, _elem) +func (p *TLockBinlogRequest) field1Length() int { + l := 0 + if p.IsSetCluster() { + l += bthrift.Binary.FieldBeginLength("cluster", thrift.STRING, 1) + l += bthrift.Binary.StringLengthNocopy(*p.Cluster) + + l += bthrift.Binary.FieldEndLength() } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + return l +} + +func (p *TLockBinlogRequest) field2Length() int { + l := 0 + if p.IsSetUser() { + l += bthrift.Binary.FieldBeginLength("user", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.User) + + l += bthrift.Binary.FieldEndLength() } - return offset, nil + return l } -// for compatibility -func (p *TTableIndexQueryStats) FastWrite(buf []byte) int { - return 0 +func (p *TLockBinlogRequest) field3Length() int { + l := 0 + if p.IsSetPasswd() { + l += bthrift.Binary.FieldBeginLength("passwd", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.Passwd) + + l += bthrift.Binary.FieldEndLength() + } + return l } -func (p *TTableIndexQueryStats) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTableIndexQueryStats") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) +func (p *TLockBinlogRequest) field4Length() int { + l := 0 + if p.IsSetDb() { + l += bthrift.Binary.FieldBeginLength("db", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.Db) + + l += bthrift.Binary.FieldEndLength() } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset + return l } -func (p *TTableIndexQueryStats) BLength() int { +func (p *TLockBinlogRequest) field5Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TTableIndexQueryStats") - if p != nil { - l += p.field1Length() - l += p.field2Length() + if p.IsSetTable() { + l += bthrift.Binary.FieldBeginLength("table", thrift.STRING, 5) + l += bthrift.Binary.StringLengthNocopy(*p.Table) + + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TTableIndexQueryStats) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetIndexName() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "index_name", thrift.STRING, 1) - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.IndexName) +func (p *TLockBinlogRequest) field6Length() int { + l := 0 + if p.IsSetTableId() { + l += bthrift.Binary.FieldBeginLength("table_id", thrift.I64, 6) + l += bthrift.Binary.I64Length(*p.TableId) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TTableIndexQueryStats) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetTableStats() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_stats", thrift.LIST, 2) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.TableStats { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TLockBinlogRequest) field7Length() int { + l := 0 + if p.IsSetToken() { + l += bthrift.Binary.FieldBeginLength("token", thrift.STRING, 7) + l += bthrift.Binary.StringLengthNocopy(*p.Token) + + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TTableIndexQueryStats) field1Length() int { +func (p *TLockBinlogRequest) field8Length() int { l := 0 - if p.IsSetIndexName() { - l += bthrift.Binary.FieldBeginLength("index_name", thrift.STRING, 1) - l += bthrift.Binary.StringLengthNocopy(*p.IndexName) + if p.IsSetJobUniqueId() { + l += bthrift.Binary.FieldBeginLength("job_unique_id", thrift.STRING, 8) + l += bthrift.Binary.StringLengthNocopy(*p.JobUniqueId) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TTableIndexQueryStats) field2Length() int { +func (p *TLockBinlogRequest) field9Length() int { l := 0 - if p.IsSetTableStats() { - l += bthrift.Binary.FieldBeginLength("table_stats", thrift.LIST, 2) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.TableStats)) - for _, v := range p.TableStats { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() + if p.IsSetLockCommitSeq() { + l += bthrift.Binary.FieldBeginLength("lock_commit_seq", thrift.I64, 9) + l += bthrift.Binary.I64Length(*p.LockCommitSeq) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TQueryStatsResult_) FastRead(buf []byte) (int, error) { +func (p *TLockBinlogResult_) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -38230,7 +34779,7 @@ func (p *TQueryStatsResult_) FastRead(buf []byte) (int, error) { } } case 2: - if fieldTypeId == thrift.MAP { + if fieldTypeId == thrift.I64 { l, err = p.FastReadField2(buf[offset:]) offset += l if err != nil { @@ -38244,7 +34793,7 @@ func (p *TQueryStatsResult_) FastRead(buf []byte) (int, error) { } } case 3: - if fieldTypeId == thrift.LIST { + if fieldTypeId == thrift.STRUCT { l, err = p.FastReadField3(buf[offset:]) offset += l if err != nil { @@ -38257,34 +34806,6 @@ func (p *TQueryStatsResult_) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 4: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -38311,7 +34832,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TQueryStatsResult_[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TLockBinlogResult_[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -38320,7 +34841,7 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TQueryStatsResult_) FastReadField1(buf []byte) (int, error) { +func (p *TLockBinlogResult_) FastReadField1(buf []byte) (int, error) { offset := 0 tmp := status.NewTStatus() @@ -38333,176 +34854,64 @@ func (p *TQueryStatsResult_) FastReadField1(buf []byte) (int, error) { return offset, nil } -func (p *TQueryStatsResult_) FastReadField2(buf []byte) (int, error) { +func (p *TLockBinlogResult_) FastReadField2(buf []byte) (int, error) { offset := 0 - _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.SimpleResult_ = make(map[string]int64, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _key = v - - } - - var _val int64 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _val = v - - } - - p.SimpleResult_[_key] = _val - } - if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { return offset, err } else { offset += l - } - return offset, nil -} + p.LockedCommitSeq = &v -func (p *TQueryStatsResult_) FastReadField3(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.TableStats = make([]*TTableQueryStats, 0, size) - for i := 0; i < size; i++ { - _elem := NewTTableQueryStats() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.TableStats = append(p.TableStats, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l } return offset, nil } -func (p *TQueryStatsResult_) FastReadField4(buf []byte) (int, error) { +func (p *TLockBinlogResult_) FastReadField3(buf []byte) (int, error) { offset := 0 - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.TableVerbosStats = make([]*TTableIndexQueryStats, 0, size) - for i := 0; i < size; i++ { - _elem := NewTTableIndexQueryStats() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.TableVerbosStats = append(p.TableVerbosStats, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TQueryStatsResult_) FastReadField5(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.TabletStats = make(map[int64]int64, size) - for i := 0; i < size; i++ { - var _key int64 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _key = v - - } - - var _val int64 - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _val = v - - } - - p.TabletStats[_key] = _val - } - if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { + tmp := types.NewTNetworkAddress() + if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { offset += l } + p.MasterAddress = tmp return offset, nil } // for compatibility -func (p *TQueryStatsResult_) FastWrite(buf []byte) int { +func (p *TLockBinlogResult_) FastWrite(buf []byte) int { return 0 } -func (p *TQueryStatsResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TQueryStatsResult") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TLockBinlogResult") if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TQueryStatsResult_) BLength() int { +func (p *TLockBinlogResult_) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TQueryStatsResult") + l += bthrift.Binary.StructBeginLength("TLockBinlogResult") if p != nil { l += p.field1Length() l += p.field2Length() l += p.field3Length() - l += p.field4Length() - l += p.field5Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() return l } -func (p *TQueryStatsResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetStatus() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) @@ -38512,87 +34921,28 @@ func (p *TQueryStatsResult_) fastWriteField1(buf []byte, binaryWriter bthrift.Bi return offset } -func (p *TQueryStatsResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetSimpleResult_() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "simple_result", thrift.MAP, 2) - mapBeginOffset := offset - offset += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.I64, 0) - var length int - for k, v := range p.SimpleResult_ { - length++ - - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, k) - - offset += bthrift.Binary.WriteI64(buf[offset:], v) - - } - bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.I64, length) - offset += bthrift.Binary.WriteMapEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *TQueryStatsResult_) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogResult_) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetTableStats() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_stats", thrift.LIST, 3) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.TableStats { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} + if p.IsSetLockedCommitSeq() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "locked_commit_seq", thrift.I64, 2) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.LockedCommitSeq) -func (p *TQueryStatsResult_) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetTableVerbosStats() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table_verbos_stats", thrift.LIST, 4) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.TableVerbosStats { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TQueryStatsResult_) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TLockBinlogResult_) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetTabletStats() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tablet_stats", thrift.MAP, 5) - mapBeginOffset := offset - offset += bthrift.Binary.MapBeginLength(thrift.I64, thrift.I64, 0) - var length int - for k, v := range p.TabletStats { - length++ - - offset += bthrift.Binary.WriteI64(buf[offset:], k) - - offset += bthrift.Binary.WriteI64(buf[offset:], v) - - } - bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.I64, thrift.I64, length) - offset += bthrift.Binary.WriteMapEnd(buf[offset:]) + if p.IsSetMasterAddress() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "master_address", thrift.STRUCT, 3) + offset += p.MasterAddress.FastWriteNocopy(buf[offset:], binaryWriter) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TQueryStatsResult_) field1Length() int { +func (p *TLockBinlogResult_) field1Length() int { l := 0 if p.IsSetStatus() { l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) @@ -38602,61 +34952,22 @@ func (p *TQueryStatsResult_) field1Length() int { return l } -func (p *TQueryStatsResult_) field2Length() int { +func (p *TLockBinlogResult_) field2Length() int { l := 0 - if p.IsSetSimpleResult_() { - l += bthrift.Binary.FieldBeginLength("simple_result", thrift.MAP, 2) - l += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.I64, len(p.SimpleResult_)) - for k, v := range p.SimpleResult_ { - - l += bthrift.Binary.StringLengthNocopy(k) + if p.IsSetLockedCommitSeq() { + l += bthrift.Binary.FieldBeginLength("locked_commit_seq", thrift.I64, 2) + l += bthrift.Binary.I64Length(*p.LockedCommitSeq) - l += bthrift.Binary.I64Length(v) - - } - l += bthrift.Binary.MapEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatsResult_) field3Length() int { - l := 0 - if p.IsSetTableStats() { - l += bthrift.Binary.FieldBeginLength("table_stats", thrift.LIST, 3) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.TableStats)) - for _, v := range p.TableStats { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() l += bthrift.Binary.FieldEndLength() } return l } -func (p *TQueryStatsResult_) field4Length() int { +func (p *TLockBinlogResult_) field3Length() int { l := 0 - if p.IsSetTableVerbosStats() { - l += bthrift.Binary.FieldBeginLength("table_verbos_stats", thrift.LIST, 4) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.TableVerbosStats)) - for _, v := range p.TableVerbosStats { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *TQueryStatsResult_) field5Length() int { - l := 0 - if p.IsSetTabletStats() { - l += bthrift.Binary.FieldBeginLength("tablet_stats", thrift.MAP, 5) - l += bthrift.Binary.MapBeginLength(thrift.I64, thrift.I64, len(p.TabletStats)) - var tmpK int64 - var tmpV int64 - l += (bthrift.Binary.I64Length(int64(tmpK)) + bthrift.Binary.I64Length(int64(tmpV))) * len(p.TabletStats) - l += bthrift.Binary.MapEndLength() + if p.IsSetMasterAddress() { + l += bthrift.Binary.FieldBeginLength("master_address", thrift.STRUCT, 3) + l += p.MasterAddress.BLength() l += bthrift.Binary.FieldEndLength() } return l @@ -51836,6 +48147,20 @@ func (p *TGetMetaTableMeta) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 5: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -51937,6 +48262,19 @@ func (p *TGetMetaTableMeta) FastReadField4(buf []byte) (int, error) { return offset, nil } +func (p *TGetMetaTableMeta) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Type = &v + + } + return offset, nil +} + // for compatibility func (p *TGetMetaTableMeta) FastWrite(buf []byte) int { return 0 @@ -51950,6 +48288,7 @@ func (p *TGetMetaTableMeta) FastWriteNocopy(buf []byte, binaryWriter bthrift.Bin offset += p.fastWriteField3(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -51964,6 +48303,7 @@ func (p *TGetMetaTableMeta) BLength() int { l += p.field2Length() l += p.field3Length() l += p.field4Length() + l += p.field5Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -52021,6 +48361,17 @@ func (p *TGetMetaTableMeta) fastWriteField4(buf []byte, binaryWriter bthrift.Bin return offset } +func (p *TGetMetaTableMeta) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "type", thrift.STRING, 5) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Type) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TGetMetaTableMeta) field1Length() int { l := 0 if p.IsSetId() { @@ -52068,6 +48419,17 @@ func (p *TGetMetaTableMeta) field4Length() int { return l } +func (p *TGetMetaTableMeta) field5Length() int { + l := 0 + if p.IsSetType() { + l += bthrift.Binary.FieldBeginLength("type", thrift.STRING, 5) + l += bthrift.Binary.StringLengthNocopy(*p.Type) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TGetMetaDBMeta) FastRead(buf []byte) (int, error) { var err error var offset int @@ -56577,265 +52939,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetTableNamesResult[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *FrontendServiceGetTableNamesResult) FastReadField0(buf []byte) (int, error) { - offset := 0 - - tmp := NewTGetTablesResult_() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Success = tmp - return offset, nil -} - -// for compatibility -func (p *FrontendServiceGetTableNamesResult) FastWrite(buf []byte) int { - return 0 -} - -func (p *FrontendServiceGetTableNamesResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "getTableNames_result") - if p != nil { - offset += p.fastWriteField0(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *FrontendServiceGetTableNamesResult) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("getTableNames_result") - if p != nil { - l += p.field0Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *FrontendServiceGetTableNamesResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetSuccess() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) - offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - -func (p *FrontendServiceGetTableNamesResult) field0Length() int { - l := 0 - if p.IsSetSuccess() { - l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) - l += p.Success.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - -func (p *FrontendServiceDescribeTableArgs) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceDescribeTableArgs[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *FrontendServiceDescribeTableArgs) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := NewTDescribeTableParams() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Params = tmp - return offset, nil -} - -// for compatibility -func (p *FrontendServiceDescribeTableArgs) FastWrite(buf []byte) int { - return 0 -} - -func (p *FrontendServiceDescribeTableArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "describeTable_args") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *FrontendServiceDescribeTableArgs) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("describeTable_args") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *FrontendServiceDescribeTableArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "params", thrift.STRUCT, 1) - offset += p.Params.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *FrontendServiceDescribeTableArgs) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("params", thrift.STRUCT, 1) - l += p.Params.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *FrontendServiceDescribeTableResult) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 0: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField0(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceDescribeTableResult[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceGetTableNamesResult[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -56844,10 +52948,10 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *FrontendServiceDescribeTableResult) FastReadField0(buf []byte) (int, error) { +func (p *FrontendServiceGetTableNamesResult) FastReadField0(buf []byte) (int, error) { offset := 0 - tmp := NewTDescribeTableResult_() + tmp := NewTGetTablesResult_() if l, err := tmp.FastRead(buf[offset:]); err != nil { return offset, err } else { @@ -56858,13 +52962,13 @@ func (p *FrontendServiceDescribeTableResult) FastReadField0(buf []byte) (int, er } // for compatibility -func (p *FrontendServiceDescribeTableResult) FastWrite(buf []byte) int { +func (p *FrontendServiceGetTableNamesResult) FastWrite(buf []byte) int { return 0 } -func (p *FrontendServiceDescribeTableResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *FrontendServiceGetTableNamesResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "describeTable_result") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "getTableNames_result") if p != nil { offset += p.fastWriteField0(buf[offset:], binaryWriter) } @@ -56873,9 +52977,9 @@ func (p *FrontendServiceDescribeTableResult) FastWriteNocopy(buf []byte, binaryW return offset } -func (p *FrontendServiceDescribeTableResult) BLength() int { +func (p *FrontendServiceGetTableNamesResult) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("describeTable_result") + l += bthrift.Binary.StructBeginLength("getTableNames_result") if p != nil { l += p.field0Length() } @@ -56884,7 +52988,7 @@ func (p *FrontendServiceDescribeTableResult) BLength() int { return l } -func (p *FrontendServiceDescribeTableResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *FrontendServiceGetTableNamesResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetSuccess() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) @@ -56894,7 +52998,7 @@ func (p *FrontendServiceDescribeTableResult) fastWriteField0(buf []byte, binaryW return offset } -func (p *FrontendServiceDescribeTableResult) field0Length() int { +func (p *FrontendServiceGetTableNamesResult) field0Length() int { l := 0 if p.IsSetSuccess() { l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) @@ -63046,6 +59150,264 @@ func (p *FrontendServiceRestoreSnapshotResult) field0Length() int { return l } +func (p *FrontendServiceLockBinlogArgs) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLockBinlogArgs[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *FrontendServiceLockBinlogArgs) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewTLockBinlogRequest() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Request = tmp + return offset, nil +} + +// for compatibility +func (p *FrontendServiceLockBinlogArgs) FastWrite(buf []byte) int { + return 0 +} + +func (p *FrontendServiceLockBinlogArgs) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "lockBinlog_args") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *FrontendServiceLockBinlogArgs) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("lockBinlog_args") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *FrontendServiceLockBinlogArgs) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "request", thrift.STRUCT, 1) + offset += p.Request.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + return offset +} + +func (p *FrontendServiceLockBinlogArgs) field1Length() int { + l := 0 + l += bthrift.Binary.FieldBeginLength("request", thrift.STRUCT, 1) + l += p.Request.BLength() + l += bthrift.Binary.FieldEndLength() + return l +} + +func (p *FrontendServiceLockBinlogResult) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 0: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField0(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_FrontendServiceLockBinlogResult[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *FrontendServiceLockBinlogResult) FastReadField0(buf []byte) (int, error) { + offset := 0 + + tmp := NewTLockBinlogResult_() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.Success = tmp + return offset, nil +} + +// for compatibility +func (p *FrontendServiceLockBinlogResult) FastWrite(buf []byte) int { + return 0 +} + +func (p *FrontendServiceLockBinlogResult) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "lockBinlog_result") + if p != nil { + offset += p.fastWriteField0(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *FrontendServiceLockBinlogResult) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("lockBinlog_result") + if p != nil { + l += p.field0Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *FrontendServiceLockBinlogResult) fastWriteField0(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetSuccess() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "success", thrift.STRUCT, 0) + offset += p.Success.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *FrontendServiceLockBinlogResult) field0Length() int { + l := 0 + if p.IsSetSuccess() { + l += bthrift.Binary.FieldBeginLength("success", thrift.STRUCT, 0) + l += p.Success.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *FrontendServiceWaitingTxnStatusArgs) FastRead(buf []byte) (int, error) { var err error var offset int @@ -71789,14 +68151,6 @@ func (p *FrontendServiceGetTableNamesResult) GetResult() interface{} { return p.Success } -func (p *FrontendServiceDescribeTableArgs) GetFirstArgument() interface{} { - return p.Params -} - -func (p *FrontendServiceDescribeTableResult) GetResult() interface{} { - return p.Success -} - func (p *FrontendServiceDescribeTablesArgs) GetFirstArgument() interface{} { return p.Params } @@ -71989,6 +68343,14 @@ func (p *FrontendServiceRestoreSnapshotResult) GetResult() interface{} { return p.Success } +func (p *FrontendServiceLockBinlogArgs) GetFirstArgument() interface{} { + return p.Request +} + +func (p *FrontendServiceLockBinlogResult) GetResult() interface{} { + return p.Success +} + func (p *FrontendServiceWaitingTxnStatusArgs) GetFirstArgument() interface{} { return p.Request } diff --git a/pkg/rpc/kitex_gen/masterservice/MasterService.go b/pkg/rpc/kitex_gen/masterservice/MasterService.go index a886a064..d1d16900 100644 --- a/pkg/rpc/kitex_gen/masterservice/MasterService.go +++ b/pkg/rpc/kitex_gen/masterservice/MasterService.go @@ -115,14 +115,28 @@ type TTabletInfo struct { CooldownTerm *int64 `thrift:"cooldown_term,19,optional" frugal:"19,optional,i64" json:"cooldown_term,omitempty"` CooldownMetaId *types.TUniqueId `thrift:"cooldown_meta_id,20,optional" frugal:"20,optional,types.TUniqueId" json:"cooldown_meta_id,omitempty"` VisibleVersionCount *int64 `thrift:"visible_version_count,21,optional" frugal:"21,optional,i64" json:"visible_version_count,omitempty"` + LocalIndexSize int64 `thrift:"local_index_size,22,optional" frugal:"22,optional,i64" json:"local_index_size,omitempty"` + LocalSegmentSize int64 `thrift:"local_segment_size,23,optional" frugal:"23,optional,i64" json:"local_segment_size,omitempty"` + RemoteIndexSize int64 `thrift:"remote_index_size,24,optional" frugal:"24,optional,i64" json:"remote_index_size,omitempty"` + RemoteSegmentSize int64 `thrift:"remote_segment_size,25,optional" frugal:"25,optional,i64" json:"remote_segment_size,omitempty"` IsPersistent *bool `thrift:"is_persistent,1000,optional" frugal:"1000,optional,bool" json:"is_persistent,omitempty"` } func NewTTabletInfo() *TTabletInfo { - return &TTabletInfo{} + return &TTabletInfo{ + + LocalIndexSize: 0, + LocalSegmentSize: 0, + RemoteIndexSize: 0, + RemoteSegmentSize: 0, + } } func (p *TTabletInfo) InitDefault() { + p.LocalIndexSize = 0 + p.LocalSegmentSize = 0 + p.RemoteIndexSize = 0 + p.RemoteSegmentSize = 0 } func (p *TTabletInfo) GetTabletId() (v types.TTabletId) { @@ -266,6 +280,42 @@ func (p *TTabletInfo) GetVisibleVersionCount() (v int64) { return *p.VisibleVersionCount } +var TTabletInfo_LocalIndexSize_DEFAULT int64 = 0 + +func (p *TTabletInfo) GetLocalIndexSize() (v int64) { + if !p.IsSetLocalIndexSize() { + return TTabletInfo_LocalIndexSize_DEFAULT + } + return p.LocalIndexSize +} + +var TTabletInfo_LocalSegmentSize_DEFAULT int64 = 0 + +func (p *TTabletInfo) GetLocalSegmentSize() (v int64) { + if !p.IsSetLocalSegmentSize() { + return TTabletInfo_LocalSegmentSize_DEFAULT + } + return p.LocalSegmentSize +} + +var TTabletInfo_RemoteIndexSize_DEFAULT int64 = 0 + +func (p *TTabletInfo) GetRemoteIndexSize() (v int64) { + if !p.IsSetRemoteIndexSize() { + return TTabletInfo_RemoteIndexSize_DEFAULT + } + return p.RemoteIndexSize +} + +var TTabletInfo_RemoteSegmentSize_DEFAULT int64 = 0 + +func (p *TTabletInfo) GetRemoteSegmentSize() (v int64) { + if !p.IsSetRemoteSegmentSize() { + return TTabletInfo_RemoteSegmentSize_DEFAULT + } + return p.RemoteSegmentSize +} + var TTabletInfo_IsPersistent_DEFAULT bool func (p *TTabletInfo) GetIsPersistent() (v bool) { @@ -331,6 +381,18 @@ func (p *TTabletInfo) SetCooldownMetaId(val *types.TUniqueId) { func (p *TTabletInfo) SetVisibleVersionCount(val *int64) { p.VisibleVersionCount = val } +func (p *TTabletInfo) SetLocalIndexSize(val int64) { + p.LocalIndexSize = val +} +func (p *TTabletInfo) SetLocalSegmentSize(val int64) { + p.LocalSegmentSize = val +} +func (p *TTabletInfo) SetRemoteIndexSize(val int64) { + p.RemoteIndexSize = val +} +func (p *TTabletInfo) SetRemoteSegmentSize(val int64) { + p.RemoteSegmentSize = val +} func (p *TTabletInfo) SetIsPersistent(val *bool) { p.IsPersistent = val } @@ -355,6 +417,10 @@ var fieldIDToName_TTabletInfo = map[int16]string{ 19: "cooldown_term", 20: "cooldown_meta_id", 21: "visible_version_count", + 22: "local_index_size", + 23: "local_segment_size", + 24: "remote_index_size", + 25: "remote_segment_size", 1000: "is_persistent", } @@ -410,6 +476,22 @@ func (p *TTabletInfo) IsSetVisibleVersionCount() bool { return p.VisibleVersionCount != nil } +func (p *TTabletInfo) IsSetLocalIndexSize() bool { + return p.LocalIndexSize != TTabletInfo_LocalIndexSize_DEFAULT +} + +func (p *TTabletInfo) IsSetLocalSegmentSize() bool { + return p.LocalSegmentSize != TTabletInfo_LocalSegmentSize_DEFAULT +} + +func (p *TTabletInfo) IsSetRemoteIndexSize() bool { + return p.RemoteIndexSize != TTabletInfo_RemoteIndexSize_DEFAULT +} + +func (p *TTabletInfo) IsSetRemoteSegmentSize() bool { + return p.RemoteSegmentSize != TTabletInfo_RemoteSegmentSize_DEFAULT +} + func (p *TTabletInfo) IsSetIsPersistent() bool { return p.IsPersistent != nil } @@ -597,6 +679,38 @@ func (p *TTabletInfo) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 22: + if fieldTypeId == thrift.I64 { + if err = p.ReadField22(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 23: + if fieldTypeId == thrift.I64 { + if err = p.ReadField23(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 24: + if fieldTypeId == thrift.I64 { + if err = p.ReadField24(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 25: + if fieldTypeId == thrift.I64 { + if err = p.ReadField25(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 1000: if fieldTypeId == thrift.BOOL { if err = p.ReadField1000(iprot); err != nil { @@ -884,6 +998,50 @@ func (p *TTabletInfo) ReadField21(iprot thrift.TProtocol) error { p.VisibleVersionCount = _field return nil } +func (p *TTabletInfo) ReadField22(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.LocalIndexSize = _field + return nil +} +func (p *TTabletInfo) ReadField23(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.LocalSegmentSize = _field + return nil +} +func (p *TTabletInfo) ReadField24(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.RemoteIndexSize = _field + return nil +} +func (p *TTabletInfo) ReadField25(iprot thrift.TProtocol) error { + + var _field int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = v + } + p.RemoteSegmentSize = _field + return nil +} func (p *TTabletInfo) ReadField1000(iprot thrift.TProtocol) error { var _field *bool @@ -978,6 +1136,22 @@ func (p *TTabletInfo) Write(oprot thrift.TProtocol) (err error) { fieldId = 21 goto WriteFieldError } + if err = p.writeField22(oprot); err != nil { + fieldId = 22 + goto WriteFieldError + } + if err = p.writeField23(oprot); err != nil { + fieldId = 23 + goto WriteFieldError + } + if err = p.writeField24(oprot); err != nil { + fieldId = 24 + goto WriteFieldError + } + if err = p.writeField25(oprot); err != nil { + fieldId = 25 + goto WriteFieldError + } if err = p.writeField1000(oprot); err != nil { fieldId = 1000 goto WriteFieldError @@ -1357,6 +1531,82 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 21 end error: ", p), err) } +func (p *TTabletInfo) writeField22(oprot thrift.TProtocol) (err error) { + if p.IsSetLocalIndexSize() { + if err = oprot.WriteFieldBegin("local_index_size", thrift.I64, 22); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.LocalIndexSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 22 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 22 end error: ", p), err) +} + +func (p *TTabletInfo) writeField23(oprot thrift.TProtocol) (err error) { + if p.IsSetLocalSegmentSize() { + if err = oprot.WriteFieldBegin("local_segment_size", thrift.I64, 23); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.LocalSegmentSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 23 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 23 end error: ", p), err) +} + +func (p *TTabletInfo) writeField24(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteIndexSize() { + if err = oprot.WriteFieldBegin("remote_index_size", thrift.I64, 24); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.RemoteIndexSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 24 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 24 end error: ", p), err) +} + +func (p *TTabletInfo) writeField25(oprot thrift.TProtocol) (err error) { + if p.IsSetRemoteSegmentSize() { + if err = oprot.WriteFieldBegin("remote_segment_size", thrift.I64, 25); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(p.RemoteSegmentSize); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 25 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 25 end error: ", p), err) +} + func (p *TTabletInfo) writeField1000(oprot thrift.TProtocol) (err error) { if p.IsSetIsPersistent() { if err = oprot.WriteFieldBegin("is_persistent", thrift.BOOL, 1000); err != nil { @@ -1447,6 +1697,18 @@ func (p *TTabletInfo) DeepEqual(ano *TTabletInfo) bool { if !p.Field21DeepEqual(ano.VisibleVersionCount) { return false } + if !p.Field22DeepEqual(ano.LocalIndexSize) { + return false + } + if !p.Field23DeepEqual(ano.LocalSegmentSize) { + return false + } + if !p.Field24DeepEqual(ano.RemoteIndexSize) { + return false + } + if !p.Field25DeepEqual(ano.RemoteSegmentSize) { + return false + } if !p.Field1000DeepEqual(ano.IsPersistent) { return false } @@ -1647,6 +1909,34 @@ func (p *TTabletInfo) Field21DeepEqual(src *int64) bool { } return true } +func (p *TTabletInfo) Field22DeepEqual(src int64) bool { + + if p.LocalIndexSize != src { + return false + } + return true +} +func (p *TTabletInfo) Field23DeepEqual(src int64) bool { + + if p.LocalSegmentSize != src { + return false + } + return true +} +func (p *TTabletInfo) Field24DeepEqual(src int64) bool { + + if p.RemoteIndexSize != src { + return false + } + return true +} +func (p *TTabletInfo) Field25DeepEqual(src int64) bool { + + if p.RemoteSegmentSize != src { + return false + } + return true +} func (p *TTabletInfo) Field1000DeepEqual(src *bool) bool { if p.IsPersistent == src { diff --git a/pkg/rpc/kitex_gen/masterservice/k-MasterService.go b/pkg/rpc/kitex_gen/masterservice/k-MasterService.go index e3f9de5b..5311d33f 100644 --- a/pkg/rpc/kitex_gen/masterservice/k-MasterService.go +++ b/pkg/rpc/kitex_gen/masterservice/k-MasterService.go @@ -332,6 +332,62 @@ func (p *TTabletInfo) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 22: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField22(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 23: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField23(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 24: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField24(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 25: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField25(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 1000: if fieldTypeId == thrift.BOOL { l, err = p.FastReadField1000(buf[offset:]) @@ -684,6 +740,62 @@ func (p *TTabletInfo) FastReadField21(buf []byte) (int, error) { return offset, nil } +func (p *TTabletInfo) FastReadField22(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.LocalIndexSize = v + + } + return offset, nil +} + +func (p *TTabletInfo) FastReadField23(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.LocalSegmentSize = v + + } + return offset, nil +} + +func (p *TTabletInfo) FastReadField24(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.RemoteIndexSize = v + + } + return offset, nil +} + +func (p *TTabletInfo) FastReadField25(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.RemoteSegmentSize = v + + } + return offset, nil +} + func (p *TTabletInfo) FastReadField1000(buf []byte) (int, error) { offset := 0 @@ -722,6 +834,10 @@ func (p *TTabletInfo) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWri offset += p.fastWriteField16(buf[offset:], binaryWriter) offset += p.fastWriteField19(buf[offset:], binaryWriter) offset += p.fastWriteField21(buf[offset:], binaryWriter) + offset += p.fastWriteField22(buf[offset:], binaryWriter) + offset += p.fastWriteField23(buf[offset:], binaryWriter) + offset += p.fastWriteField24(buf[offset:], binaryWriter) + offset += p.fastWriteField25(buf[offset:], binaryWriter) offset += p.fastWriteField1000(buf[offset:], binaryWriter) offset += p.fastWriteField7(buf[offset:], binaryWriter) offset += p.fastWriteField8(buf[offset:], binaryWriter) @@ -755,6 +871,10 @@ func (p *TTabletInfo) BLength() int { l += p.field19Length() l += p.field20Length() l += p.field21Length() + l += p.field22Length() + l += p.field23Length() + l += p.field24Length() + l += p.field25Length() l += p.field1000Length() } l += bthrift.Binary.FieldStopLength() @@ -966,6 +1086,50 @@ func (p *TTabletInfo) fastWriteField21(buf []byte, binaryWriter bthrift.BinaryWr return offset } +func (p *TTabletInfo) fastWriteField22(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLocalIndexSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "local_index_size", thrift.I64, 22) + offset += bthrift.Binary.WriteI64(buf[offset:], p.LocalIndexSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTabletInfo) fastWriteField23(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetLocalSegmentSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "local_segment_size", thrift.I64, 23) + offset += bthrift.Binary.WriteI64(buf[offset:], p.LocalSegmentSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTabletInfo) fastWriteField24(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRemoteIndexSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "remote_index_size", thrift.I64, 24) + offset += bthrift.Binary.WriteI64(buf[offset:], p.RemoteIndexSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TTabletInfo) fastWriteField25(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRemoteSegmentSize() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "remote_segment_size", thrift.I64, 25) + offset += bthrift.Binary.WriteI64(buf[offset:], p.RemoteSegmentSize) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TTabletInfo) fastWriteField1000(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetIsPersistent() { @@ -1175,6 +1339,50 @@ func (p *TTabletInfo) field21Length() int { return l } +func (p *TTabletInfo) field22Length() int { + l := 0 + if p.IsSetLocalIndexSize() { + l += bthrift.Binary.FieldBeginLength("local_index_size", thrift.I64, 22) + l += bthrift.Binary.I64Length(p.LocalIndexSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTabletInfo) field23Length() int { + l := 0 + if p.IsSetLocalSegmentSize() { + l += bthrift.Binary.FieldBeginLength("local_segment_size", thrift.I64, 23) + l += bthrift.Binary.I64Length(p.LocalSegmentSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTabletInfo) field24Length() int { + l := 0 + if p.IsSetRemoteIndexSize() { + l += bthrift.Binary.FieldBeginLength("remote_index_size", thrift.I64, 24) + l += bthrift.Binary.I64Length(p.RemoteIndexSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TTabletInfo) field25Length() int { + l := 0 + if p.IsSetRemoteSegmentSize() { + l += bthrift.Binary.FieldBeginLength("remote_segment_size", thrift.I64, 25) + l += bthrift.Binary.I64Length(p.RemoteSegmentSize) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TTabletInfo) field1000Length() int { l := 0 if p.IsSetIsPersistent() { diff --git a/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go b/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go index 21d37ce0..95fbe8d1 100644 --- a/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go +++ b/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go @@ -1763,6 +1763,12 @@ type TQueryOptions struct { OrcOnceMaxReadBytes int64 `thrift:"orc_once_max_read_bytes,139,optional" frugal:"139,optional,i64" json:"orc_once_max_read_bytes,omitempty"` OrcMaxMergeDistanceBytes int64 `thrift:"orc_max_merge_distance_bytes,140,optional" frugal:"140,optional,i64" json:"orc_max_merge_distance_bytes,omitempty"` IgnoreRuntimeFilterError bool `thrift:"ignore_runtime_filter_error,141,optional" frugal:"141,optional,bool" json:"ignore_runtime_filter_error,omitempty"` + EnableFixedLenToUint32V2 bool `thrift:"enable_fixed_len_to_uint32_v2,142,optional" frugal:"142,optional,bool" json:"enable_fixed_len_to_uint32_v2,omitempty"` + EnableSharedExchangeSinkBuffer bool `thrift:"enable_shared_exchange_sink_buffer,143,optional" frugal:"143,optional,bool" json:"enable_shared_exchange_sink_buffer,omitempty"` + EnableInvertedIndexSearcherCache bool `thrift:"enable_inverted_index_searcher_cache,144,optional" frugal:"144,optional,bool" json:"enable_inverted_index_searcher_cache,omitempty"` + EnableInvertedIndexQueryCache bool `thrift:"enable_inverted_index_query_cache,145,optional" frugal:"145,optional,bool" json:"enable_inverted_index_query_cache,omitempty"` + FuzzyDisableRuntimeFilterInBe bool `thrift:"fuzzy_disable_runtime_filter_in_be,146,optional" frugal:"146,optional,bool" json:"fuzzy_disable_runtime_filter_in_be,omitempty"` + ProfileLevel int32 `thrift:"profile_level,147,optional" frugal:"147,optional,i32" json:"profile_level,omitempty"` DisableFileCache bool `thrift:"disable_file_cache,1000,optional" frugal:"1000,optional,bool" json:"disable_file_cache,omitempty"` } @@ -1890,6 +1896,12 @@ func NewTQueryOptions() *TQueryOptions { OrcOnceMaxReadBytes: 8388608, OrcMaxMergeDistanceBytes: 1048576, IgnoreRuntimeFilterError: false, + EnableFixedLenToUint32V2: false, + EnableSharedExchangeSinkBuffer: true, + EnableInvertedIndexSearcherCache: true, + EnableInvertedIndexQueryCache: true, + FuzzyDisableRuntimeFilterInBe: false, + ProfileLevel: 1, DisableFileCache: false, } } @@ -2016,6 +2028,12 @@ func (p *TQueryOptions) InitDefault() { p.OrcOnceMaxReadBytes = 8388608 p.OrcMaxMergeDistanceBytes = 1048576 p.IgnoreRuntimeFilterError = false + p.EnableFixedLenToUint32V2 = false + p.EnableSharedExchangeSinkBuffer = true + p.EnableInvertedIndexSearcherCache = true + p.EnableInvertedIndexQueryCache = true + p.FuzzyDisableRuntimeFilterInBe = false + p.ProfileLevel = 1 p.DisableFileCache = false } @@ -3207,6 +3225,60 @@ func (p *TQueryOptions) GetIgnoreRuntimeFilterError() (v bool) { return p.IgnoreRuntimeFilterError } +var TQueryOptions_EnableFixedLenToUint32V2_DEFAULT bool = false + +func (p *TQueryOptions) GetEnableFixedLenToUint32V2() (v bool) { + if !p.IsSetEnableFixedLenToUint32V2() { + return TQueryOptions_EnableFixedLenToUint32V2_DEFAULT + } + return p.EnableFixedLenToUint32V2 +} + +var TQueryOptions_EnableSharedExchangeSinkBuffer_DEFAULT bool = true + +func (p *TQueryOptions) GetEnableSharedExchangeSinkBuffer() (v bool) { + if !p.IsSetEnableSharedExchangeSinkBuffer() { + return TQueryOptions_EnableSharedExchangeSinkBuffer_DEFAULT + } + return p.EnableSharedExchangeSinkBuffer +} + +var TQueryOptions_EnableInvertedIndexSearcherCache_DEFAULT bool = true + +func (p *TQueryOptions) GetEnableInvertedIndexSearcherCache() (v bool) { + if !p.IsSetEnableInvertedIndexSearcherCache() { + return TQueryOptions_EnableInvertedIndexSearcherCache_DEFAULT + } + return p.EnableInvertedIndexSearcherCache +} + +var TQueryOptions_EnableInvertedIndexQueryCache_DEFAULT bool = true + +func (p *TQueryOptions) GetEnableInvertedIndexQueryCache() (v bool) { + if !p.IsSetEnableInvertedIndexQueryCache() { + return TQueryOptions_EnableInvertedIndexQueryCache_DEFAULT + } + return p.EnableInvertedIndexQueryCache +} + +var TQueryOptions_FuzzyDisableRuntimeFilterInBe_DEFAULT bool = false + +func (p *TQueryOptions) GetFuzzyDisableRuntimeFilterInBe() (v bool) { + if !p.IsSetFuzzyDisableRuntimeFilterInBe() { + return TQueryOptions_FuzzyDisableRuntimeFilterInBe_DEFAULT + } + return p.FuzzyDisableRuntimeFilterInBe +} + +var TQueryOptions_ProfileLevel_DEFAULT int32 = 1 + +func (p *TQueryOptions) GetProfileLevel() (v int32) { + if !p.IsSetProfileLevel() { + return TQueryOptions_ProfileLevel_DEFAULT + } + return p.ProfileLevel +} + var TQueryOptions_DisableFileCache_DEFAULT bool = false func (p *TQueryOptions) GetDisableFileCache() (v bool) { @@ -3611,6 +3683,24 @@ func (p *TQueryOptions) SetOrcMaxMergeDistanceBytes(val int64) { func (p *TQueryOptions) SetIgnoreRuntimeFilterError(val bool) { p.IgnoreRuntimeFilterError = val } +func (p *TQueryOptions) SetEnableFixedLenToUint32V2(val bool) { + p.EnableFixedLenToUint32V2 = val +} +func (p *TQueryOptions) SetEnableSharedExchangeSinkBuffer(val bool) { + p.EnableSharedExchangeSinkBuffer = val +} +func (p *TQueryOptions) SetEnableInvertedIndexSearcherCache(val bool) { + p.EnableInvertedIndexSearcherCache = val +} +func (p *TQueryOptions) SetEnableInvertedIndexQueryCache(val bool) { + p.EnableInvertedIndexQueryCache = val +} +func (p *TQueryOptions) SetFuzzyDisableRuntimeFilterInBe(val bool) { + p.FuzzyDisableRuntimeFilterInBe = val +} +func (p *TQueryOptions) SetProfileLevel(val int32) { + p.ProfileLevel = val +} func (p *TQueryOptions) SetDisableFileCache(val bool) { p.DisableFileCache = val } @@ -3748,6 +3838,12 @@ var fieldIDToName_TQueryOptions = map[int16]string{ 139: "orc_once_max_read_bytes", 140: "orc_max_merge_distance_bytes", 141: "ignore_runtime_filter_error", + 142: "enable_fixed_len_to_uint32_v2", + 143: "enable_shared_exchange_sink_buffer", + 144: "enable_inverted_index_searcher_cache", + 145: "enable_inverted_index_query_cache", + 146: "fuzzy_disable_runtime_filter_in_be", + 147: "profile_level", 1000: "disable_file_cache", } @@ -4279,6 +4375,30 @@ func (p *TQueryOptions) IsSetIgnoreRuntimeFilterError() bool { return p.IgnoreRuntimeFilterError != TQueryOptions_IgnoreRuntimeFilterError_DEFAULT } +func (p *TQueryOptions) IsSetEnableFixedLenToUint32V2() bool { + return p.EnableFixedLenToUint32V2 != TQueryOptions_EnableFixedLenToUint32V2_DEFAULT +} + +func (p *TQueryOptions) IsSetEnableSharedExchangeSinkBuffer() bool { + return p.EnableSharedExchangeSinkBuffer != TQueryOptions_EnableSharedExchangeSinkBuffer_DEFAULT +} + +func (p *TQueryOptions) IsSetEnableInvertedIndexSearcherCache() bool { + return p.EnableInvertedIndexSearcherCache != TQueryOptions_EnableInvertedIndexSearcherCache_DEFAULT +} + +func (p *TQueryOptions) IsSetEnableInvertedIndexQueryCache() bool { + return p.EnableInvertedIndexQueryCache != TQueryOptions_EnableInvertedIndexQueryCache_DEFAULT +} + +func (p *TQueryOptions) IsSetFuzzyDisableRuntimeFilterInBe() bool { + return p.FuzzyDisableRuntimeFilterInBe != TQueryOptions_FuzzyDisableRuntimeFilterInBe_DEFAULT +} + +func (p *TQueryOptions) IsSetProfileLevel() bool { + return p.ProfileLevel != TQueryOptions_ProfileLevel_DEFAULT +} + func (p *TQueryOptions) IsSetDisableFileCache() bool { return p.DisableFileCache != TQueryOptions_DisableFileCache_DEFAULT } @@ -5358,6 +5478,54 @@ func (p *TQueryOptions) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 142: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField142(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 143: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField143(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 144: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField144(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 145: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField145(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 146: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField146(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 147: + if fieldTypeId == thrift.I32 { + if err = p.ReadField147(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 1000: if fieldTypeId == thrift.BOOL { if err = p.ReadField1000(iprot); err != nil { @@ -6844,6 +7012,72 @@ func (p *TQueryOptions) ReadField141(iprot thrift.TProtocol) error { p.IgnoreRuntimeFilterError = _field return nil } +func (p *TQueryOptions) ReadField142(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.EnableFixedLenToUint32V2 = _field + return nil +} +func (p *TQueryOptions) ReadField143(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.EnableSharedExchangeSinkBuffer = _field + return nil +} +func (p *TQueryOptions) ReadField144(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.EnableInvertedIndexSearcherCache = _field + return nil +} +func (p *TQueryOptions) ReadField145(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.EnableInvertedIndexQueryCache = _field + return nil +} +func (p *TQueryOptions) ReadField146(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.FuzzyDisableRuntimeFilterInBe = _field + return nil +} +func (p *TQueryOptions) ReadField147(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.ProfileLevel = _field + return nil +} func (p *TQueryOptions) ReadField1000(iprot thrift.TProtocol) error { var _field bool @@ -7390,6 +7624,30 @@ func (p *TQueryOptions) Write(oprot thrift.TProtocol) (err error) { fieldId = 141 goto WriteFieldError } + if err = p.writeField142(oprot); err != nil { + fieldId = 142 + goto WriteFieldError + } + if err = p.writeField143(oprot); err != nil { + fieldId = 143 + goto WriteFieldError + } + if err = p.writeField144(oprot); err != nil { + fieldId = 144 + goto WriteFieldError + } + if err = p.writeField145(oprot); err != nil { + fieldId = 145 + goto WriteFieldError + } + if err = p.writeField146(oprot); err != nil { + fieldId = 146 + goto WriteFieldError + } + if err = p.writeField147(oprot); err != nil { + fieldId = 147 + goto WriteFieldError + } if err = p.writeField1000(oprot); err != nil { fieldId = 1000 goto WriteFieldError @@ -9920,6 +10178,120 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 141 end error: ", p), err) } +func (p *TQueryOptions) writeField142(oprot thrift.TProtocol) (err error) { + if p.IsSetEnableFixedLenToUint32V2() { + if err = oprot.WriteFieldBegin("enable_fixed_len_to_uint32_v2", thrift.BOOL, 142); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.EnableFixedLenToUint32V2); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 142 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 142 end error: ", p), err) +} + +func (p *TQueryOptions) writeField143(oprot thrift.TProtocol) (err error) { + if p.IsSetEnableSharedExchangeSinkBuffer() { + if err = oprot.WriteFieldBegin("enable_shared_exchange_sink_buffer", thrift.BOOL, 143); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.EnableSharedExchangeSinkBuffer); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 143 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 143 end error: ", p), err) +} + +func (p *TQueryOptions) writeField144(oprot thrift.TProtocol) (err error) { + if p.IsSetEnableInvertedIndexSearcherCache() { + if err = oprot.WriteFieldBegin("enable_inverted_index_searcher_cache", thrift.BOOL, 144); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.EnableInvertedIndexSearcherCache); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 144 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 144 end error: ", p), err) +} + +func (p *TQueryOptions) writeField145(oprot thrift.TProtocol) (err error) { + if p.IsSetEnableInvertedIndexQueryCache() { + if err = oprot.WriteFieldBegin("enable_inverted_index_query_cache", thrift.BOOL, 145); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.EnableInvertedIndexQueryCache); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 145 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 145 end error: ", p), err) +} + +func (p *TQueryOptions) writeField146(oprot thrift.TProtocol) (err error) { + if p.IsSetFuzzyDisableRuntimeFilterInBe() { + if err = oprot.WriteFieldBegin("fuzzy_disable_runtime_filter_in_be", thrift.BOOL, 146); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.FuzzyDisableRuntimeFilterInBe); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 146 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 146 end error: ", p), err) +} + +func (p *TQueryOptions) writeField147(oprot thrift.TProtocol) (err error) { + if p.IsSetProfileLevel() { + if err = oprot.WriteFieldBegin("profile_level", thrift.I32, 147); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(p.ProfileLevel); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 147 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 147 end error: ", p), err) +} + func (p *TQueryOptions) writeField1000(oprot thrift.TProtocol) (err error) { if p.IsSetDisableFileCache() { if err = oprot.WriteFieldBegin("disable_file_cache", thrift.BOOL, 1000); err != nil { @@ -10349,6 +10721,24 @@ func (p *TQueryOptions) DeepEqual(ano *TQueryOptions) bool { if !p.Field141DeepEqual(ano.IgnoreRuntimeFilterError) { return false } + if !p.Field142DeepEqual(ano.EnableFixedLenToUint32V2) { + return false + } + if !p.Field143DeepEqual(ano.EnableSharedExchangeSinkBuffer) { + return false + } + if !p.Field144DeepEqual(ano.EnableInvertedIndexSearcherCache) { + return false + } + if !p.Field145DeepEqual(ano.EnableInvertedIndexQueryCache) { + return false + } + if !p.Field146DeepEqual(ano.FuzzyDisableRuntimeFilterInBe) { + return false + } + if !p.Field147DeepEqual(ano.ProfileLevel) { + return false + } if !p.Field1000DeepEqual(ano.DisableFileCache) { return false } @@ -11329,28 +11719,70 @@ func (p *TQueryOptions) Field141DeepEqual(src bool) bool { } return true } -func (p *TQueryOptions) Field1000DeepEqual(src bool) bool { +func (p *TQueryOptions) Field142DeepEqual(src bool) bool { - if p.DisableFileCache != src { + if p.EnableFixedLenToUint32V2 != src { return false } return true } +func (p *TQueryOptions) Field143DeepEqual(src bool) bool { -type TScanRangeParams struct { - ScanRange *plannodes.TScanRange `thrift:"scan_range,1,required" frugal:"1,required,plannodes.TScanRange" json:"scan_range"` - VolumeId int32 `thrift:"volume_id,2,optional" frugal:"2,optional,i32" json:"volume_id,omitempty"` + if p.EnableSharedExchangeSinkBuffer != src { + return false + } + return true } +func (p *TQueryOptions) Field144DeepEqual(src bool) bool { -func NewTScanRangeParams() *TScanRangeParams { - return &TScanRangeParams{ + if p.EnableInvertedIndexSearcherCache != src { + return false + } + return true +} +func (p *TQueryOptions) Field145DeepEqual(src bool) bool { - VolumeId: -1, + if p.EnableInvertedIndexQueryCache != src { + return false } + return true } +func (p *TQueryOptions) Field146DeepEqual(src bool) bool { -func (p *TScanRangeParams) InitDefault() { - p.VolumeId = -1 + if p.FuzzyDisableRuntimeFilterInBe != src { + return false + } + return true +} +func (p *TQueryOptions) Field147DeepEqual(src int32) bool { + + if p.ProfileLevel != src { + return false + } + return true +} +func (p *TQueryOptions) Field1000DeepEqual(src bool) bool { + + if p.DisableFileCache != src { + return false + } + return true +} + +type TScanRangeParams struct { + ScanRange *plannodes.TScanRange `thrift:"scan_range,1,required" frugal:"1,required,plannodes.TScanRange" json:"scan_range"` + VolumeId int32 `thrift:"volume_id,2,optional" frugal:"2,optional,i32" json:"volume_id,omitempty"` +} + +func NewTScanRangeParams() *TScanRangeParams { + return &TScanRangeParams{ + + VolumeId: -1, + } +} + +func (p *TScanRangeParams) InitDefault() { + p.VolumeId = -1 } var TScanRangeParams_ScanRange_DEFAULT *plannodes.TScanRange @@ -19598,212 +20030,6 @@ func (p *TCancelPlanFragmentResult_) Field1DeepEqual(src *status.TStatus) bool { return true } -type TExprMap struct { - ExprMap map[string]*exprs.TExpr `thrift:"expr_map,1,required" frugal:"1,required,map" json:"expr_map"` -} - -func NewTExprMap() *TExprMap { - return &TExprMap{} -} - -func (p *TExprMap) InitDefault() { -} - -func (p *TExprMap) GetExprMap() (v map[string]*exprs.TExpr) { - return p.ExprMap -} -func (p *TExprMap) SetExprMap(val map[string]*exprs.TExpr) { - p.ExprMap = val -} - -var fieldIDToName_TExprMap = map[int16]string{ - 1: "expr_map", -} - -func (p *TExprMap) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetExprMap bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetExprMap = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetExprMap { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExprMap[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExprMap[fieldId])) -} - -func (p *TExprMap) ReadField1(iprot thrift.TProtocol) error { - _, _, size, err := iprot.ReadMapBegin() - if err != nil { - return err - } - _field := make(map[string]*exprs.TExpr, size) - values := make([]exprs.TExpr, size) - for i := 0; i < size; i++ { - var _key string - if v, err := iprot.ReadString(); err != nil { - return err - } else { - _key = v - } - - _val := &values[i] - _val.InitDefault() - if err := _val.Read(iprot); err != nil { - return err - } - - _field[_key] = _val - } - if err := iprot.ReadMapEnd(); err != nil { - return err - } - p.ExprMap = _field - return nil -} - -func (p *TExprMap) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TExprMap"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TExprMap) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("expr_map", thrift.MAP, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteMapBegin(thrift.STRING, thrift.STRUCT, len(p.ExprMap)); err != nil { - return err - } - for k, v := range p.ExprMap { - if err := oprot.WriteString(k); err != nil { - return err - } - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteMapEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TExprMap) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TExprMap(%+v)", *p) - -} - -func (p *TExprMap) DeepEqual(ano *TExprMap) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ExprMap) { - return false - } - return true -} - -func (p *TExprMap) Field1DeepEqual(src map[string]*exprs.TExpr) bool { - - if len(p.ExprMap) != len(src) { - return false - } - for k, v := range p.ExprMap { - _src := src[k] - if !v.DeepEqual(_src) { - return false - } - } - return true -} - type TFoldConstantParams struct { ExprMap map[string]map[string]*exprs.TExpr `thrift:"expr_map,1,required" frugal:"1,required,map>" json:"expr_map"` QueryGlobals *TQueryGlobals `thrift:"query_globals,2,required" frugal:"2,required,TQueryGlobals" json:"query_globals"` @@ -20405,7 +20631,6 @@ type TTransmitDataParams struct { ProtocolVersion PaloInternalServiceVersion `thrift:"protocol_version,1,required" frugal:"1,required,PaloInternalServiceVersion" json:"protocol_version"` DestFragmentInstanceId *types.TUniqueId `thrift:"dest_fragment_instance_id,2,optional" frugal:"2,optional,types.TUniqueId" json:"dest_fragment_instance_id,omitempty"` DestNodeId *types.TPlanNodeId `thrift:"dest_node_id,4,optional" frugal:"4,optional,i32" json:"dest_node_id,omitempty"` - RowBatch *data.TRowBatch `thrift:"row_batch,5,optional" frugal:"5,optional,data.TRowBatch" json:"row_batch,omitempty"` Eos *bool `thrift:"eos,6,optional" frugal:"6,optional,bool" json:"eos,omitempty"` BeNumber *int32 `thrift:"be_number,7,optional" frugal:"7,optional,i32" json:"be_number,omitempty"` PacketSeq *int64 `thrift:"packet_seq,8,optional" frugal:"8,optional,i64" json:"packet_seq,omitempty"` @@ -20441,15 +20666,6 @@ func (p *TTransmitDataParams) GetDestNodeId() (v types.TPlanNodeId) { return *p.DestNodeId } -var TTransmitDataParams_RowBatch_DEFAULT *data.TRowBatch - -func (p *TTransmitDataParams) GetRowBatch() (v *data.TRowBatch) { - if !p.IsSetRowBatch() { - return TTransmitDataParams_RowBatch_DEFAULT - } - return p.RowBatch -} - var TTransmitDataParams_Eos_DEFAULT bool func (p *TTransmitDataParams) GetEos() (v bool) { @@ -20494,9 +20710,6 @@ func (p *TTransmitDataParams) SetDestFragmentInstanceId(val *types.TUniqueId) { func (p *TTransmitDataParams) SetDestNodeId(val *types.TPlanNodeId) { p.DestNodeId = val } -func (p *TTransmitDataParams) SetRowBatch(val *data.TRowBatch) { - p.RowBatch = val -} func (p *TTransmitDataParams) SetEos(val *bool) { p.Eos = val } @@ -20514,7 +20727,6 @@ var fieldIDToName_TTransmitDataParams = map[int16]string{ 1: "protocol_version", 2: "dest_fragment_instance_id", 4: "dest_node_id", - 5: "row_batch", 6: "eos", 7: "be_number", 8: "packet_seq", @@ -20529,10 +20741,6 @@ func (p *TTransmitDataParams) IsSetDestNodeId() bool { return p.DestNodeId != nil } -func (p *TTransmitDataParams) IsSetRowBatch() bool { - return p.RowBatch != nil -} - func (p *TTransmitDataParams) IsSetEos() bool { return p.Eos != nil } @@ -20594,14 +20802,6 @@ func (p *TTransmitDataParams) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } - case 5: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } case 6: if fieldTypeId == thrift.BOOL { if err = p.ReadField6(iprot); err != nil { @@ -20699,14 +20899,6 @@ func (p *TTransmitDataParams) ReadField4(iprot thrift.TProtocol) error { p.DestNodeId = _field return nil } -func (p *TTransmitDataParams) ReadField5(iprot thrift.TProtocol) error { - _field := data.NewTRowBatch() - if err := _field.Read(iprot); err != nil { - return err - } - p.RowBatch = _field - return nil -} func (p *TTransmitDataParams) ReadField6(iprot thrift.TProtocol) error { var _field *bool @@ -20770,10 +20962,6 @@ func (p *TTransmitDataParams) Write(oprot thrift.TProtocol) (err error) { fieldId = 4 goto WriteFieldError } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } if err = p.writeField6(oprot); err != nil { fieldId = 6 goto WriteFieldError @@ -20863,25 +21051,6 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) } -func (p *TTransmitDataParams) writeField5(oprot thrift.TProtocol) (err error) { - if p.IsSetRowBatch() { - if err = oprot.WriteFieldBegin("row_batch", thrift.STRUCT, 5); err != nil { - goto WriteFieldBeginError - } - if err := p.RowBatch.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - func (p *TTransmitDataParams) writeField6(oprot thrift.TProtocol) (err error) { if p.IsSetEos() { if err = oprot.WriteFieldBegin("eos", thrift.BOOL, 6); err != nil { @@ -20981,9 +21150,6 @@ func (p *TTransmitDataParams) DeepEqual(ano *TTransmitDataParams) bool { if !p.Field4DeepEqual(ano.DestNodeId) { return false } - if !p.Field5DeepEqual(ano.RowBatch) { - return false - } if !p.Field6DeepEqual(ano.Eos) { return false } @@ -21025,14 +21191,7 @@ func (p *TTransmitDataParams) Field4DeepEqual(src *types.TPlanNodeId) bool { } return true } -func (p *TTransmitDataParams) Field5DeepEqual(src *data.TRowBatch) bool { - - if !p.RowBatch.DeepEqual(src) { - return false - } - return true -} -func (p *TTransmitDataParams) Field6DeepEqual(src *bool) bool { +func (p *TTransmitDataParams) Field6DeepEqual(src *bool) bool { if p.Eos == src { return true @@ -21706,2568 +21865,6 @@ func (p *TTabletWithPartition) Field2DeepEqual(src int64) bool { return true } -type TTabletWriterOpenParams struct { - Id *types.TUniqueId `thrift:"id,1,required" frugal:"1,required,types.TUniqueId" json:"id"` - IndexId int64 `thrift:"index_id,2,required" frugal:"2,required,i64" json:"index_id"` - TxnId int64 `thrift:"txn_id,3,required" frugal:"3,required,i64" json:"txn_id"` - Schema *descriptors.TOlapTableSchemaParam `thrift:"schema,4,required" frugal:"4,required,descriptors.TOlapTableSchemaParam" json:"schema"` - Tablets []*TTabletWithPartition `thrift:"tablets,5,required" frugal:"5,required,list" json:"tablets"` - NumSenders int32 `thrift:"num_senders,6,required" frugal:"6,required,i32" json:"num_senders"` -} - -func NewTTabletWriterOpenParams() *TTabletWriterOpenParams { - return &TTabletWriterOpenParams{} -} - -func (p *TTabletWriterOpenParams) InitDefault() { -} - -var TTabletWriterOpenParams_Id_DEFAULT *types.TUniqueId - -func (p *TTabletWriterOpenParams) GetId() (v *types.TUniqueId) { - if !p.IsSetId() { - return TTabletWriterOpenParams_Id_DEFAULT - } - return p.Id -} - -func (p *TTabletWriterOpenParams) GetIndexId() (v int64) { - return p.IndexId -} - -func (p *TTabletWriterOpenParams) GetTxnId() (v int64) { - return p.TxnId -} - -var TTabletWriterOpenParams_Schema_DEFAULT *descriptors.TOlapTableSchemaParam - -func (p *TTabletWriterOpenParams) GetSchema() (v *descriptors.TOlapTableSchemaParam) { - if !p.IsSetSchema() { - return TTabletWriterOpenParams_Schema_DEFAULT - } - return p.Schema -} - -func (p *TTabletWriterOpenParams) GetTablets() (v []*TTabletWithPartition) { - return p.Tablets -} - -func (p *TTabletWriterOpenParams) GetNumSenders() (v int32) { - return p.NumSenders -} -func (p *TTabletWriterOpenParams) SetId(val *types.TUniqueId) { - p.Id = val -} -func (p *TTabletWriterOpenParams) SetIndexId(val int64) { - p.IndexId = val -} -func (p *TTabletWriterOpenParams) SetTxnId(val int64) { - p.TxnId = val -} -func (p *TTabletWriterOpenParams) SetSchema(val *descriptors.TOlapTableSchemaParam) { - p.Schema = val -} -func (p *TTabletWriterOpenParams) SetTablets(val []*TTabletWithPartition) { - p.Tablets = val -} -func (p *TTabletWriterOpenParams) SetNumSenders(val int32) { - p.NumSenders = val -} - -var fieldIDToName_TTabletWriterOpenParams = map[int16]string{ - 1: "id", - 2: "index_id", - 3: "txn_id", - 4: "schema", - 5: "tablets", - 6: "num_senders", -} - -func (p *TTabletWriterOpenParams) IsSetId() bool { - return p.Id != nil -} - -func (p *TTabletWriterOpenParams) IsSetSchema() bool { - return p.Schema != nil -} - -func (p *TTabletWriterOpenParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetTxnId bool = false - var issetSchema bool = false - var issetTablets bool = false - var issetNumSenders bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetIndexId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetTxnId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - issetSchema = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.LIST { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetTablets = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.I32 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - issetNumSenders = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetTxnId { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetSchema { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetTablets { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetNumSenders { - fieldId = 6 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterOpenParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterOpenParams[fieldId])) -} - -func (p *TTabletWriterOpenParams) ReadField1(iprot thrift.TProtocol) error { - _field := types.NewTUniqueId() - if err := _field.Read(iprot); err != nil { - return err - } - p.Id = _field - return nil -} -func (p *TTabletWriterOpenParams) ReadField2(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.IndexId = _field - return nil -} -func (p *TTabletWriterOpenParams) ReadField3(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.TxnId = _field - return nil -} -func (p *TTabletWriterOpenParams) ReadField4(iprot thrift.TProtocol) error { - _field := descriptors.NewTOlapTableSchemaParam() - if err := _field.Read(iprot); err != nil { - return err - } - p.Schema = _field - return nil -} -func (p *TTabletWriterOpenParams) ReadField5(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]*TTabletWithPartition, 0, size) - values := make([]TTabletWithPartition, size) - for i := 0; i < size; i++ { - _elem := &values[i] - _elem.InitDefault() - - if err := _elem.Read(iprot); err != nil { - return err - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.Tablets = _field - return nil -} -func (p *TTabletWriterOpenParams) ReadField6(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.NumSenders = _field - return nil -} - -func (p *TTabletWriterOpenParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTabletWriterOpenParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterOpenParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Id.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTabletWriterOpenParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("index_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.IndexId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TTabletWriterOpenParams) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("txn_id", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.TxnId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TTabletWriterOpenParams) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("schema", thrift.STRUCT, 4); err != nil { - goto WriteFieldBeginError - } - if err := p.Schema.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TTabletWriterOpenParams) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("tablets", thrift.LIST, 5); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.STRUCT, len(p.Tablets)); err != nil { - return err - } - for _, v := range p.Tablets { - if err := v.Write(oprot); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TTabletWriterOpenParams) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("num_senders", thrift.I32, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.NumSenders); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *TTabletWriterOpenParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterOpenParams(%+v)", *p) - -} - -func (p *TTabletWriterOpenParams) DeepEqual(ano *TTabletWriterOpenParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Id) { - return false - } - if !p.Field2DeepEqual(ano.IndexId) { - return false - } - if !p.Field3DeepEqual(ano.TxnId) { - return false - } - if !p.Field4DeepEqual(ano.Schema) { - return false - } - if !p.Field5DeepEqual(ano.Tablets) { - return false - } - if !p.Field6DeepEqual(ano.NumSenders) { - return false - } - return true -} - -func (p *TTabletWriterOpenParams) Field1DeepEqual(src *types.TUniqueId) bool { - - if !p.Id.DeepEqual(src) { - return false - } - return true -} -func (p *TTabletWriterOpenParams) Field2DeepEqual(src int64) bool { - - if p.IndexId != src { - return false - } - return true -} -func (p *TTabletWriterOpenParams) Field3DeepEqual(src int64) bool { - - if p.TxnId != src { - return false - } - return true -} -func (p *TTabletWriterOpenParams) Field4DeepEqual(src *descriptors.TOlapTableSchemaParam) bool { - - if !p.Schema.DeepEqual(src) { - return false - } - return true -} -func (p *TTabletWriterOpenParams) Field5DeepEqual(src []*TTabletWithPartition) bool { - - if len(p.Tablets) != len(src) { - return false - } - for i, v := range p.Tablets { - _src := src[i] - if !v.DeepEqual(_src) { - return false - } - } - return true -} -func (p *TTabletWriterOpenParams) Field6DeepEqual(src int32) bool { - - if p.NumSenders != src { - return false - } - return true -} - -type TTabletWriterOpenResult_ struct { - Status *status.TStatus `thrift:"status,1,required" frugal:"1,required,status.TStatus" json:"status"` -} - -func NewTTabletWriterOpenResult_() *TTabletWriterOpenResult_ { - return &TTabletWriterOpenResult_{} -} - -func (p *TTabletWriterOpenResult_) InitDefault() { -} - -var TTabletWriterOpenResult__Status_DEFAULT *status.TStatus - -func (p *TTabletWriterOpenResult_) GetStatus() (v *status.TStatus) { - if !p.IsSetStatus() { - return TTabletWriterOpenResult__Status_DEFAULT - } - return p.Status -} -func (p *TTabletWriterOpenResult_) SetStatus(val *status.TStatus) { - p.Status = val -} - -var fieldIDToName_TTabletWriterOpenResult_ = map[int16]string{ - 1: "status", -} - -func (p *TTabletWriterOpenResult_) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TTabletWriterOpenResult_) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetStatus bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetStatus = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterOpenResult_[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterOpenResult_[fieldId])) -} - -func (p *TTabletWriterOpenResult_) ReadField1(iprot thrift.TProtocol) error { - _field := status.NewTStatus() - if err := _field.Read(iprot); err != nil { - return err - } - p.Status = _field - return nil -} - -func (p *TTabletWriterOpenResult_) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTabletWriterOpenResult"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterOpenResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Status.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTabletWriterOpenResult_) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterOpenResult_(%+v)", *p) - -} - -func (p *TTabletWriterOpenResult_) DeepEqual(ano *TTabletWriterOpenResult_) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Status) { - return false - } - return true -} - -func (p *TTabletWriterOpenResult_) Field1DeepEqual(src *status.TStatus) bool { - - if !p.Status.DeepEqual(src) { - return false - } - return true -} - -type TTabletWriterAddBatchParams struct { - Id *types.TUniqueId `thrift:"id,1,required" frugal:"1,required,types.TUniqueId" json:"id"` - IndexId int64 `thrift:"index_id,2,required" frugal:"2,required,i64" json:"index_id"` - PacketSeq int64 `thrift:"packet_seq,3,required" frugal:"3,required,i64" json:"packet_seq"` - TabletIds []types.TTabletId `thrift:"tablet_ids,4,required" frugal:"4,required,list" json:"tablet_ids"` - RowBatch *data.TRowBatch `thrift:"row_batch,5,required" frugal:"5,required,data.TRowBatch" json:"row_batch"` - SenderNo int32 `thrift:"sender_no,6,required" frugal:"6,required,i32" json:"sender_no"` -} - -func NewTTabletWriterAddBatchParams() *TTabletWriterAddBatchParams { - return &TTabletWriterAddBatchParams{} -} - -func (p *TTabletWriterAddBatchParams) InitDefault() { -} - -var TTabletWriterAddBatchParams_Id_DEFAULT *types.TUniqueId - -func (p *TTabletWriterAddBatchParams) GetId() (v *types.TUniqueId) { - if !p.IsSetId() { - return TTabletWriterAddBatchParams_Id_DEFAULT - } - return p.Id -} - -func (p *TTabletWriterAddBatchParams) GetIndexId() (v int64) { - return p.IndexId -} - -func (p *TTabletWriterAddBatchParams) GetPacketSeq() (v int64) { - return p.PacketSeq -} - -func (p *TTabletWriterAddBatchParams) GetTabletIds() (v []types.TTabletId) { - return p.TabletIds -} - -var TTabletWriterAddBatchParams_RowBatch_DEFAULT *data.TRowBatch - -func (p *TTabletWriterAddBatchParams) GetRowBatch() (v *data.TRowBatch) { - if !p.IsSetRowBatch() { - return TTabletWriterAddBatchParams_RowBatch_DEFAULT - } - return p.RowBatch -} - -func (p *TTabletWriterAddBatchParams) GetSenderNo() (v int32) { - return p.SenderNo -} -func (p *TTabletWriterAddBatchParams) SetId(val *types.TUniqueId) { - p.Id = val -} -func (p *TTabletWriterAddBatchParams) SetIndexId(val int64) { - p.IndexId = val -} -func (p *TTabletWriterAddBatchParams) SetPacketSeq(val int64) { - p.PacketSeq = val -} -func (p *TTabletWriterAddBatchParams) SetTabletIds(val []types.TTabletId) { - p.TabletIds = val -} -func (p *TTabletWriterAddBatchParams) SetRowBatch(val *data.TRowBatch) { - p.RowBatch = val -} -func (p *TTabletWriterAddBatchParams) SetSenderNo(val int32) { - p.SenderNo = val -} - -var fieldIDToName_TTabletWriterAddBatchParams = map[int16]string{ - 1: "id", - 2: "index_id", - 3: "packet_seq", - 4: "tablet_ids", - 5: "row_batch", - 6: "sender_no", -} - -func (p *TTabletWriterAddBatchParams) IsSetId() bool { - return p.Id != nil -} - -func (p *TTabletWriterAddBatchParams) IsSetRowBatch() bool { - return p.RowBatch != nil -} - -func (p *TTabletWriterAddBatchParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetPacketSeq bool = false - var issetTabletIds bool = false - var issetRowBatch bool = false - var issetSenderNo bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetIndexId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I64 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetPacketSeq = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 4: - if fieldTypeId == thrift.LIST { - if err = p.ReadField4(iprot); err != nil { - goto ReadFieldError - } - issetTabletIds = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 5: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField5(iprot); err != nil { - goto ReadFieldError - } - issetRowBatch = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 6: - if fieldTypeId == thrift.I32 { - if err = p.ReadField6(iprot); err != nil { - goto ReadFieldError - } - issetSenderNo = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetPacketSeq { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetTabletIds { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetRowBatch { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetSenderNo { - fieldId = 6 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterAddBatchParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterAddBatchParams[fieldId])) -} - -func (p *TTabletWriterAddBatchParams) ReadField1(iprot thrift.TProtocol) error { - _field := types.NewTUniqueId() - if err := _field.Read(iprot); err != nil { - return err - } - p.Id = _field - return nil -} -func (p *TTabletWriterAddBatchParams) ReadField2(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.IndexId = _field - return nil -} -func (p *TTabletWriterAddBatchParams) ReadField3(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.PacketSeq = _field - return nil -} -func (p *TTabletWriterAddBatchParams) ReadField4(iprot thrift.TProtocol) error { - _, size, err := iprot.ReadListBegin() - if err != nil { - return err - } - _field := make([]types.TTabletId, 0, size) - for i := 0; i < size; i++ { - - var _elem types.TTabletId - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _elem = v - } - - _field = append(_field, _elem) - } - if err := iprot.ReadListEnd(); err != nil { - return err - } - p.TabletIds = _field - return nil -} -func (p *TTabletWriterAddBatchParams) ReadField5(iprot thrift.TProtocol) error { - _field := data.NewTRowBatch() - if err := _field.Read(iprot); err != nil { - return err - } - p.RowBatch = _field - return nil -} -func (p *TTabletWriterAddBatchParams) ReadField6(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.SenderNo = _field - return nil -} - -func (p *TTabletWriterAddBatchParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTabletWriterAddBatchParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - if err = p.writeField4(oprot); err != nil { - fieldId = 4 - goto WriteFieldError - } - if err = p.writeField5(oprot); err != nil { - fieldId = 5 - goto WriteFieldError - } - if err = p.writeField6(oprot); err != nil { - fieldId = 6 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterAddBatchParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Id.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTabletWriterAddBatchParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("index_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.IndexId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TTabletWriterAddBatchParams) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("packet_seq", thrift.I64, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.PacketSeq); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TTabletWriterAddBatchParams) writeField4(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("tablet_ids", thrift.LIST, 4); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteListBegin(thrift.I64, len(p.TabletIds)); err != nil { - return err - } - for _, v := range p.TabletIds { - if err := oprot.WriteI64(v); err != nil { - return err - } - } - if err := oprot.WriteListEnd(); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) -} - -func (p *TTabletWriterAddBatchParams) writeField5(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("row_batch", thrift.STRUCT, 5); err != nil { - goto WriteFieldBeginError - } - if err := p.RowBatch.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) -} - -func (p *TTabletWriterAddBatchParams) writeField6(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sender_no", thrift.I32, 6); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.SenderNo); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) -} - -func (p *TTabletWriterAddBatchParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterAddBatchParams(%+v)", *p) - -} - -func (p *TTabletWriterAddBatchParams) DeepEqual(ano *TTabletWriterAddBatchParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Id) { - return false - } - if !p.Field2DeepEqual(ano.IndexId) { - return false - } - if !p.Field3DeepEqual(ano.PacketSeq) { - return false - } - if !p.Field4DeepEqual(ano.TabletIds) { - return false - } - if !p.Field5DeepEqual(ano.RowBatch) { - return false - } - if !p.Field6DeepEqual(ano.SenderNo) { - return false - } - return true -} - -func (p *TTabletWriterAddBatchParams) Field1DeepEqual(src *types.TUniqueId) bool { - - if !p.Id.DeepEqual(src) { - return false - } - return true -} -func (p *TTabletWriterAddBatchParams) Field2DeepEqual(src int64) bool { - - if p.IndexId != src { - return false - } - return true -} -func (p *TTabletWriterAddBatchParams) Field3DeepEqual(src int64) bool { - - if p.PacketSeq != src { - return false - } - return true -} -func (p *TTabletWriterAddBatchParams) Field4DeepEqual(src []types.TTabletId) bool { - - if len(p.TabletIds) != len(src) { - return false - } - for i, v := range p.TabletIds { - _src := src[i] - if v != _src { - return false - } - } - return true -} -func (p *TTabletWriterAddBatchParams) Field5DeepEqual(src *data.TRowBatch) bool { - - if !p.RowBatch.DeepEqual(src) { - return false - } - return true -} -func (p *TTabletWriterAddBatchParams) Field6DeepEqual(src int32) bool { - - if p.SenderNo != src { - return false - } - return true -} - -type TTabletWriterAddBatchResult_ struct { - Status *status.TStatus `thrift:"status,1,required" frugal:"1,required,status.TStatus" json:"status"` -} - -func NewTTabletWriterAddBatchResult_() *TTabletWriterAddBatchResult_ { - return &TTabletWriterAddBatchResult_{} -} - -func (p *TTabletWriterAddBatchResult_) InitDefault() { -} - -var TTabletWriterAddBatchResult__Status_DEFAULT *status.TStatus - -func (p *TTabletWriterAddBatchResult_) GetStatus() (v *status.TStatus) { - if !p.IsSetStatus() { - return TTabletWriterAddBatchResult__Status_DEFAULT - } - return p.Status -} -func (p *TTabletWriterAddBatchResult_) SetStatus(val *status.TStatus) { - p.Status = val -} - -var fieldIDToName_TTabletWriterAddBatchResult_ = map[int16]string{ - 1: "status", -} - -func (p *TTabletWriterAddBatchResult_) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TTabletWriterAddBatchResult_) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetStatus bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetStatus = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterAddBatchResult_[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterAddBatchResult_[fieldId])) -} - -func (p *TTabletWriterAddBatchResult_) ReadField1(iprot thrift.TProtocol) error { - _field := status.NewTStatus() - if err := _field.Read(iprot); err != nil { - return err - } - p.Status = _field - return nil -} - -func (p *TTabletWriterAddBatchResult_) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTabletWriterAddBatchResult"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterAddBatchResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Status.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTabletWriterAddBatchResult_) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterAddBatchResult_(%+v)", *p) - -} - -func (p *TTabletWriterAddBatchResult_) DeepEqual(ano *TTabletWriterAddBatchResult_) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Status) { - return false - } - return true -} - -func (p *TTabletWriterAddBatchResult_) Field1DeepEqual(src *status.TStatus) bool { - - if !p.Status.DeepEqual(src) { - return false - } - return true -} - -type TTabletWriterCloseParams struct { - Id *types.TUniqueId `thrift:"id,1,required" frugal:"1,required,types.TUniqueId" json:"id"` - IndexId int64 `thrift:"index_id,2,required" frugal:"2,required,i64" json:"index_id"` - SenderNo int32 `thrift:"sender_no,3,required" frugal:"3,required,i32" json:"sender_no"` -} - -func NewTTabletWriterCloseParams() *TTabletWriterCloseParams { - return &TTabletWriterCloseParams{} -} - -func (p *TTabletWriterCloseParams) InitDefault() { -} - -var TTabletWriterCloseParams_Id_DEFAULT *types.TUniqueId - -func (p *TTabletWriterCloseParams) GetId() (v *types.TUniqueId) { - if !p.IsSetId() { - return TTabletWriterCloseParams_Id_DEFAULT - } - return p.Id -} - -func (p *TTabletWriterCloseParams) GetIndexId() (v int64) { - return p.IndexId -} - -func (p *TTabletWriterCloseParams) GetSenderNo() (v int32) { - return p.SenderNo -} -func (p *TTabletWriterCloseParams) SetId(val *types.TUniqueId) { - p.Id = val -} -func (p *TTabletWriterCloseParams) SetIndexId(val int64) { - p.IndexId = val -} -func (p *TTabletWriterCloseParams) SetSenderNo(val int32) { - p.SenderNo = val -} - -var fieldIDToName_TTabletWriterCloseParams = map[int16]string{ - 1: "id", - 2: "index_id", - 3: "sender_no", -} - -func (p *TTabletWriterCloseParams) IsSetId() bool { - return p.Id != nil -} - -func (p *TTabletWriterCloseParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetSenderNo bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetIndexId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I32 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetSenderNo = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetSenderNo { - fieldId = 3 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterCloseParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterCloseParams[fieldId])) -} - -func (p *TTabletWriterCloseParams) ReadField1(iprot thrift.TProtocol) error { - _field := types.NewTUniqueId() - if err := _field.Read(iprot); err != nil { - return err - } - p.Id = _field - return nil -} -func (p *TTabletWriterCloseParams) ReadField2(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.IndexId = _field - return nil -} -func (p *TTabletWriterCloseParams) ReadField3(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.SenderNo = _field - return nil -} - -func (p *TTabletWriterCloseParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTabletWriterCloseParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterCloseParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Id.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTabletWriterCloseParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("index_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.IndexId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TTabletWriterCloseParams) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sender_no", thrift.I32, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.SenderNo); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TTabletWriterCloseParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterCloseParams(%+v)", *p) - -} - -func (p *TTabletWriterCloseParams) DeepEqual(ano *TTabletWriterCloseParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Id) { - return false - } - if !p.Field2DeepEqual(ano.IndexId) { - return false - } - if !p.Field3DeepEqual(ano.SenderNo) { - return false - } - return true -} - -func (p *TTabletWriterCloseParams) Field1DeepEqual(src *types.TUniqueId) bool { - - if !p.Id.DeepEqual(src) { - return false - } - return true -} -func (p *TTabletWriterCloseParams) Field2DeepEqual(src int64) bool { - - if p.IndexId != src { - return false - } - return true -} -func (p *TTabletWriterCloseParams) Field3DeepEqual(src int32) bool { - - if p.SenderNo != src { - return false - } - return true -} - -type TTabletWriterCloseResult_ struct { - Status *status.TStatus `thrift:"status,1,required" frugal:"1,required,status.TStatus" json:"status"` -} - -func NewTTabletWriterCloseResult_() *TTabletWriterCloseResult_ { - return &TTabletWriterCloseResult_{} -} - -func (p *TTabletWriterCloseResult_) InitDefault() { -} - -var TTabletWriterCloseResult__Status_DEFAULT *status.TStatus - -func (p *TTabletWriterCloseResult_) GetStatus() (v *status.TStatus) { - if !p.IsSetStatus() { - return TTabletWriterCloseResult__Status_DEFAULT - } - return p.Status -} -func (p *TTabletWriterCloseResult_) SetStatus(val *status.TStatus) { - p.Status = val -} - -var fieldIDToName_TTabletWriterCloseResult_ = map[int16]string{ - 1: "status", -} - -func (p *TTabletWriterCloseResult_) IsSetStatus() bool { - return p.Status != nil -} - -func (p *TTabletWriterCloseResult_) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetStatus bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetStatus = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterCloseResult_[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterCloseResult_[fieldId])) -} - -func (p *TTabletWriterCloseResult_) ReadField1(iprot thrift.TProtocol) error { - _field := status.NewTStatus() - if err := _field.Read(iprot); err != nil { - return err - } - p.Status = _field - return nil -} - -func (p *TTabletWriterCloseResult_) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTabletWriterCloseResult"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterCloseResult_) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("status", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Status.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTabletWriterCloseResult_) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterCloseResult_(%+v)", *p) - -} - -func (p *TTabletWriterCloseResult_) DeepEqual(ano *TTabletWriterCloseResult_) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Status) { - return false - } - return true -} - -func (p *TTabletWriterCloseResult_) Field1DeepEqual(src *status.TStatus) bool { - - if !p.Status.DeepEqual(src) { - return false - } - return true -} - -type TTabletWriterCancelParams struct { - Id *types.TUniqueId `thrift:"id,1,required" frugal:"1,required,types.TUniqueId" json:"id"` - IndexId int64 `thrift:"index_id,2,required" frugal:"2,required,i64" json:"index_id"` - SenderNo int32 `thrift:"sender_no,3,required" frugal:"3,required,i32" json:"sender_no"` -} - -func NewTTabletWriterCancelParams() *TTabletWriterCancelParams { - return &TTabletWriterCancelParams{} -} - -func (p *TTabletWriterCancelParams) InitDefault() { -} - -var TTabletWriterCancelParams_Id_DEFAULT *types.TUniqueId - -func (p *TTabletWriterCancelParams) GetId() (v *types.TUniqueId) { - if !p.IsSetId() { - return TTabletWriterCancelParams_Id_DEFAULT - } - return p.Id -} - -func (p *TTabletWriterCancelParams) GetIndexId() (v int64) { - return p.IndexId -} - -func (p *TTabletWriterCancelParams) GetSenderNo() (v int32) { - return p.SenderNo -} -func (p *TTabletWriterCancelParams) SetId(val *types.TUniqueId) { - p.Id = val -} -func (p *TTabletWriterCancelParams) SetIndexId(val int64) { - p.IndexId = val -} -func (p *TTabletWriterCancelParams) SetSenderNo(val int32) { - p.SenderNo = val -} - -var fieldIDToName_TTabletWriterCancelParams = map[int16]string{ - 1: "id", - 2: "index_id", - 3: "sender_no", -} - -func (p *TTabletWriterCancelParams) IsSetId() bool { - return p.Id != nil -} - -func (p *TTabletWriterCancelParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetSenderNo bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.I64 { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetIndexId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 3: - if fieldTypeId == thrift.I32 { - if err = p.ReadField3(iprot); err != nil { - goto ReadFieldError - } - issetSenderNo = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetSenderNo { - fieldId = 3 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterCancelParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterCancelParams[fieldId])) -} - -func (p *TTabletWriterCancelParams) ReadField1(iprot thrift.TProtocol) error { - _field := types.NewTUniqueId() - if err := _field.Read(iprot); err != nil { - return err - } - p.Id = _field - return nil -} -func (p *TTabletWriterCancelParams) ReadField2(iprot thrift.TProtocol) error { - - var _field int64 - if v, err := iprot.ReadI64(); err != nil { - return err - } else { - _field = v - } - p.IndexId = _field - return nil -} -func (p *TTabletWriterCancelParams) ReadField3(iprot thrift.TProtocol) error { - - var _field int32 - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = v - } - p.SenderNo = _field - return nil -} - -func (p *TTabletWriterCancelParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TTabletWriterCancelParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - if err = p.writeField3(oprot); err != nil { - fieldId = 3 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterCancelParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("id", thrift.STRUCT, 1); err != nil { - goto WriteFieldBeginError - } - if err := p.Id.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TTabletWriterCancelParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("index_id", thrift.I64, 2); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI64(p.IndexId); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TTabletWriterCancelParams) writeField3(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("sender_no", thrift.I32, 3); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(p.SenderNo); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) -} - -func (p *TTabletWriterCancelParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterCancelParams(%+v)", *p) - -} - -func (p *TTabletWriterCancelParams) DeepEqual(ano *TTabletWriterCancelParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.Id) { - return false - } - if !p.Field2DeepEqual(ano.IndexId) { - return false - } - if !p.Field3DeepEqual(ano.SenderNo) { - return false - } - return true -} - -func (p *TTabletWriterCancelParams) Field1DeepEqual(src *types.TUniqueId) bool { - - if !p.Id.DeepEqual(src) { - return false - } - return true -} -func (p *TTabletWriterCancelParams) Field2DeepEqual(src int64) bool { - - if p.IndexId != src { - return false - } - return true -} -func (p *TTabletWriterCancelParams) Field3DeepEqual(src int32) bool { - - if p.SenderNo != src { - return false - } - return true -} - -type TTabletWriterCancelResult_ struct { -} - -func NewTTabletWriterCancelResult_() *TTabletWriterCancelResult_ { - return &TTabletWriterCancelResult_{} -} - -func (p *TTabletWriterCancelResult_) InitDefault() { -} - -var fieldIDToName_TTabletWriterCancelResult_ = map[int16]string{} - -func (p *TTabletWriterCancelResult_) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldTypeError - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldTypeError: - return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -func (p *TTabletWriterCancelResult_) Write(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteStructBegin("TTabletWriterCancelResult"); err != nil { - goto WriteStructBeginError - } - if p != nil { - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TTabletWriterCancelResult_) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TTabletWriterCancelResult_(%+v)", *p) - -} - -func (p *TTabletWriterCancelResult_) DeepEqual(ano *TTabletWriterCancelResult_) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - return true -} - -type TFetchDataParams struct { - ProtocolVersion PaloInternalServiceVersion `thrift:"protocol_version,1,required" frugal:"1,required,PaloInternalServiceVersion" json:"protocol_version"` - FragmentInstanceId *types.TUniqueId `thrift:"fragment_instance_id,2,required" frugal:"2,required,types.TUniqueId" json:"fragment_instance_id"` -} - -func NewTFetchDataParams() *TFetchDataParams { - return &TFetchDataParams{} -} - -func (p *TFetchDataParams) InitDefault() { -} - -func (p *TFetchDataParams) GetProtocolVersion() (v PaloInternalServiceVersion) { - return p.ProtocolVersion -} - -var TFetchDataParams_FragmentInstanceId_DEFAULT *types.TUniqueId - -func (p *TFetchDataParams) GetFragmentInstanceId() (v *types.TUniqueId) { - if !p.IsSetFragmentInstanceId() { - return TFetchDataParams_FragmentInstanceId_DEFAULT - } - return p.FragmentInstanceId -} -func (p *TFetchDataParams) SetProtocolVersion(val PaloInternalServiceVersion) { - p.ProtocolVersion = val -} -func (p *TFetchDataParams) SetFragmentInstanceId(val *types.TUniqueId) { - p.FragmentInstanceId = val -} - -var fieldIDToName_TFetchDataParams = map[int16]string{ - 1: "protocol_version", - 2: "fragment_instance_id", -} - -func (p *TFetchDataParams) IsSetFragmentInstanceId() bool { - return p.FragmentInstanceId != nil -} - -func (p *TFetchDataParams) Read(iprot thrift.TProtocol) (err error) { - - var fieldTypeId thrift.TType - var fieldId int16 - var issetProtocolVersion bool = false - var issetFragmentInstanceId bool = false - - if _, err = iprot.ReadStructBegin(); err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - if err = p.ReadField1(iprot); err != nil { - goto ReadFieldError - } - issetProtocolVersion = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - case 2: - if fieldTypeId == thrift.STRUCT { - if err = p.ReadField2(iprot); err != nil { - goto ReadFieldError - } - issetFragmentInstanceId = true - } else if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - default: - if err = iprot.Skip(fieldTypeId); err != nil { - goto SkipFieldError - } - } - if err = iprot.ReadFieldEnd(); err != nil { - goto ReadFieldEndError - } - } - if err = iprot.ReadStructEnd(); err != nil { - goto ReadStructEndError - } - - if !issetProtocolVersion { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFragmentInstanceId { - fieldId = 2 - goto RequiredFieldNotSetError - } - return nil -ReadStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFetchDataParams[fieldId]), err) -SkipFieldError: - return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) - -ReadFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFetchDataParams[fieldId])) -} - -func (p *TFetchDataParams) ReadField1(iprot thrift.TProtocol) error { - - var _field PaloInternalServiceVersion - if v, err := iprot.ReadI32(); err != nil { - return err - } else { - _field = PaloInternalServiceVersion(v) - } - p.ProtocolVersion = _field - return nil -} -func (p *TFetchDataParams) ReadField2(iprot thrift.TProtocol) error { - _field := types.NewTUniqueId() - if err := _field.Read(iprot); err != nil { - return err - } - p.FragmentInstanceId = _field - return nil -} - -func (p *TFetchDataParams) Write(oprot thrift.TProtocol) (err error) { - var fieldId int16 - if err = oprot.WriteStructBegin("TFetchDataParams"); err != nil { - goto WriteStructBeginError - } - if p != nil { - if err = p.writeField1(oprot); err != nil { - fieldId = 1 - goto WriteFieldError - } - if err = p.writeField2(oprot); err != nil { - fieldId = 2 - goto WriteFieldError - } - } - if err = oprot.WriteFieldStop(); err != nil { - goto WriteFieldStopError - } - if err = oprot.WriteStructEnd(); err != nil { - goto WriteStructEndError - } - return nil -WriteStructBeginError: - return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) -WriteFieldError: - return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) -WriteFieldStopError: - return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) -WriteStructEndError: - return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) -} - -func (p *TFetchDataParams) writeField1(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("protocol_version", thrift.I32, 1); err != nil { - goto WriteFieldBeginError - } - if err := oprot.WriteI32(int32(p.ProtocolVersion)); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) -} - -func (p *TFetchDataParams) writeField2(oprot thrift.TProtocol) (err error) { - if err = oprot.WriteFieldBegin("fragment_instance_id", thrift.STRUCT, 2); err != nil { - goto WriteFieldBeginError - } - if err := p.FragmentInstanceId.Write(oprot); err != nil { - return err - } - if err = oprot.WriteFieldEnd(); err != nil { - goto WriteFieldEndError - } - return nil -WriteFieldBeginError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) -WriteFieldEndError: - return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) -} - -func (p *TFetchDataParams) String() string { - if p == nil { - return "" - } - return fmt.Sprintf("TFetchDataParams(%+v)", *p) - -} - -func (p *TFetchDataParams) DeepEqual(ano *TFetchDataParams) bool { - if p == ano { - return true - } else if p == nil || ano == nil { - return false - } - if !p.Field1DeepEqual(ano.ProtocolVersion) { - return false - } - if !p.Field2DeepEqual(ano.FragmentInstanceId) { - return false - } - return true -} - -func (p *TFetchDataParams) Field1DeepEqual(src PaloInternalServiceVersion) bool { - - if p.ProtocolVersion != src { - return false - } - return true -} -func (p *TFetchDataParams) Field2DeepEqual(src *types.TUniqueId) bool { - - if !p.FragmentInstanceId.DeepEqual(src) { - return false - } - return true -} - type TFetchDataResult_ struct { ResultBatch *data.TResultBatch `thrift:"result_batch,1,required" frugal:"1,required,data.TResultBatch" json:"result_batch"` Eos bool `thrift:"eos,2,required" frugal:"2,required,bool" json:"eos"` diff --git a/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go b/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go index 92ad27e1..ce439a1d 100644 --- a/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go +++ b/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go @@ -16,7 +16,6 @@ import ( "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/datasinks" "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/descriptors" "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/exprs" - "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/paloservice" "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/planner" "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/plannodes" "github.com/selectdb/ccr_syncer/pkg/rpc/kitex_gen/runtimeprofile" @@ -36,7 +35,6 @@ var ( _ = datasinks.KitexUnusedProtection _ = descriptors.KitexUnusedProtection _ = exprs.KitexUnusedProtection - _ = paloservice.KitexUnusedProtection _ = planner.KitexUnusedProtection _ = plannodes.KitexUnusedProtection _ = runtimeprofile.KitexUnusedProtection @@ -2985,6 +2983,90 @@ func (p *TQueryOptions) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 142: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField142(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 143: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField143(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 144: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField144(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 145: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField145(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 146: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField146(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 147: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField147(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 1000: if fieldTypeId == thrift.BOOL { l, err = p.FastReadField1000(buf[offset:]) @@ -4871,6 +4953,90 @@ func (p *TQueryOptions) FastReadField141(buf []byte) (int, error) { return offset, nil } +func (p *TQueryOptions) FastReadField142(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EnableFixedLenToUint32V2 = v + + } + return offset, nil +} + +func (p *TQueryOptions) FastReadField143(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EnableSharedExchangeSinkBuffer = v + + } + return offset, nil +} + +func (p *TQueryOptions) FastReadField144(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EnableInvertedIndexSearcherCache = v + + } + return offset, nil +} + +func (p *TQueryOptions) FastReadField145(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EnableInvertedIndexQueryCache = v + + } + return offset, nil +} + +func (p *TQueryOptions) FastReadField146(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.FuzzyDisableRuntimeFilterInBe = v + + } + return offset, nil +} + +func (p *TQueryOptions) FastReadField147(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.ProfileLevel = v + + } + return offset, nil +} + func (p *TQueryOptions) FastReadField1000(buf []byte) (int, error) { offset := 0 @@ -5021,6 +5187,12 @@ func (p *TQueryOptions) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryW offset += p.fastWriteField139(buf[offset:], binaryWriter) offset += p.fastWriteField140(buf[offset:], binaryWriter) offset += p.fastWriteField141(buf[offset:], binaryWriter) + offset += p.fastWriteField142(buf[offset:], binaryWriter) + offset += p.fastWriteField143(buf[offset:], binaryWriter) + offset += p.fastWriteField144(buf[offset:], binaryWriter) + offset += p.fastWriteField145(buf[offset:], binaryWriter) + offset += p.fastWriteField146(buf[offset:], binaryWriter) + offset += p.fastWriteField147(buf[offset:], binaryWriter) offset += p.fastWriteField1000(buf[offset:], binaryWriter) offset += p.fastWriteField18(buf[offset:], binaryWriter) offset += p.fastWriteField42(buf[offset:], binaryWriter) @@ -5169,6 +5341,12 @@ func (p *TQueryOptions) BLength() int { l += p.field139Length() l += p.field140Length() l += p.field141Length() + l += p.field142Length() + l += p.field143Length() + l += p.field144Length() + l += p.field145Length() + l += p.field146Length() + l += p.field147Length() l += p.field1000Length() } l += bthrift.Binary.FieldStopLength() @@ -6627,6 +6805,72 @@ func (p *TQueryOptions) fastWriteField141(buf []byte, binaryWriter bthrift.Binar return offset } +func (p *TQueryOptions) fastWriteField142(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetEnableFixedLenToUint32V2() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "enable_fixed_len_to_uint32_v2", thrift.BOOL, 142) + offset += bthrift.Binary.WriteBool(buf[offset:], p.EnableFixedLenToUint32V2) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryOptions) fastWriteField143(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetEnableSharedExchangeSinkBuffer() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "enable_shared_exchange_sink_buffer", thrift.BOOL, 143) + offset += bthrift.Binary.WriteBool(buf[offset:], p.EnableSharedExchangeSinkBuffer) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryOptions) fastWriteField144(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetEnableInvertedIndexSearcherCache() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "enable_inverted_index_searcher_cache", thrift.BOOL, 144) + offset += bthrift.Binary.WriteBool(buf[offset:], p.EnableInvertedIndexSearcherCache) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryOptions) fastWriteField145(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetEnableInvertedIndexQueryCache() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "enable_inverted_index_query_cache", thrift.BOOL, 145) + offset += bthrift.Binary.WriteBool(buf[offset:], p.EnableInvertedIndexQueryCache) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryOptions) fastWriteField146(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetFuzzyDisableRuntimeFilterInBe() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fuzzy_disable_runtime_filter_in_be", thrift.BOOL, 146) + offset += bthrift.Binary.WriteBool(buf[offset:], p.FuzzyDisableRuntimeFilterInBe) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryOptions) fastWriteField147(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetProfileLevel() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "profile_level", thrift.I32, 147) + offset += bthrift.Binary.WriteI32(buf[offset:], p.ProfileLevel) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TQueryOptions) fastWriteField1000(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetDisableFileCache() { @@ -8089,6 +8333,72 @@ func (p *TQueryOptions) field141Length() int { return l } +func (p *TQueryOptions) field142Length() int { + l := 0 + if p.IsSetEnableFixedLenToUint32V2() { + l += bthrift.Binary.FieldBeginLength("enable_fixed_len_to_uint32_v2", thrift.BOOL, 142) + l += bthrift.Binary.BoolLength(p.EnableFixedLenToUint32V2) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryOptions) field143Length() int { + l := 0 + if p.IsSetEnableSharedExchangeSinkBuffer() { + l += bthrift.Binary.FieldBeginLength("enable_shared_exchange_sink_buffer", thrift.BOOL, 143) + l += bthrift.Binary.BoolLength(p.EnableSharedExchangeSinkBuffer) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryOptions) field144Length() int { + l := 0 + if p.IsSetEnableInvertedIndexSearcherCache() { + l += bthrift.Binary.FieldBeginLength("enable_inverted_index_searcher_cache", thrift.BOOL, 144) + l += bthrift.Binary.BoolLength(p.EnableInvertedIndexSearcherCache) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryOptions) field145Length() int { + l := 0 + if p.IsSetEnableInvertedIndexQueryCache() { + l += bthrift.Binary.FieldBeginLength("enable_inverted_index_query_cache", thrift.BOOL, 145) + l += bthrift.Binary.BoolLength(p.EnableInvertedIndexQueryCache) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryOptions) field146Length() int { + l := 0 + if p.IsSetFuzzyDisableRuntimeFilterInBe() { + l += bthrift.Binary.FieldBeginLength("fuzzy_disable_runtime_filter_in_be", thrift.BOOL, 146) + l += bthrift.Binary.BoolLength(p.FuzzyDisableRuntimeFilterInBe) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryOptions) field147Length() int { + l := 0 + if p.IsSetProfileLevel() { + l += bthrift.Binary.FieldBeginLength("profile_level", thrift.I32, 147) + l += bthrift.Binary.I32Length(p.ProfileLevel) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TQueryOptions) field1000Length() int { l := 0 if p.IsSetDisableFileCache() { @@ -14355,13 +14665,14 @@ func (p *TCancelPlanFragmentResult_) field1Length() int { return l } -func (p *TExprMap) FastRead(buf []byte) (int, error) { +func (p *TFoldConstantParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int var fieldTypeId thrift.TType var fieldId int16 var issetExprMap bool = false + var issetQueryGlobals bool = false _, l, err = bthrift.Binary.ReadStructBegin(buf) offset += l if err != nil { @@ -14393,197 +14704,20 @@ func (p *TExprMap) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetExprMap { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TExprMap[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TExprMap[fieldId])) -} - -func (p *TExprMap) FastReadField1(buf []byte) (int, error) { - offset := 0 - - _, _, size, l, err := bthrift.Binary.ReadMapBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.ExprMap = make(map[string]*exprs.TExpr, size) - for i := 0; i < size; i++ { - var _key string - if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _key = v - - } - _val := exprs.NewTExpr() - if l, err := _val.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.ExprMap[_key] = _val - } - if l, err := bthrift.Binary.ReadMapEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -// for compatibility -func (p *TExprMap) FastWrite(buf []byte) int { - return 0 -} - -func (p *TExprMap) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TExprMap") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TExprMap) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TExprMap") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TExprMap) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "expr_map", thrift.MAP, 1) - mapBeginOffset := offset - offset += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.STRUCT, 0) - var length int - for k, v := range p.ExprMap { - length++ - - offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, k) - - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteMapBegin(buf[mapBeginOffset:], thrift.STRING, thrift.STRUCT, length) - offset += bthrift.Binary.WriteMapEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TExprMap) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("expr_map", thrift.MAP, 1) - l += bthrift.Binary.MapBeginLength(thrift.STRING, thrift.STRUCT, len(p.ExprMap)) - for k, v := range p.ExprMap { - - l += bthrift.Binary.StringLengthNocopy(k) - - l += v.BLength() - } - l += bthrift.Binary.MapEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TFoldConstantParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetExprMap bool = false - var issetQueryGlobals bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.MAP { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetExprMap = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetQueryGlobals = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } + case 2: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + issetQueryGlobals = true + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } } case 3: if fieldTypeId == thrift.BOOL { @@ -15068,20 +15202,6 @@ func (p *TTransmitDataParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } case 6: if fieldTypeId == thrift.BOOL { l, err = p.FastReadField6(buf[offset:]) @@ -15219,19 +15339,6 @@ func (p *TTransmitDataParams) FastReadField4(buf []byte) (int, error) { return offset, nil } -func (p *TTransmitDataParams) FastReadField5(buf []byte) (int, error) { - offset := 0 - - tmp := data.NewTRowBatch() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.RowBatch = tmp - return offset, nil -} - func (p *TTransmitDataParams) FastReadField6(buf []byte) (int, error) { offset := 0 @@ -15300,7 +15407,6 @@ func (p *TTransmitDataParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.B offset += p.fastWriteField9(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -15314,7 +15420,6 @@ func (p *TTransmitDataParams) BLength() int { l += p.field1Length() l += p.field2Length() l += p.field4Length() - l += p.field5Length() l += p.field6Length() l += p.field7Length() l += p.field8Length() @@ -15355,16 +15460,6 @@ func (p *TTransmitDataParams) fastWriteField4(buf []byte, binaryWriter bthrift.B return offset } -func (p *TTransmitDataParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetRowBatch() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "row_batch", thrift.STRUCT, 5) - offset += p.RowBatch.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - } - return offset -} - func (p *TTransmitDataParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetEos() { @@ -15439,16 +15534,6 @@ func (p *TTransmitDataParams) field4Length() int { return l } -func (p *TTransmitDataParams) field5Length() int { - l := 0 - if p.IsSetRowBatch() { - l += bthrift.Binary.FieldBeginLength("row_batch", thrift.STRUCT, 5) - l += p.RowBatch.BLength() - l += bthrift.Binary.FieldEndLength() - } - return l -} - func (p *TTransmitDataParams) field6Length() int { l := 0 if p.IsSetEos() { @@ -15968,2031 +16053,6 @@ func (p *TTabletWithPartition) field2Length() int { return l } -func (p *TTabletWriterOpenParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetTxnId bool = false - var issetSchema bool = false - var issetTablets bool = false - var issetNumSenders bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetIndexId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetTxnId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetSchema = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetTablets = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetNumSenders = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetTxnId { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetSchema { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetTablets { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetNumSenders { - fieldId = 6 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterOpenParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterOpenParams[fieldId])) -} - -func (p *TTabletWriterOpenParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Id = tmp - return offset, nil -} - -func (p *TTabletWriterOpenParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.IndexId = v - - } - return offset, nil -} - -func (p *TTabletWriterOpenParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.TxnId = v - - } - return offset, nil -} - -func (p *TTabletWriterOpenParams) FastReadField4(buf []byte) (int, error) { - offset := 0 - - tmp := descriptors.NewTOlapTableSchemaParam() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Schema = tmp - return offset, nil -} - -func (p *TTabletWriterOpenParams) FastReadField5(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.Tablets = make([]*TTabletWithPartition, 0, size) - for i := 0; i < size; i++ { - _elem := NewTTabletWithPartition() - if l, err := _elem.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - - p.Tablets = append(p.Tablets, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TTabletWriterOpenParams) FastReadField6(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.NumSenders = v - - } - return offset, nil -} - -// for compatibility -func (p *TTabletWriterOpenParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterOpenParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterOpenParams") - if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterOpenParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTabletWriterOpenParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.STRUCT, 1) - offset += p.Id.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "index_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], p.IndexId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "txn_id", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], p.TxnId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "schema", thrift.STRUCT, 4) - offset += p.Schema.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tablets", thrift.LIST, 5) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) - var length int - for _, v := range p.Tablets { - length++ - offset += v.FastWriteNocopy(buf[offset:], binaryWriter) - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "num_senders", thrift.I32, 6) - offset += bthrift.Binary.WriteI32(buf[offset:], p.NumSenders) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("id", thrift.STRUCT, 1) - l += p.Id.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterOpenParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("index_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(p.IndexId) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterOpenParams) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("txn_id", thrift.I64, 3) - l += bthrift.Binary.I64Length(p.TxnId) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterOpenParams) field4Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("schema", thrift.STRUCT, 4) - l += p.Schema.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterOpenParams) field5Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("tablets", thrift.LIST, 5) - l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.Tablets)) - for _, v := range p.Tablets { - l += v.BLength() - } - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterOpenParams) field6Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("num_senders", thrift.I32, 6) - l += bthrift.Binary.I32Length(p.NumSenders) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterOpenResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetStatus bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetStatus = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterOpenResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterOpenResult_[fieldId])) -} - -func (p *TTabletWriterOpenResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Status = tmp - return offset, nil -} - -// for compatibility -func (p *TTabletWriterOpenResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterOpenResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterOpenResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterOpenResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTabletWriterOpenResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterOpenResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterAddBatchParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetPacketSeq bool = false - var issetTabletIds bool = false - var issetRowBatch bool = false - var issetSenderNo bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetIndexId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetPacketSeq = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 4: - if fieldTypeId == thrift.LIST { - l, err = p.FastReadField4(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetTabletIds = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 5: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField5(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetRowBatch = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 6: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField6(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetSenderNo = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetPacketSeq { - fieldId = 3 - goto RequiredFieldNotSetError - } - - if !issetTabletIds { - fieldId = 4 - goto RequiredFieldNotSetError - } - - if !issetRowBatch { - fieldId = 5 - goto RequiredFieldNotSetError - } - - if !issetSenderNo { - fieldId = 6 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterAddBatchParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterAddBatchParams[fieldId])) -} - -func (p *TTabletWriterAddBatchParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Id = tmp - return offset, nil -} - -func (p *TTabletWriterAddBatchParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.IndexId = v - - } - return offset, nil -} - -func (p *TTabletWriterAddBatchParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.PacketSeq = v - - } - return offset, nil -} - -func (p *TTabletWriterAddBatchParams) FastReadField4(buf []byte) (int, error) { - offset := 0 - - _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) - offset += l - if err != nil { - return offset, err - } - p.TabletIds = make([]types.TTabletId, 0, size) - for i := 0; i < size; i++ { - var _elem types.TTabletId - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - _elem = v - - } - - p.TabletIds = append(p.TabletIds, _elem) - } - if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - return offset, nil -} - -func (p *TTabletWriterAddBatchParams) FastReadField5(buf []byte) (int, error) { - offset := 0 - - tmp := data.NewTRowBatch() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.RowBatch = tmp - return offset, nil -} - -func (p *TTabletWriterAddBatchParams) FastReadField6(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.SenderNo = v - - } - return offset, nil -} - -// for compatibility -func (p *TTabletWriterAddBatchParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterAddBatchParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterAddBatchParams") - if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField6(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField4(buf[offset:], binaryWriter) - offset += p.fastWriteField5(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterAddBatchParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - l += p.field4Length() - l += p.field5Length() - l += p.field6Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTabletWriterAddBatchParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.STRUCT, 1) - offset += p.Id.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "index_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], p.IndexId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "packet_seq", thrift.I64, 3) - offset += bthrift.Binary.WriteI64(buf[offset:], p.PacketSeq) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "tablet_ids", thrift.LIST, 4) - listBeginOffset := offset - offset += bthrift.Binary.ListBeginLength(thrift.I64, 0) - var length int - for _, v := range p.TabletIds { - length++ - offset += bthrift.Binary.WriteI64(buf[offset:], v) - - } - bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.I64, length) - offset += bthrift.Binary.WriteListEnd(buf[offset:]) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchParams) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "row_batch", thrift.STRUCT, 5) - offset += p.RowBatch.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchParams) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "sender_no", thrift.I32, 6) - offset += bthrift.Binary.WriteI32(buf[offset:], p.SenderNo) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("id", thrift.STRUCT, 1) - l += p.Id.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterAddBatchParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("index_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(p.IndexId) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterAddBatchParams) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("packet_seq", thrift.I64, 3) - l += bthrift.Binary.I64Length(p.PacketSeq) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterAddBatchParams) field4Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("tablet_ids", thrift.LIST, 4) - l += bthrift.Binary.ListBeginLength(thrift.I64, len(p.TabletIds)) - var tmpV types.TTabletId - l += bthrift.Binary.I64Length(int64(tmpV)) * len(p.TabletIds) - l += bthrift.Binary.ListEndLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterAddBatchParams) field5Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("row_batch", thrift.STRUCT, 5) - l += p.RowBatch.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterAddBatchParams) field6Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("sender_no", thrift.I32, 6) - l += bthrift.Binary.I32Length(p.SenderNo) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterAddBatchResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetStatus bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetStatus = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterAddBatchResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterAddBatchResult_[fieldId])) -} - -func (p *TTabletWriterAddBatchResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Status = tmp - return offset, nil -} - -// for compatibility -func (p *TTabletWriterAddBatchResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterAddBatchResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterAddBatchResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterAddBatchResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTabletWriterAddBatchResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterAddBatchResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCloseParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetSenderNo bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetIndexId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetSenderNo = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetSenderNo { - fieldId = 3 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterCloseParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterCloseParams[fieldId])) -} - -func (p *TTabletWriterCloseParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Id = tmp - return offset, nil -} - -func (p *TTabletWriterCloseParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.IndexId = v - - } - return offset, nil -} - -func (p *TTabletWriterCloseParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.SenderNo = v - - } - return offset, nil -} - -// for compatibility -func (p *TTabletWriterCloseParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterCloseParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterCloseParams") - if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCloseParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterCloseParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTabletWriterCloseParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.STRUCT, 1) - offset += p.Id.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCloseParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "index_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], p.IndexId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCloseParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "sender_no", thrift.I32, 3) - offset += bthrift.Binary.WriteI32(buf[offset:], p.SenderNo) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCloseParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("id", thrift.STRUCT, 1) - l += p.Id.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCloseParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("index_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(p.IndexId) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCloseParams) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("sender_no", thrift.I32, 3) - l += bthrift.Binary.I32Length(p.SenderNo) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCloseResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetStatus bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetStatus = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetStatus { - fieldId = 1 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterCloseResult_[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterCloseResult_[fieldId])) -} - -func (p *TTabletWriterCloseResult_) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := status.NewTStatus() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Status = tmp - return offset, nil -} - -// for compatibility -func (p *TTabletWriterCloseResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterCloseResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterCloseResult") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCloseResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterCloseResult") - if p != nil { - l += p.field1Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTabletWriterCloseResult_) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "status", thrift.STRUCT, 1) - offset += p.Status.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCloseResult_) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("status", thrift.STRUCT, 1) - l += p.Status.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCancelParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetId bool = false - var issetIndexId bool = false - var issetSenderNo bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.I64 { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetIndexId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 3: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField3(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetSenderNo = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetId { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetIndexId { - fieldId = 2 - goto RequiredFieldNotSetError - } - - if !issetSenderNo { - fieldId = 3 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TTabletWriterCancelParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TTabletWriterCancelParams[fieldId])) -} - -func (p *TTabletWriterCancelParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.Id = tmp - return offset, nil -} - -func (p *TTabletWriterCancelParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.IndexId = v - - } - return offset, nil -} - -func (p *TTabletWriterCancelParams) FastReadField3(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.SenderNo = v - - } - return offset, nil -} - -// for compatibility -func (p *TTabletWriterCancelParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterCancelParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterCancelParams") - if p != nil { - offset += p.fastWriteField2(buf[offset:], binaryWriter) - offset += p.fastWriteField3(buf[offset:], binaryWriter) - offset += p.fastWriteField1(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCancelParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterCancelParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - l += p.field3Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TTabletWriterCancelParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "id", thrift.STRUCT, 1) - offset += p.Id.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCancelParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "index_id", thrift.I64, 2) - offset += bthrift.Binary.WriteI64(buf[offset:], p.IndexId) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCancelParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "sender_no", thrift.I32, 3) - offset += bthrift.Binary.WriteI32(buf[offset:], p.SenderNo) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCancelParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("id", thrift.STRUCT, 1) - l += p.Id.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCancelParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("index_id", thrift.I64, 2) - l += bthrift.Binary.I64Length(p.IndexId) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCancelParams) field3Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("sender_no", thrift.I32, 3) - l += bthrift.Binary.I32Length(p.SenderNo) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TTabletWriterCancelResult_) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -} - -// for compatibility -func (p *TTabletWriterCancelResult_) FastWrite(buf []byte) int { - return 0 -} - -func (p *TTabletWriterCancelResult_) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TTabletWriterCancelResult") - if p != nil { - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TTabletWriterCancelResult_) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TTabletWriterCancelResult") - if p != nil { - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TFetchDataParams) FastRead(buf []byte) (int, error) { - var err error - var offset int - var l int - var fieldTypeId thrift.TType - var fieldId int16 - var issetProtocolVersion bool = false - var issetFragmentInstanceId bool = false - _, l, err = bthrift.Binary.ReadStructBegin(buf) - offset += l - if err != nil { - goto ReadStructBeginError - } - - for { - _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldBeginError - } - if fieldTypeId == thrift.STOP { - break - } - switch fieldId { - case 1: - if fieldTypeId == thrift.I32 { - l, err = p.FastReadField1(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetProtocolVersion = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - case 2: - if fieldTypeId == thrift.STRUCT { - l, err = p.FastReadField2(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldError - } - issetFragmentInstanceId = true - } else { - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - default: - l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) - offset += l - if err != nil { - goto SkipFieldError - } - } - - l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadFieldEndError - } - } - l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) - offset += l - if err != nil { - goto ReadStructEndError - } - - if !issetProtocolVersion { - fieldId = 1 - goto RequiredFieldNotSetError - } - - if !issetFragmentInstanceId { - fieldId = 2 - goto RequiredFieldNotSetError - } - return offset, nil -ReadStructBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) -ReadFieldBeginError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) -ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TFetchDataParams[fieldId]), err) -SkipFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) -ReadFieldEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) -ReadStructEndError: - return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) -RequiredFieldNotSetError: - return offset, thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, fmt.Errorf("required field %s is not set", fieldIDToName_TFetchDataParams[fieldId])) -} - -func (p *TFetchDataParams) FastReadField1(buf []byte) (int, error) { - offset := 0 - - if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - - p.ProtocolVersion = PaloInternalServiceVersion(v) - - } - return offset, nil -} - -func (p *TFetchDataParams) FastReadField2(buf []byte) (int, error) { - offset := 0 - - tmp := types.NewTUniqueId() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l - } - p.FragmentInstanceId = tmp - return offset, nil -} - -// for compatibility -func (p *TFetchDataParams) FastWrite(buf []byte) int { - return 0 -} - -func (p *TFetchDataParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TFetchDataParams") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) - offset += p.fastWriteField2(buf[offset:], binaryWriter) - } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) - return offset -} - -func (p *TFetchDataParams) BLength() int { - l := 0 - l += bthrift.Binary.StructBeginLength("TFetchDataParams") - if p != nil { - l += p.field1Length() - l += p.field2Length() - } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() - return l -} - -func (p *TFetchDataParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "protocol_version", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(p.ProtocolVersion)) - - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TFetchDataParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "fragment_instance_id", thrift.STRUCT, 2) - offset += p.FragmentInstanceId.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) - return offset -} - -func (p *TFetchDataParams) field1Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("protocol_version", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(p.ProtocolVersion)) - - l += bthrift.Binary.FieldEndLength() - return l -} - -func (p *TFetchDataParams) field2Length() int { - l := 0 - l += bthrift.Binary.FieldBeginLength("fragment_instance_id", thrift.STRUCT, 2) - l += p.FragmentInstanceId.BLength() - l += bthrift.Binary.FieldEndLength() - return l -} - func (p *TFetchDataResult_) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/pkg/rpc/kitex_gen/plannodes/PlanNodes.go b/pkg/rpc/kitex_gen/plannodes/PlanNodes.go index d542dbc3..ff485409 100644 --- a/pkg/rpc/kitex_gen/plannodes/PlanNodes.go +++ b/pkg/rpc/kitex_gen/plannodes/PlanNodes.go @@ -218,105 +218,6 @@ func (p *TPlanNodeType) Value() (driver.Value, error) { return int64(*p), nil } -type TExecNodePhase int64 - -const ( - TExecNodePhase_PREPARE TExecNodePhase = 0 - TExecNodePhase_OPEN TExecNodePhase = 1 - TExecNodePhase_GETNEXT TExecNodePhase = 2 - TExecNodePhase_CLOSE TExecNodePhase = 3 - TExecNodePhase_INVALID TExecNodePhase = 4 -) - -func (p TExecNodePhase) String() string { - switch p { - case TExecNodePhase_PREPARE: - return "PREPARE" - case TExecNodePhase_OPEN: - return "OPEN" - case TExecNodePhase_GETNEXT: - return "GETNEXT" - case TExecNodePhase_CLOSE: - return "CLOSE" - case TExecNodePhase_INVALID: - return "INVALID" - } - return "" -} - -func TExecNodePhaseFromString(s string) (TExecNodePhase, error) { - switch s { - case "PREPARE": - return TExecNodePhase_PREPARE, nil - case "OPEN": - return TExecNodePhase_OPEN, nil - case "GETNEXT": - return TExecNodePhase_GETNEXT, nil - case "CLOSE": - return TExecNodePhase_CLOSE, nil - case "INVALID": - return TExecNodePhase_INVALID, nil - } - return TExecNodePhase(0), fmt.Errorf("not a valid TExecNodePhase string") -} - -func TExecNodePhasePtr(v TExecNodePhase) *TExecNodePhase { return &v } -func (p *TExecNodePhase) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = TExecNodePhase(result.Int64) - return -} - -func (p *TExecNodePhase) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - -type TDebugAction int64 - -const ( - TDebugAction_WAIT TDebugAction = 0 - TDebugAction_FAIL TDebugAction = 1 -) - -func (p TDebugAction) String() string { - switch p { - case TDebugAction_WAIT: - return "WAIT" - case TDebugAction_FAIL: - return "FAIL" - } - return "" -} - -func TDebugActionFromString(s string) (TDebugAction, error) { - switch s { - case "WAIT": - return TDebugAction_WAIT, nil - case "FAIL": - return TDebugAction_FAIL, nil - } - return TDebugAction(0), fmt.Errorf("not a valid TDebugAction string") -} - -func TDebugActionPtr(v TDebugAction) *TDebugAction { return &v } -func (p *TDebugAction) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = TDebugAction(result.Int64) - return -} - -func (p *TDebugAction) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - type TFileFormatType int64 const ( @@ -7833,25 +7734,30 @@ func (p *TFileScanSlotInfo) Field2DeepEqual(src *bool) bool { } type TFileAttributes struct { - TextParams *TFileTextScanRangeParams `thrift:"text_params,1,optional" frugal:"1,optional,TFileTextScanRangeParams" json:"text_params,omitempty"` - StripOuterArray *bool `thrift:"strip_outer_array,2,optional" frugal:"2,optional,bool" json:"strip_outer_array,omitempty"` - Jsonpaths *string `thrift:"jsonpaths,3,optional" frugal:"3,optional,string" json:"jsonpaths,omitempty"` - JsonRoot *string `thrift:"json_root,4,optional" frugal:"4,optional,string" json:"json_root,omitempty"` - NumAsString *bool `thrift:"num_as_string,5,optional" frugal:"5,optional,bool" json:"num_as_string,omitempty"` - FuzzyParse *bool `thrift:"fuzzy_parse,6,optional" frugal:"6,optional,bool" json:"fuzzy_parse,omitempty"` - ReadJsonByLine *bool `thrift:"read_json_by_line,7,optional" frugal:"7,optional,bool" json:"read_json_by_line,omitempty"` - ReadByColumnDef *bool `thrift:"read_by_column_def,8,optional" frugal:"8,optional,bool" json:"read_by_column_def,omitempty"` - HeaderType *string `thrift:"header_type,9,optional" frugal:"9,optional,string" json:"header_type,omitempty"` - TrimDoubleQuotes *bool `thrift:"trim_double_quotes,10,optional" frugal:"10,optional,bool" json:"trim_double_quotes,omitempty"` - SkipLines *int32 `thrift:"skip_lines,11,optional" frugal:"11,optional,i32" json:"skip_lines,omitempty"` - IgnoreCsvRedundantCol *bool `thrift:"ignore_csv_redundant_col,1001,optional" frugal:"1001,optional,bool" json:"ignore_csv_redundant_col,omitempty"` + TextParams *TFileTextScanRangeParams `thrift:"text_params,1,optional" frugal:"1,optional,TFileTextScanRangeParams" json:"text_params,omitempty"` + StripOuterArray *bool `thrift:"strip_outer_array,2,optional" frugal:"2,optional,bool" json:"strip_outer_array,omitempty"` + Jsonpaths *string `thrift:"jsonpaths,3,optional" frugal:"3,optional,string" json:"jsonpaths,omitempty"` + JsonRoot *string `thrift:"json_root,4,optional" frugal:"4,optional,string" json:"json_root,omitempty"` + NumAsString *bool `thrift:"num_as_string,5,optional" frugal:"5,optional,bool" json:"num_as_string,omitempty"` + FuzzyParse *bool `thrift:"fuzzy_parse,6,optional" frugal:"6,optional,bool" json:"fuzzy_parse,omitempty"` + ReadJsonByLine *bool `thrift:"read_json_by_line,7,optional" frugal:"7,optional,bool" json:"read_json_by_line,omitempty"` + ReadByColumnDef *bool `thrift:"read_by_column_def,8,optional" frugal:"8,optional,bool" json:"read_by_column_def,omitempty"` + HeaderType *string `thrift:"header_type,9,optional" frugal:"9,optional,string" json:"header_type,omitempty"` + TrimDoubleQuotes *bool `thrift:"trim_double_quotes,10,optional" frugal:"10,optional,bool" json:"trim_double_quotes,omitempty"` + SkipLines *int32 `thrift:"skip_lines,11,optional" frugal:"11,optional,i32" json:"skip_lines,omitempty"` + EnableTextValidateUtf8 bool `thrift:"enable_text_validate_utf8,12,optional" frugal:"12,optional,bool" json:"enable_text_validate_utf8,omitempty"` + IgnoreCsvRedundantCol *bool `thrift:"ignore_csv_redundant_col,1001,optional" frugal:"1001,optional,bool" json:"ignore_csv_redundant_col,omitempty"` } func NewTFileAttributes() *TFileAttributes { - return &TFileAttributes{} + return &TFileAttributes{ + + EnableTextValidateUtf8: true, + } } func (p *TFileAttributes) InitDefault() { + p.EnableTextValidateUtf8 = true } var TFileAttributes_TextParams_DEFAULT *TFileTextScanRangeParams @@ -7953,6 +7859,15 @@ func (p *TFileAttributes) GetSkipLines() (v int32) { return *p.SkipLines } +var TFileAttributes_EnableTextValidateUtf8_DEFAULT bool = true + +func (p *TFileAttributes) GetEnableTextValidateUtf8() (v bool) { + if !p.IsSetEnableTextValidateUtf8() { + return TFileAttributes_EnableTextValidateUtf8_DEFAULT + } + return p.EnableTextValidateUtf8 +} + var TFileAttributes_IgnoreCsvRedundantCol_DEFAULT bool func (p *TFileAttributes) GetIgnoreCsvRedundantCol() (v bool) { @@ -7994,6 +7909,9 @@ func (p *TFileAttributes) SetTrimDoubleQuotes(val *bool) { func (p *TFileAttributes) SetSkipLines(val *int32) { p.SkipLines = val } +func (p *TFileAttributes) SetEnableTextValidateUtf8(val bool) { + p.EnableTextValidateUtf8 = val +} func (p *TFileAttributes) SetIgnoreCsvRedundantCol(val *bool) { p.IgnoreCsvRedundantCol = val } @@ -8010,6 +7928,7 @@ var fieldIDToName_TFileAttributes = map[int16]string{ 9: "header_type", 10: "trim_double_quotes", 11: "skip_lines", + 12: "enable_text_validate_utf8", 1001: "ignore_csv_redundant_col", } @@ -8057,6 +7976,10 @@ func (p *TFileAttributes) IsSetSkipLines() bool { return p.SkipLines != nil } +func (p *TFileAttributes) IsSetEnableTextValidateUtf8() bool { + return p.EnableTextValidateUtf8 != TFileAttributes_EnableTextValidateUtf8_DEFAULT +} + func (p *TFileAttributes) IsSetIgnoreCsvRedundantCol() bool { return p.IgnoreCsvRedundantCol != nil } @@ -8168,6 +8091,14 @@ func (p *TFileAttributes) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 12: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 1001: if fieldTypeId == thrift.BOOL { if err = p.ReadField1001(iprot); err != nil { @@ -8323,6 +8254,17 @@ func (p *TFileAttributes) ReadField11(iprot thrift.TProtocol) error { p.SkipLines = _field return nil } +func (p *TFileAttributes) ReadField12(iprot thrift.TProtocol) error { + + var _field bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = v + } + p.EnableTextValidateUtf8 = _field + return nil +} func (p *TFileAttributes) ReadField1001(iprot thrift.TProtocol) error { var _field *bool @@ -8385,6 +8327,10 @@ func (p *TFileAttributes) Write(oprot thrift.TProtocol) (err error) { fieldId = 11 goto WriteFieldError } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } if err = p.writeField1001(oprot); err != nil { fieldId = 1001 goto WriteFieldError @@ -8616,6 +8562,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } +func (p *TFileAttributes) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetEnableTextValidateUtf8() { + if err = oprot.WriteFieldBegin("enable_text_validate_utf8", thrift.BOOL, 12); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(p.EnableTextValidateUtf8); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + func (p *TFileAttributes) writeField1001(oprot thrift.TProtocol) (err error) { if p.IsSetIgnoreCsvRedundantCol() { if err = oprot.WriteFieldBegin("ignore_csv_redundant_col", thrift.BOOL, 1001); err != nil { @@ -8682,6 +8647,9 @@ func (p *TFileAttributes) DeepEqual(ano *TFileAttributes) bool { if !p.Field11DeepEqual(ano.SkipLines) { return false } + if !p.Field12DeepEqual(ano.EnableTextValidateUtf8) { + return false + } if !p.Field1001DeepEqual(ano.IgnoreCsvRedundantCol) { return false } @@ -8815,6 +8783,13 @@ func (p *TFileAttributes) Field11DeepEqual(src *int32) bool { } return true } +func (p *TFileAttributes) Field12DeepEqual(src bool) bool { + + if p.EnableTextValidateUtf8 != src { + return false + } + return true +} func (p *TFileAttributes) Field1001DeepEqual(src *bool) bool { if p.IgnoreCsvRedundantCol == src { @@ -12468,6 +12443,9 @@ type TMaxComputeFileDesc struct { PartitionSpec *string `thrift:"partition_spec,1,optional" frugal:"1,optional,string" json:"partition_spec,omitempty"` SessionId *string `thrift:"session_id,2,optional" frugal:"2,optional,string" json:"session_id,omitempty"` TableBatchReadSession *string `thrift:"table_batch_read_session,3,optional" frugal:"3,optional,string" json:"table_batch_read_session,omitempty"` + ConnectTimeout *int32 `thrift:"connect_timeout,4,optional" frugal:"4,optional,i32" json:"connect_timeout,omitempty"` + ReadTimeout *int32 `thrift:"read_timeout,5,optional" frugal:"5,optional,i32" json:"read_timeout,omitempty"` + RetryTimes *int32 `thrift:"retry_times,6,optional" frugal:"6,optional,i32" json:"retry_times,omitempty"` } func NewTMaxComputeFileDesc() *TMaxComputeFileDesc { @@ -12503,6 +12481,33 @@ func (p *TMaxComputeFileDesc) GetTableBatchReadSession() (v string) { } return *p.TableBatchReadSession } + +var TMaxComputeFileDesc_ConnectTimeout_DEFAULT int32 + +func (p *TMaxComputeFileDesc) GetConnectTimeout() (v int32) { + if !p.IsSetConnectTimeout() { + return TMaxComputeFileDesc_ConnectTimeout_DEFAULT + } + return *p.ConnectTimeout +} + +var TMaxComputeFileDesc_ReadTimeout_DEFAULT int32 + +func (p *TMaxComputeFileDesc) GetReadTimeout() (v int32) { + if !p.IsSetReadTimeout() { + return TMaxComputeFileDesc_ReadTimeout_DEFAULT + } + return *p.ReadTimeout +} + +var TMaxComputeFileDesc_RetryTimes_DEFAULT int32 + +func (p *TMaxComputeFileDesc) GetRetryTimes() (v int32) { + if !p.IsSetRetryTimes() { + return TMaxComputeFileDesc_RetryTimes_DEFAULT + } + return *p.RetryTimes +} func (p *TMaxComputeFileDesc) SetPartitionSpec(val *string) { p.PartitionSpec = val } @@ -12512,11 +12517,23 @@ func (p *TMaxComputeFileDesc) SetSessionId(val *string) { func (p *TMaxComputeFileDesc) SetTableBatchReadSession(val *string) { p.TableBatchReadSession = val } +func (p *TMaxComputeFileDesc) SetConnectTimeout(val *int32) { + p.ConnectTimeout = val +} +func (p *TMaxComputeFileDesc) SetReadTimeout(val *int32) { + p.ReadTimeout = val +} +func (p *TMaxComputeFileDesc) SetRetryTimes(val *int32) { + p.RetryTimes = val +} var fieldIDToName_TMaxComputeFileDesc = map[int16]string{ 1: "partition_spec", 2: "session_id", 3: "table_batch_read_session", + 4: "connect_timeout", + 5: "read_timeout", + 6: "retry_times", } func (p *TMaxComputeFileDesc) IsSetPartitionSpec() bool { @@ -12531,6 +12548,18 @@ func (p *TMaxComputeFileDesc) IsSetTableBatchReadSession() bool { return p.TableBatchReadSession != nil } +func (p *TMaxComputeFileDesc) IsSetConnectTimeout() bool { + return p.ConnectTimeout != nil +} + +func (p *TMaxComputeFileDesc) IsSetReadTimeout() bool { + return p.ReadTimeout != nil +} + +func (p *TMaxComputeFileDesc) IsSetRetryTimes() bool { + return p.RetryTimes != nil +} + func (p *TMaxComputeFileDesc) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -12574,6 +12603,30 @@ func (p *TMaxComputeFileDesc) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 4: + if fieldTypeId == thrift.I32 { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 5: + if fieldTypeId == thrift.I32 { + if err = p.ReadField5(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 6: + if fieldTypeId == thrift.I32 { + if err = p.ReadField6(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -12636,6 +12689,39 @@ func (p *TMaxComputeFileDesc) ReadField3(iprot thrift.TProtocol) error { p.TableBatchReadSession = _field return nil } +func (p *TMaxComputeFileDesc) ReadField4(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.ConnectTimeout = _field + return nil +} +func (p *TMaxComputeFileDesc) ReadField5(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.ReadTimeout = _field + return nil +} +func (p *TMaxComputeFileDesc) ReadField6(iprot thrift.TProtocol) error { + + var _field *int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = &v + } + p.RetryTimes = _field + return nil +} func (p *TMaxComputeFileDesc) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -12655,6 +12741,18 @@ func (p *TMaxComputeFileDesc) Write(oprot thrift.TProtocol) (err error) { fieldId = 3 goto WriteFieldError } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + if err = p.writeField5(oprot); err != nil { + fieldId = 5 + goto WriteFieldError + } + if err = p.writeField6(oprot); err != nil { + fieldId = 6 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -12730,6 +12828,63 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) } +func (p *TMaxComputeFileDesc) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetConnectTimeout() { + if err = oprot.WriteFieldBegin("connect_timeout", thrift.I32, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*p.ConnectTimeout); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *TMaxComputeFileDesc) writeField5(oprot thrift.TProtocol) (err error) { + if p.IsSetReadTimeout() { + if err = oprot.WriteFieldBegin("read_timeout", thrift.I32, 5); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*p.ReadTimeout); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err) +} + +func (p *TMaxComputeFileDesc) writeField6(oprot thrift.TProtocol) (err error) { + if p.IsSetRetryTimes() { + if err = oprot.WriteFieldBegin("retry_times", thrift.I32, 6); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(*p.RetryTimes); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err) +} + func (p *TMaxComputeFileDesc) String() string { if p == nil { return "" @@ -12753,6 +12908,15 @@ func (p *TMaxComputeFileDesc) DeepEqual(ano *TMaxComputeFileDesc) bool { if !p.Field3DeepEqual(ano.TableBatchReadSession) { return false } + if !p.Field4DeepEqual(ano.ConnectTimeout) { + return false + } + if !p.Field5DeepEqual(ano.ReadTimeout) { + return false + } + if !p.Field6DeepEqual(ano.RetryTimes) { + return false + } return true } @@ -12792,6 +12956,42 @@ func (p *TMaxComputeFileDesc) Field3DeepEqual(src *string) bool { } return true } +func (p *TMaxComputeFileDesc) Field4DeepEqual(src *int32) bool { + + if p.ConnectTimeout == src { + return true + } else if p.ConnectTimeout == nil || src == nil { + return false + } + if *p.ConnectTimeout != *src { + return false + } + return true +} +func (p *TMaxComputeFileDesc) Field5DeepEqual(src *int32) bool { + + if p.ReadTimeout == src { + return true + } else if p.ReadTimeout == nil || src == nil { + return false + } + if *p.ReadTimeout != *src { + return false + } + return true +} +func (p *TMaxComputeFileDesc) Field6DeepEqual(src *int32) bool { + + if p.RetryTimes == src { + return true + } else if p.RetryTimes == nil || src == nil { + return false + } + if *p.RetryTimes != *src { + return false + } + return true +} type THudiFileDesc struct { InstantTime *string `thrift:"instant_time,1,optional" frugal:"1,optional,string" json:"instant_time,omitempty"` @@ -12804,6 +13004,7 @@ type THudiFileDesc struct { ColumnNames []string `thrift:"column_names,8,optional" frugal:"8,optional,list" json:"column_names,omitempty"` ColumnTypes []string `thrift:"column_types,9,optional" frugal:"9,optional,list" json:"column_types,omitempty"` NestedFields []string `thrift:"nested_fields,10,optional" frugal:"10,optional,list" json:"nested_fields,omitempty"` + HudiJniScanner *string `thrift:"hudi_jni_scanner,11,optional" frugal:"11,optional,string" json:"hudi_jni_scanner,omitempty"` } func NewTHudiFileDesc() *THudiFileDesc { @@ -12902,6 +13103,15 @@ func (p *THudiFileDesc) GetNestedFields() (v []string) { } return p.NestedFields } + +var THudiFileDesc_HudiJniScanner_DEFAULT string + +func (p *THudiFileDesc) GetHudiJniScanner() (v string) { + if !p.IsSetHudiJniScanner() { + return THudiFileDesc_HudiJniScanner_DEFAULT + } + return *p.HudiJniScanner +} func (p *THudiFileDesc) SetInstantTime(val *string) { p.InstantTime = val } @@ -12932,6 +13142,9 @@ func (p *THudiFileDesc) SetColumnTypes(val []string) { func (p *THudiFileDesc) SetNestedFields(val []string) { p.NestedFields = val } +func (p *THudiFileDesc) SetHudiJniScanner(val *string) { + p.HudiJniScanner = val +} var fieldIDToName_THudiFileDesc = map[int16]string{ 1: "instant_time", @@ -12944,6 +13157,7 @@ var fieldIDToName_THudiFileDesc = map[int16]string{ 8: "column_names", 9: "column_types", 10: "nested_fields", + 11: "hudi_jni_scanner", } func (p *THudiFileDesc) IsSetInstantTime() bool { @@ -12986,6 +13200,10 @@ func (p *THudiFileDesc) IsSetNestedFields() bool { return p.NestedFields != nil } +func (p *THudiFileDesc) IsSetHudiJniScanner() bool { + return p.HudiJniScanner != nil +} + func (p *THudiFileDesc) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -13085,6 +13303,14 @@ func (p *THudiFileDesc) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 11: + if fieldTypeId == thrift.STRING { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -13272,6 +13498,17 @@ func (p *THudiFileDesc) ReadField10(iprot thrift.TProtocol) error { p.NestedFields = _field return nil } +func (p *THudiFileDesc) ReadField11(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.HudiJniScanner = _field + return nil +} func (p *THudiFileDesc) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -13319,6 +13556,10 @@ func (p *THudiFileDesc) Write(oprot thrift.TProtocol) (err error) { fieldId = 10 goto WriteFieldError } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -13559,6 +13800,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) } +func (p *THudiFileDesc) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetHudiJniScanner() { + if err = oprot.WriteFieldBegin("hudi_jni_scanner", thrift.STRING, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.HudiJniScanner); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + func (p *THudiFileDesc) String() string { if p == nil { return "" @@ -13603,6 +13863,9 @@ func (p *THudiFileDesc) DeepEqual(ano *THudiFileDesc) bool { if !p.Field10DeepEqual(ano.NestedFields) { return false } + if !p.Field11DeepEqual(ano.HudiJniScanner) { + return false + } return true } @@ -13730,6 +13993,18 @@ func (p *THudiFileDesc) Field10DeepEqual(src []string) bool { } return true } +func (p *THudiFileDesc) Field11DeepEqual(src *string) bool { + + if p.HudiJniScanner == src { + return true + } else if p.HudiJniScanner == nil || src == nil { + return false + } + if strings.Compare(*p.HudiJniScanner, *src) != 0 { + return false + } + return true +} type TLakeSoulFileDesc struct { FilePaths []string `thrift:"file_paths,1,optional" frugal:"1,optional,list" json:"file_paths,omitempty"` @@ -17586,6 +17861,7 @@ type TFileRangeDesc struct { FileType *types.TFileType `thrift:"file_type,10,optional" frugal:"10,optional,TFileType" json:"file_type,omitempty"` CompressType *TFileCompressType `thrift:"compress_type,11,optional" frugal:"11,optional,TFileCompressType" json:"compress_type,omitempty"` FsName *string `thrift:"fs_name,12,optional" frugal:"12,optional,string" json:"fs_name,omitempty"` + FormatType *TFileFormatType `thrift:"format_type,13,optional" frugal:"13,optional,TFileFormatType" json:"format_type,omitempty"` } func NewTFileRangeDesc() *TFileRangeDesc { @@ -17706,6 +17982,15 @@ func (p *TFileRangeDesc) GetFsName() (v string) { } return *p.FsName } + +var TFileRangeDesc_FormatType_DEFAULT TFileFormatType + +func (p *TFileRangeDesc) GetFormatType() (v TFileFormatType) { + if !p.IsSetFormatType() { + return TFileRangeDesc_FormatType_DEFAULT + } + return *p.FormatType +} func (p *TFileRangeDesc) SetLoadId(val *types.TUniqueId) { p.LoadId = val } @@ -17742,6 +18027,9 @@ func (p *TFileRangeDesc) SetCompressType(val *TFileCompressType) { func (p *TFileRangeDesc) SetFsName(val *string) { p.FsName = val } +func (p *TFileRangeDesc) SetFormatType(val *TFileFormatType) { + p.FormatType = val +} var fieldIDToName_TFileRangeDesc = map[int16]string{ 1: "load_id", @@ -17756,6 +18044,7 @@ var fieldIDToName_TFileRangeDesc = map[int16]string{ 10: "file_type", 11: "compress_type", 12: "fs_name", + 13: "format_type", } func (p *TFileRangeDesc) IsSetLoadId() bool { @@ -17806,6 +18095,10 @@ func (p *TFileRangeDesc) IsSetFsName() bool { return p.FsName != nil } +func (p *TFileRangeDesc) IsSetFormatType() bool { + return p.FormatType != nil +} + func (p *TFileRangeDesc) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -17921,6 +18214,14 @@ func (p *TFileRangeDesc) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 13: + if fieldTypeId == thrift.I32 { + if err = p.ReadField13(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -18102,6 +18403,18 @@ func (p *TFileRangeDesc) ReadField12(iprot thrift.TProtocol) error { p.FsName = _field return nil } +func (p *TFileRangeDesc) ReadField13(iprot thrift.TProtocol) error { + + var _field *TFileFormatType + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + tmp := TFileFormatType(v) + _field = &tmp + } + p.FormatType = _field + return nil +} func (p *TFileRangeDesc) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -18157,6 +18470,10 @@ func (p *TFileRangeDesc) Write(oprot thrift.TProtocol) (err error) { fieldId = 12 goto WriteFieldError } + if err = p.writeField13(oprot); err != nil { + fieldId = 13 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -18419,6 +18736,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) } +func (p *TFileRangeDesc) writeField13(oprot thrift.TProtocol) (err error) { + if p.IsSetFormatType() { + if err = oprot.WriteFieldBegin("format_type", thrift.I32, 13); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(*p.FormatType)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 13 end error: ", p), err) +} + func (p *TFileRangeDesc) String() string { if p == nil { return "" @@ -18469,6 +18805,9 @@ func (p *TFileRangeDesc) DeepEqual(ano *TFileRangeDesc) bool { if !p.Field12DeepEqual(ano.FsName) { return false } + if !p.Field13DeepEqual(ano.FormatType) { + return false + } return true } @@ -18603,6 +18942,18 @@ func (p *TFileRangeDesc) Field12DeepEqual(src *string) bool { } return true } +func (p *TFileRangeDesc) Field13DeepEqual(src *TFileFormatType) bool { + + if p.FormatType == src { + return true + } else if p.FormatType == nil || src == nil { + return false + } + if *p.FormatType != *src { + return false + } + return true +} type TSplitSource struct { SplitSourceId *int64 `thrift:"split_source_id,1,optional" frugal:"1,optional,i64" json:"split_source_id,omitempty"` @@ -20268,6 +20619,411 @@ func (p *TIcebergMetadataParams) Field4DeepEqual(src *string) bool { return true } +type THudiMetadataParams struct { + HudiQueryType *types.THudiQueryType `thrift:"hudi_query_type,1,optional" frugal:"1,optional,THudiQueryType" json:"hudi_query_type,omitempty"` + Catalog *string `thrift:"catalog,2,optional" frugal:"2,optional,string" json:"catalog,omitempty"` + Database *string `thrift:"database,3,optional" frugal:"3,optional,string" json:"database,omitempty"` + Table *string `thrift:"table,4,optional" frugal:"4,optional,string" json:"table,omitempty"` +} + +func NewTHudiMetadataParams() *THudiMetadataParams { + return &THudiMetadataParams{} +} + +func (p *THudiMetadataParams) InitDefault() { +} + +var THudiMetadataParams_HudiQueryType_DEFAULT types.THudiQueryType + +func (p *THudiMetadataParams) GetHudiQueryType() (v types.THudiQueryType) { + if !p.IsSetHudiQueryType() { + return THudiMetadataParams_HudiQueryType_DEFAULT + } + return *p.HudiQueryType +} + +var THudiMetadataParams_Catalog_DEFAULT string + +func (p *THudiMetadataParams) GetCatalog() (v string) { + if !p.IsSetCatalog() { + return THudiMetadataParams_Catalog_DEFAULT + } + return *p.Catalog +} + +var THudiMetadataParams_Database_DEFAULT string + +func (p *THudiMetadataParams) GetDatabase() (v string) { + if !p.IsSetDatabase() { + return THudiMetadataParams_Database_DEFAULT + } + return *p.Database +} + +var THudiMetadataParams_Table_DEFAULT string + +func (p *THudiMetadataParams) GetTable() (v string) { + if !p.IsSetTable() { + return THudiMetadataParams_Table_DEFAULT + } + return *p.Table +} +func (p *THudiMetadataParams) SetHudiQueryType(val *types.THudiQueryType) { + p.HudiQueryType = val +} +func (p *THudiMetadataParams) SetCatalog(val *string) { + p.Catalog = val +} +func (p *THudiMetadataParams) SetDatabase(val *string) { + p.Database = val +} +func (p *THudiMetadataParams) SetTable(val *string) { + p.Table = val +} + +var fieldIDToName_THudiMetadataParams = map[int16]string{ + 1: "hudi_query_type", + 2: "catalog", + 3: "database", + 4: "table", +} + +func (p *THudiMetadataParams) IsSetHudiQueryType() bool { + return p.HudiQueryType != nil +} + +func (p *THudiMetadataParams) IsSetCatalog() bool { + return p.Catalog != nil +} + +func (p *THudiMetadataParams) IsSetDatabase() bool { + return p.Database != nil +} + +func (p *THudiMetadataParams) IsSetTable() bool { + return p.Table != nil +} + +func (p *THudiMetadataParams) Read(iprot thrift.TProtocol) (err error) { + + var fieldTypeId thrift.TType + var fieldId int16 + + if _, err = iprot.ReadStructBegin(); err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, err = iprot.ReadFieldBegin() + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + if err = p.ReadField1(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 2: + if fieldTypeId == thrift.STRING { + if err = p.ReadField2(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 3: + if fieldTypeId == thrift.STRING { + if err = p.ReadField3(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 4: + if fieldTypeId == thrift.STRING { + if err = p.ReadField4(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + default: + if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + } + if err = iprot.ReadFieldEnd(); err != nil { + goto ReadFieldEndError + } + } + if err = iprot.ReadStructEnd(); err != nil { + goto ReadStructEndError + } + + return nil +ReadStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_THudiMetadataParams[fieldId]), err) +SkipFieldError: + return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) + +ReadFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *THudiMetadataParams) ReadField1(iprot thrift.TProtocol) error { + + var _field *types.THudiQueryType + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + tmp := types.THudiQueryType(v) + _field = &tmp + } + p.HudiQueryType = _field + return nil +} +func (p *THudiMetadataParams) ReadField2(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Catalog = _field + return nil +} +func (p *THudiMetadataParams) ReadField3(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Database = _field + return nil +} +func (p *THudiMetadataParams) ReadField4(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Table = _field + return nil +} + +func (p *THudiMetadataParams) Write(oprot thrift.TProtocol) (err error) { + var fieldId int16 + if err = oprot.WriteStructBegin("THudiMetadataParams"); err != nil { + goto WriteStructBeginError + } + if p != nil { + if err = p.writeField1(oprot); err != nil { + fieldId = 1 + goto WriteFieldError + } + if err = p.writeField2(oprot); err != nil { + fieldId = 2 + goto WriteFieldError + } + if err = p.writeField3(oprot); err != nil { + fieldId = 3 + goto WriteFieldError + } + if err = p.writeField4(oprot); err != nil { + fieldId = 4 + goto WriteFieldError + } + } + if err = oprot.WriteFieldStop(); err != nil { + goto WriteFieldStopError + } + if err = oprot.WriteStructEnd(); err != nil { + goto WriteStructEndError + } + return nil +WriteStructBeginError: + return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err) +WriteFieldError: + return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err) +WriteFieldStopError: + return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err) +WriteStructEndError: + return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err) +} + +func (p *THudiMetadataParams) writeField1(oprot thrift.TProtocol) (err error) { + if p.IsSetHudiQueryType() { + if err = oprot.WriteFieldBegin("hudi_query_type", thrift.I32, 1); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(int32(*p.HudiQueryType)); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err) +} + +func (p *THudiMetadataParams) writeField2(oprot thrift.TProtocol) (err error) { + if p.IsSetCatalog() { + if err = oprot.WriteFieldBegin("catalog", thrift.STRING, 2); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Catalog); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err) +} + +func (p *THudiMetadataParams) writeField3(oprot thrift.TProtocol) (err error) { + if p.IsSetDatabase() { + if err = oprot.WriteFieldBegin("database", thrift.STRING, 3); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Database); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err) +} + +func (p *THudiMetadataParams) writeField4(oprot thrift.TProtocol) (err error) { + if p.IsSetTable() { + if err = oprot.WriteFieldBegin("table", thrift.STRING, 4); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Table); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err) +} + +func (p *THudiMetadataParams) String() string { + if p == nil { + return "" + } + return fmt.Sprintf("THudiMetadataParams(%+v)", *p) + +} + +func (p *THudiMetadataParams) DeepEqual(ano *THudiMetadataParams) bool { + if p == ano { + return true + } else if p == nil || ano == nil { + return false + } + if !p.Field1DeepEqual(ano.HudiQueryType) { + return false + } + if !p.Field2DeepEqual(ano.Catalog) { + return false + } + if !p.Field3DeepEqual(ano.Database) { + return false + } + if !p.Field4DeepEqual(ano.Table) { + return false + } + return true +} + +func (p *THudiMetadataParams) Field1DeepEqual(src *types.THudiQueryType) bool { + + if p.HudiQueryType == src { + return true + } else if p.HudiQueryType == nil || src == nil { + return false + } + if *p.HudiQueryType != *src { + return false + } + return true +} +func (p *THudiMetadataParams) Field2DeepEqual(src *string) bool { + + if p.Catalog == src { + return true + } else if p.Catalog == nil || src == nil { + return false + } + if strings.Compare(*p.Catalog, *src) != 0 { + return false + } + return true +} +func (p *THudiMetadataParams) Field3DeepEqual(src *string) bool { + + if p.Database == src { + return true + } else if p.Database == nil || src == nil { + return false + } + if strings.Compare(*p.Database, *src) != 0 { + return false + } + return true +} +func (p *THudiMetadataParams) Field4DeepEqual(src *string) bool { + + if p.Table == src { + return true + } else if p.Table == nil || src == nil { + return false + } + if strings.Compare(*p.Table, *src) != 0 { + return false + } + return true +} + type TBackendsMetadataParams struct { ClusterName *string `thrift:"cluster_name,1,optional" frugal:"1,optional,string" json:"cluster_name,omitempty"` } @@ -22715,6 +23471,7 @@ type TMetaScanRange struct { PartitionsParams *TPartitionsMetadataParams `thrift:"partitions_params,9,optional" frugal:"9,optional,TPartitionsMetadataParams" json:"partitions_params,omitempty"` MetaCacheStatsParams *TMetaCacheStatsParams `thrift:"meta_cache_stats_params,10,optional" frugal:"10,optional,TMetaCacheStatsParams" json:"meta_cache_stats_params,omitempty"` PartitionValuesParams *TPartitionValuesMetadataParams `thrift:"partition_values_params,11,optional" frugal:"11,optional,TPartitionValuesMetadataParams" json:"partition_values_params,omitempty"` + HudiParams *THudiMetadataParams `thrift:"hudi_params,12,optional" frugal:"12,optional,THudiMetadataParams" json:"hudi_params,omitempty"` } func NewTMetaScanRange() *TMetaScanRange { @@ -22822,6 +23579,15 @@ func (p *TMetaScanRange) GetPartitionValuesParams() (v *TPartitionValuesMetadata } return p.PartitionValuesParams } + +var TMetaScanRange_HudiParams_DEFAULT *THudiMetadataParams + +func (p *TMetaScanRange) GetHudiParams() (v *THudiMetadataParams) { + if !p.IsSetHudiParams() { + return TMetaScanRange_HudiParams_DEFAULT + } + return p.HudiParams +} func (p *TMetaScanRange) SetMetadataType(val *types.TMetadataType) { p.MetadataType = val } @@ -22855,6 +23621,9 @@ func (p *TMetaScanRange) SetMetaCacheStatsParams(val *TMetaCacheStatsParams) { func (p *TMetaScanRange) SetPartitionValuesParams(val *TPartitionValuesMetadataParams) { p.PartitionValuesParams = val } +func (p *TMetaScanRange) SetHudiParams(val *THudiMetadataParams) { + p.HudiParams = val +} var fieldIDToName_TMetaScanRange = map[int16]string{ 1: "metadata_type", @@ -22868,6 +23637,7 @@ var fieldIDToName_TMetaScanRange = map[int16]string{ 9: "partitions_params", 10: "meta_cache_stats_params", 11: "partition_values_params", + 12: "hudi_params", } func (p *TMetaScanRange) IsSetMetadataType() bool { @@ -22914,6 +23684,10 @@ func (p *TMetaScanRange) IsSetPartitionValuesParams() bool { return p.PartitionValuesParams != nil } +func (p *TMetaScanRange) IsSetHudiParams() bool { + return p.HudiParams != nil +} + func (p *TMetaScanRange) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -23021,6 +23795,14 @@ func (p *TMetaScanRange) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 12: + if fieldTypeId == thrift.STRUCT { + if err = p.ReadField12(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -23142,6 +23924,14 @@ func (p *TMetaScanRange) ReadField11(iprot thrift.TProtocol) error { p.PartitionValuesParams = _field return nil } +func (p *TMetaScanRange) ReadField12(iprot thrift.TProtocol) error { + _field := NewTHudiMetadataParams() + if err := _field.Read(iprot); err != nil { + return err + } + p.HudiParams = _field + return nil +} func (p *TMetaScanRange) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -23193,6 +23983,10 @@ func (p *TMetaScanRange) Write(oprot thrift.TProtocol) (err error) { fieldId = 11 goto WriteFieldError } + if err = p.writeField12(oprot); err != nil { + fieldId = 12 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -23420,6 +24214,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) } +func (p *TMetaScanRange) writeField12(oprot thrift.TProtocol) (err error) { + if p.IsSetHudiParams() { + if err = oprot.WriteFieldBegin("hudi_params", thrift.STRUCT, 12); err != nil { + goto WriteFieldBeginError + } + if err := p.HudiParams.Write(oprot); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 12 end error: ", p), err) +} + func (p *TMetaScanRange) String() string { if p == nil { return "" @@ -23467,6 +24280,9 @@ func (p *TMetaScanRange) DeepEqual(ano *TMetaScanRange) bool { if !p.Field11DeepEqual(ano.PartitionValuesParams) { return false } + if !p.Field12DeepEqual(ano.HudiParams) { + return false + } return true } @@ -23552,6 +24368,13 @@ func (p *TMetaScanRange) Field11DeepEqual(src *TPartitionValuesMetadataParams) b } return true } +func (p *TMetaScanRange) Field12DeepEqual(src *THudiMetadataParams) bool { + + if !p.HudiParams.DeepEqual(src) { + return false + } + return true +} type TScanRange struct { PaloScanRange *TPaloScanRange `thrift:"palo_scan_range,4,optional" frugal:"4,optional,TPaloScanRange" json:"palo_scan_range,omitempty"` @@ -38704,16 +39527,17 @@ func (p *TAnalyticWindow) Field3DeepEqual(src *TAnalyticWindowBoundary) bool { } type TAnalyticNode struct { - PartitionExprs []*exprs.TExpr `thrift:"partition_exprs,1,required" frugal:"1,required,list" json:"partition_exprs"` - OrderByExprs []*exprs.TExpr `thrift:"order_by_exprs,2,required" frugal:"2,required,list" json:"order_by_exprs"` - AnalyticFunctions []*exprs.TExpr `thrift:"analytic_functions,3,required" frugal:"3,required,list" json:"analytic_functions"` - Window *TAnalyticWindow `thrift:"window,4,optional" frugal:"4,optional,TAnalyticWindow" json:"window,omitempty"` - IntermediateTupleId types.TTupleId `thrift:"intermediate_tuple_id,5,required" frugal:"5,required,i32" json:"intermediate_tuple_id"` - OutputTupleId types.TTupleId `thrift:"output_tuple_id,6,required" frugal:"6,required,i32" json:"output_tuple_id"` - BufferedTupleId *types.TTupleId `thrift:"buffered_tuple_id,7,optional" frugal:"7,optional,i32" json:"buffered_tuple_id,omitempty"` - PartitionByEq *exprs.TExpr `thrift:"partition_by_eq,8,optional" frugal:"8,optional,exprs.TExpr" json:"partition_by_eq,omitempty"` - OrderByEq *exprs.TExpr `thrift:"order_by_eq,9,optional" frugal:"9,optional,exprs.TExpr" json:"order_by_eq,omitempty"` - IsColocate *bool `thrift:"is_colocate,10,optional" frugal:"10,optional,bool" json:"is_colocate,omitempty"` + PartitionExprs []*exprs.TExpr `thrift:"partition_exprs,1,required" frugal:"1,required,list" json:"partition_exprs"` + OrderByExprs []*exprs.TExpr `thrift:"order_by_exprs,2,required" frugal:"2,required,list" json:"order_by_exprs"` + AnalyticFunctions []*exprs.TExpr `thrift:"analytic_functions,3,required" frugal:"3,required,list" json:"analytic_functions"` + Window *TAnalyticWindow `thrift:"window,4,optional" frugal:"4,optional,TAnalyticWindow" json:"window,omitempty"` + IntermediateTupleId types.TTupleId `thrift:"intermediate_tuple_id,5,required" frugal:"5,required,i32" json:"intermediate_tuple_id"` + OutputTupleId types.TTupleId `thrift:"output_tuple_id,6,required" frugal:"6,required,i32" json:"output_tuple_id"` + BufferedTupleId *types.TTupleId `thrift:"buffered_tuple_id,7,optional" frugal:"7,optional,i32" json:"buffered_tuple_id,omitempty"` + PartitionByEq *exprs.TExpr `thrift:"partition_by_eq,8,optional" frugal:"8,optional,exprs.TExpr" json:"partition_by_eq,omitempty"` + OrderByEq *exprs.TExpr `thrift:"order_by_eq,9,optional" frugal:"9,optional,exprs.TExpr" json:"order_by_eq,omitempty"` + IsColocate *bool `thrift:"is_colocate,10,optional" frugal:"10,optional,bool" json:"is_colocate,omitempty"` + RangeBetweenOffsetExprs []*exprs.TExpr `thrift:"range_between_offset_exprs,11,optional" frugal:"11,optional,list" json:"range_between_offset_exprs,omitempty"` } func NewTAnalyticNode() *TAnalyticNode { @@ -38787,6 +39611,15 @@ func (p *TAnalyticNode) GetIsColocate() (v bool) { } return *p.IsColocate } + +var TAnalyticNode_RangeBetweenOffsetExprs_DEFAULT []*exprs.TExpr + +func (p *TAnalyticNode) GetRangeBetweenOffsetExprs() (v []*exprs.TExpr) { + if !p.IsSetRangeBetweenOffsetExprs() { + return TAnalyticNode_RangeBetweenOffsetExprs_DEFAULT + } + return p.RangeBetweenOffsetExprs +} func (p *TAnalyticNode) SetPartitionExprs(val []*exprs.TExpr) { p.PartitionExprs = val } @@ -38817,6 +39650,9 @@ func (p *TAnalyticNode) SetOrderByEq(val *exprs.TExpr) { func (p *TAnalyticNode) SetIsColocate(val *bool) { p.IsColocate = val } +func (p *TAnalyticNode) SetRangeBetweenOffsetExprs(val []*exprs.TExpr) { + p.RangeBetweenOffsetExprs = val +} var fieldIDToName_TAnalyticNode = map[int16]string{ 1: "partition_exprs", @@ -38829,6 +39665,7 @@ var fieldIDToName_TAnalyticNode = map[int16]string{ 8: "partition_by_eq", 9: "order_by_eq", 10: "is_colocate", + 11: "range_between_offset_exprs", } func (p *TAnalyticNode) IsSetWindow() bool { @@ -38851,6 +39688,10 @@ func (p *TAnalyticNode) IsSetIsColocate() bool { return p.IsColocate != nil } +func (p *TAnalyticNode) IsSetRangeBetweenOffsetExprs() bool { + return p.RangeBetweenOffsetExprs != nil +} + func (p *TAnalyticNode) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -38960,6 +39801,14 @@ func (p *TAnalyticNode) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 11: + if fieldTypeId == thrift.LIST { + if err = p.ReadField11(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -39152,6 +40001,29 @@ func (p *TAnalyticNode) ReadField10(iprot thrift.TProtocol) error { p.IsColocate = _field return nil } +func (p *TAnalyticNode) ReadField11(iprot thrift.TProtocol) error { + _, size, err := iprot.ReadListBegin() + if err != nil { + return err + } + _field := make([]*exprs.TExpr, 0, size) + values := make([]exprs.TExpr, size) + for i := 0; i < size; i++ { + _elem := &values[i] + _elem.InitDefault() + + if err := _elem.Read(iprot); err != nil { + return err + } + + _field = append(_field, _elem) + } + if err := iprot.ReadListEnd(); err != nil { + return err + } + p.RangeBetweenOffsetExprs = _field + return nil +} func (p *TAnalyticNode) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -39199,6 +40071,10 @@ func (p *TAnalyticNode) Write(oprot thrift.TProtocol) (err error) { fieldId = 10 goto WriteFieldError } + if err = p.writeField11(oprot); err != nil { + fieldId = 11 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -39421,6 +40297,33 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) } +func (p *TAnalyticNode) writeField11(oprot thrift.TProtocol) (err error) { + if p.IsSetRangeBetweenOffsetExprs() { + if err = oprot.WriteFieldBegin("range_between_offset_exprs", thrift.LIST, 11); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteListBegin(thrift.STRUCT, len(p.RangeBetweenOffsetExprs)); err != nil { + return err + } + for _, v := range p.RangeBetweenOffsetExprs { + if err := v.Write(oprot); err != nil { + return err + } + } + if err := oprot.WriteListEnd(); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 11 end error: ", p), err) +} + func (p *TAnalyticNode) String() string { if p == nil { return "" @@ -39465,6 +40368,9 @@ func (p *TAnalyticNode) DeepEqual(ano *TAnalyticNode) bool { if !p.Field10DeepEqual(ano.IsColocate) { return false } + if !p.Field11DeepEqual(ano.RangeBetweenOffsetExprs) { + return false + } return true } @@ -39566,6 +40472,19 @@ func (p *TAnalyticNode) Field10DeepEqual(src *bool) bool { } return true } +func (p *TAnalyticNode) Field11DeepEqual(src []*exprs.TExpr) bool { + + if len(p.RangeBetweenOffsetExprs) != len(src) { + return false + } + for i, v := range p.RangeBetweenOffsetExprs { + _src := src[i] + if !v.DeepEqual(_src) { + return false + } + } + return true +} type TMergeNode struct { TupleId types.TTupleId `thrift:"tuple_id,1,required" frugal:"1,required,i32" json:"tuple_id"` @@ -43822,6 +44741,7 @@ type TRuntimeFilterDesc struct { BloomFilterSizeCalculatedByNdv *bool `thrift:"bloom_filter_size_calculated_by_ndv,14,optional" frugal:"14,optional,bool" json:"bloom_filter_size_calculated_by_ndv,omitempty"` NullAware *bool `thrift:"null_aware,15,optional" frugal:"15,optional,bool" json:"null_aware,omitempty"` SyncFilterSize *bool `thrift:"sync_filter_size,16,optional" frugal:"16,optional,bool" json:"sync_filter_size,omitempty"` + BuildBfExactly *bool `thrift:"build_bf_exactly,17,optional" frugal:"17,optional,bool" json:"build_bf_exactly,omitempty"` } func NewTRuntimeFilterDesc() *TRuntimeFilterDesc { @@ -43939,6 +44859,15 @@ func (p *TRuntimeFilterDesc) GetSyncFilterSize() (v bool) { } return *p.SyncFilterSize } + +var TRuntimeFilterDesc_BuildBfExactly_DEFAULT bool + +func (p *TRuntimeFilterDesc) GetBuildBfExactly() (v bool) { + if !p.IsSetBuildBfExactly() { + return TRuntimeFilterDesc_BuildBfExactly_DEFAULT + } + return *p.BuildBfExactly +} func (p *TRuntimeFilterDesc) SetFilterId(val int32) { p.FilterId = val } @@ -43987,6 +44916,9 @@ func (p *TRuntimeFilterDesc) SetNullAware(val *bool) { func (p *TRuntimeFilterDesc) SetSyncFilterSize(val *bool) { p.SyncFilterSize = val } +func (p *TRuntimeFilterDesc) SetBuildBfExactly(val *bool) { + p.BuildBfExactly = val +} var fieldIDToName_TRuntimeFilterDesc = map[int16]string{ 1: "filter_id", @@ -44005,6 +44937,7 @@ var fieldIDToName_TRuntimeFilterDesc = map[int16]string{ 14: "bloom_filter_size_calculated_by_ndv", 15: "null_aware", 16: "sync_filter_size", + 17: "build_bf_exactly", } func (p *TRuntimeFilterDesc) IsSetSrcExpr() bool { @@ -44043,6 +44976,10 @@ func (p *TRuntimeFilterDesc) IsSetSyncFilterSize() bool { return p.SyncFilterSize != nil } +func (p *TRuntimeFilterDesc) IsSetBuildBfExactly() bool { + return p.BuildBfExactly != nil +} + func (p *TRuntimeFilterDesc) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -44206,6 +45143,14 @@ func (p *TRuntimeFilterDesc) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 17: + if fieldTypeId == thrift.BOOL { + if err = p.ReadField17(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -44465,6 +45410,17 @@ func (p *TRuntimeFilterDesc) ReadField16(iprot thrift.TProtocol) error { p.SyncFilterSize = _field return nil } +func (p *TRuntimeFilterDesc) ReadField17(iprot thrift.TProtocol) error { + + var _field *bool + if v, err := iprot.ReadBool(); err != nil { + return err + } else { + _field = &v + } + p.BuildBfExactly = _field + return nil +} func (p *TRuntimeFilterDesc) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -44536,6 +45492,10 @@ func (p *TRuntimeFilterDesc) Write(oprot thrift.TProtocol) (err error) { fieldId = 16 goto WriteFieldError } + if err = p.writeField17(oprot); err != nil { + fieldId = 17 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -44853,6 +45813,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 16 end error: ", p), err) } +func (p *TRuntimeFilterDesc) writeField17(oprot thrift.TProtocol) (err error) { + if p.IsSetBuildBfExactly() { + if err = oprot.WriteFieldBegin("build_bf_exactly", thrift.BOOL, 17); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteBool(*p.BuildBfExactly); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 17 end error: ", p), err) +} + func (p *TRuntimeFilterDesc) String() string { if p == nil { return "" @@ -44915,6 +45894,9 @@ func (p *TRuntimeFilterDesc) DeepEqual(ano *TRuntimeFilterDesc) bool { if !p.Field16DeepEqual(ano.SyncFilterSize) { return false } + if !p.Field17DeepEqual(ano.BuildBfExactly) { + return false + } return true } @@ -45071,6 +46053,18 @@ func (p *TRuntimeFilterDesc) Field16DeepEqual(src *bool) bool { } return true } +func (p *TRuntimeFilterDesc) Field17DeepEqual(src *bool) bool { + + if p.BuildBfExactly == src { + return true + } else if p.BuildBfExactly == nil || src == nil { + return false + } + if *p.BuildBfExactly != *src { + return false + } + return true +} type TDataGenScanNode struct { TupleId *types.TTupleId `thrift:"tuple_id,1,optional" frugal:"1,optional,i32" json:"tuple_id,omitempty"` diff --git a/pkg/rpc/kitex_gen/plannodes/k-PlanNodes.go b/pkg/rpc/kitex_gen/plannodes/k-PlanNodes.go index 4dfc203e..871694a4 100644 --- a/pkg/rpc/kitex_gen/plannodes/k-PlanNodes.go +++ b/pkg/rpc/kitex_gen/plannodes/k-PlanNodes.go @@ -5167,6 +5167,20 @@ func (p *TFileAttributes) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 12: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 1001: if fieldTypeId == thrift.BOOL { l, err = p.FastReadField1001(buf[offset:]) @@ -5359,6 +5373,20 @@ func (p *TFileAttributes) FastReadField11(buf []byte) (int, error) { return offset, nil } +func (p *TFileAttributes) FastReadField12(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.EnableTextValidateUtf8 = v + + } + return offset, nil +} + func (p *TFileAttributes) FastReadField1001(buf []byte) (int, error) { offset := 0 @@ -5388,6 +5416,7 @@ func (p *TFileAttributes) FastWriteNocopy(buf []byte, binaryWriter bthrift.Binar offset += p.fastWriteField8(buf[offset:], binaryWriter) offset += p.fastWriteField10(buf[offset:], binaryWriter) offset += p.fastWriteField11(buf[offset:], binaryWriter) + offset += p.fastWriteField12(buf[offset:], binaryWriter) offset += p.fastWriteField1001(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) @@ -5414,6 +5443,7 @@ func (p *TFileAttributes) BLength() int { l += p.field9Length() l += p.field10Length() l += p.field11Length() + l += p.field12Length() l += p.field1001Length() } l += bthrift.Binary.FieldStopLength() @@ -5541,6 +5571,17 @@ func (p *TFileAttributes) fastWriteField11(buf []byte, binaryWriter bthrift.Bina return offset } +func (p *TFileAttributes) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetEnableTextValidateUtf8() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "enable_text_validate_utf8", thrift.BOOL, 12) + offset += bthrift.Binary.WriteBool(buf[offset:], p.EnableTextValidateUtf8) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TFileAttributes) fastWriteField1001(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetIgnoreCsvRedundantCol() { @@ -5672,6 +5713,17 @@ func (p *TFileAttributes) field11Length() int { return l } +func (p *TFileAttributes) field12Length() int { + l := 0 + if p.IsSetEnableTextValidateUtf8() { + l += bthrift.Binary.FieldBeginLength("enable_text_validate_utf8", thrift.BOOL, 12) + l += bthrift.Binary.BoolLength(p.EnableTextValidateUtf8) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TFileAttributes) field1001Length() int { l := 0 if p.IsSetIgnoreCsvRedundantCol() { @@ -8379,6 +8431,48 @@ func (p *TMaxComputeFileDesc) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 4: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 5: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField5(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 6: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField6(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -8453,6 +8547,45 @@ func (p *TMaxComputeFileDesc) FastReadField3(buf []byte) (int, error) { return offset, nil } +func (p *TMaxComputeFileDesc) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ConnectTimeout = &v + + } + return offset, nil +} + +func (p *TMaxComputeFileDesc) FastReadField5(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.ReadTimeout = &v + + } + return offset, nil +} + +func (p *TMaxComputeFileDesc) FastReadField6(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.RetryTimes = &v + + } + return offset, nil +} + // for compatibility func (p *TMaxComputeFileDesc) FastWrite(buf []byte) int { return 0 @@ -8462,6 +8595,9 @@ func (p *TMaxComputeFileDesc) FastWriteNocopy(buf []byte, binaryWriter bthrift.B offset := 0 offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TMaxComputeFileDesc") if p != nil { + offset += p.fastWriteField4(buf[offset:], binaryWriter) + offset += p.fastWriteField5(buf[offset:], binaryWriter) + offset += p.fastWriteField6(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) @@ -8478,6 +8614,9 @@ func (p *TMaxComputeFileDesc) BLength() int { l += p.field1Length() l += p.field2Length() l += p.field3Length() + l += p.field4Length() + l += p.field5Length() + l += p.field6Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -8517,6 +8656,39 @@ func (p *TMaxComputeFileDesc) fastWriteField3(buf []byte, binaryWriter bthrift.B return offset } +func (p *TMaxComputeFileDesc) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetConnectTimeout() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "connect_timeout", thrift.I32, 4) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.ConnectTimeout) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMaxComputeFileDesc) fastWriteField5(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetReadTimeout() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "read_timeout", thrift.I32, 5) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.ReadTimeout) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TMaxComputeFileDesc) fastWriteField6(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRetryTimes() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "retry_times", thrift.I32, 6) + offset += bthrift.Binary.WriteI32(buf[offset:], *p.RetryTimes) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TMaxComputeFileDesc) field1Length() int { l := 0 if p.IsSetPartitionSpec() { @@ -8550,6 +8722,39 @@ func (p *TMaxComputeFileDesc) field3Length() int { return l } +func (p *TMaxComputeFileDesc) field4Length() int { + l := 0 + if p.IsSetConnectTimeout() { + l += bthrift.Binary.FieldBeginLength("connect_timeout", thrift.I32, 4) + l += bthrift.Binary.I32Length(*p.ConnectTimeout) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TMaxComputeFileDesc) field5Length() int { + l := 0 + if p.IsSetReadTimeout() { + l += bthrift.Binary.FieldBeginLength("read_timeout", thrift.I32, 5) + l += bthrift.Binary.I32Length(*p.ReadTimeout) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TMaxComputeFileDesc) field6Length() int { + l := 0 + if p.IsSetRetryTimes() { + l += bthrift.Binary.FieldBeginLength("retry_times", thrift.I32, 6) + l += bthrift.Binary.I32Length(*p.RetryTimes) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *THudiFileDesc) FastRead(buf []byte) (int, error) { var err error var offset int @@ -8712,6 +8917,20 @@ func (p *THudiFileDesc) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 11: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -8945,6 +9164,19 @@ func (p *THudiFileDesc) FastReadField10(buf []byte) (int, error) { return offset, nil } +func (p *THudiFileDesc) FastReadField11(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.HudiJniScanner = &v + + } + return offset, nil +} + // for compatibility func (p *THudiFileDesc) FastWrite(buf []byte) int { return 0 @@ -8964,6 +9196,7 @@ func (p *THudiFileDesc) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryW offset += p.fastWriteField8(buf[offset:], binaryWriter) offset += p.fastWriteField9(buf[offset:], binaryWriter) offset += p.fastWriteField10(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -8984,6 +9217,7 @@ func (p *THudiFileDesc) BLength() int { l += p.field8Length() l += p.field9Length() l += p.field10Length() + l += p.field11Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -9132,6 +9366,17 @@ func (p *THudiFileDesc) fastWriteField10(buf []byte, binaryWriter bthrift.Binary return offset } +func (p *THudiFileDesc) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetHudiJniScanner() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "hudi_jni_scanner", thrift.STRING, 11) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.HudiJniScanner) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *THudiFileDesc) field1Length() int { l := 0 if p.IsSetInstantTime() { @@ -9258,6 +9503,17 @@ func (p *THudiFileDesc) field10Length() int { return l } +func (p *THudiFileDesc) field11Length() int { + l := 0 + if p.IsSetHudiJniScanner() { + l += bthrift.Binary.FieldBeginLength("hudi_jni_scanner", thrift.STRING, 11) + l += bthrift.Binary.StringLengthNocopy(*p.HudiJniScanner) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TLakeSoulFileDesc) FastRead(buf []byte) (int, error) { var err error var offset int @@ -12381,6 +12637,20 @@ func (p *TFileRangeDesc) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 13: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField13(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -12611,6 +12881,21 @@ func (p *TFileRangeDesc) FastReadField12(buf []byte) (int, error) { return offset, nil } +func (p *TFileRangeDesc) FastReadField13(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := TFileFormatType(v) + p.FormatType = &tmp + + } + return offset, nil +} + // for compatibility func (p *TFileRangeDesc) FastWrite(buf []byte) int { return 0 @@ -12632,6 +12917,7 @@ func (p *TFileRangeDesc) FastWriteNocopy(buf []byte, binaryWriter bthrift.Binary offset += p.fastWriteField10(buf[offset:], binaryWriter) offset += p.fastWriteField11(buf[offset:], binaryWriter) offset += p.fastWriteField12(buf[offset:], binaryWriter) + offset += p.fastWriteField13(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -12654,6 +12940,7 @@ func (p *TFileRangeDesc) BLength() int { l += p.field10Length() l += p.field11Length() l += p.field12Length() + l += p.field13Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -12806,6 +13093,17 @@ func (p *TFileRangeDesc) fastWriteField12(buf []byte, binaryWriter bthrift.Binar return offset } +func (p *TFileRangeDesc) fastWriteField13(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetFormatType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "format_type", thrift.I32, 13) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.FormatType)) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TFileRangeDesc) field1Length() int { l := 0 if p.IsSetLoadId() { @@ -12944,6 +13242,17 @@ func (p *TFileRangeDesc) field12Length() int { return l } +func (p *TFileRangeDesc) field13Length() int { + l := 0 + if p.IsSetFormatType() { + l += bthrift.Binary.FieldBeginLength("format_type", thrift.I32, 13) + l += bthrift.Binary.I32Length(int32(*p.FormatType)) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TSplitSource) FastRead(buf []byte) (int, error) { var err error var offset int @@ -13820,67 +14129,355 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TDataGenScanRange) FastReadField1(buf []byte) (int, error) { +func (p *TDataGenScanRange) FastReadField1(buf []byte) (int, error) { + offset := 0 + + tmp := NewTTVFNumbersScanRange() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.NumbersParams = tmp + return offset, nil +} + +// for compatibility +func (p *TDataGenScanRange) FastWrite(buf []byte) int { + return 0 +} + +func (p *TDataGenScanRange) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDataGenScanRange") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *TDataGenScanRange) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TDataGenScanRange") + if p != nil { + l += p.field1Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TDataGenScanRange) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetNumbersParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "numbers_params", thrift.STRUCT, 1) + offset += p.NumbersParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TDataGenScanRange) field1Length() int { + l := 0 + if p.IsSetNumbersParams() { + l += bthrift.Binary.FieldBeginLength("numbers_params", thrift.STRUCT, 1) + l += p.NumbersParams.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TIcebergMetadataParams) FastRead(buf []byte) (int, error) { + var err error + var offset int + var l int + var fieldTypeId thrift.TType + var fieldId int16 + _, l, err = bthrift.Binary.ReadStructBegin(buf) + offset += l + if err != nil { + goto ReadStructBeginError + } + + for { + _, fieldTypeId, fieldId, l, err = bthrift.Binary.ReadFieldBegin(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldBeginError + } + if fieldTypeId == thrift.STOP { + break + } + switch fieldId { + case 1: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField1(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 2: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField2(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 3: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField3(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 4: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField4(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + default: + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + + l, err = bthrift.Binary.ReadFieldEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldEndError + } + } + l, err = bthrift.Binary.ReadStructEnd(buf[offset:]) + offset += l + if err != nil { + goto ReadStructEndError + } + + return offset, nil +ReadStructBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err) +ReadFieldBeginError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) +ReadFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TIcebergMetadataParams[fieldId]), err) +SkipFieldError: + return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) +ReadFieldEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read field end error", p), err) +ReadStructEndError: + return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) +} + +func (p *TIcebergMetadataParams) FastReadField1(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + tmp := types.TIcebergQueryType(v) + p.IcebergQueryType = &tmp + + } + return offset, nil +} + +func (p *TIcebergMetadataParams) FastReadField2(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Catalog = &v + + } + return offset, nil +} + +func (p *TIcebergMetadataParams) FastReadField3(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Database = &v + + } + return offset, nil +} + +func (p *TIcebergMetadataParams) FastReadField4(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Table = &v + + } + return offset, nil +} + +// for compatibility +func (p *TIcebergMetadataParams) FastWrite(buf []byte) int { + return 0 +} + +func (p *TIcebergMetadataParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TIcebergMetadataParams") + if p != nil { + offset += p.fastWriteField1(buf[offset:], binaryWriter) + offset += p.fastWriteField2(buf[offset:], binaryWriter) + offset += p.fastWriteField3(buf[offset:], binaryWriter) + offset += p.fastWriteField4(buf[offset:], binaryWriter) + } + offset += bthrift.Binary.WriteFieldStop(buf[offset:]) + offset += bthrift.Binary.WriteStructEnd(buf[offset:]) + return offset +} + +func (p *TIcebergMetadataParams) BLength() int { + l := 0 + l += bthrift.Binary.StructBeginLength("TIcebergMetadataParams") + if p != nil { + l += p.field1Length() + l += p.field2Length() + l += p.field3Length() + l += p.field4Length() + } + l += bthrift.Binary.FieldStopLength() + l += bthrift.Binary.StructEndLength() + return l +} + +func (p *TIcebergMetadataParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetIcebergQueryType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "iceberg_query_type", thrift.I32, 1) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.IcebergQueryType)) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TIcebergMetadataParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetCatalog() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 2) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Catalog) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TIcebergMetadataParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 + if p.IsSetDatabase() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "database", thrift.STRING, 3) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Database) - tmp := NewTTVFNumbersScanRange() - if l, err := tmp.FastRead(buf[offset:]); err != nil { - return offset, err - } else { - offset += l + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - p.NumbersParams = tmp - return offset, nil -} - -// for compatibility -func (p *TDataGenScanRange) FastWrite(buf []byte) int { - return 0 + return offset } -func (p *TDataGenScanRange) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *TIcebergMetadataParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TDataGenScanRange") - if p != nil { - offset += p.fastWriteField1(buf[offset:], binaryWriter) + if p.IsSetTable() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table", thrift.STRING, 4) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Table) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } - offset += bthrift.Binary.WriteFieldStop(buf[offset:]) - offset += bthrift.Binary.WriteStructEnd(buf[offset:]) return offset } -func (p *TDataGenScanRange) BLength() int { +func (p *TIcebergMetadataParams) field1Length() int { l := 0 - l += bthrift.Binary.StructBeginLength("TDataGenScanRange") - if p != nil { - l += p.field1Length() + if p.IsSetIcebergQueryType() { + l += bthrift.Binary.FieldBeginLength("iceberg_query_type", thrift.I32, 1) + l += bthrift.Binary.I32Length(int32(*p.IcebergQueryType)) + + l += bthrift.Binary.FieldEndLength() } - l += bthrift.Binary.FieldStopLength() - l += bthrift.Binary.StructEndLength() return l } -func (p *TDataGenScanRange) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { - offset := 0 - if p.IsSetNumbersParams() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "numbers_params", thrift.STRUCT, 1) - offset += p.NumbersParams.FastWriteNocopy(buf[offset:], binaryWriter) - offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) +func (p *TIcebergMetadataParams) field2Length() int { + l := 0 + if p.IsSetCatalog() { + l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 2) + l += bthrift.Binary.StringLengthNocopy(*p.Catalog) + + l += bthrift.Binary.FieldEndLength() } - return offset + return l } -func (p *TDataGenScanRange) field1Length() int { +func (p *TIcebergMetadataParams) field3Length() int { l := 0 - if p.IsSetNumbersParams() { - l += bthrift.Binary.FieldBeginLength("numbers_params", thrift.STRUCT, 1) - l += p.NumbersParams.BLength() + if p.IsSetDatabase() { + l += bthrift.Binary.FieldBeginLength("database", thrift.STRING, 3) + l += bthrift.Binary.StringLengthNocopy(*p.Database) + l += bthrift.Binary.FieldEndLength() } return l } -func (p *TIcebergMetadataParams) FastRead(buf []byte) (int, error) { +func (p *TIcebergMetadataParams) field4Length() int { + l := 0 + if p.IsSetTable() { + l += bthrift.Binary.FieldBeginLength("table", thrift.STRING, 4) + l += bthrift.Binary.StringLengthNocopy(*p.Table) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *THudiMetadataParams) FastRead(buf []byte) (int, error) { var err error var offset int var l int @@ -13984,7 +14581,7 @@ ReadStructBeginError: ReadFieldBeginError: return offset, thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err) ReadFieldError: - return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_TIcebergMetadataParams[fieldId]), err) + return offset, thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_THudiMetadataParams[fieldId]), err) SkipFieldError: return offset, thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err) ReadFieldEndError: @@ -13993,7 +14590,7 @@ ReadStructEndError: return offset, thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err) } -func (p *TIcebergMetadataParams) FastReadField1(buf []byte) (int, error) { +func (p *THudiMetadataParams) FastReadField1(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { @@ -14001,14 +14598,14 @@ func (p *TIcebergMetadataParams) FastReadField1(buf []byte) (int, error) { } else { offset += l - tmp := types.TIcebergQueryType(v) - p.IcebergQueryType = &tmp + tmp := types.THudiQueryType(v) + p.HudiQueryType = &tmp } return offset, nil } -func (p *TIcebergMetadataParams) FastReadField2(buf []byte) (int, error) { +func (p *THudiMetadataParams) FastReadField2(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -14021,7 +14618,7 @@ func (p *TIcebergMetadataParams) FastReadField2(buf []byte) (int, error) { return offset, nil } -func (p *TIcebergMetadataParams) FastReadField3(buf []byte) (int, error) { +func (p *THudiMetadataParams) FastReadField3(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -14034,7 +14631,7 @@ func (p *TIcebergMetadataParams) FastReadField3(buf []byte) (int, error) { return offset, nil } -func (p *TIcebergMetadataParams) FastReadField4(buf []byte) (int, error) { +func (p *THudiMetadataParams) FastReadField4(buf []byte) (int, error) { offset := 0 if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { @@ -14048,13 +14645,13 @@ func (p *TIcebergMetadataParams) FastReadField4(buf []byte) (int, error) { } // for compatibility -func (p *TIcebergMetadataParams) FastWrite(buf []byte) int { +func (p *THudiMetadataParams) FastWrite(buf []byte) int { return 0 } -func (p *TIcebergMetadataParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *THudiMetadataParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - offset += bthrift.Binary.WriteStructBegin(buf[offset:], "TIcebergMetadataParams") + offset += bthrift.Binary.WriteStructBegin(buf[offset:], "THudiMetadataParams") if p != nil { offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) @@ -14066,9 +14663,9 @@ func (p *TIcebergMetadataParams) FastWriteNocopy(buf []byte, binaryWriter bthrif return offset } -func (p *TIcebergMetadataParams) BLength() int { +func (p *THudiMetadataParams) BLength() int { l := 0 - l += bthrift.Binary.StructBeginLength("TIcebergMetadataParams") + l += bthrift.Binary.StructBeginLength("THudiMetadataParams") if p != nil { l += p.field1Length() l += p.field2Length() @@ -14080,18 +14677,18 @@ func (p *TIcebergMetadataParams) BLength() int { return l } -func (p *TIcebergMetadataParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *THudiMetadataParams) fastWriteField1(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 - if p.IsSetIcebergQueryType() { - offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "iceberg_query_type", thrift.I32, 1) - offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.IcebergQueryType)) + if p.IsSetHudiQueryType() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "hudi_query_type", thrift.I32, 1) + offset += bthrift.Binary.WriteI32(buf[offset:], int32(*p.HudiQueryType)) offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) } return offset } -func (p *TIcebergMetadataParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *THudiMetadataParams) fastWriteField2(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetCatalog() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "catalog", thrift.STRING, 2) @@ -14102,7 +14699,7 @@ func (p *TIcebergMetadataParams) fastWriteField2(buf []byte, binaryWriter bthrif return offset } -func (p *TIcebergMetadataParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *THudiMetadataParams) fastWriteField3(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetDatabase() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "database", thrift.STRING, 3) @@ -14113,7 +14710,7 @@ func (p *TIcebergMetadataParams) fastWriteField3(buf []byte, binaryWriter bthrif return offset } -func (p *TIcebergMetadataParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { +func (p *THudiMetadataParams) fastWriteField4(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetTable() { offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table", thrift.STRING, 4) @@ -14124,18 +14721,18 @@ func (p *TIcebergMetadataParams) fastWriteField4(buf []byte, binaryWriter bthrif return offset } -func (p *TIcebergMetadataParams) field1Length() int { +func (p *THudiMetadataParams) field1Length() int { l := 0 - if p.IsSetIcebergQueryType() { - l += bthrift.Binary.FieldBeginLength("iceberg_query_type", thrift.I32, 1) - l += bthrift.Binary.I32Length(int32(*p.IcebergQueryType)) + if p.IsSetHudiQueryType() { + l += bthrift.Binary.FieldBeginLength("hudi_query_type", thrift.I32, 1) + l += bthrift.Binary.I32Length(int32(*p.HudiQueryType)) l += bthrift.Binary.FieldEndLength() } return l } -func (p *TIcebergMetadataParams) field2Length() int { +func (p *THudiMetadataParams) field2Length() int { l := 0 if p.IsSetCatalog() { l += bthrift.Binary.FieldBeginLength("catalog", thrift.STRING, 2) @@ -14146,7 +14743,7 @@ func (p *TIcebergMetadataParams) field2Length() int { return l } -func (p *TIcebergMetadataParams) field3Length() int { +func (p *THudiMetadataParams) field3Length() int { l := 0 if p.IsSetDatabase() { l += bthrift.Binary.FieldBeginLength("database", thrift.STRING, 3) @@ -14157,7 +14754,7 @@ func (p *TIcebergMetadataParams) field3Length() int { return l } -func (p *TIcebergMetadataParams) field4Length() int { +func (p *THudiMetadataParams) field4Length() int { l := 0 if p.IsSetTable() { l += bthrift.Binary.FieldBeginLength("table", thrift.STRING, 4) @@ -16132,6 +16729,20 @@ func (p *TMetaScanRange) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 12: + if fieldTypeId == thrift.STRUCT { + l, err = p.FastReadField12(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -16312,6 +16923,19 @@ func (p *TMetaScanRange) FastReadField11(buf []byte) (int, error) { return offset, nil } +func (p *TMetaScanRange) FastReadField12(buf []byte) (int, error) { + offset := 0 + + tmp := NewTHudiMetadataParams() + if l, err := tmp.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + p.HudiParams = tmp + return offset, nil +} + // for compatibility func (p *TMetaScanRange) FastWrite(buf []byte) int { return 0 @@ -16332,6 +16956,7 @@ func (p *TMetaScanRange) FastWriteNocopy(buf []byte, binaryWriter bthrift.Binary offset += p.fastWriteField9(buf[offset:], binaryWriter) offset += p.fastWriteField10(buf[offset:], binaryWriter) offset += p.fastWriteField11(buf[offset:], binaryWriter) + offset += p.fastWriteField12(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -16353,6 +16978,7 @@ func (p *TMetaScanRange) BLength() int { l += p.field9Length() l += p.field10Length() l += p.field11Length() + l += p.field12Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -16470,6 +17096,16 @@ func (p *TMetaScanRange) fastWriteField11(buf []byte, binaryWriter bthrift.Binar return offset } +func (p *TMetaScanRange) fastWriteField12(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetHudiParams() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "hudi_params", thrift.STRUCT, 12) + offset += p.HudiParams.FastWriteNocopy(buf[offset:], binaryWriter) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TMetaScanRange) field1Length() int { l := 0 if p.IsSetMetadataType() { @@ -16581,6 +17217,16 @@ func (p *TMetaScanRange) field11Length() int { return l } +func (p *TMetaScanRange) field12Length() int { + l := 0 + if p.IsSetHudiParams() { + l += bthrift.Binary.FieldBeginLength("hudi_params", thrift.STRUCT, 12) + l += p.HudiParams.BLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TScanRange) FastRead(buf []byte) (int, error) { var err error var offset int @@ -28471,6 +29117,20 @@ func (p *TAnalyticNode) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 11: + if fieldTypeId == thrift.LIST { + l, err = p.FastReadField11(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -28706,6 +29366,33 @@ func (p *TAnalyticNode) FastReadField10(buf []byte) (int, error) { return offset, nil } +func (p *TAnalyticNode) FastReadField11(buf []byte) (int, error) { + offset := 0 + + _, size, l, err := bthrift.Binary.ReadListBegin(buf[offset:]) + offset += l + if err != nil { + return offset, err + } + p.RangeBetweenOffsetExprs = make([]*exprs.TExpr, 0, size) + for i := 0; i < size; i++ { + _elem := exprs.NewTExpr() + if l, err := _elem.FastRead(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + + p.RangeBetweenOffsetExprs = append(p.RangeBetweenOffsetExprs, _elem) + } + if l, err := bthrift.Binary.ReadListEnd(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + } + return offset, nil +} + // for compatibility func (p *TAnalyticNode) FastWrite(buf []byte) int { return 0 @@ -28725,6 +29412,7 @@ func (p *TAnalyticNode) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryW offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField8(buf[offset:], binaryWriter) offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField11(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -28745,6 +29433,7 @@ func (p *TAnalyticNode) BLength() int { l += p.field8Length() l += p.field9Length() l += p.field10Length() + l += p.field11Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -28869,6 +29558,24 @@ func (p *TAnalyticNode) fastWriteField10(buf []byte, binaryWriter bthrift.Binary return offset } +func (p *TAnalyticNode) fastWriteField11(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetRangeBetweenOffsetExprs() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "range_between_offset_exprs", thrift.LIST, 11) + listBeginOffset := offset + offset += bthrift.Binary.ListBeginLength(thrift.STRUCT, 0) + var length int + for _, v := range p.RangeBetweenOffsetExprs { + length++ + offset += v.FastWriteNocopy(buf[offset:], binaryWriter) + } + bthrift.Binary.WriteListBegin(buf[listBeginOffset:], thrift.STRUCT, length) + offset += bthrift.Binary.WriteListEnd(buf[offset:]) + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TAnalyticNode) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("partition_exprs", thrift.LIST, 1) @@ -28975,6 +29682,20 @@ func (p *TAnalyticNode) field10Length() int { return l } +func (p *TAnalyticNode) field11Length() int { + l := 0 + if p.IsSetRangeBetweenOffsetExprs() { + l += bthrift.Binary.FieldBeginLength("range_between_offset_exprs", thrift.LIST, 11) + l += bthrift.Binary.ListBeginLength(thrift.STRUCT, len(p.RangeBetweenOffsetExprs)) + for _, v := range p.RangeBetweenOffsetExprs { + l += v.BLength() + } + l += bthrift.Binary.ListEndLength() + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TMergeNode) FastRead(buf []byte) (int, error) { var err error var offset int @@ -32668,6 +33389,20 @@ func (p *TRuntimeFilterDesc) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 17: + if fieldTypeId == thrift.BOOL { + l, err = p.FastReadField17(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -32983,6 +33718,19 @@ func (p *TRuntimeFilterDesc) FastReadField16(buf []byte) (int, error) { return offset, nil } +func (p *TRuntimeFilterDesc) FastReadField17(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadBool(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.BuildBfExactly = &v + + } + return offset, nil +} + // for compatibility func (p *TRuntimeFilterDesc) FastWrite(buf []byte) int { return 0 @@ -33003,6 +33751,7 @@ func (p *TRuntimeFilterDesc) FastWriteNocopy(buf []byte, binaryWriter bthrift.Bi offset += p.fastWriteField14(buf[offset:], binaryWriter) offset += p.fastWriteField15(buf[offset:], binaryWriter) offset += p.fastWriteField16(buf[offset:], binaryWriter) + offset += p.fastWriteField17(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField4(buf[offset:], binaryWriter) offset += p.fastWriteField8(buf[offset:], binaryWriter) @@ -33034,6 +33783,7 @@ func (p *TRuntimeFilterDesc) BLength() int { l += p.field14Length() l += p.field15Length() l += p.field16Length() + l += p.field17Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -33208,6 +33958,17 @@ func (p *TRuntimeFilterDesc) fastWriteField16(buf []byte, binaryWriter bthrift.B return offset } +func (p *TRuntimeFilterDesc) fastWriteField17(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetBuildBfExactly() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "build_bf_exactly", thrift.BOOL, 17) + offset += bthrift.Binary.WriteBool(buf[offset:], *p.BuildBfExactly) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TRuntimeFilterDesc) field1Length() int { l := 0 l += bthrift.Binary.FieldBeginLength("filter_id", thrift.I32, 1) @@ -33372,6 +34133,17 @@ func (p *TRuntimeFilterDesc) field16Length() int { return l } +func (p *TRuntimeFilterDesc) field17Length() int { + l := 0 + if p.IsSetBuildBfExactly() { + l += bthrift.Binary.FieldBeginLength("build_bf_exactly", thrift.BOOL, 17) + l += bthrift.Binary.BoolLength(*p.BuildBfExactly) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TDataGenScanNode) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/pkg/rpc/kitex_gen/types/Types.go b/pkg/rpc/kitex_gen/types/Types.go index 3f1baf47..9fda5714 100644 --- a/pkg/rpc/kitex_gen/types/Types.go +++ b/pkg/rpc/kitex_gen/types/Types.go @@ -516,6 +516,7 @@ const ( TInvertedIndexFileStorageFormat_DEFAULT TInvertedIndexFileStorageFormat = 0 TInvertedIndexFileStorageFormat_V1 TInvertedIndexFileStorageFormat = 1 TInvertedIndexFileStorageFormat_V2 TInvertedIndexFileStorageFormat = 2 + TInvertedIndexFileStorageFormat_V3 TInvertedIndexFileStorageFormat = 3 ) func (p TInvertedIndexFileStorageFormat) String() string { @@ -526,6 +527,8 @@ func (p TInvertedIndexFileStorageFormat) String() string { return "V1" case TInvertedIndexFileStorageFormat_V2: return "V2" + case TInvertedIndexFileStorageFormat_V3: + return "V3" } return "" } @@ -538,6 +541,8 @@ func TInvertedIndexFileStorageFormatFromString(s string) (TInvertedIndexFileStor return TInvertedIndexFileStorageFormat_V1, nil case "V2": return TInvertedIndexFileStorageFormat_V2, nil + case "V3": + return TInvertedIndexFileStorageFormat_V3, nil } return TInvertedIndexFileStorageFormat(0), fmt.Errorf("not a valid TInvertedIndexFileStorageFormat string") } @@ -900,58 +905,6 @@ func (p *TTaskType) Value() (driver.Value, error) { return int64(*p), nil } -type TStmtType int64 - -const ( - TStmtType_QUERY TStmtType = 0 - TStmtType_DDL TStmtType = 1 - TStmtType_DML TStmtType = 2 - TStmtType_EXPLAIN TStmtType = 3 -) - -func (p TStmtType) String() string { - switch p { - case TStmtType_QUERY: - return "QUERY" - case TStmtType_DDL: - return "DDL" - case TStmtType_DML: - return "DML" - case TStmtType_EXPLAIN: - return "EXPLAIN" - } - return "" -} - -func TStmtTypeFromString(s string) (TStmtType, error) { - switch s { - case "QUERY": - return TStmtType_QUERY, nil - case "DDL": - return TStmtType_DDL, nil - case "DML": - return TStmtType_DML, nil - case "EXPLAIN": - return TStmtType_EXPLAIN, nil - } - return TStmtType(0), fmt.Errorf("not a valid TStmtType string") -} - -func TStmtTypePtr(v TStmtType) *TStmtType { return &v } -func (p *TStmtType) Scan(value interface{}) (err error) { - var result sql.NullInt64 - err = result.Scan(value) - *p = TStmtType(result.Int64) - return -} - -func (p *TStmtType) Value() (driver.Value, error) { - if p == nil { - return nil, nil - } - return int64(*p), nil -} - type TExplainLevel int64 const ( @@ -2039,6 +1992,7 @@ const ( TMetadataType_WORKLOAD_SCHED_POLICY TMetadataType = 8 TMetadataType_PARTITIONS TMetadataType = 9 TMetadataType_PARTITION_VALUES TMetadataType = 10 + TMetadataType_HUDI TMetadataType = 11 ) func (p TMetadataType) String() string { @@ -2065,6 +2019,8 @@ func (p TMetadataType) String() string { return "PARTITIONS" case TMetadataType_PARTITION_VALUES: return "PARTITION_VALUES" + case TMetadataType_HUDI: + return "HUDI" } return "" } @@ -2093,6 +2049,8 @@ func TMetadataTypeFromString(s string) (TMetadataType, error) { return TMetadataType_PARTITIONS, nil case "PARTITION_VALUES": return TMetadataType_PARTITION_VALUES, nil + case "HUDI": + return TMetadataType_HUDI, nil } return TMetadataType(0), fmt.Errorf("not a valid TMetadataType string") } @@ -2149,6 +2107,43 @@ func (p *TIcebergQueryType) Value() (driver.Value, error) { return int64(*p), nil } +type THudiQueryType int64 + +const ( + THudiQueryType_TIMELINE THudiQueryType = 0 +) + +func (p THudiQueryType) String() string { + switch p { + case THudiQueryType_TIMELINE: + return "TIMELINE" + } + return "" +} + +func THudiQueryTypeFromString(s string) (THudiQueryType, error) { + switch s { + case "TIMELINE": + return THudiQueryType_TIMELINE, nil + } + return THudiQueryType(0), fmt.Errorf("not a valid THudiQueryType string") +} + +func THudiQueryTypePtr(v THudiQueryType) *THudiQueryType { return &v } +func (p *THudiQueryType) Scan(value interface{}) (err error) { + var result sql.NullInt64 + err = result.Scan(value) + *p = THudiQueryType(result.Int64) + return +} + +func (p *THudiQueryType) Value() (driver.Value, error) { + if p == nil { + return nil, nil + } + return int64(*p), nil +} + type TTimestamp = int64 type TPlanNodeId = int32 diff --git a/pkg/rpc/thrift/AgentService.thrift b/pkg/rpc/thrift/AgentService.thrift index fdbf4483..7bb24ba8 100644 --- a/pkg/rpc/thrift/AgentService.thrift +++ b/pkg/rpc/thrift/AgentService.thrift @@ -44,7 +44,7 @@ struct TTabletSchema { 16: optional bool store_row_column = false 17: optional bool enable_single_replica_compaction = false 18: optional bool skip_write_index_on_load = false - 19: optional list cluster_key_idxes + 19: optional list cluster_key_uids // col unique id for row store column 20: optional list row_store_col_cids 21: optional i64 row_store_page_size = 16384 diff --git a/pkg/rpc/thrift/BackendService.thrift b/pkg/rpc/thrift/BackendService.thrift index 7f073b2b..3c2f256b 100644 --- a/pkg/rpc/thrift/BackendService.thrift +++ b/pkg/rpc/thrift/BackendService.thrift @@ -32,13 +32,18 @@ struct TExportTaskRequest { struct TTabletStat { 1: required i64 tablet_id - // local data size + // local data size = local inverted index file size + local segment file size 2: optional i64 data_size 3: optional i64 row_count 4: optional i64 total_version_count + // remote data size = remote inverted index file size + remote segment file size 5: optional i64 remote_data_size 6: optional i64 visible_version_count 7: optional i64 visible_version + 8: optional i64 local_index_size = 0 // .idx + 9: optional i64 local_segment_size = 0 // .dat + 10: optional i64 remote_index_size = 0 // .idx + 11: optional i64 remote_segment_size = 0 // .dat } struct TTabletStatResult { @@ -352,11 +357,6 @@ service BackendService { PaloInternalService.TCancelPlanFragmentResult cancel_plan_fragment( 1:PaloInternalService.TCancelPlanFragmentParams params); - // Called by sender to transmit single row batch. Returns error indication - // if params.fragmentId or params.destNodeId are unknown or if data couldn't be read. - PaloInternalService.TTransmitDataResult transmit_data( - 1:PaloInternalService.TTransmitDataParams params); - AgentService.TAgentResult submit_tasks(1:list tasks); AgentService.TAgentResult make_snapshot(1:AgentService.TSnapshotRequest snapshot_request); diff --git a/pkg/rpc/thrift/Data.thrift b/pkg/rpc/thrift/Data.thrift index dc1190c6..17007a08 100644 --- a/pkg/rpc/thrift/Data.thrift +++ b/pkg/rpc/thrift/Data.thrift @@ -20,32 +20,6 @@ namespace java org.apache.doris.thrift include "Types.thrift" -// Serialized, self-contained version of a RowBatch (in be/src/runtime/row-batch.h). -struct TRowBatch { - // total number of rows contained in this batch - 1: required i32 num_rows - - // row composition - 2: required list row_tuples - - // There are a total of num_rows * num_tuples_per_row offsets - // pointing into tuple_data. - // An offset of -1 records a NULL. - 3: list tuple_offsets - - // binary tuple data - // TODO: figure out how we can avoid copying the data during TRowBatch construction - 4: string tuple_data - - // Indicates whether tuple_data is snappy-compressed - 5: bool is_compressed - - // backend num, source - 6: i32 be_number - // packet seq - 7: i64 packet_seq -} - // this is a union over all possible return types struct TCell { // TODO: use _val instead of camelcase diff --git a/pkg/rpc/thrift/DataSinks.thrift b/pkg/rpc/thrift/DataSinks.thrift index ed7ccee6..03a23c2c 100644 --- a/pkg/rpc/thrift/DataSinks.thrift +++ b/pkg/rpc/thrift/DataSinks.thrift @@ -189,6 +189,7 @@ struct TDataStreamSink { 11: optional i64 tablet_sink_txn_id 12: optional Types.TTupleId tablet_sink_tuple_id 13: optional list tablet_sink_exprs + 14: optional bool is_merge } struct TMultiCastDataStreamSink { diff --git a/pkg/rpc/thrift/FrontendService.thrift b/pkg/rpc/thrift/FrontendService.thrift index f48f7291..0d536e3c 100644 --- a/pkg/rpc/thrift/FrontendService.thrift +++ b/pkg/rpc/thrift/FrontendService.thrift @@ -35,15 +35,6 @@ include "HeartbeatService.thrift" // These are supporting structs for JniFrontend.java, which serves as the glue // between our C++ execution environment and the Java frontend. -struct TSetSessionParams { - 1: required string user -} - -struct TAuthenticateParams { - 1: required string user - 2: required string passwd -} - struct TColumnDesc { 1: required string columnName 2: required Types.TPrimitiveType columnType @@ -53,6 +44,7 @@ struct TColumnDesc { 6: optional bool isAllowNull 7: optional string columnKey 8: optional list children + 9: optional string defaultValue } // A column definition; used by CREATE TABLE and DESCRIBE statements. A column @@ -63,23 +55,6 @@ struct TColumnDef { 2: optional string comment } -// Arguments to DescribeTable, which returns a list of column descriptors for a -// given table -struct TDescribeTableParams { - 1: optional string db - 2: required string table_name - 3: optional string user // deprecated - 4: optional string user_ip // deprecated - 5: optional Types.TUserIdentity current_user_ident // to replace the user and user ip - 6: optional bool show_hidden_columns = false - 7: optional string catalog -} - -// Results of a call to describeTable() -struct TDescribeTableResult { - 1: required list columns -} - // Arguments to DescribeTables, which returns a list of column descriptors for // given tables struct TDescribeTablesParams { @@ -109,197 +84,6 @@ struct TShowVariableResult { 1: required list> variables } -// Valid table file formats -enum TFileFormat { - PARQUETFILE, - RCFILE, - SEQUENCEFILE, - TEXTFILE, -} - -// set type -enum TSetType { - OPT_DEFAULT, - OPT_GLOBAL, - OPT_SESSION, -} - -// The row format specifies how to interpret the fields (columns) and lines (rows) in a -// data file when creating a new table. -struct TTableRowFormat { - // Optional terminator string used to delimit fields (columns) in the table - 1: optional string field_terminator - - // Optional terminator string used to delimit lines (rows) in a table - 2: optional string line_terminator - - // Optional string used to specify a special escape character sequence - 3: optional string escaped_by -} - - -// Represents a single item in a partition spec (column name + value) -struct TPartitionKeyValue { - // Partition column name - 1: required string name, - - // Partition value - 2: required string value -} - -// Per-client session state -struct TSessionState { - // The default database, changed by USE queries. - 1: required string database - - // The user who this session belongs to. - 2: required string user - - // The user who this session belongs to. - 3: required i64 connection_id -} - -struct TClientRequest { - // select stmt to be executed - 1: required string stmt - - // query options - 2: required PaloInternalService.TQueryOptions queryOptions - - // session state - 3: required TSessionState sessionState; -} - - -// Parameters for SHOW DATABASES commands -struct TExplainParams { - // Optional pattern to match database names. If not set, all databases are returned. - 1: required string explain -} - -struct TSetVar{ - 1: required TSetType type - 2: required string variable - 3: required Exprs.TExpr value -} -// Parameters for Set commands -struct TSetParams { - // Optional pattern to match database names. If not set, all databases are returned. - 1: required list set_vars -} - -struct TKillParams { - // Optional pattern to match database names. If not set, all databases are returned. - 1: required bool is_kill_connection - 2: required i64 connection_id -} - -struct TCommonDdlParams { - //1: required Ddl.TCommonDdlType ddl_type - //2: optional Ddl.TCreateDbParams create_db_params - //3: optional Ddl.TCreateTableParams create_table_params - //4: optional Ddl.TLoadParams load_params -} - -// Parameters for the USE db command -struct TUseDbParams { - 1: required string db -} - -struct TResultSetMetadata { - 1: required list columnDescs -} - -// Result of call to PaloPlanService/JniFrontend.CreateQueryRequest() -struct TQueryExecRequest { - // global descriptor tbl for all fragments - 1: optional Descriptors.TDescriptorTable desc_tbl - - // fragments[i] may consume the output of fragments[j > i]; - // fragments[0] is the root fragment and also the coordinator fragment, if - // it is unpartitioned. - 2: required list fragments - - // Specifies the destination fragment of the output of each fragment. - // parent_fragment_idx.size() == fragments.size() - 1 and - // fragments[i] sends its output to fragments[dest_fragment_idx[i-1]] - 3: optional list dest_fragment_idx - - // A map from scan node ids to a list of scan range locations. - // The node ids refer to scan nodes in fragments[].plan_tree - 4: optional map> - per_node_scan_ranges - - // Metadata of the query result set (only for select) - 5: optional TResultSetMetadata result_set_metadata - - 7: required PaloInternalService.TQueryGlobals query_globals - - // The statement type governs when the coordinator can judge a query to be finished. - // DML queries are complete after Wait(), SELECTs may not be. - 9: required Types.TStmtType stmt_type - - // The statement type governs when the coordinator can judge a query to be finished. - // DML queries are complete after Wait(), SELECTs may not be. - 10: optional bool is_block_query; -} - -enum TDdlType { - USE, - DESCRIBE, - SET, - EXPLAIN, - KILL, - COMMON -} - -struct TDdlExecRequest { - 1: required TDdlType ddl_type - - // Parameters for USE commands - 2: optional TUseDbParams use_db_params; - - // Parameters for DESCRIBE table commands - 3: optional TDescribeTableParams describe_table_params - - 10: optional TExplainParams explain_params - - 11: optional TSetParams set_params - 12: optional TKillParams kill_params - //13: optional Ddl.TMasterDdlRequest common_params -} - -// Results of an EXPLAIN -struct TExplainResult { - // each line in the explain plan occupies an entry in the list - 1: required list results -} - -// Result of call to createExecRequest() -struct TExecRequest { - 1: required Types.TStmtType stmt_type; - - 2: optional string sql_stmt; - - // Globally unique id for this request. Assigned by the planner. - 3: required Types.TUniqueId request_id - - // Copied from the corresponding TClientRequest - 4: required PaloInternalService.TQueryOptions query_options; - - // TQueryExecRequest for the backend - // Set iff stmt_type is QUERY or DML - 5: optional TQueryExecRequest query_exec_request - - // Set iff stmt_type is DDL - 6: optional TDdlExecRequest ddl_exec_request - - // Metadata of the query result set (not set for DML) - 7: optional TResultSetMetadata result_set_metadata - - // Result of EXPLAIN. Set iff stmt_type is EXPLAIN - 8: optional TExplainResult explain_result -} // Arguments to getDbNames, which returns a list of dbs that match an optional // pattern @@ -350,6 +134,7 @@ struct TTableStatus { 11: optional i64 rows; 12: optional i64 avg_row_length 13: optional i64 data_length; + 14: optional i64 index_length; } struct TListTableStatusResult { @@ -1034,6 +819,7 @@ struct TMetadataTableRequestParams { 11: optional PlanNodes.TPartitionsMetadataParams partitions_metadata_params 12: optional PlanNodes.TMetaCacheStatsParams meta_cache_stats_params 13: optional PlanNodes.TPartitionValuesMetadataParams partition_values_metadata_params + 14: optional PlanNodes.THudiMetadataParams hudi_metadata_params } struct TSchemaTableRequestParams { @@ -1160,6 +946,29 @@ struct TQueryStatsResult { 5: optional map tablet_stats } +// Lock the binlogs, to avoid being GC during sync. +// +// The caller should lock the binlog before backup, and bumps lock commit seq intervally. +// +// The locked binlogs will be kept until the binlog properties ttl_seconds, max_bytes ... are reached. +struct TLockBinlogRequest { + 1: optional string cluster + 2: optional string user + 3: optional string passwd + 4: optional string db + 5: optional string table + 6: optional i64 table_id + 7: optional string token + 8: optional string job_unique_id + 9: optional i64 lock_commit_seq // if not set, lock the latest binlog +} + +struct TLockBinlogResult { + 1: optional Status.TStatus status + 2: optional i64 locked_commit_seq + 3: optional Types.TNetworkAddress master_address +} + struct TGetBinlogRequest { 1: optional string cluster 2: optional string user @@ -1198,6 +1007,7 @@ enum TBinlogType { RENAME_PARTITION = 22, DROP_ROLLUP = 23, RECOVER_INFO = 24, + // Keep some IDs for allocation so that when new binlog types are added in the // future, the changes can be picked back to the old versions without breaking // compatibility. @@ -1615,6 +1425,7 @@ struct TGetMetaTableMeta { 2: optional string name 3: optional bool in_trash 4: optional list partitions + 5: optional string type } struct TGetMetaDBMeta { @@ -1718,7 +1529,6 @@ struct TFetchRunningQueriesRequest { service FrontendService { TGetDbsResult getDbNames(1: TGetDbsParams params) TGetTablesResult getTableNames(1: TGetTablesParams params) - TDescribeTableResult describeTable(1: TDescribeTableParams params) TDescribeTablesResult describeTables(1: TDescribeTablesParams params) TShowVariableResult showVariables(1: TShowVariableRequest params) TReportExecStatusResult reportExecStatus(1: TReportExecStatusParams params) @@ -1750,6 +1560,7 @@ service FrontendService { TGetBinlogResult getBinlog(1: TGetBinlogRequest request) TGetSnapshotResult getSnapshot(1: TGetSnapshotRequest request) TRestoreSnapshotResult restoreSnapshot(1: TRestoreSnapshotRequest request) + TLockBinlogResult lockBinlog(1: TLockBinlogRequest request) TWaitingTxnStatusResult waitingTxnStatus(1: TWaitingTxnStatusRequest request) diff --git a/pkg/rpc/thrift/MasterService.thrift b/pkg/rpc/thrift/MasterService.thrift index 9d8cd911..a045fa3a 100644 --- a/pkg/rpc/thrift/MasterService.thrift +++ b/pkg/rpc/thrift/MasterService.thrift @@ -47,6 +47,10 @@ struct TTabletInfo { 19: optional i64 cooldown_term 20: optional Types.TUniqueId cooldown_meta_id 21: optional i64 visible_version_count + 22: optional i64 local_index_size = 0 // .idx + 23: optional i64 local_segment_size = 0 // .dat + 24: optional i64 remote_index_size = 0 // .idx + 25: optional i64 remote_segment_size = 0 // .dat // For cloud 1000: optional bool is_persistent diff --git a/pkg/rpc/thrift/PaloInternalService.thrift b/pkg/rpc/thrift/PaloInternalService.thrift index 9a0fd910..2e8ed9c3 100644 --- a/pkg/rpc/thrift/PaloInternalService.thrift +++ b/pkg/rpc/thrift/PaloInternalService.thrift @@ -27,7 +27,6 @@ include "Planner.thrift" include "DataSinks.thrift" include "Data.thrift" include "RuntimeProfile.thrift" -include "PaloService.thrift" // constants for TQueryOptions.num_nodes const i32 NUM_NODES_ALL = 0 @@ -104,7 +103,7 @@ struct TQueryOptions { 13: optional bool abort_on_default_limit_exceeded = 0 14: optional i32 query_timeout = 3600 15: optional bool is_report_success = 0 - 16: optional i32 codegen_level = 0 + 16: optional i32 codegen_level = 0 // Deprecated // INT64::MAX 17: optional i64 kudu_latest_observed_ts = 9223372036854775807 // Deprecated 18: optional TQueryType query_type = TQueryType.SELECT @@ -182,7 +181,7 @@ struct TQueryOptions { 52: optional i32 be_exec_version = 0 - 53: optional i32 partitioned_hash_join_rows_threshold = 0 + 53: optional i32 partitioned_hash_join_rows_threshold = 0 // deprecated 54: optional bool enable_share_hash_table_for_broadcast_join @@ -198,7 +197,7 @@ struct TQueryOptions { 59: optional i64 external_sort_bytes_threshold = 0 // deprecated - 60: optional i32 partitioned_hash_agg_rows_threshold = 0 + 60: optional i32 partitioned_hash_agg_rows_threshold = 0 // deprecated 61: optional bool enable_file_cache = false @@ -358,6 +357,15 @@ struct TQueryOptions { 140: optional i64 orc_max_merge_distance_bytes = 1048576; 141: optional bool ignore_runtime_filter_error = false; + 142: optional bool enable_fixed_len_to_uint32_v2 = false; + 143: optional bool enable_shared_exchange_sink_buffer = true; + + 144: optional bool enable_inverted_index_searcher_cache = true; + 145: optional bool enable_inverted_index_query_cache = true; + 146: optional bool fuzzy_disable_runtime_filter_in_be = false; + + 147: optional i32 profile_level = 1; + // For cloud, to control if the content would be written into file cache // In write path, to control if the content would be written into file cache. // In read path, read from file cache or remote storage when execute query. @@ -371,6 +379,7 @@ struct TScanRangeParams { 2: optional i32 volume_id = -1 } +// deprecated struct TRuntimeFilterTargetParams { 1: required Types.TUniqueId target_fragment_instance_id // The address of the instance where the fragment is expected to run @@ -385,19 +394,21 @@ struct TRuntimeFilterTargetParamsV2 { } struct TRuntimeFilterParams { - // Runtime filter merge instance address + // Runtime filter merge instance address. Used if this filter has a remote target 1: optional Types.TNetworkAddress runtime_filter_merge_addr - // Runtime filter ID to the instance address of the fragment, - // that is expected to use this runtime filter + // deprecated 2: optional map> rid_to_target_param // Runtime filter ID to the runtime filter desc + // Used if this filter has a remote target 3: optional map rid_to_runtime_filter // Number of Runtime filter producers + // Used if this filter has a remote target 4: optional map runtime_filter_builder_num + // Used if this filter has a remote target 5: optional map> rid_to_target_paramv2 } @@ -616,11 +627,6 @@ struct TCancelPlanFragmentResult { 1: optional Status.TStatus status } -// fold constant expr -struct TExprMap { - 1: required map expr_map -} - struct TFoldConstantParams { 1: required map> expr_map 2: required TQueryGlobals query_globals @@ -643,9 +649,6 @@ struct TTransmitDataParams { // required in V1 4: optional Types.TPlanNodeId dest_node_id - // required in V1 - 5: optional Data.TRowBatch row_batch - // if set to true, indicates that no more row batches will be sent // for this dest_node_id 6: optional bool eos @@ -670,66 +673,6 @@ struct TTabletWithPartition { 2: required i64 tablet_id } -// open a tablet writer -struct TTabletWriterOpenParams { - 1: required Types.TUniqueId id - 2: required i64 index_id - 3: required i64 txn_id - 4: required Descriptors.TOlapTableSchemaParam schema - 5: required list tablets - - 6: required i32 num_senders -} - -struct TTabletWriterOpenResult { - 1: required Status.TStatus status -} - -// add batch to tablet writer -struct TTabletWriterAddBatchParams { - 1: required Types.TUniqueId id - 2: required i64 index_id - - 3: required i64 packet_seq - 4: required list tablet_ids - 5: required Data.TRowBatch row_batch - - 6: required i32 sender_no -} - -struct TTabletWriterAddBatchResult { - 1: required Status.TStatus status -} - -struct TTabletWriterCloseParams { - 1: required Types.TUniqueId id - 2: required i64 index_id - - 3: required i32 sender_no -} - -struct TTabletWriterCloseResult { - 1: required Status.TStatus status -} - -// -struct TTabletWriterCancelParams { - 1: required Types.TUniqueId id - 2: required i64 index_id - - 3: required i32 sender_no -} - -struct TTabletWriterCancelResult { -} - -struct TFetchDataParams { - 1: required PaloInternalServiceVersion protocol_version - // required in V1 - // query id which want to fetch data - 2: required Types.TUniqueId fragment_instance_id -} - struct TFetchDataResult { // result batch 1: required Data.TResultBatch result_batch diff --git a/pkg/rpc/thrift/PlanNodes.thrift b/pkg/rpc/thrift/PlanNodes.thrift index 0bbd364f..a46cc8f7 100644 --- a/pkg/rpc/thrift/PlanNodes.thrift +++ b/pkg/rpc/thrift/PlanNodes.thrift @@ -61,21 +61,6 @@ enum TPlanNodeType { GROUP_COMMIT_SCAN_NODE } -// phases of an execution node -enum TExecNodePhase { - PREPARE, - OPEN, - GETNEXT, - CLOSE, - INVALID -} - -// what to do when hitting a debug point (TPaloQueryOptions.DEBUG_ACTION) -enum TDebugAction { - WAIT, - FAIL -} - struct TKeyRange { 1: required i64 begin_key 2: required i64 end_key @@ -284,6 +269,8 @@ struct TFileAttributes { 10: optional bool trim_double_quotes; // csv skip line num, only used when csv header_type is not set. 11: optional i32 skip_lines; + //For text type file reading, whether to enable utf8 encoding check.(Catalog && TVF) + 12: optional bool enable_text_validate_utf8 = true; // for cloud copy into 1001: optional bool ignore_csv_redundant_col; } @@ -353,7 +340,10 @@ struct TMaxComputeFileDesc { 1: optional string partition_spec // deprecated 2: optional string session_id 3: optional string table_batch_read_session - + // for mc network configuration + 4: optional i32 connect_timeout + 5: optional i32 read_timeout + 6: optional i32 retry_times } struct THudiFileDesc { @@ -367,6 +357,7 @@ struct THudiFileDesc { 8: optional list column_names; 9: optional list column_types; 10: optional list nested_fields; + 11: optional string hudi_jni_scanner; } struct TLakeSoulFileDesc { @@ -406,6 +397,7 @@ enum TTextSerdeType { struct TFileScanRangeParams { // deprecated, move to TFileScanRange 1: optional Types.TFileType file_type; + // deprecated, move to TFileScanRange 2: optional TFileFormatType format_type; // deprecated, move to TFileScanRange 3: optional TFileCompressType compress_type; @@ -480,6 +472,7 @@ struct TFileRangeDesc { // for hive table, different files may have different fs, // so fs_name should be with TFileRangeDesc 12: optional string fs_name + 13: optional TFileFormatType format_type; } struct TSplitSource { @@ -529,6 +522,13 @@ struct TIcebergMetadataParams { 4: optional string table } +struct THudiMetadataParams { + 1: optional Types.THudiQueryType hudi_query_type + 2: optional string catalog + 3: optional string database + 4: optional string table +} + struct TBackendsMetadataParams { 1: optional string cluster_name } @@ -589,6 +589,7 @@ struct TMetaScanRange { 9: optional TPartitionsMetadataParams partitions_params 10: optional TMetaCacheStatsParams meta_cache_stats_params 11: optional TPartitionValuesMetadataParams partition_values_params + 12: optional THudiMetadataParams hudi_params } // Specification of an individual data range which is held in its entirety @@ -829,12 +830,9 @@ struct THashJoinNode { // anything from the ON, USING or WHERE clauses that's an equi-join predicate 2: required list eq_join_conjuncts - // anything from the ON or USING clauses (but *not* the WHERE clause) that's not an - // equi-join predicate + // deprecated 3: optional list other_join_conjuncts - - // If true, this join node can (but may choose not to) generate slot filters - // after constructing the build side that can be applied to the probe side. + // deprecated 4: optional bool add_probe_filters // anything from the ON or USING clauses (but *not* the WHERE clause) that's not an @@ -845,8 +843,9 @@ struct THashJoinNode { 6: optional list hash_output_slot_ids // TODO: remove 7 and 8 in the version after the version include projection on ExecNode + // deprecated 7: optional list srcExprList - + // deprecated 8: optional Types.TTupleId voutput_tuple_id 9: optional list vintermediate_tuple_id_list @@ -857,14 +856,15 @@ struct THashJoinNode { 12: optional TJoinDistributionType dist_type 13: optional list mark_join_conjuncts // use_specific_projections true, if output exprssions is denoted by srcExprList represents, o.w. PlanNode.projections + // deprecated 14: optional bool use_specific_projections } struct TNestedLoopJoinNode { 1: required TJoinOp join_op - // TODO: remove 2 and 3 in the version after the version include projection on ExecNode + // deprecated 2: optional list srcExprList - + // deprecated 3: optional Types.TTupleId voutput_tuple_id 4: optional list vintermediate_tuple_id_list @@ -879,7 +879,7 @@ struct TNestedLoopJoinNode { 8: optional list join_conjuncts 9: optional list mark_join_conjuncts - // use_specific_projections true, if output exprssions is denoted by srcExprList represents, o.w. PlanNode.projections + // deprecated 10: optional bool use_specific_projections } @@ -1102,6 +1102,8 @@ struct TAnalyticNode { 9: optional Exprs.TExpr order_by_eq 10: optional bool is_colocate + + 11: optional list range_between_offset_exprs } struct TMergeNode { @@ -1252,7 +1254,7 @@ struct TRuntimeFilterDesc { // The order of Expr in join predicate 3: required i32 expr_order - // Map of target node id to the target expr + // Map of target node id to the target expr. Used by consumer 4: required map planId_to_target_expr // Indicates if the source join node of this filter is a broadcast or @@ -1293,7 +1295,9 @@ struct TRuntimeFilterDesc { // true, if join type is null aware like <=>. rf should dispose the case 15: optional bool null_aware; - 16: optional bool sync_filter_size; + 16: optional bool sync_filter_size; // Deprecated + + 17: optional bool build_bf_exactly; } diff --git a/pkg/rpc/thrift/RuntimeProfile.thrift b/pkg/rpc/thrift/RuntimeProfile.thrift index 0b4b6179..dd4a936f 100644 --- a/pkg/rpc/thrift/RuntimeProfile.thrift +++ b/pkg/rpc/thrift/RuntimeProfile.thrift @@ -32,6 +32,7 @@ struct TCounter { struct TRuntimeProfileNode { 1: required string name 2: required i32 num_children + // Counters is a list of flattened counters for this node and all its children 3: required list counters // TODO: should we make metadata a serializable struct? We only use it to // store the node id right now so this is sufficient. diff --git a/pkg/rpc/thrift/Types.thrift b/pkg/rpc/thrift/Types.thrift index 235c1cb2..4dbc1d06 100644 --- a/pkg/rpc/thrift/Types.thrift +++ b/pkg/rpc/thrift/Types.thrift @@ -122,9 +122,10 @@ enum TStorageBackendType { // This enum is used to distinguish between different organizational methods // of inverted index data, affecting how the index is stored and accessed. enum TInvertedIndexFileStorageFormat { - DEFAULT, // Default format, unspecified storage method. - V1, // Index per idx: Each index is stored separately based on its identifier. - V2 // Segment id per idx: Indexes are organized based on segment identifiers, grouping indexes by their associated segment. + DEFAULT = 0, // Default format, unspecified storage method. + V1 = 1, // Index per idx: Each index is stored separately based on its identifier. + V2 = 2 // Segment id per idx: Indexes are organized based on segment identifiers, grouping indexes by their associated segment. + V3 = 3 // Position and dictionary compression } struct TScalarType { @@ -242,13 +243,6 @@ enum TTaskType { CALCULATE_DELETE_BITMAP = 1000 } -enum TStmtType { - QUERY, - DDL, // Data definition, e.g. CREATE TABLE (includes read-only functions e.g. SHOW) - DML, // Data modification e.g. INSERT - EXPLAIN // EXPLAIN -} - // level of verboseness for "explain" output // TODO: should this go somewhere else? enum TExplainLevel { @@ -740,13 +734,18 @@ enum TMetadataType { TASKS, WORKLOAD_SCHED_POLICY, PARTITIONS, - PARTITION_VALUES; + PARTITION_VALUES, + HUDI, } enum TIcebergQueryType { SNAPSHOTS } +enum THudiQueryType { + TIMELINE +} + // represent a user identity struct TUserIdentity { 1: optional string username From dca5f103e4deffa8b17ea84564f761dcbc33ed7e Mon Sep 17 00:00:00 2001 From: walter Date: Sat, 8 Feb 2025 15:41:31 +0800 Subject: [PATCH 11/41] feat: support getting binlogs in batch (#400) --- pkg/ccr/job.go | 6 +- pkg/rpc/fe.go | 11 +- .../frontendservice/FrontendService.go | 168 +++++++++++++++++- .../frontendservice/k-FrontendService.go | 102 +++++++++++ .../PaloInternalService.go | 144 +++++++++++++++ .../k-PaloInternalService.go | 104 +++++++++++ pkg/rpc/thrift/FrontendService.thrift | 2 + pkg/rpc/thrift/PaloInternalService.thrift | 4 + .../dml/insert/test_ds_dml_insert.groovy | 60 +++++++ 9 files changed, 586 insertions(+), 15 deletions(-) create mode 100644 regression-test/suites/db_sync/dml/insert/test_ds_dml_insert.groovy diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 413bf736..f657e484 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -72,6 +72,8 @@ var ( featureFilterStorageMedium bool featureRestoreReplaceDiffSchema bool + flagBinlogBatchSize int64 + ErrMaterializedViewTable = xerror.NewWithoutStack(xerror.Meta, "Not support table type: materialized view") ) @@ -102,6 +104,8 @@ func init() { "enable filter storage medium property") flag.BoolVar(&featureRestoreReplaceDiffSchema, "feature_restore_replace_diff_schema", true, "replace the table with different schema during restore") + + flag.Int64Var(&flagBinlogBatchSize, "binlog_batch_size", 16, "the max num of binlogs to get in a batch") } type SyncType int @@ -3089,7 +3093,7 @@ func (j *Job) incrementalSync() error { commitSeq := j.progress.CommitSeq log.Debugf("src: %s, commitSeq: %v", src, commitSeq) - getBinlogResp, err := srcRpc.GetBinlog(src, commitSeq) + getBinlogResp, err := srcRpc.GetBinlog(src, commitSeq, flagBinlogBatchSize) if err != nil { return err } diff --git a/pkg/rpc/fe.go b/pkg/rpc/fe.go index 77a2adb2..0ee5ac7c 100644 --- a/pkg/rpc/fe.go +++ b/pkg/rpc/fe.go @@ -104,7 +104,7 @@ type IFeRpc interface { CommitTransaction(*base.Spec, int64, []*festruct_types.TTabletCommitInfo) (*festruct.TCommitTxnResult_, error) CommitTransactionForTxnInsert(*base.Spec, int64, bool, []*festruct.TSubTxnInfo) (*festruct.TCommitTxnResult_, error) RollbackTransaction(spec *base.Spec, txnId int64) (*festruct.TRollbackTxnResult_, error) - GetBinlog(*base.Spec, int64) (*festruct.TGetBinlogResult_, error) + GetBinlog(*base.Spec, int64, int64) (*festruct.TGetBinlogResult_, error) GetBinlogLag(*base.Spec, int64) (*festruct.TGetBinlogLagResult_, error) GetSnapshot(*base.Spec, string, bool) (*festruct.TGetSnapshotResult_, error) RestoreSnapshot(*base.Spec, *RestoreSnapshotRequest) (*festruct.TRestoreSnapshotResult_, error) @@ -420,10 +420,10 @@ func (rpc *FeRpc) RollbackTransaction(spec *base.Spec, txnId int64) (*festruct.T return convertResult[festruct.TRollbackTxnResult_](result, err) } -func (rpc *FeRpc) GetBinlog(spec *base.Spec, commitSeq int64) (*festruct.TGetBinlogResult_, error) { +func (rpc *FeRpc) GetBinlog(spec *base.Spec, commitSeq, numAcquired int64) (*festruct.TGetBinlogResult_, error) { // return rpc.masterClient.GetBinlog(spec, commitSeq) caller := func(client IFeRpc) (resultType, error) { - return client.GetBinlog(spec, commitSeq) + return client.GetBinlog(spec, commitSeq, numAcquired) } result, err := rpc.callWithMasterRedirect(caller) return convertResult[festruct.TGetBinlogResult_](result, err) @@ -669,12 +669,13 @@ func (rpc *singleFeClient) RollbackTransaction(spec *base.Spec, txnId int64) (*f // 7: optional string token // 8: required i64 prev_commit_seq // } -func (rpc *singleFeClient) GetBinlog(spec *base.Spec, commitSeq int64) (*festruct.TGetBinlogResult_, error) { - log.Debugf("Call GetBinlog, addr: %s, spec: %s, commit seq: %d", rpc.Address(), spec, commitSeq) +func (rpc *singleFeClient) GetBinlog(spec *base.Spec, commitSeq, numAcquired int64) (*festruct.TGetBinlogResult_, error) { + log.Tracef("Call GetBinlog, addr: %s, spec: %s, commit seq: %d, num acquired: %d", rpc.Address(), spec, commitSeq, numAcquired) client := rpc.client req := &festruct.TGetBinlogRequest{ PrevCommitSeq: &commitSeq, + NumAcquired: &numAcquired, } setAuthInfo(req, spec) diff --git a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go index e59ebe7d..97856a6f 100644 --- a/pkg/rpc/kitex_gen/frontendservice/FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/FrontendService.go @@ -4578,6 +4578,7 @@ type TGetTablesParams struct { CurrentUserIdent *types.TUserIdentity `thrift:"current_user_ident,5,optional" frugal:"5,optional,types.TUserIdentity" json:"current_user_ident,omitempty"` Type *string `thrift:"type,6,optional" frugal:"6,optional,string" json:"type,omitempty"` Catalog *string `thrift:"catalog,7,optional" frugal:"7,optional,string" json:"catalog,omitempty"` + Table *string `thrift:"table,8,optional" frugal:"8,optional,string" json:"table,omitempty"` } func NewTGetTablesParams() *TGetTablesParams { @@ -4649,6 +4650,15 @@ func (p *TGetTablesParams) GetCatalog() (v string) { } return *p.Catalog } + +var TGetTablesParams_Table_DEFAULT string + +func (p *TGetTablesParams) GetTable() (v string) { + if !p.IsSetTable() { + return TGetTablesParams_Table_DEFAULT + } + return *p.Table +} func (p *TGetTablesParams) SetDb(val *string) { p.Db = val } @@ -4670,6 +4680,9 @@ func (p *TGetTablesParams) SetType(val *string) { func (p *TGetTablesParams) SetCatalog(val *string) { p.Catalog = val } +func (p *TGetTablesParams) SetTable(val *string) { + p.Table = val +} var fieldIDToName_TGetTablesParams = map[int16]string{ 1: "db", @@ -4679,6 +4692,7 @@ var fieldIDToName_TGetTablesParams = map[int16]string{ 5: "current_user_ident", 6: "type", 7: "catalog", + 8: "table", } func (p *TGetTablesParams) IsSetDb() bool { @@ -4709,6 +4723,10 @@ func (p *TGetTablesParams) IsSetCatalog() bool { return p.Catalog != nil } +func (p *TGetTablesParams) IsSetTable() bool { + return p.Table != nil +} + func (p *TGetTablesParams) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -4784,6 +4802,14 @@ func (p *TGetTablesParams) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 8: + if fieldTypeId == thrift.STRING { + if err = p.ReadField8(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -4887,6 +4913,17 @@ func (p *TGetTablesParams) ReadField7(iprot thrift.TProtocol) error { p.Catalog = _field return nil } +func (p *TGetTablesParams) ReadField8(iprot thrift.TProtocol) error { + + var _field *string + if v, err := iprot.ReadString(); err != nil { + return err + } else { + _field = &v + } + p.Table = _field + return nil +} func (p *TGetTablesParams) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -4922,6 +4959,10 @@ func (p *TGetTablesParams) Write(oprot thrift.TProtocol) (err error) { fieldId = 7 goto WriteFieldError } + if err = p.writeField8(oprot); err != nil { + fieldId = 8 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -5073,6 +5114,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err) } +func (p *TGetTablesParams) writeField8(oprot thrift.TProtocol) (err error) { + if p.IsSetTable() { + if err = oprot.WriteFieldBegin("table", thrift.STRING, 8); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteString(*p.Table); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err) +} + func (p *TGetTablesParams) String() string { if p == nil { return "" @@ -5108,6 +5168,9 @@ func (p *TGetTablesParams) DeepEqual(ano *TGetTablesParams) bool { if !p.Field7DeepEqual(ano.Catalog) { return false } + if !p.Field8DeepEqual(ano.Table) { + return false + } return true } @@ -5190,6 +5253,18 @@ func (p *TGetTablesParams) Field7DeepEqual(src *string) bool { } return true } +func (p *TGetTablesParams) Field8DeepEqual(src *string) bool { + + if p.Table == src { + return true + } else if p.Table == nil || src == nil { + return false + } + if strings.Compare(*p.Table, *src) != 0 { + return false + } + return true +} type TTableStatus struct { Name string `thrift:"name,1,required" frugal:"1,required,string" json:"name"` @@ -48412,6 +48487,7 @@ type TGetBinlogRequest struct { UserIp *string `thrift:"user_ip,7,optional" frugal:"7,optional,string" json:"user_ip,omitempty"` Token *string `thrift:"token,8,optional" frugal:"8,optional,string" json:"token,omitempty"` PrevCommitSeq *int64 `thrift:"prev_commit_seq,9,optional" frugal:"9,optional,i64" json:"prev_commit_seq,omitempty"` + NumAcquired *int64 `thrift:"num_acquired,10,optional" frugal:"10,optional,i64" json:"num_acquired,omitempty"` } func NewTGetBinlogRequest() *TGetBinlogRequest { @@ -48501,6 +48577,15 @@ func (p *TGetBinlogRequest) GetPrevCommitSeq() (v int64) { } return *p.PrevCommitSeq } + +var TGetBinlogRequest_NumAcquired_DEFAULT int64 + +func (p *TGetBinlogRequest) GetNumAcquired() (v int64) { + if !p.IsSetNumAcquired() { + return TGetBinlogRequest_NumAcquired_DEFAULT + } + return *p.NumAcquired +} func (p *TGetBinlogRequest) SetCluster(val *string) { p.Cluster = val } @@ -48528,17 +48613,21 @@ func (p *TGetBinlogRequest) SetToken(val *string) { func (p *TGetBinlogRequest) SetPrevCommitSeq(val *int64) { p.PrevCommitSeq = val } +func (p *TGetBinlogRequest) SetNumAcquired(val *int64) { + p.NumAcquired = val +} var fieldIDToName_TGetBinlogRequest = map[int16]string{ - 1: "cluster", - 2: "user", - 3: "passwd", - 4: "db", - 5: "table", - 6: "table_id", - 7: "user_ip", - 8: "token", - 9: "prev_commit_seq", + 1: "cluster", + 2: "user", + 3: "passwd", + 4: "db", + 5: "table", + 6: "table_id", + 7: "user_ip", + 8: "token", + 9: "prev_commit_seq", + 10: "num_acquired", } func (p *TGetBinlogRequest) IsSetCluster() bool { @@ -48577,6 +48666,10 @@ func (p *TGetBinlogRequest) IsSetPrevCommitSeq() bool { return p.PrevCommitSeq != nil } +func (p *TGetBinlogRequest) IsSetNumAcquired() bool { + return p.NumAcquired != nil +} + func (p *TGetBinlogRequest) Read(iprot thrift.TProtocol) (err error) { var fieldTypeId thrift.TType @@ -48668,6 +48761,14 @@ func (p *TGetBinlogRequest) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 10: + if fieldTypeId == thrift.I64 { + if err = p.ReadField10(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } default: if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError @@ -48796,6 +48897,17 @@ func (p *TGetBinlogRequest) ReadField9(iprot thrift.TProtocol) error { p.PrevCommitSeq = _field return nil } +func (p *TGetBinlogRequest) ReadField10(iprot thrift.TProtocol) error { + + var _field *int64 + if v, err := iprot.ReadI64(); err != nil { + return err + } else { + _field = &v + } + p.NumAcquired = _field + return nil +} func (p *TGetBinlogRequest) Write(oprot thrift.TProtocol) (err error) { var fieldId int16 @@ -48839,6 +48951,10 @@ func (p *TGetBinlogRequest) Write(oprot thrift.TProtocol) (err error) { fieldId = 9 goto WriteFieldError } + if err = p.writeField10(oprot); err != nil { + fieldId = 10 + goto WriteFieldError + } } if err = oprot.WriteFieldStop(); err != nil { goto WriteFieldStopError @@ -49028,6 +49144,25 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err) } +func (p *TGetBinlogRequest) writeField10(oprot thrift.TProtocol) (err error) { + if p.IsSetNumAcquired() { + if err = oprot.WriteFieldBegin("num_acquired", thrift.I64, 10); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI64(*p.NumAcquired); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err) +} + func (p *TGetBinlogRequest) String() string { if p == nil { return "" @@ -49069,6 +49204,9 @@ func (p *TGetBinlogRequest) DeepEqual(ano *TGetBinlogRequest) bool { if !p.Field9DeepEqual(ano.PrevCommitSeq) { return false } + if !p.Field10DeepEqual(ano.NumAcquired) { + return false + } return true } @@ -49180,6 +49318,18 @@ func (p *TGetBinlogRequest) Field9DeepEqual(src *int64) bool { } return true } +func (p *TGetBinlogRequest) Field10DeepEqual(src *int64) bool { + + if p.NumAcquired == src { + return true + } else if p.NumAcquired == nil || src == nil { + return false + } + if *p.NumAcquired != *src { + return false + } + return true +} type TBinlog struct { CommitSeq *int64 `thrift:"commit_seq,1,optional" frugal:"1,optional,i64" json:"commit_seq,omitempty"` diff --git a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go index 7b70a664..28976eb8 100644 --- a/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go +++ b/pkg/rpc/kitex_gen/frontendservice/k-FrontendService.go @@ -2813,6 +2813,20 @@ func (p *TGetTablesParams) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 8: + if fieldTypeId == thrift.STRING { + l, err = p.FastReadField8(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -2939,6 +2953,19 @@ func (p *TGetTablesParams) FastReadField7(buf []byte) (int, error) { return offset, nil } +func (p *TGetTablesParams) FastReadField8(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadString(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.Table = &v + + } + return offset, nil +} + // for compatibility func (p *TGetTablesParams) FastWrite(buf []byte) int { return 0 @@ -2955,6 +2982,7 @@ func (p *TGetTablesParams) FastWriteNocopy(buf []byte, binaryWriter bthrift.Bina offset += p.fastWriteField5(buf[offset:], binaryWriter) offset += p.fastWriteField6(buf[offset:], binaryWriter) offset += p.fastWriteField7(buf[offset:], binaryWriter) + offset += p.fastWriteField8(buf[offset:], binaryWriter) } offset += bthrift.Binary.WriteFieldStop(buf[offset:]) offset += bthrift.Binary.WriteStructEnd(buf[offset:]) @@ -2972,6 +3000,7 @@ func (p *TGetTablesParams) BLength() int { l += p.field5Length() l += p.field6Length() l += p.field7Length() + l += p.field8Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -3054,6 +3083,17 @@ func (p *TGetTablesParams) fastWriteField7(buf []byte, binaryWriter bthrift.Bina return offset } +func (p *TGetTablesParams) fastWriteField8(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetTable() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "table", thrift.STRING, 8) + offset += bthrift.Binary.WriteStringNocopy(buf[offset:], binaryWriter, *p.Table) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TGetTablesParams) field1Length() int { l := 0 if p.IsSetDb() { @@ -3130,6 +3170,17 @@ func (p *TGetTablesParams) field7Length() int { return l } +func (p *TGetTablesParams) field8Length() int { + l := 0 + if p.IsSetTable() { + l += bthrift.Binary.FieldBeginLength("table", thrift.STRING, 8) + l += bthrift.Binary.StringLengthNocopy(*p.Table) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TTableStatus) FastRead(buf []byte) (int, error) { var err error var offset int @@ -35121,6 +35172,20 @@ func (p *TGetBinlogRequest) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 10: + if fieldTypeId == thrift.I64 { + l, err = p.FastReadField10(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } default: l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) offset += l @@ -35273,6 +35338,19 @@ func (p *TGetBinlogRequest) FastReadField9(buf []byte) (int, error) { return offset, nil } +func (p *TGetBinlogRequest) FastReadField10(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI64(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + p.NumAcquired = &v + + } + return offset, nil +} + // for compatibility func (p *TGetBinlogRequest) FastWrite(buf []byte) int { return 0 @@ -35284,6 +35362,7 @@ func (p *TGetBinlogRequest) FastWriteNocopy(buf []byte, binaryWriter bthrift.Bin if p != nil { offset += p.fastWriteField6(buf[offset:], binaryWriter) offset += p.fastWriteField9(buf[offset:], binaryWriter) + offset += p.fastWriteField10(buf[offset:], binaryWriter) offset += p.fastWriteField1(buf[offset:], binaryWriter) offset += p.fastWriteField2(buf[offset:], binaryWriter) offset += p.fastWriteField3(buf[offset:], binaryWriter) @@ -35310,6 +35389,7 @@ func (p *TGetBinlogRequest) BLength() int { l += p.field7Length() l += p.field8Length() l += p.field9Length() + l += p.field10Length() } l += bthrift.Binary.FieldStopLength() l += bthrift.Binary.StructEndLength() @@ -35415,6 +35495,17 @@ func (p *TGetBinlogRequest) fastWriteField9(buf []byte, binaryWriter bthrift.Bin return offset } +func (p *TGetBinlogRequest) fastWriteField10(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetNumAcquired() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "num_acquired", thrift.I64, 10) + offset += bthrift.Binary.WriteI64(buf[offset:], *p.NumAcquired) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TGetBinlogRequest) field1Length() int { l := 0 if p.IsSetCluster() { @@ -35514,6 +35605,17 @@ func (p *TGetBinlogRequest) field9Length() int { return l } +func (p *TGetBinlogRequest) field10Length() int { + l := 0 + if p.IsSetNumAcquired() { + l += bthrift.Binary.FieldBeginLength("num_acquired", thrift.I64, 10) + l += bthrift.Binary.I64Length(*p.NumAcquired) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TBinlog) FastRead(buf []byte) (int, error) { var err error var offset int diff --git a/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go b/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go index 95fbe8d1..12cba123 100644 --- a/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go +++ b/pkg/rpc/kitex_gen/palointernalservice/PaloInternalService.go @@ -1769,6 +1769,8 @@ type TQueryOptions struct { EnableInvertedIndexQueryCache bool `thrift:"enable_inverted_index_query_cache,145,optional" frugal:"145,optional,bool" json:"enable_inverted_index_query_cache,omitempty"` FuzzyDisableRuntimeFilterInBe bool `thrift:"fuzzy_disable_runtime_filter_in_be,146,optional" frugal:"146,optional,bool" json:"fuzzy_disable_runtime_filter_in_be,omitempty"` ProfileLevel int32 `thrift:"profile_level,147,optional" frugal:"147,optional,i32" json:"profile_level,omitempty"` + MinScannerConcurrency int32 `thrift:"min_scanner_concurrency,148,optional" frugal:"148,optional,i32" json:"min_scanner_concurrency,omitempty"` + MinScanSchedulerConcurrency int32 `thrift:"min_scan_scheduler_concurrency,149,optional" frugal:"149,optional,i32" json:"min_scan_scheduler_concurrency,omitempty"` DisableFileCache bool `thrift:"disable_file_cache,1000,optional" frugal:"1000,optional,bool" json:"disable_file_cache,omitempty"` } @@ -1902,6 +1904,8 @@ func NewTQueryOptions() *TQueryOptions { EnableInvertedIndexQueryCache: true, FuzzyDisableRuntimeFilterInBe: false, ProfileLevel: 1, + MinScannerConcurrency: 1, + MinScanSchedulerConcurrency: 0, DisableFileCache: false, } } @@ -2034,6 +2038,8 @@ func (p *TQueryOptions) InitDefault() { p.EnableInvertedIndexQueryCache = true p.FuzzyDisableRuntimeFilterInBe = false p.ProfileLevel = 1 + p.MinScannerConcurrency = 1 + p.MinScanSchedulerConcurrency = 0 p.DisableFileCache = false } @@ -3279,6 +3285,24 @@ func (p *TQueryOptions) GetProfileLevel() (v int32) { return p.ProfileLevel } +var TQueryOptions_MinScannerConcurrency_DEFAULT int32 = 1 + +func (p *TQueryOptions) GetMinScannerConcurrency() (v int32) { + if !p.IsSetMinScannerConcurrency() { + return TQueryOptions_MinScannerConcurrency_DEFAULT + } + return p.MinScannerConcurrency +} + +var TQueryOptions_MinScanSchedulerConcurrency_DEFAULT int32 = 0 + +func (p *TQueryOptions) GetMinScanSchedulerConcurrency() (v int32) { + if !p.IsSetMinScanSchedulerConcurrency() { + return TQueryOptions_MinScanSchedulerConcurrency_DEFAULT + } + return p.MinScanSchedulerConcurrency +} + var TQueryOptions_DisableFileCache_DEFAULT bool = false func (p *TQueryOptions) GetDisableFileCache() (v bool) { @@ -3701,6 +3725,12 @@ func (p *TQueryOptions) SetFuzzyDisableRuntimeFilterInBe(val bool) { func (p *TQueryOptions) SetProfileLevel(val int32) { p.ProfileLevel = val } +func (p *TQueryOptions) SetMinScannerConcurrency(val int32) { + p.MinScannerConcurrency = val +} +func (p *TQueryOptions) SetMinScanSchedulerConcurrency(val int32) { + p.MinScanSchedulerConcurrency = val +} func (p *TQueryOptions) SetDisableFileCache(val bool) { p.DisableFileCache = val } @@ -3844,6 +3874,8 @@ var fieldIDToName_TQueryOptions = map[int16]string{ 145: "enable_inverted_index_query_cache", 146: "fuzzy_disable_runtime_filter_in_be", 147: "profile_level", + 148: "min_scanner_concurrency", + 149: "min_scan_scheduler_concurrency", 1000: "disable_file_cache", } @@ -4399,6 +4431,14 @@ func (p *TQueryOptions) IsSetProfileLevel() bool { return p.ProfileLevel != TQueryOptions_ProfileLevel_DEFAULT } +func (p *TQueryOptions) IsSetMinScannerConcurrency() bool { + return p.MinScannerConcurrency != TQueryOptions_MinScannerConcurrency_DEFAULT +} + +func (p *TQueryOptions) IsSetMinScanSchedulerConcurrency() bool { + return p.MinScanSchedulerConcurrency != TQueryOptions_MinScanSchedulerConcurrency_DEFAULT +} + func (p *TQueryOptions) IsSetDisableFileCache() bool { return p.DisableFileCache != TQueryOptions_DisableFileCache_DEFAULT } @@ -5526,6 +5566,22 @@ func (p *TQueryOptions) Read(iprot thrift.TProtocol) (err error) { } else if err = iprot.Skip(fieldTypeId); err != nil { goto SkipFieldError } + case 148: + if fieldTypeId == thrift.I32 { + if err = p.ReadField148(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } + case 149: + if fieldTypeId == thrift.I32 { + if err = p.ReadField149(iprot); err != nil { + goto ReadFieldError + } + } else if err = iprot.Skip(fieldTypeId); err != nil { + goto SkipFieldError + } case 1000: if fieldTypeId == thrift.BOOL { if err = p.ReadField1000(iprot); err != nil { @@ -7078,6 +7134,28 @@ func (p *TQueryOptions) ReadField147(iprot thrift.TProtocol) error { p.ProfileLevel = _field return nil } +func (p *TQueryOptions) ReadField148(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.MinScannerConcurrency = _field + return nil +} +func (p *TQueryOptions) ReadField149(iprot thrift.TProtocol) error { + + var _field int32 + if v, err := iprot.ReadI32(); err != nil { + return err + } else { + _field = v + } + p.MinScanSchedulerConcurrency = _field + return nil +} func (p *TQueryOptions) ReadField1000(iprot thrift.TProtocol) error { var _field bool @@ -7648,6 +7726,14 @@ func (p *TQueryOptions) Write(oprot thrift.TProtocol) (err error) { fieldId = 147 goto WriteFieldError } + if err = p.writeField148(oprot); err != nil { + fieldId = 148 + goto WriteFieldError + } + if err = p.writeField149(oprot); err != nil { + fieldId = 149 + goto WriteFieldError + } if err = p.writeField1000(oprot); err != nil { fieldId = 1000 goto WriteFieldError @@ -10292,6 +10378,44 @@ WriteFieldEndError: return thrift.PrependError(fmt.Sprintf("%T write field 147 end error: ", p), err) } +func (p *TQueryOptions) writeField148(oprot thrift.TProtocol) (err error) { + if p.IsSetMinScannerConcurrency() { + if err = oprot.WriteFieldBegin("min_scanner_concurrency", thrift.I32, 148); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(p.MinScannerConcurrency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 148 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 148 end error: ", p), err) +} + +func (p *TQueryOptions) writeField149(oprot thrift.TProtocol) (err error) { + if p.IsSetMinScanSchedulerConcurrency() { + if err = oprot.WriteFieldBegin("min_scan_scheduler_concurrency", thrift.I32, 149); err != nil { + goto WriteFieldBeginError + } + if err := oprot.WriteI32(p.MinScanSchedulerConcurrency); err != nil { + return err + } + if err = oprot.WriteFieldEnd(); err != nil { + goto WriteFieldEndError + } + } + return nil +WriteFieldBeginError: + return thrift.PrependError(fmt.Sprintf("%T write field 149 begin error: ", p), err) +WriteFieldEndError: + return thrift.PrependError(fmt.Sprintf("%T write field 149 end error: ", p), err) +} + func (p *TQueryOptions) writeField1000(oprot thrift.TProtocol) (err error) { if p.IsSetDisableFileCache() { if err = oprot.WriteFieldBegin("disable_file_cache", thrift.BOOL, 1000); err != nil { @@ -10739,6 +10863,12 @@ func (p *TQueryOptions) DeepEqual(ano *TQueryOptions) bool { if !p.Field147DeepEqual(ano.ProfileLevel) { return false } + if !p.Field148DeepEqual(ano.MinScannerConcurrency) { + return false + } + if !p.Field149DeepEqual(ano.MinScanSchedulerConcurrency) { + return false + } if !p.Field1000DeepEqual(ano.DisableFileCache) { return false } @@ -11761,6 +11891,20 @@ func (p *TQueryOptions) Field147DeepEqual(src int32) bool { } return true } +func (p *TQueryOptions) Field148DeepEqual(src int32) bool { + + if p.MinScannerConcurrency != src { + return false + } + return true +} +func (p *TQueryOptions) Field149DeepEqual(src int32) bool { + + if p.MinScanSchedulerConcurrency != src { + return false + } + return true +} func (p *TQueryOptions) Field1000DeepEqual(src bool) bool { if p.DisableFileCache != src { diff --git a/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go b/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go index ce439a1d..1565a963 100644 --- a/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go +++ b/pkg/rpc/kitex_gen/palointernalservice/k-PaloInternalService.go @@ -3067,6 +3067,34 @@ func (p *TQueryOptions) FastRead(buf []byte) (int, error) { goto SkipFieldError } } + case 148: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField148(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } + case 149: + if fieldTypeId == thrift.I32 { + l, err = p.FastReadField149(buf[offset:]) + offset += l + if err != nil { + goto ReadFieldError + } + } else { + l, err = bthrift.Binary.Skip(buf[offset:], fieldTypeId) + offset += l + if err != nil { + goto SkipFieldError + } + } case 1000: if fieldTypeId == thrift.BOOL { l, err = p.FastReadField1000(buf[offset:]) @@ -5037,6 +5065,34 @@ func (p *TQueryOptions) FastReadField147(buf []byte) (int, error) { return offset, nil } +func (p *TQueryOptions) FastReadField148(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.MinScannerConcurrency = v + + } + return offset, nil +} + +func (p *TQueryOptions) FastReadField149(buf []byte) (int, error) { + offset := 0 + + if v, l, err := bthrift.Binary.ReadI32(buf[offset:]); err != nil { + return offset, err + } else { + offset += l + + p.MinScanSchedulerConcurrency = v + + } + return offset, nil +} + func (p *TQueryOptions) FastReadField1000(buf []byte) (int, error) { offset := 0 @@ -5193,6 +5249,8 @@ func (p *TQueryOptions) FastWriteNocopy(buf []byte, binaryWriter bthrift.BinaryW offset += p.fastWriteField145(buf[offset:], binaryWriter) offset += p.fastWriteField146(buf[offset:], binaryWriter) offset += p.fastWriteField147(buf[offset:], binaryWriter) + offset += p.fastWriteField148(buf[offset:], binaryWriter) + offset += p.fastWriteField149(buf[offset:], binaryWriter) offset += p.fastWriteField1000(buf[offset:], binaryWriter) offset += p.fastWriteField18(buf[offset:], binaryWriter) offset += p.fastWriteField42(buf[offset:], binaryWriter) @@ -5347,6 +5405,8 @@ func (p *TQueryOptions) BLength() int { l += p.field145Length() l += p.field146Length() l += p.field147Length() + l += p.field148Length() + l += p.field149Length() l += p.field1000Length() } l += bthrift.Binary.FieldStopLength() @@ -6871,6 +6931,28 @@ func (p *TQueryOptions) fastWriteField147(buf []byte, binaryWriter bthrift.Binar return offset } +func (p *TQueryOptions) fastWriteField148(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetMinScannerConcurrency() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "min_scanner_concurrency", thrift.I32, 148) + offset += bthrift.Binary.WriteI32(buf[offset:], p.MinScannerConcurrency) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + +func (p *TQueryOptions) fastWriteField149(buf []byte, binaryWriter bthrift.BinaryWriter) int { + offset := 0 + if p.IsSetMinScanSchedulerConcurrency() { + offset += bthrift.Binary.WriteFieldBegin(buf[offset:], "min_scan_scheduler_concurrency", thrift.I32, 149) + offset += bthrift.Binary.WriteI32(buf[offset:], p.MinScanSchedulerConcurrency) + + offset += bthrift.Binary.WriteFieldEnd(buf[offset:]) + } + return offset +} + func (p *TQueryOptions) fastWriteField1000(buf []byte, binaryWriter bthrift.BinaryWriter) int { offset := 0 if p.IsSetDisableFileCache() { @@ -8399,6 +8481,28 @@ func (p *TQueryOptions) field147Length() int { return l } +func (p *TQueryOptions) field148Length() int { + l := 0 + if p.IsSetMinScannerConcurrency() { + l += bthrift.Binary.FieldBeginLength("min_scanner_concurrency", thrift.I32, 148) + l += bthrift.Binary.I32Length(p.MinScannerConcurrency) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + +func (p *TQueryOptions) field149Length() int { + l := 0 + if p.IsSetMinScanSchedulerConcurrency() { + l += bthrift.Binary.FieldBeginLength("min_scan_scheduler_concurrency", thrift.I32, 149) + l += bthrift.Binary.I32Length(p.MinScanSchedulerConcurrency) + + l += bthrift.Binary.FieldEndLength() + } + return l +} + func (p *TQueryOptions) field1000Length() int { l := 0 if p.IsSetDisableFileCache() { diff --git a/pkg/rpc/thrift/FrontendService.thrift b/pkg/rpc/thrift/FrontendService.thrift index 0d536e3c..29d7febd 100644 --- a/pkg/rpc/thrift/FrontendService.thrift +++ b/pkg/rpc/thrift/FrontendService.thrift @@ -118,6 +118,7 @@ struct TGetTablesParams { 5: optional Types.TUserIdentity current_user_ident // to replace the user and user ip 6: optional string type 7: optional string catalog + 8: optional string table } struct TTableStatus { @@ -979,6 +980,7 @@ struct TGetBinlogRequest { 7: optional string user_ip 8: optional string token 9: optional i64 prev_commit_seq + 10: optional i64 num_acquired // the max num of binlogs in a batch } enum TBinlogType { diff --git a/pkg/rpc/thrift/PaloInternalService.thrift b/pkg/rpc/thrift/PaloInternalService.thrift index 2e8ed9c3..8e3b14f3 100644 --- a/pkg/rpc/thrift/PaloInternalService.thrift +++ b/pkg/rpc/thrift/PaloInternalService.thrift @@ -360,12 +360,16 @@ struct TQueryOptions { 142: optional bool enable_fixed_len_to_uint32_v2 = false; 143: optional bool enable_shared_exchange_sink_buffer = true; + 144: optional bool enable_inverted_index_searcher_cache = true; 145: optional bool enable_inverted_index_query_cache = true; 146: optional bool fuzzy_disable_runtime_filter_in_be = false; 147: optional i32 profile_level = 1; + 148: optional i32 min_scanner_concurrency = 1; + 149: optional i32 min_scan_scheduler_concurrency = 0; + // For cloud, to control if the content would be written into file cache // In write path, to control if the content would be written into file cache. // In read path, read from file cache or remote storage when execute query. diff --git a/regression-test/suites/db_sync/dml/insert/test_ds_dml_insert.groovy b/regression-test/suites/db_sync/dml/insert/test_ds_dml_insert.groovy new file mode 100644 index 00000000..a38473bc --- /dev/null +++ b/regression-test/suites/db_sync/dml/insert/test_ds_dml_insert.groovy @@ -0,0 +1,60 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +suite("test_ds_dml_insert") { + def helper = new GroovyShell(new Binding(['suite': delegate])) + .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + + def tableName = "tbl_" + helper.randomSuffix() + + def exist = { res -> Boolean + return res.size() != 0 + } + + helper.enableDbBinlog() + helper.ccrJobDelete() + helper.ccrJobCreate() + + sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT, + ) + ENGINE=OLAP + DUPLICATE KEY(`test`) + PARTITION BY RANGE(id) + ( + PARTITION `p1` VALUES LESS THAN ("100"), + PARTITION `p2` VALUES LESS THAN ("200") + ) + DISTRIBUTED BY HASH(id) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "binlog.enable" = "true", + "binlog.ttl_seconds" = "180" + ) + """ + + for (int i = 0; i < 200; i++) { + sql """ INSERT INTO ${tableName} VALUES (${i}, ${i}) """ + } + sql "sync" + + assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 60)) + assertTrue(helper.checkShowTimesOf("SELECT * FROM ${tableName}", exist, 60, "sql")) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableName}", 200, 60)) +} From 0e86f3aefb7b9311ec6138d7f20e8a685058c7a5 Mon Sep 17 00:00:00 2001 From: walter Date: Mon, 10 Feb 2025 15:23:57 +0800 Subject: [PATCH 12/41] fix: lock binlog after handle binlogs (#406) --- pkg/ccr/job.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index f657e484..0d9359c9 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -3127,8 +3127,12 @@ func (j *Job) incrementalSync() error { if err, backToRunLoop := j.handleBinlogs(binlogs); err != nil { return err } else if backToRunLoop { - // release the binlogs before PrevCommitSeq. - return j.lockBinlog(j.progress.PrevCommitSeq) + return nil + } + + // release the binlogs before PrevCommitSeq. + if err = j.lockBinlog(j.progress.PrevCommitSeq); err != nil { + return err } } } From f22ad396f9e585f6849633d015035210ac01f4b8 Mon Sep 17 00:00:00 2001 From: walter Date: Mon, 10 Feb 2025 17:47:35 +0800 Subject: [PATCH 13/41] feat: compatible with unknown lock_binlog method (#407) --- pkg/ccr/job.go | 7 ++++++- pkg/rpc/error.go | 32 ++++++++++++++++++++++++++++++++ pkg/rpc/fe.go | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 pkg/rpc/error.go diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 0d9359c9..75e7eef2 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -3728,7 +3728,12 @@ func (j *Job) lockBinlog(lockCommitSeq int64) error { jobUniqueId := fmt.Sprintf("%s_%s", j.Name, j.Id) resp, err := srcRpc.LockBinlog(src, jobUniqueId, tableId, lockCommitSeq) - if err != nil { + if err != nil && rpc.IsUnknownMethod(err) { + // Keep compatibility with old version + log.Debugf("lock binlog failed, because of unknown method, src: %v", src) + j.progress.LockedCommitSeq = lockCommitSeq + return nil + } else if err != nil { log.Errorf("lock binlog failed, src: %v, err: %+v", src, err) return err } else if status := resp.GetStatus().GetStatusCode(); status != tstatus.TStatusCode_OK && diff --git a/pkg/rpc/error.go b/pkg/rpc/error.go new file mode 100644 index 00000000..ccfcb65f --- /dev/null +++ b/pkg/rpc/error.go @@ -0,0 +1,32 @@ +package rpc + +import ( + "errors" + + "github.com/cloudwego/kitex/pkg/kerrors" + "github.com/cloudwego/kitex/pkg/remote" + "github.com/selectdb/ccr_syncer/pkg/xerror" +) + +func IsUnknownMethod(err error) bool { + if err == nil { + return false + } + + var xerr *xerror.XError + if errors.As(err, &xerr) { + return IsUnknownMethod(xerr.Unwrap()) + } + + var de *kerrors.DetailedError + if errors.As(err, &de) { + return IsUnknownMethod(de.Unwrap()) + } + + var te *remote.TransError + if errors.As(err, &te) && te.TypeID() == remote.UnknownMethod { + return true + } + + return false +} diff --git a/pkg/rpc/fe.go b/pkg/rpc/fe.go index 0ee5ac7c..f9a4c9b5 100644 --- a/pkg/rpc/fe.go +++ b/pkg/rpc/fe.go @@ -67,7 +67,7 @@ func canUseNextAddr(err error) bool { return true } if errors.Is(err, kerrors.ErrRemoteOrNetwork) { - return true + return !IsUnknownMethod(err) } errMsg := err.Error() From 668126164ecc4f0412793ea12267c806299226a7 Mon Sep 17 00:00:00 2001 From: walter Date: Tue, 18 Feb 2025 11:34:17 +0800 Subject: [PATCH 14/41] fix: avoid leaking rpc conns (#435) --- pkg/service/http_service.go | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/pkg/service/http_service.go b/pkg/service/http_service.go index dbac7168..13874edc 100644 --- a/pkg/service/http_service.go +++ b/pkg/service/http_service.go @@ -30,6 +30,7 @@ import ( "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/selectdb/ccr_syncer/pkg/ccr" "github.com/selectdb/ccr_syncer/pkg/ccr/base" + "github.com/selectdb/ccr_syncer/pkg/rpc" "github.com/selectdb/ccr_syncer/pkg/storage" "github.com/selectdb/ccr_syncer/pkg/utils" "github.com/selectdb/ccr_syncer/pkg/version" @@ -94,9 +95,9 @@ func NewHttpServer(host string, port int, db storage.DB, jobManager *ccr.JobMana type CreateCcrRequest struct { // must need all fields required - Name string `json:"name,required"` - Src base.Spec `json:"src,required"` - Dest base.Spec `json:"dest,required"` + Name string `json:"name"` + Src base.Spec `json:"src"` + Dest base.Spec `json:"dest"` SkipError bool `json:"skip_error"` // For table sync, allow to create ccr job even if the target table already exists. AllowTableExists bool `json:"allow_table_exists"` @@ -214,7 +215,7 @@ func (s *HttpService) createHandler(w http.ResponseWriter, r *http.Request) { type CcrCommonRequest struct { // must need all fields required - Name string `json:"name,required"` + Name string `json:"name"` } // GetLag service @@ -228,7 +229,7 @@ func (s *HttpService) getLagHandler(w http.ResponseWriter, r *http.Request) { LastCommitSeq int64 `json:"last_commit_seq"` FirstBinlogTimestamp string `json:"first_binlog_timestamp"` LastBinlogTimestamp string `json:"last_binlog_timestamp"` - TimeInterval float64 `json:"time_interval"` + TimeInterval float64 `json:"time_interval_secs"` } var lagResult *result defer func() { writeJson(w, lagResult) }() @@ -294,7 +295,7 @@ func (s *HttpService) getLagHandler(w http.ResponseWriter, r *http.Request) { } srcSpec := &job.Src - rpc, err := s.jobManager.GetFactory().NewFeRpc(srcSpec) + feRpc, err := rpc.NewFeRpc(srcSpec) if err != nil { log.Warnf("new fe rpc failed: %+v", err) lagResult = &result{ @@ -304,9 +305,9 @@ func (s *HttpService) getLagHandler(w http.ResponseWriter, r *http.Request) { } commitSeq := jobProgress.CommitSeq - resp, err := rpc.GetBinlogLag(srcSpec, commitSeq) + resp, err := feRpc.GetBinlogLag(srcSpec, commitSeq) if err != nil { - log.Warnf("rpc get bin log failed: %+v", err) + log.Warnf("rpc get binlog failed: %+v", err) lagResult = &result{ defaultResult: newErrorResult(err.Error()), } @@ -553,17 +554,15 @@ func (s *HttpService) listJobsHandler(w http.ResponseWriter, r *http.Request) { defer func() { writeJson(w, jobResult) }() // use GetAllData to get all jobs - if ans, err := s.db.GetAllData(); err != nil { + if datum, err := s.db.GetAllData(); err != nil { log.Warnf("when list jobs, get all data failed: %+v", err) jobResult = &result{ defaultResult: newErrorResult(err.Error()), } } else { - var jobData []string - jobData = ans["jobs"] allJobs := make([]string, 0) - for _, eachJob := range jobData { + for _, eachJob := range datum["jobs"] { allJobs = append(allJobs, strings.Trim(strings.Split(eachJob, ",")[0], " ")) } @@ -766,8 +765,8 @@ func (s *HttpService) updateHostMappingHandler(w http.ResponseWriter, r *http.Re // Parse the JSON request body var request struct { CcrCommonRequest - SrcHostMapping map[string]string `json:"src_host_mapping,required"` - DestHostMapping map[string]string `json:"dest_host_mapping,required"` + SrcHostMapping map[string]string `json:"src_host_mapping"` + DestHostMapping map[string]string `json:"dest_host_mapping"` } err := json.NewDecoder(r.Body).Decode(&request) if err != nil { @@ -804,7 +803,7 @@ func (s *HttpService) skipBinlogHandler(w http.ResponseWriter, r *http.Request) var request struct { CcrCommonRequest SkipCommitSeq int64 `json:"skip_commit_seq"` - SkipBy string `json:"skip_by,required"` + SkipBy string `json:"skip_by"` } err := json.NewDecoder(r.Body).Decode(&request) if err != nil { @@ -856,8 +855,8 @@ func (s *HttpService) failpointHandler(w http.ResponseWriter, r *http.Request) { // Parse the JSON request body var request struct { - Name string `json:"name,required"` // the ccr job name - Failpoint string `json:"failpoint,required"` + Name string `json:"name"` // the ccr job name + Failpoint string `json:"failpoint"` Value interface{} `json:"value"` } err := json.NewDecoder(r.Body).Decode(&request) From 70688f2be7b44cdbf89cbe22e83a6e4b913d5108 Mon Sep 17 00:00:00 2001 From: walter Date: Wed, 19 Feb 2025 10:13:13 +0800 Subject: [PATCH 15/41] chore: add desync.sh (#452) --- shell/desync.sh | 86 +++++++++++++++++++++++++++++++++++++++++++ shell/start_syncer.sh | 10 ++--- 2 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 shell/desync.sh diff --git a/shell/desync.sh b/shell/desync.sh new file mode 100644 index 00000000..15e2e3f4 --- /dev/null +++ b/shell/desync.sh @@ -0,0 +1,86 @@ +#!/bin/bash + +# ./cli -h $host -p $port --j $job_name +usage() { + echo "Usage: $0 [-h host] [-p port] [-j job]" + echo "" + echo "Options:" + echo " -h host the ccr syncer host, default is 127.0.0.1" + echo " -p port the ccr syncer port, default is 9190" + echo " -j job the job name" + exit 1 +} + +# parse cli args +host="127.0.0.1" +port="9030" +job="" +while getopts ":h:p:j:" opt; do + case $opt in + h) host="$OPTARG" + ;; + p) port="$OPTARG" + ;; + j) job="$OPTARG" + ;; + \?) echo "Invalid option -$OPTARG" >&2 + usage + ;; + esac +done + +if [ -z "$job" ]; then + echo "the job name is empty" + exit 1 +fi + +# check if jq command exists +if ! [ -x "$(command -v jq)" ]; then + echo "Error: jq is not installed." >&2 + echo "You can install jq by running: sudo apt-get install jq" >&2 + exit 1 +fi + +echo "${host}:${port} Pause job ${job} ..." +while [ true ]; do + # check until the curl result is json ok + response=$(curl -s -X POST -H "Content-Type: application/json" \ + -d "{\"name\":\"${job}\"}" http://${host}:${port}/pause) + if [ $? -ne 0 ]; then + echo "${host}:${port} Failed to pause job ${job}, retry after 3s" >&2 + sleep 3 + continue + fi + + state=$(echo $response | jq -r '.success') + if [ "$state" == "true" ]; then + echo "${host}:${port} Pause job ${job} success" + break + fi + + error_msg=$(echo $response | jq -r '.error_msg') + echo "${host}:${port} Pause job ${job} failed, error: ${error_msg}" >&2 + exit 1 +done + +echo "${host}:${port} Desync the job ${job} ..." +while [ true ]; do + # Check until the curl result is json ok + response=$(curl -s -X POST -H "Content-Type: application/json" \ + -d "{\"name\":\"${job}\"}" http://${host}:${port}/desync) + if [ $? -ne 0 ]; then + echo "${host}:${port} Failed to desync job ${job}, retry after 3s" >&2 + sleep 3 + continue + fi + + state=$(echo $response | jq -r '.success') + if [ "$state" == "true" ]; then + echo "${host}:${port} Desync job ${job} success" + break + fi + + error_msg=$(echo $response | jq -r '.error_msg') + echo "${host}:${port} Desync job ${job} failed, error: ${error_msg}" >&2 + exit 1 +done diff --git a/shell/start_syncer.sh b/shell/start_syncer.sh index 9d1bf978..6945448b 100644 --- a/shell/start_syncer.sh +++ b/shell/start_syncer.sh @@ -24,14 +24,14 @@ Options: --host the host of ccr progress, default is 127.0.0.1 --port the port of ccr progress, default is 9190 --pid_dir the path of ccr progress id, default is ./bin/ - --pprof use pprof or not, arg is one of [true|false], defalut value is false + --pprof use pprof or not, arg is one of [true|false], default value is false --pprof_port the port of pprof --connect_timeout arg like 15s, default is 10s --rpc_timeout arg like 10s, default is 3s - --config_file the config file of ccr, which contains db_type,host,port,user and password, - defalut config file name is db.conf. If set config_file, the db_type, db_host, + --config_file the config file of ccr, which contains db_type,host,port,user and password, + default config file name is db.conf. If set config_file, the db_type, db_host, db_port, db_user, db_password should not be set. - --db_type one of the [mysql|sqlite3|postgresql], defalut value is sqlite3 + --db_type one of the [mysql|sqlite3|postgresql], default value is sqlite3 --db_host the host of meta database --db_port the port of meta database --db_user the user name of meta database @@ -165,7 +165,7 @@ while true; do done export PID_DIR -PID_FILENAME="${HOST}_${PORT}" +PID_FILENAME="${HOST}_${PORT}" if [[ RUN_DAEMON -eq 0 ]]; then if [[ -z "${LOG_LEVEL}" ]]; then From ae6792751cefb569b06164614759a222f532c857 Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Wed, 19 Feb 2025 11:10:56 +0800 Subject: [PATCH 16/41] test: add basic failover test (#453) --- pkg/ccr/base/spec.go | 21 +++ pkg/ccr/base/specer.go | 1 + pkg/ccr/job.go | 41 ++++++ pkg/ccr/job_manager.go | 11 ++ pkg/service/http_service.go | 37 ++++++ regression-test/common/helper.groovy | 10 ++ .../common/test_fail_over_common.groovy | 120 ++++++++++++++++++ 7 files changed, 241 insertions(+) create mode 100644 regression-test/suites/fail_over/common/test_fail_over_common.groovy diff --git a/pkg/ccr/base/spec.go b/pkg/ccr/base/spec.go index c8001c5f..bff42b07 100644 --- a/pkg/ccr/base/spec.go +++ b/pkg/ccr/base/spec.go @@ -1485,6 +1485,27 @@ func (s *Spec) DropRollup(destTableName, rollup string) error { return s.Exec(dropRollupSql) } +func (s *Spec) SyncTables(tables ...string) error { + var err error + + failedTables := []string{} + dbName := utils.FormatKeywordName(s.Database) + for _, table := range tables { + table = utils.FormatKeywordName(table) + syncSql := fmt.Sprintf("ALTER TABLE %s.%s SET (\"is_being_synced\"=\"true\")", dbName, table) + log.Debugf("exec sql: %s", syncSql) + if err = s.Exec(syncSql); err != nil { + failedTables = append(failedTables, table) + } + } + + if len(failedTables) > 0 { + return xerror.Wrapf(err, xerror.FE, "failed tables: %s", strings.Join(failedTables, ",")) + } + + return nil +} + func (s *Spec) DesyncTables(tables ...string) error { var err error diff --git a/pkg/ccr/base/specer.go b/pkg/ccr/base/specer.go index a6c66d57..91795326 100644 --- a/pkg/ccr/base/specer.go +++ b/pkg/ccr/base/specer.go @@ -74,6 +74,7 @@ type Specer interface { DropRollup(destTableName, rollupName string) error DesyncTables(tables ...string) error + SyncTables(tables ...string) error utils.Subject[SpecEvent] } diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 75e7eef2..65d1755c 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -3440,7 +3440,48 @@ func (j *Job) desyncDB() error { return j.IDest.DesyncTables(tableNames...) } +func (j *Job) Sync() error { + j.lock.Lock() + defer j.lock.Unlock() + + if j.SyncType == DBSync { + return j.syncDB() + } else { + return j.syncTable() + } +} + +func (j *Job) syncTable() error { + log.Debugf("sync table") + + tableName, err := j.destMeta.GetTableNameById(j.Dest.TableId) + if err != nil { + return err + } + + return j.IDest.SyncTables(tableName) +} + +func (j *Job) syncDB() error { + log.Debugf("sync db") + + tables, err := j.destMeta.GetTables() + if err != nil { + return err + } + + tableNames := []string{} + for _, tableMeta := range tables { + tableNames = append(tableNames, tableMeta.Name) + } + + return j.IDest.SyncTables(tableNames...) +} + func (j *Job) Desync() error { + j.lock.Lock() + defer j.lock.Unlock() + if j.SyncType == DBSync { return j.desyncDB() } else { diff --git a/pkg/ccr/job_manager.go b/pkg/ccr/job_manager.go index 5ad03a35..4302d7cf 100644 --- a/pkg/ccr/job_manager.go +++ b/pkg/ccr/job_manager.go @@ -232,6 +232,17 @@ func (jm *JobManager) Desync(jobName string) error { } } +func (jm *JobManager) Sync(jobName string) error { + jm.lock.RLock() + defer jm.lock.RUnlock() + + if job, ok := jm.jobs[jobName]; ok { + return job.Sync() + } else { + return xerror.Errorf(xerror.Normal, "job not exist: %s", jobName) + } +} + func (jm *JobManager) ListJobs() []*JobStatus { jm.lock.RLock() defer jm.lock.RUnlock() diff --git a/pkg/service/http_service.go b/pkg/service/http_service.go index 13874edc..adde63c0 100644 --- a/pkg/service/http_service.go +++ b/pkg/service/http_service.go @@ -541,6 +541,42 @@ func (s *HttpService) desyncHandler(w http.ResponseWriter, r *http.Request) { } } +func (s *HttpService) syncHandler(w http.ResponseWriter, r *http.Request) { + log.Infof("sync job") + + var syncResult *defaultResult + defer func() { writeJson(w, syncResult) }() + + // Parse the JSON request body + var request CcrCommonRequest + err := json.NewDecoder(r.Body).Decode(&request) + if err != nil { + log.Warnf("sync job failed: %+v", err) + + syncResult = newErrorResult(err.Error()) + return + } + + if request.Name == "" { + log.Warnf("sync job failed: name is empty") + + syncResult = newErrorResult("name is empty") + return + } + + if s.redirect(request.Name, w, r) { + return + } + + if err := s.jobManager.Sync(request.Name); err != nil { + log.Warnf("sync job failed: %+v", err) + + syncResult = newErrorResult(err.Error()) + } else { + syncResult = newSuccessResult() + } +} + // ListJobs service func (s *HttpService) listJobsHandler(w http.ResponseWriter, r *http.Request) { log.Infof("list jobs") @@ -905,6 +941,7 @@ func (s *HttpService) RegisterHandlers() { s.mux.HandleFunc("/job_skip_binlog", s.skipBinlogHandler) s.mux.HandleFunc("/failpoint", s.failpointHandler) s.mux.Handle("/metrics", promhttp.Handler()) + s.mux.HandleFunc("/sync", s.syncHandler) } func (s *HttpService) Start() error { diff --git a/regression-test/common/helper.groovy b/regression-test/common/helper.groovy index e7dfb7fc..fa186ee8 100644 --- a/regression-test/common/helper.groovy +++ b/regression-test/common/helper.groovy @@ -183,6 +183,16 @@ class Helper { } } + void ccrJobSync(table = "") { + def bodyJson = get_ccr_body "${table}" + suite.httpTest { + uri "/sync" + endpoint syncerAddress + body "${bodyJson}" + op "post" + } + } + void enableDbBinlog() { suite.sql """ ALTER DATABASE ${context.dbName} SET properties ("binlog.enable" = "true") diff --git a/regression-test/suites/fail_over/common/test_fail_over_common.groovy b/regression-test/suites/fail_over/common/test_fail_over_common.groovy new file mode 100644 index 00000000..ea3a22a3 --- /dev/null +++ b/regression-test/suites/fail_over/common/test_fail_over_common.groovy @@ -0,0 +1,120 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite("test_fail_over_common") { + def versions = sql_return_maparray "show variables like 'version_comment'" + if (versions[0].Value.contains('doris-2.0.')) { + logger.info("2.0 not support AUTO PARTITION, current version is: ${versions[0].Value}") + return + } + + def helper = new GroovyShell(new Binding(['suite': delegate])) + .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + + def test_num = 0 + def insert_num = 5 + def date_num = "2025-01-01" + + def createDuplicateTable = { tableName -> + sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT, + `date_time` date NOT NULL + ) + ENGINE=OLAP + DUPLICATE KEY(`test`, `id`, `date_time`) + AUTO PARTITION BY RANGE (date_trunc(`date_time`, 'day')) + ( + ) + DISTRIBUTED BY HASH(id) BUCKETS AUTO + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "estimate_partition_size" = "10G", + "binlog.enable" = "true" + ) + """ + } + + def exist = { res -> Boolean + return res.size() != 0 + } + def notExist = { res -> Boolean + return res.size() == 0 + } + + def suffix = helper.randomSuffix() + def tableDuplicate0 = "tbl_duplicate_0_${suffix}" + + sql "DROP TABLE IF EXISTS ${tableDuplicate0}" + target_sql "DROP TABLE IF EXISTS ${tableDuplicate0}" + + createDuplicateTable(tableDuplicate0) + for (int index = 0; index < insert_num; index++) { + sql """ + INSERT INTO ${tableDuplicate0} VALUES (0, 99, '${date_num}') + """ + } + + helper.enableDbBinlog() + helper.ccrJobDelete() + helper.ccrJobCreate() + + assertTrue(helper.checkRestoreFinishTimesOf("${tableDuplicate0}", 30)) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableDuplicate0} WHERE test=${test_num}", + insert_num, 30)) + + logger.info("=== Test 1: dest cluster follow source cluster case ===") + test_num = 1 + + for (int index = 0; index < insert_num; index++) { + sql """ + INSERT INTO ${tableDuplicate0} VALUES (0, 99, '${date_num}') + """ + } + + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableDuplicate0} WHERE test=0", + insert_num * (test_num + 1), 30)) + + + logger.info("=== Test 3: desync job and fail over===") + + helper.ccrJobPause() + helper.ccrJobDesync() + + def desync_res = target_sql "SHOW CREATE TABLE ${tableDuplicate0}" + assertTrue(desync_res[0][1].contains("\"is_being_synced\" = \"false\"")) + + test_num = 7 + date_num = "2025-01-02" + for (int index = 0; index < insert_num; index++) { + sql """ + INSERT INTO ${tableDuplicate0} VALUES (${test_num}, ${index}, '${date_num}') + """ + } + + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableDuplicate0} WHERE test=${test_num}", 0, 3)) + + target_sql """ + INSERT INTO ${tableDuplicate0} VALUES (${test_num}, 2, '2025-02-01') + """ + + assertTrue(helper.checkShowTimesOf("SHOW PARTITIONS FROM ${tableDuplicate0} WHERE PartitionName LIKE 'p20250201000000'", + exist, 3, "target")) + +} From f74f7e6884b957785b512494d1cc53f47edb6283 Mon Sep 17 00:00:00 2001 From: walter Date: Wed, 19 Feb 2025 11:38:12 +0800 Subject: [PATCH 17/41] chore: arrange failover test (#454) --- regression-test/common/helper.groovy | 57 ++++++++++++++++++- .../failover/test_syncer_failover.groovy} | 33 +++++++---- 2 files changed, 76 insertions(+), 14 deletions(-) rename regression-test/suites/{fail_over/common/test_fail_over_common.groovy => syncer/failover/test_syncer_failover.groovy} (84%) diff --git a/regression-test/common/helper.groovy b/regression-test/common/helper.groovy index fa186ee8..b464ac75 100644 --- a/regression-test/common/helper.groovy +++ b/regression-test/common/helper.groovy @@ -150,6 +150,15 @@ class Helper { endpoint syncerAddress body "${bodyJson}" op "post" + check { code, body -> + if (!"${code}".toString().equals("200")) { + throw new Exception("request failed, code: ${code}, body: ${body}") + } + def value = jsonSlurper.parseText "${body}" + if (!value.success) { + throw new Exception("request failed, error msg: ${value.error_msg}") + } + } } } @@ -160,6 +169,16 @@ class Helper { endpoint syncerAddress body "${bodyJson}" op "post" + check { code, body -> + if (!"${code}".toString().equals("200")) { + throw new Exception("request failed, code: ${code}, body: ${body}") + } + def jsonSlurper = new groovy.json.JsonSlurper() + def object = jsonSlurper.parseText "${body}" + if (!object.success) { + throw new Exception("request failed, error msg: ${object.error_msg}") + } + } } } @@ -170,6 +189,16 @@ class Helper { endpoint syncerAddress body "${bodyJson}" op "post" + check { code, body -> + if (!"${code}".toString().equals("200")) { + throw new Exception("request failed, code: ${code}, body: ${body}") + } + def jsonSlurper = new groovy.json.JsonSlurper() + def object = jsonSlurper.parseText "${body}" + if (!object.success) { + throw new Exception("request failed, error msg: ${object.error_msg}") + } + } } } @@ -180,6 +209,16 @@ class Helper { endpoint syncerAddress body "${bodyJson}" op "post" + check { code, body -> + if (!"${code}".toString().equals("200")) { + throw new Exception("request failed, code: ${code}, body: ${body}") + } + def jsonSlurper = new groovy.json.JsonSlurper() + def object = jsonSlurper.parseText "${body}" + if (!object.success) { + throw new Exception("request failed, error msg: ${object.error_msg}") + } + } } } @@ -190,6 +229,16 @@ class Helper { endpoint syncerAddress body "${bodyJson}" op "post" + check { code, body -> + if (!"${code}".toString().equals("200")) { + throw new Exception("request failed, code: ${code}, body: ${body}") + } + def jsonSlurper = new groovy.json.JsonSlurper() + def object = jsonSlurper.parseText "${body}" + if (!object.success) { + throw new Exception("request failed, error msg: ${object.error_msg}") + } + } } } @@ -218,7 +267,9 @@ class Helper { if (myClosure.call(res)) { ret = true } - } catch (Exception e) {} + } catch (Exception e) { + logger.info("exception", e) + } if (ret) { break @@ -265,7 +316,9 @@ class Helper { if (tmpRes.size() == rowSize) { return true } - } catch (Exception) {} + } catch (Exception) { + logger.info("exception", e) + } sleep(sync_gap_time) } diff --git a/regression-test/suites/fail_over/common/test_fail_over_common.groovy b/regression-test/suites/syncer/failover/test_syncer_failover.groovy similarity index 84% rename from regression-test/suites/fail_over/common/test_fail_over_common.groovy rename to regression-test/suites/syncer/failover/test_syncer_failover.groovy index ea3a22a3..cbb12e49 100644 --- a/regression-test/suites/fail_over/common/test_fail_over_common.groovy +++ b/regression-test/suites/syncer/failover/test_syncer_failover.groovy @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -suite("test_fail_over_common") { +suite("test_syncer_failover") { def versions = sql_return_maparray "show variables like 'version_comment'" if (versions[0].Value.contains('doris-2.0.')) { logger.info("2.0 not support AUTO PARTITION, current version is: ${versions[0].Value}") @@ -79,9 +79,12 @@ suite("test_fail_over_common") { assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableDuplicate0} WHERE test=${test_num}", insert_num, 30)) - logger.info("=== Test 1: dest cluster follow source cluster case ===") - test_num = 1 + def res = target_sql "SHOW CREATE TABLE ${tableDuplicate0}" + assertTrue(res[0][1].contains("\"is_being_synced\" = \"true\"")) + + logger.info("=== dest cluster follow source cluster case ===") + test_num = 1 for (int index = 0; index < insert_num; index++) { sql """ INSERT INTO ${tableDuplicate0} VALUES (0, 99, '${date_num}') @@ -92,7 +95,7 @@ suite("test_fail_over_common") { insert_num * (test_num + 1), 30)) - logger.info("=== Test 3: desync job and fail over===") + logger.info("=== pause and desync job ===") helper.ccrJobPause() helper.ccrJobDesync() @@ -100,7 +103,19 @@ suite("test_fail_over_common") { def desync_res = target_sql "SHOW CREATE TABLE ${tableDuplicate0}" assertTrue(desync_res[0][1].contains("\"is_being_synced\" = \"false\"")) + logger.info("=== insert & auto partition are working ===") test_num = 7 + target_sql """ + INSERT INTO ${tableDuplicate0} VALUES (${test_num}, 2, '2025-02-01') + """ + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableDuplicate0} WHERE test=${test_num}", 1, 3)) + + assertTrue(helper.checkShowTimesOf(""" + SHOW PARTITIONS FROM ${tableDuplicate0} WHERE PartitionName LIKE 'p20250201000000'""", + exist, 3, "target")) + + logger.info("=== the upstream upserts will not be synced ===") + test_num = 8 date_num = "2025-01-02" for (int index = 0; index < insert_num; index++) { sql """ @@ -108,13 +123,7 @@ suite("test_fail_over_common") { """ } - assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableDuplicate0} WHERE test=${test_num}", 0, 3)) - - target_sql """ - INSERT INTO ${tableDuplicate0} VALUES (${test_num}, 2, '2025-02-01') - """ - - assertTrue(helper.checkShowTimesOf("SHOW PARTITIONS FROM ${tableDuplicate0} WHERE PartitionName LIKE 'p20250201000000'", - exist, 3, "target")) + sleep(10000) // sleep 10s + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableDuplicate0} WHERE test=${test_num}", 0, 3)) } From 99e3aad495a877a87e46a7324de1aecd97f2d98e Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Fri, 21 Feb 2025 10:17:41 +0800 Subject: [PATCH 18/41] fix: db not enable binlog and ignore e for checkSelectTimesOf (#460) --- regression-test/common/helper.groovy | 2 +- .../db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/regression-test/common/helper.groovy b/regression-test/common/helper.groovy index b464ac75..f66686cb 100644 --- a/regression-test/common/helper.groovy +++ b/regression-test/common/helper.groovy @@ -316,7 +316,7 @@ class Helper { if (tmpRes.size() == rowSize) { return true } - } catch (Exception) { + } catch (Exception e) { logger.info("exception", e) } sleep(sync_gap_time) diff --git a/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy b/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy index cf64b7f2..cc28d7ca 100644 --- a/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy +++ b/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy @@ -67,6 +67,8 @@ suite("test_ds_tbl_diff_schema") { ) """ + helper.enableDbBinlog() + helper.ccrJobDelete() helper.ccrJobCreate() From 31d6003a5d369de4c7f99eda5126258e84719ca3 Mon Sep 17 00:00:00 2001 From: walter Date: Thu, 20 Feb 2025 10:20:50 +0800 Subject: [PATCH 19/41] fix: avoid skipping binlogs when partial sync with partitions (#456) --- pkg/ccr/job.go | 104 +++++++++++++----- pkg/ccr/job_progress.go | 41 ++++--- pkg/ccr/utils.go | 8 +- .../replace/test_ds_part_replace.groovy | 2 +- .../replace_1/test_ds_part_replace_1.groovy | 83 ++++++++++++++ .../replace_2/test_ds_part_replace_2.groovy | 84 ++++++++++++++ 6 files changed, 277 insertions(+), 45 deletions(-) create mode 100644 regression-test/suites/db_sync/partition/replace_1/test_ds_part_replace_1.groovy create mode 100644 regression-test/suites/db_sync/partition/replace_2/test_ds_part_replace_2.groovy diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 65d1755c..d9013024 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -424,11 +424,12 @@ func (j *Job) handlePartialSyncTableNotFound() error { // Like fullSync, but only backup and restore partial of the partitions of a table. func (j *Job) partialSync() error { type inMemoryData struct { - SnapshotName string `json:"snapshot_name"` - SnapshotResp *festruct.TGetSnapshotResult_ `json:"snapshot_resp"` - TableCommitSeqMap map[int64]int64 `json:"table_commit_seq_map"` - TableNameMapping map[int64]string `json:"table_name_mapping"` - RestoreLabel string `json:"restore_label"` + SnapshotName string `json:"snapshot_name"` + SnapshotResp *festruct.TGetSnapshotResult_ `json:"snapshot_resp"` + TableCommitSeqMap map[int64]int64 `json:"table_commit_seq_map"` + PartitionCommitSeqMap map[int64]int64 `json:"partition_commit_seq_map"` + TableNameMapping map[int64]string `json:"table_name_mapping"` + RestoreLabel string `json:"restore_label"` } if j.progress.PartialSyncData == nil { @@ -535,6 +536,7 @@ func (j *Job) partialSync() error { return err } + partitionCommitSeqMap := make(map[int64]int64) tableCommitSeqMap := backupJobInfo.TableCommitSeqMap tableNameMapping := backupJobInfo.TableNameMapping() log.Debugf("table commit seq map: %v, table name mapping: %v", tableCommitSeqMap, tableNameMapping) @@ -548,15 +550,27 @@ func (j *Job) partialSync() error { j.Src.TableId = backupObject.Id } return j.newSnapshot(j.progress.CommitSeq) - } else if _, ok := tableCommitSeqMap[backupObject.Id]; !ok { + } else if commitSeq, ok := tableCommitSeqMap[backupObject.Id]; !ok { return xerror.Errorf(xerror.Normal, "commit seq not found, table id %d, table name: %s", backupObject.Id, table) + } else { + for _, name := range partitions { + if part, ok := backupObject.Partitions[name]; !ok { + return xerror.Errorf(xerror.Normal, "partition %s not found in backup objects", name) + } else { + partitionCommitSeqMap[part.Id] = commitSeq + } + } + if len(partitionCommitSeqMap) > 0 { + log.Debugf("partition commit seq map: %v", partitionCommitSeqMap) + } } inMemoryData := &inMemoryData{ - SnapshotName: snapshotName, - SnapshotResp: snapshotResp, - TableCommitSeqMap: tableCommitSeqMap, - TableNameMapping: tableNameMapping, + SnapshotName: snapshotName, + SnapshotResp: snapshotResp, + TableCommitSeqMap: tableCommitSeqMap, + TableNameMapping: tableNameMapping, + PartitionCommitSeqMap: partitionCommitSeqMap, } j.progress.NextSubVolatile(AddExtraInfo, inMemoryData) @@ -695,9 +709,14 @@ func (j *Job) partialSync() error { return nil } - // save the entire commit seq map, this value will be used in PersistRestoreInfo. - j.progress.TableCommitSeqMap = utils.MergeMap( - j.progress.TableCommitSeqMap, inMemoryData.TableCommitSeqMap) + // save the entire table/partition commit seq map, this value will be used in PersistRestoreInfo. + if len(partitions) > 0 { + j.progress.PartitionCommitSeqMap = utils.MergeMap( + j.progress.PartitionCommitSeqMap, inMemoryData.PartitionCommitSeqMap) + } else { + j.progress.TableCommitSeqMap = utils.MergeMap( + j.progress.TableCommitSeqMap, inMemoryData.TableCommitSeqMap) + } j.progress.TableNameMapping = utils.MergeMap( j.progress.TableNameMapping, inMemoryData.TableNameMapping) j.progress.NextSubCheckpoint(PersistRestoreInfo, restoreSnapshotName) @@ -753,6 +772,10 @@ func (j *Job) partialSync() error { if !ok { return xerror.Errorf(xerror.Normal, "table id %d, commit seq not found", j.Src.TableId) } + if len(partitions) > 0 { + // Only commit partition commit seq map, instead of the entire table commit seq. + commitSeq = j.progress.CommitSeq + } j.Dest.TableId = destTable.Id j.progress.TableMapping = nil j.progress.TableCommitSeqMap = nil @@ -1269,6 +1292,7 @@ func (j *Job) fullSync() error { j.progress.TableMapping = tableMapping j.progress.ShadowIndexes = nil + j.progress.PartitionCommitSeqMap = nil j.progress.NextWithPersist(j.progress.CommitSeq, DBTablesIncrementalSync, Done, "") case TableSync: if destTable, err := j.destMeta.UpdateTable(j.Dest.Table, 0); err != nil { @@ -1281,6 +1305,7 @@ func (j *Job) fullSync() error { return err } + j.progress.PartitionCommitSeqMap = nil j.progress.TableCommitSeqMap = nil j.progress.TableMapping = nil j.progress.ShadowIndexes = nil @@ -1411,6 +1436,8 @@ func (j *Job) getDestNameBySrcId(srcTableId int64) (string, error) { } func (j *Job) isBinlogCommitted(tableId int64, binlogCommitSeq int64) bool { + // FIXME: + // what happend if the PartitionCommitSeqMap is not empty? if j.progress.SyncState == DBTablesIncrementalSync { tableCommitSeq, ok := j.progress.TableCommitSeqMap[tableId] if ok && binlogCommitSeq <= tableCommitSeq { @@ -1425,21 +1452,28 @@ func (j *Job) isBinlogCommitted(tableId int64, binlogCommitSeq int64) bool { func (j *Job) getDbSyncTableRecords(upsert *record.Upsert) []*record.TableRecord { commitSeq := upsert.CommitSeq tableCommitSeqMap := j.progress.TableCommitSeqMap + partitionCommitSeqMap := j.progress.PartitionCommitSeqMap tableRecords := make([]*record.TableRecord, 0, len(upsert.TableRecords)) for tableId, tableRecord := range upsert.TableRecords { - // DBIncrementalSync - if tableCommitSeqMap == nil { - tableRecords = append(tableRecords, tableRecord) + if tableCommitSeq, ok := tableCommitSeqMap[tableId]; ok && commitSeq <= tableCommitSeq { + // All the partition records of the table have been committed continue } - if tableCommitSeq, ok := tableCommitSeqMap[tableId]; ok { - if commitSeq > tableCommitSeq { - tableRecords = append(tableRecords, tableRecord) + // Filter the committed partitions + if partitionCommitSeqMap != nil { + partitionRecords := make([]record.PartitionRecord, 0, len(tableRecord.PartitionRecords)) + for _, partition := range tableRecord.PartitionRecords { + if partitionCommitSeq, ok := partitionCommitSeqMap[partition.Id]; ok && commitSeq <= partitionCommitSeq { + continue + } + partitionRecords = append(partitionRecords, partition) // copy } - } else { - // for db partial sync + tableRecord.PartitionRecords = partitionRecords + } + + if len(tableRecord.PartitionRecords) > 0 { tableRecords = append(tableRecords, tableRecord) } } @@ -1463,6 +1497,22 @@ func (j *Job) getRelatedTableRecords(upsert *record.Upsert) ([]*record.TableReco return nil, xerror.Errorf(xerror.Normal, "table record not found, table: %s", j.Src.Table) } + // Filter the committed partitions + partitionCommitSeqMap := j.progress.PartitionCommitSeqMap + if partitionCommitSeqMap != nil { + partitionRecords := make([]record.PartitionRecord, 0, len(tableRecord.PartitionRecords)) + for _, partition := range tableRecord.PartitionRecords { + if partitionCommitSeq, ok := partitionCommitSeqMap[partition.Id]; ok && upsert.CommitSeq <= partitionCommitSeq { + continue + } + partitionRecords = append(partitionRecords, partition) // copy + } + tableRecord.PartitionRecords = partitionRecords + } + if len(tableRecord.PartitionRecords) == 0 { + return nil, nil + } + tableRecords = make([]*record.TableRecord, 0, 1) tableRecords = append(tableRecords, tableRecord) default: @@ -2426,10 +2476,6 @@ func (j *Job) handleReplacePartitions(binlog *festruct.TBinlog) error { replacePartition.TableName, oldPartitions, newPartitions) partitions := replacePartition.Partitions - if replacePartition.UseTempName { - partitions = replacePartition.TempPartitions - } - return j.newPartialSnapshot(replacePartition.TableId, replacePartition.TableName, partitions, false) } @@ -2953,9 +2999,17 @@ func (j *Job) handleBinlogs(binlogs []*festruct.TBinlog) (error, bool) { break } } + for _, partitionCommitSeq := range j.progress.PartitionCommitSeqMap { + if partitionCommitSeq > commitSeq { + reachSwitchToDBIncrementalSync = false + break + } + } if reachSwitchToDBIncrementalSync { + log.Infof("all table/partition commit seq reach the commit seq, switch to incremental sync, commit seq: %d", commitSeq) j.progress.TableCommitSeqMap = nil + j.progress.PartitionCommitSeqMap = nil j.progress.NextWithPersist(j.progress.CommitSeq, DBIncrementalSync, Done, "") } } diff --git a/pkg/ccr/job_progress.go b/pkg/ccr/job_progress.go index a6359a67..63c3b566 100644 --- a/pkg/ccr/job_progress.go +++ b/pkg/ccr/job_progress.go @@ -174,14 +174,15 @@ type JobProgress struct { CommitSeq int64 `json:"commit_seq"` LastCommitSeq int64 `json:"last_commit_seq"` // the last commit seq try to sync LockedCommitSeq int64 `json:"-"` - TableMapping map[int64]int64 `json:"table_mapping"` + TableMapping map[int64]int64 `json:"table_mapping,omitempty"` // the upstream table id to name mapping, build during the fullsync, // keep snapshot to avoid rename. it might be staled. - TableNameMapping map[int64]string `json:"table_name_mapping,omitempty"` - TableCommitSeqMap map[int64]int64 `json:"table_commit_seq_map"` // only for DBTablesIncrementalSync - InMemoryData any `json:"-"` - PersistData string `json:"data"` // this often for binlog or snapshot info - PartialSyncData *JobPartialSyncData `json:"partial_sync_data,omitempty"` + TableNameMapping map[int64]string `json:"table_name_mapping,omitempty"` + TableCommitSeqMap map[int64]int64 `json:"table_commit_seq_map,omitempty"` // only for DBTablesIncrementalSync + PartitionCommitSeqMap map[int64]int64 `json:"partition_commit_seq_map,omitempty"` // only for DBTablesIncrementalSync, partial sync with partitions + InMemoryData any `json:"-"` + PersistData string `json:"data"` // this often for binlog or snapshot info + PartialSyncData *JobPartialSyncData `json:"partial_sync_data,omitempty"` // The tables need to be replaced rather than dropped during sync. TableAliases map[string]string `json:"table_aliases,omitempty"` @@ -213,18 +214,22 @@ func NewJobProgress(jobName string, syncType SyncType, db storage.DB) *JobProgre JobName: jobName, db: db, - SyncId: time.Now().Unix(), - SyncState: syncState, - SubSyncState: BeginCreateSnapshot, - CommitSeq: 0, - TableMapping: nil, - - TableCommitSeqMap: nil, - InMemoryData: nil, - PersistData: "", - PartialSyncData: nil, - TableAliases: nil, - ShadowIndexes: nil, + SyncId: time.Now().Unix(), + SyncState: syncState, + SubSyncState: BeginCreateSnapshot, + CommitSeq: 0, + LastCommitSeq: 0, + LockedCommitSeq: 0, + TableMapping: nil, + + TableNameMapping: nil, + TableCommitSeqMap: nil, + PartitionCommitSeqMap: nil, + InMemoryData: nil, + PersistData: "", + PartialSyncData: nil, + TableAliases: nil, + ShadowIndexes: nil, CreatedAt: time.Now().Unix(), FullSyncStartAt: 0, diff --git a/pkg/ccr/utils.go b/pkg/ccr/utils.go index 95fff714..eba7dde4 100644 --- a/pkg/ccr/utils.go +++ b/pkg/ccr/utils.go @@ -27,8 +27,14 @@ type BackupViewInfo struct { Name string `json:"name"` } +type BackupPartition struct { + Id int64 `json:"id"` + Version int64 `json:"version"` +} + type BackupOlapTableInfo struct { - Id int64 `json:"id"` + Id int64 `json:"id"` + Partitions map[string]BackupPartition `json:"partitions"` } type NewBackupObject struct { diff --git a/regression-test/suites/db_sync/partition/replace/test_ds_part_replace.groovy b/regression-test/suites/db_sync/partition/replace/test_ds_part_replace.groovy index d7333a33..4ee1d923 100644 --- a/regression-test/suites/db_sync/partition/replace/test_ds_part_replace.groovy +++ b/regression-test/suites/db_sync/partition/replace/test_ds_part_replace.groovy @@ -32,7 +32,7 @@ suite("test_ds_part_replace") { } logger.info("=== Create table ===") - tableName = "${baseTableName}" + def tableName = "${baseTableName}" sql """ CREATE TABLE if NOT EXISTS ${tableName} ( diff --git a/regression-test/suites/db_sync/partition/replace_1/test_ds_part_replace_1.groovy b/regression-test/suites/db_sync/partition/replace_1/test_ds_part_replace_1.groovy new file mode 100644 index 00000000..5979fffe --- /dev/null +++ b/regression-test/suites/db_sync/partition/replace_1/test_ds_part_replace_1.groovy @@ -0,0 +1,83 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite('test_ds_part_replace_1') { + def helper = new GroovyShell(new Binding(['suite': delegate])) + .evaluate(new File("${context.config.suitePath}/../common", 'helper.groovy')) + + def tableName = 'tbl_' + helper.randomSuffix() + + logger.info('=== Create table ===') + sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT + ) + ENGINE=OLAP + UNIQUE KEY(`test`, `id`) + PARTITION BY RANGE(`id`) + ( + PARTITION `p1` VALUES LESS THAN ("0"), + PARTITION `p2` VALUES LESS THAN ("100"), + PARTITION `p3` VALUES LESS THAN ("200"), + PARTITION `p4` VALUES LESS THAN ("300") + ) + DISTRIBUTED BY HASH(id) BUCKETS AUTO + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "binlog.enable" = "true" + ) + """ + + helper.enableDbBinlog() + helper.ccrJobDelete() + helper.ccrJobCreate() + + assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 60)) + + logger.info('=== Add temp partition p5 ===') + + sql """ + ALTER TABLE ${tableName} ADD TEMPORARY PARTITION p5 VALUES [("0"), ("100")) + """ + + assertTrue(helper.checkShowTimesOf(""" + SHOW TEMPORARY PARTITIONS + FROM ${tableName} + WHERE PartitionName = "p5" + """, + { res -> res.size() > 0 }, 60, 'sql')) + + logger.info('=== Replace partition p2 by p5 ===') + + helper.ccrJobPause() + sql "ALTER TABLE ${tableName} REPLACE PARTITION (p2) WITH TEMPORARY PARTITION (p5)" + + // insert into p3 + sql "INSERT INTO ${tableName} VALUES (1, 150)" + + helper.ccrJobResume() + + // the insert into p3 should be replicated to dest cluster + assertTrue(helper.checkShowTimesOf(""" + SELECT * + FROM ${tableName} + WHERE id = 150 + """, + { res -> res.size() == 1 }, 60, 'target')) +} diff --git a/regression-test/suites/db_sync/partition/replace_2/test_ds_part_replace_2.groovy b/regression-test/suites/db_sync/partition/replace_2/test_ds_part_replace_2.groovy new file mode 100644 index 00000000..244bae3c --- /dev/null +++ b/regression-test/suites/db_sync/partition/replace_2/test_ds_part_replace_2.groovy @@ -0,0 +1,84 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +suite('test_ds_part_replace_2') { + def helper = new GroovyShell(new Binding(['suite': delegate])) + .evaluate(new File("${context.config.suitePath}/../common", 'helper.groovy')) + + def tableName = 'tbl_' + helper.randomSuffix() + + logger.info('=== Create table ===') + sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT + ) + ENGINE=OLAP + DUPLICATE KEY(`test`, `id`) + PARTITION BY RANGE(`id`) + ( + PARTITION `p1` VALUES LESS THAN ("0"), + PARTITION `p2` VALUES LESS THAN ("100"), + PARTITION `p3` VALUES LESS THAN ("200"), + PARTITION `p4` VALUES LESS THAN ("300") + ) + DISTRIBUTED BY HASH(id) BUCKETS AUTO + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "binlog.enable" = "true" + ) + """ + + helper.enableDbBinlog() + helper.ccrJobDelete() + helper.ccrJobCreate() + + assertTrue(helper.checkRestoreFinishTimesOf("${tableName}", 60)) + + logger.info('=== Add temp partition p5 ===') + + sql """ + ALTER TABLE ${tableName} ADD TEMPORARY PARTITION p5 VALUES [("0"), ("100")) + """ + + assertTrue(helper.checkShowTimesOf(""" + SHOW TEMPORARY PARTITIONS + FROM ${tableName} + WHERE PartitionName = "p5" + """, + { res -> res.size() > 0 }, 60, 'sql')) + + logger.info('=== Replace partition p2 by p5 ===') + + helper.ccrJobPause() + sql "ALTER TABLE ${tableName} REPLACE PARTITION (p2) WITH TEMPORARY PARTITION (p5)" + + // insert into p2 + sql "INSERT INTO ${tableName} VALUES (1, 50)" + + helper.ccrJobResume() + + // the insert into p2 should not be replicated to dest cluster twice + assertTrue(helper.checkShowTimesOf(""" + SELECT * + FROM ${tableName} + WHERE id = 50 + """, + { res -> res.size() == 1 }, 60, 'target')) +} + From 6451981107b72749f4f27b6bd0893410ebe69ffe Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Thu, 20 Feb 2025 11:37:54 +0800 Subject: [PATCH 20/41] fix: db not enable binlog and ignore e for checkSelectTimesOf (#457) --- .../db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy b/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy index cc28d7ca..d973e05a 100644 --- a/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy +++ b/regression-test/suites/db_sync/table/diff_schema/test_ds_tbl_diff_schema.groovy @@ -66,6 +66,7 @@ suite("test_ds_tbl_diff_schema") { "binlog.enable" = "true" ) """ + helper.enableDbBinlog() helper.enableDbBinlog() From 166fc979524318d9f16aa0b1cd48e2bfa4f738de Mon Sep 17 00:00:00 2001 From: lsy3993 <110876560+lsy3993@users.noreply.github.com> Date: Mon, 24 Feb 2025 16:40:40 +0800 Subject: [PATCH 21/41] fix: avoid escape escaped \" in comment (#463) --- pkg/ccr/base/spec.go | 7 +++- .../db_sync/common/test_ds_common.groovy | 36 +++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/pkg/ccr/base/spec.go b/pkg/ccr/base/spec.go index bff42b07..5a1a27bb 100644 --- a/pkg/ccr/base/spec.go +++ b/pkg/ccr/base/spec.go @@ -1610,7 +1610,12 @@ func ReplaceAndEscapeComment(input string) string { if len(groups) < 2 { return match } - content := strings.ReplaceAll(groups[1], `"`, `\"`) + + // The `\"` and `"` should be replaced with `\"` + regex := regexp.MustCompile(`\\"|"`) + content := regex.ReplaceAllStringFunc(groups[1], func(match string) string { + return `\"` + }) return fmt.Sprintf(`COMMENT "%s"`, content) }) } diff --git a/regression-test/suites/db_sync/common/test_ds_common.groovy b/regression-test/suites/db_sync/common/test_ds_common.groovy index bcddb664..efc8ec38 100644 --- a/regression-test/suites/db_sync/common/test_ds_common.groovy +++ b/regression-test/suites/db_sync/common/test_ds_common.groovy @@ -97,6 +97,30 @@ suite("test_ds_common") { """ } + // complex double quotes in comment + def createDuplicateTableWithComment = { tableName -> + sql """ + CREATE TABLE if NOT EXISTS ${tableName} + ( + `test` INT, + `id` INT, + `date_time` date NOT NULL + ) + ENGINE=OLAP + DUPLICATE KEY(`test`, `id`, `date_time`) + COMMENT '"\"OLAP\""' + AUTO PARTITION BY RANGE (date_trunc(`date_time`, 'day')) + ( + ) + DISTRIBUTED BY HASH(id) BUCKETS AUTO + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "estimate_partition_size" = "10G", + "binlog.enable" = "true" + ) + """ + } + def exist = { res -> Boolean return res.size() != 0 } @@ -179,11 +203,13 @@ suite("test_ds_common") { def tableAggregate1 = "tbl_aggregate_1_${suffix}" def tableDuplicate1 = "tbl_duplicate_1_${suffix}" def keywordTableName = "`roles`" + def tableWithComment = "tbl_comment_1_${suffix}" createUniqueTable(tableUnique1) createAggergateTable(tableAggregate1) createDuplicateTable(tableDuplicate1) createUniqueTable(keywordTableName) + createDuplicateTableWithComment(tableWithComment) for (int index = 0; index < insert_num; index++) { sql """ @@ -200,6 +226,11 @@ suite("test_ds_common") { INSERT INTO ${tableDuplicate1} VALUES (0, 99, '${date_num}') """ } + for (int index = 0; index < insert_num; index++) { + sql """ + INSERT INTO ${tableWithComment} VALUES (0, 99, '${date_num}') + """ + } for (int index = 0; index < insert_num; index++) { sql """ INSERT INTO ${keywordTableName} VALUES (${test_num}, ${index}, '${date_num}') @@ -226,6 +257,11 @@ suite("test_ds_common") { assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${keywordTableName} WHERE test=${test_num}", insert_num, 30)) + assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE TEST_${context.dbName}.${tableWithComment}", + exist, 30, "target")) + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableWithComment} WHERE test=${test_num}", + insert_num, 30)) + logger.info("=== Test 3: drop table case ===") sql "DROP TABLE ${tableUnique1}" sql "DROP TABLE ${tableAggregate1}" From e7c970272d47fe86cf4055f3d556435594acc435 Mon Sep 17 00:00:00 2001 From: walter Date: Thu, 27 Feb 2025 17:23:09 +0800 Subject: [PATCH 22/41] fix: initial TableMapping before using (#470) --- pkg/ccr/job.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index d9013024..edb1a4d3 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -765,6 +765,9 @@ func (j *Job) partialSync() error { } switch j.SyncType { case DBSync: + if len(j.progress.TableMapping) == 0 { + j.progress.TableMapping = make(map[int64]int64) + } j.progress.TableMapping[tableId] = destTable.Id j.progress.NextWithPersist(j.progress.CommitSeq, DBTablesIncrementalSync, Done, "") case TableSync: From 7e2659e3f2a9d588615b7488ad2b2f369242a50e Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Thu, 27 Feb 2025 11:01:38 +0800 Subject: [PATCH 23/41] fix ds common test (#467) --- regression-test/suites/db_sync/common/test_ds_common.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regression-test/suites/db_sync/common/test_ds_common.groovy b/regression-test/suites/db_sync/common/test_ds_common.groovy index efc8ec38..5d801f28 100644 --- a/regression-test/suites/db_sync/common/test_ds_common.groovy +++ b/regression-test/suites/db_sync/common/test_ds_common.groovy @@ -259,7 +259,7 @@ suite("test_ds_common") { assertTrue(helper.checkShowTimesOf("SHOW CREATE TABLE TEST_${context.dbName}.${tableWithComment}", exist, 30, "target")) - assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableWithComment} WHERE test=${test_num}", + assertTrue(helper.checkSelectTimesOf("SELECT * FROM ${tableWithComment} WHERE test=0", insert_num, 30)) logger.info("=== Test 3: drop table case ===") From 87b4bc71519a170b3a3c6c3696d8ff34813d7340 Mon Sep 17 00:00:00 2001 From: walter Date: Tue, 15 Apr 2025 15:53:12 +0800 Subject: [PATCH 24/41] chore: add seperated handles flag & enable txn insert (#592) --- pkg/ccr/job.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 9995fb40..50ffbecd 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -76,6 +76,7 @@ var ( featureSkipWaitingTxnPublish bool featureSkipCheckAsyncMvTable bool featurePipelineCommit bool + featureSeperatedHandles bool flagBinlogBatchSize int64 @@ -103,7 +104,7 @@ func init() { "compress the snapshot job info and meta") flag.BoolVar(&FeatureSkipRollupBinlogs, "feature_skip_rollup_binlogs", false, "skip the rollup related binlogs") - flag.BoolVar(&featureTxnInsert, "feature_txn_insert", false, + flag.BoolVar(&featureTxnInsert, "feature_txn_insert", true, "enable txn insert support") flag.BoolVar(&FeatureFilterStorageMedium, "feature_filter_storage_medium", true, "enable filter storage medium property") @@ -117,6 +118,8 @@ func init() { "skip checking async mv table, the async mv binlogs will be filtered by doris") flag.BoolVar(&featurePipelineCommit, "feature_pipeline_commit", true, "enable pipeline commit for upsert binlogs") + flag.BoolVar(&featureSeperatedHandles, "feature_seperated_handles", false, + "enable the seperated handles (the refactor)") flag.Int64Var(&flagBinlogBatchSize, "binlog_batch_size", 16, "the max num of binlogs to get in a batch") } From bb07dd499682b88e55d86203c296714ad751a3b4 Mon Sep 17 00:00:00 2001 From: w41ter Date: Tue, 15 Apr 2025 15:53:46 +0800 Subject: [PATCH 25/41] fixup --- pkg/ccr/job.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 50ffbecd..6f405f5c 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -3433,7 +3433,7 @@ func (j *Job) handleNonBarrierBinlog(binlog *festruct.TBinlog) error { } var err error - if IsJobHandleRegistered(binlogType) { + if featureSeperatedHandles && IsJobHandleRegistered(binlogType) { err = HandleBinlog(j, binlog) } else { switch binlogType { From 891ba89dd3cad2dcc3d095c3a32662a7613daede Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Tue, 15 Apr 2025 17:47:06 +0800 Subject: [PATCH 26/41] fix ci wrong test (#593) --- .../cross_ds/view/alter_view/test_cds_view_alter_view.groovy | 3 ++- .../prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy | 3 +++ .../view/modify_comment/test_ds_view_modify_comment.groovy | 4 ++++ .../db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy | 2 ++ .../modify_view/test_ds_idem_modify_view_def.groovy | 3 +++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy b/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy index d918beaf..f5dcc1e1 100644 --- a/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy +++ b/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy @@ -52,7 +52,8 @@ suite("test_cds_view_alter_view") { PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "binlog.enable" = "true", - "binlog.ttl_seconds" = "180" + "binlog.ttl_seconds" = "180", + "light_schema_change" = "true" ) """ diff --git a/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy b/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy index a965b790..4ecdc0f6 100644 --- a/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy +++ b/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy @@ -19,6 +19,9 @@ suite("test_ds_prop_unique_key_mow") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + log.info("branch-3.0: not support unique key merge on write for property 'enable_unique_key_skip_bitmap_column'") + return + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def test_num = 0 diff --git a/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy b/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy index 486653f4..03cee64d 100644 --- a/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy +++ b/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy @@ -19,6 +19,10 @@ suite("test_ds_view_modify_comment") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + log.info("branch-3.0: not support modify view def") + return + + def viewName = "test_ds_view_modify_comment_view" def exist = { res -> Boolean diff --git a/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy b/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy index 50fda04d..cf60d649 100644 --- a/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy +++ b/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy @@ -33,6 +33,8 @@ suite('test_dsd_rollup_drop_2') { sql "DROP TABLE IF EXISTS ${tableName}" target_sql "DROP TABLE IF EXISTS ${tableName}" + helper.enableDbBinlog() + sql """ CREATE TABLE if NOT EXISTS ${tableName} ( diff --git a/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy b/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy index 7a32c51d..817b85ad 100644 --- a/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy +++ b/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy @@ -19,6 +19,9 @@ suite("test_ds_idem_modify_view_def") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + log.info("branch-3.0: not support modify view def") + return + def viewName = "test_ds_idem_modify_view_def_view" def exist = { res -> Boolean From 0032892774f242f6bc42daa90eefd411ebf4c291 Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Tue, 29 Apr 2025 18:35:45 +0800 Subject: [PATCH 27/41] test: fix branch_3_0 wrong ci test #608 --- .../compact/test_ds_absorb_tbl_alt_prop_compaction.groovy | 1 - .../compact/test_ds_absorb_tbl_create_alt_compaction.groovy | 2 -- .../db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy | 2 +- .../compact/test_ts_absorb_tbl_alt_prop_compaction.groovy | 1 - .../compact/test_tsa_absorb_tbl_alt_prop_compaction.groovy | 1 - 5 files changed, 1 insertion(+), 6 deletions(-) diff --git a/regression-test/suites/db_sync_absorb/tbl/alt_prop/compact/test_ds_absorb_tbl_alt_prop_compaction.groovy b/regression-test/suites/db_sync_absorb/tbl/alt_prop/compact/test_ds_absorb_tbl_alt_prop_compaction.groovy index 1ab765da..f0a7ed12 100644 --- a/regression-test/suites/db_sync_absorb/tbl/alt_prop/compact/test_ds_absorb_tbl_alt_prop_compaction.groovy +++ b/regression-test/suites/db_sync_absorb/tbl/alt_prop/compact/test_ds_absorb_tbl_alt_prop_compaction.groovy @@ -64,7 +64,6 @@ suite("test_ds_absorb_tbl_alt_prop_compaction") { `id` INT ) ENGINE=OLAP - UNIQUE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( PARTITION p10 values less than (10), diff --git a/regression-test/suites/db_sync_absorb/tbl/create_alter/compact/test_ds_absorb_tbl_create_alt_compaction.groovy b/regression-test/suites/db_sync_absorb/tbl/create_alter/compact/test_ds_absorb_tbl_create_alt_compaction.groovy index 239bed1e..cfa7ca2a 100644 --- a/regression-test/suites/db_sync_absorb/tbl/create_alter/compact/test_ds_absorb_tbl_create_alt_compaction.groovy +++ b/regression-test/suites/db_sync_absorb/tbl/create_alter/compact/test_ds_absorb_tbl_create_alt_compaction.groovy @@ -67,7 +67,6 @@ suite("test_ds_absorb_tbl_create_alt_compaction") { `id` INT ) ENGINE=OLAP - UNIQUE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( PARTITION p10 values less than (10), @@ -118,7 +117,6 @@ suite("test_ds_absorb_tbl_create_alt_compaction") { `id` INT ) ENGINE=OLAP - UNIQUE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( PARTITION p10 values less than (10), diff --git a/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy b/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy index cf60d649..33716ad5 100644 --- a/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy +++ b/regression-test/suites/db_sync_dep/rollup/drop_2/test_dsd_rollup_drop_2.groovy @@ -93,7 +93,7 @@ suite('test_dsd_rollup_drop_2') { return true } - assertTrue(helper.checkShowTimesOf("DESC ${context.dbName}.${tableName} ALL", + assertTrue(helper.checkShowTimesOf("DESC TEST_${context.dbName}.${tableName} ALL", hasRollupDropped, 30, 'target')) assertTrue(helper.checkShowTimesOf("SHOW TABLES LIKE \"${tableName}_0\"", exist, 60, "sql")) diff --git a/regression-test/suites/tbl_sync_absorb/tbl/alt_prop/compact/test_ts_absorb_tbl_alt_prop_compaction.groovy b/regression-test/suites/tbl_sync_absorb/tbl/alt_prop/compact/test_ts_absorb_tbl_alt_prop_compaction.groovy index ac785168..eefb79cb 100644 --- a/regression-test/suites/tbl_sync_absorb/tbl/alt_prop/compact/test_ts_absorb_tbl_alt_prop_compaction.groovy +++ b/regression-test/suites/tbl_sync_absorb/tbl/alt_prop/compact/test_ts_absorb_tbl_alt_prop_compaction.groovy @@ -64,7 +64,6 @@ suite("test_ts_absorb_tbl_alt_prop_compaction") { `id` INT ) ENGINE=OLAP - UNIQUE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( PARTITION p10 values less than (10), diff --git a/regression-test/suites/tbl_sync_alias_abs/tbl/alt_prop/compact/test_tsa_absorb_tbl_alt_prop_compaction.groovy b/regression-test/suites/tbl_sync_alias_abs/tbl/alt_prop/compact/test_tsa_absorb_tbl_alt_prop_compaction.groovy index 71788a19..c14ac587 100644 --- a/regression-test/suites/tbl_sync_alias_abs/tbl/alt_prop/compact/test_tsa_absorb_tbl_alt_prop_compaction.groovy +++ b/regression-test/suites/tbl_sync_alias_abs/tbl/alt_prop/compact/test_tsa_absorb_tbl_alt_prop_compaction.groovy @@ -67,7 +67,6 @@ suite("test_tsa_absorb_tbl_alt_prop_compaction") { `id` INT ) ENGINE=OLAP - UNIQUE KEY(`test`, `id`) PARTITION BY RANGE(`id`) ( PARTITION p10 values less than (10), From 8be1df579d8dc5e810c5a2c85519ab87f2ea0d91 Mon Sep 17 00:00:00 2001 From: w41ter Date: Tue, 13 May 2025 14:55:24 +0800 Subject: [PATCH 28/41] chore: disable some cases not supported in branch-2.1/3.0 --- .../db_sync/alt_prop/bucket/test_ds_alt_prop_bucket.groovy | 6 ++++++ .../distribution_num/test_ds_alt_prop_distr_num.groovy | 6 ++++++ .../distribution_type/test_ds_alt_prop_distr_type.groovy | 6 ++++++ .../distribution_num/test_ds_idem_distribution_num.groovy | 6 ++++++ .../modify_comment/test_ds_idem_modify_comment.groovy | 2 +- .../alt_prop/bucket/test_ts_alt_prop_bucket.groovy | 6 ++++++ .../distribution_num/test_ts_alt_prop_distr_num.groovy | 6 ++++++ .../distribution_type/test_ts_alt_prop_distr_type.groovy | 6 ++++++ .../alt_prop/bucket/test_tsa_alt_prop_bucket.groovy | 6 ++++++ .../distribution_num/test_tsa_alt_prop_distr_num.groovy | 6 ++++++ .../distribution_type/test_tsa_alt_prop_distr_type.groovy | 6 ++++++ 11 files changed, 61 insertions(+), 1 deletion(-) diff --git a/regression-test/suites/db_sync/alt_prop/bucket/test_ds_alt_prop_bucket.groovy b/regression-test/suites/db_sync/alt_prop/bucket/test_ds_alt_prop_bucket.groovy index 0528a03a..6cc28a5b 100644 --- a/regression-test/suites/db_sync/alt_prop/bucket/test_ds_alt_prop_bucket.groovy +++ b/regression-test/suites/db_sync/alt_prop/bucket/test_ds_alt_prop_bucket.groovy @@ -19,6 +19,12 @@ suite("test_ds_alt_prop_bucket") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/db_sync/alt_prop/distribution_num/test_ds_alt_prop_distr_num.groovy b/regression-test/suites/db_sync/alt_prop/distribution_num/test_ds_alt_prop_distr_num.groovy index 1126c88e..4ed56d4d 100644 --- a/regression-test/suites/db_sync/alt_prop/distribution_num/test_ds_alt_prop_distr_num.groovy +++ b/regression-test/suites/db_sync/alt_prop/distribution_num/test_ds_alt_prop_distr_num.groovy @@ -18,6 +18,12 @@ suite("test_ds_alt_prop_distr_num") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/db_sync/alt_prop/distribution_type/test_ds_alt_prop_distr_type.groovy b/regression-test/suites/db_sync/alt_prop/distribution_type/test_ds_alt_prop_distr_type.groovy index c4c3ad4e..2426a373 100644 --- a/regression-test/suites/db_sync/alt_prop/distribution_type/test_ds_alt_prop_distr_type.groovy +++ b/regression-test/suites/db_sync/alt_prop/distribution_type/test_ds_alt_prop_distr_type.groovy @@ -19,6 +19,12 @@ suite("test_ds_alt_prop_distr_type") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/db_sync_idem/distribution_num/test_ds_idem_distribution_num.groovy b/regression-test/suites/db_sync_idem/distribution_num/test_ds_idem_distribution_num.groovy index 6a0b255a..f47e5dbd 100644 --- a/regression-test/suites/db_sync_idem/distribution_num/test_ds_idem_distribution_num.groovy +++ b/regression-test/suites/db_sync_idem/distribution_num/test_ds_idem_distribution_num.groovy @@ -19,6 +19,12 @@ suite('test_ds_idem_distribution_num') { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", 'helper.groovy')) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + if (!helper.has_feature("feature_idempotent_ddl")) { logger.info("this case only works with feature_idempotent_ddl") return diff --git a/regression-test/suites/db_sync_idem/modify_comment/test_ds_idem_modify_comment.groovy b/regression-test/suites/db_sync_idem/modify_comment/test_ds_idem_modify_comment.groovy index e0eb07c2..9bac8466 100644 --- a/regression-test/suites/db_sync_idem/modify_comment/test_ds_idem_modify_comment.groovy +++ b/regression-test/suites/db_sync_idem/modify_comment/test_ds_idem_modify_comment.groovy @@ -19,7 +19,7 @@ suite("test_ds_idem_modify_comment") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) - if (!helper.is_version_supported([20108, 20017, 30004])) { + if (!helper.is_version_supported([20199, 20099, 30099])) { def version = helper.upstream_version() logger.info("Skip the test case because the version is not supported. current version ${version}") } diff --git a/regression-test/suites/table_sync/alt_prop/bucket/test_ts_alt_prop_bucket.groovy b/regression-test/suites/table_sync/alt_prop/bucket/test_ts_alt_prop_bucket.groovy index c5b82540..9792c21d 100644 --- a/regression-test/suites/table_sync/alt_prop/bucket/test_ts_alt_prop_bucket.groovy +++ b/regression-test/suites/table_sync/alt_prop/bucket/test_ts_alt_prop_bucket.groovy @@ -19,6 +19,12 @@ suite("test_ts_alt_prop_bucket") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/table_sync/alt_prop/distribution_num/test_ts_alt_prop_distr_num.groovy b/regression-test/suites/table_sync/alt_prop/distribution_num/test_ts_alt_prop_distr_num.groovy index 70f634e6..f8df53ad 100644 --- a/regression-test/suites/table_sync/alt_prop/distribution_num/test_ts_alt_prop_distr_num.groovy +++ b/regression-test/suites/table_sync/alt_prop/distribution_num/test_ts_alt_prop_distr_num.groovy @@ -19,6 +19,12 @@ suite("test_ts_alt_prop_distr_num") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/table_sync/alt_prop/distribution_type/test_ts_alt_prop_distr_type.groovy b/regression-test/suites/table_sync/alt_prop/distribution_type/test_ts_alt_prop_distr_type.groovy index a34e9019..e8f8f4b1 100644 --- a/regression-test/suites/table_sync/alt_prop/distribution_type/test_ts_alt_prop_distr_type.groovy +++ b/regression-test/suites/table_sync/alt_prop/distribution_type/test_ts_alt_prop_distr_type.groovy @@ -19,6 +19,12 @@ suite("test_ts_alt_prop_distr_type") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/table_sync_alias/alt_prop/bucket/test_tsa_alt_prop_bucket.groovy b/regression-test/suites/table_sync_alias/alt_prop/bucket/test_tsa_alt_prop_bucket.groovy index 218a7b19..a983defa 100644 --- a/regression-test/suites/table_sync_alias/alt_prop/bucket/test_tsa_alt_prop_bucket.groovy +++ b/regression-test/suites/table_sync_alias/alt_prop/bucket/test_tsa_alt_prop_bucket.groovy @@ -19,6 +19,12 @@ suite("test_tsa_alt_prop_bucket") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def aliasTableName = "tbl_alias_" + helper.randomSuffix() diff --git a/regression-test/suites/table_sync_alias/alt_prop/distribution_num/test_tsa_alt_prop_distr_num.groovy b/regression-test/suites/table_sync_alias/alt_prop/distribution_num/test_tsa_alt_prop_distr_num.groovy index 8bb08d8d..1dc2a12c 100644 --- a/regression-test/suites/table_sync_alias/alt_prop/distribution_num/test_tsa_alt_prop_distr_num.groovy +++ b/regression-test/suites/table_sync_alias/alt_prop/distribution_num/test_tsa_alt_prop_distr_num.groovy @@ -19,6 +19,12 @@ suite("test_tsa_alt_prop_distr_num") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def aliasTableName = "tbl_alias_" + helper.randomSuffix() diff --git a/regression-test/suites/table_sync_alias/alt_prop/distribution_type/test_tsa_alt_prop_distr_type.groovy b/regression-test/suites/table_sync_alias/alt_prop/distribution_type/test_tsa_alt_prop_distr_type.groovy index 2fb50189..00689491 100644 --- a/regression-test/suites/table_sync_alias/alt_prop/distribution_type/test_tsa_alt_prop_distr_type.groovy +++ b/regression-test/suites/table_sync_alias/alt_prop/distribution_type/test_tsa_alt_prop_distr_type.groovy @@ -19,6 +19,12 @@ suite("test_tsa_alt_prop_distr_type") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def aliasTableName = "tbl_alias_" + helper.randomSuffix() From 935aa57427a73f42ba4da1954720817947c778d8 Mon Sep 17 00:00:00 2001 From: w41ter Date: Tue, 13 May 2025 16:09:56 +0800 Subject: [PATCH 29/41] fix: apply dropped binlogs early with barrier --- pkg/ccr/ingest_binlog_job.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkg/ccr/ingest_binlog_job.go b/pkg/ccr/ingest_binlog_job.go index 5f705f5e..879052ed 100644 --- a/pkg/ccr/ingest_binlog_job.go +++ b/pkg/ccr/ingest_binlog_job.go @@ -806,6 +806,27 @@ func (j *IngestBinlogJob) applyDroppedBinlogs() { return } + if binlog.GetType() == festruct.TBinlogType_BARRIER { + barrierLog, err := record.NewBarrierLogFromJson(binlog.GetData()) + if err != nil { + j.setError(err) + return + } + + if barrierLog.Binlog != "" { + // keep compatible with old version + binlogType := festruct.TBinlogType(barrierLog.BinlogType) + newBinlog := festruct.NewTBinlog() + newBinlog.SetCommitSeq(utils.ThriftValueWrapper(binlog.GetCommitSeq())) + newBinlog.SetTimestamp(utils.ThriftValueWrapper(binlog.GetTimestamp())) + newBinlog.SetType(&binlogType) + newBinlog.SetDbId(utils.ThriftValueWrapper(binlog.GetDbId())) + newBinlog.SetData(&barrierLog.Binlog) + newBinlog.SetTableIds(binlog.GetTableIds()) + binlog = newBinlog + } + } + if binlog.GetType() == festruct.TBinlogType_ALTER_JOB { log.Infof("txn %d ingest binlog: trigger new partial snapshot by alter job binlog, commitSeq: %d", j.txnId, commitSeq) alterJobRecord, err := record.NewAlterJobV2FromJson(binlog.GetData()) From 997beda5bf2616ba36fdb7076b4369d265ca5a24 Mon Sep 17 00:00:00 2001 From: w41ter Date: Tue, 13 May 2025 16:10:39 +0800 Subject: [PATCH 30/41] fix: use new name instead of old name, to compatible with 2.1 --- pkg/ccr/handle/rename_partition.go | 8 ++++---- pkg/ccr/job.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/ccr/handle/rename_partition.go b/pkg/ccr/handle/rename_partition.go index 8fb34218..b098068a 100644 --- a/pkg/ccr/handle/rename_partition.go +++ b/pkg/ccr/handle/rename_partition.go @@ -30,16 +30,16 @@ func (h *RenamePartitionHandle) IsBinlogCommitted(j *ccr.Job, record *record.Ren } for _, partition := range partitions { - if partition.Name == record.OldPartitionName { - log.Infof("partition %s is not renamed to %s in dest table %d, this binlog is not committed", + if partition.Name == record.NewPartitionName { + log.Infof("partition %s is not renamed to %s in dest table %d, this binlog is committed", record.OldPartitionName, record.NewPartitionName, destTableId) - return false, nil + return true, nil } } log.Infof("partition %s is renamed to %s in dest table %d, this binlog is not committed", record.OldPartitionName, record.NewPartitionName, destTableId) - return true, nil + return false, nil } func (h *RenamePartitionHandle) IsIdempotent() bool { diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 231ed6fe..ad7770de 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -3257,16 +3257,16 @@ func (j *Job) isRenamePartitionCommitted(record *record.RenamePartition) (bool, } for _, partition := range partitions { - if partition.Name == record.OldPartitionName { - log.Infof("partition %s is not renamed to %s in dest table %d, this binlog is not committed", + if partition.Name == record.NewPartitionName { + log.Infof("partition %s is not renamed to %s in dest table %d, this binlog is committed", record.OldPartitionName, record.NewPartitionName, destTableId) - return false, nil + return true, nil } } log.Infof("partition %s is renamed to %s in dest table %d, this binlog is not committed", record.OldPartitionName, record.NewPartitionName, destTableId) - return true, nil + return false, nil } func (j *Job) isModifyDistributionTypeCommitted(r *record.ModifyDistributionType) (bool, error) { From 2d6ffb1e93bd1aa6b46c780b60af34790cb02b39 Mon Sep 17 00:00:00 2001 From: w41ter Date: Tue, 13 May 2025 16:10:52 +0800 Subject: [PATCH 31/41] chore: disable some cases not supported in branch-2.1/3.0 --- .../cross_ds/upsert_index/test_cds_upsert_index.groovy | 6 ++++++ .../view/alter_view/test_cds_view_alter_view.groovy | 7 +++++++ .../generated_column/test_ds_prop_generated_column.groovy | 6 ++++++ .../unique_key_mow/test_ds_prop_unique_key_mow.groovy | 8 ++++++-- .../variant_nested/test_ds_prop_variant_nested.groovy | 6 ++++++ .../test_ds_prop_incrsync_generated_column.groovy | 6 ++++++ .../row_store/test_ds_prop_incrsync_row_store.groovy | 6 ++++++ .../test_ds_prop_incrsync_variant_nested.groovy | 6 ++++++ .../suites/db_sync/txn_insert/test_ds_txn_insert.groovy | 6 ++++++ .../modify_comment/test_ds_view_modify_comment.groovy | 8 +++++--- .../modify_view/test_ds_idem_modify_view_def.groovy | 7 +++++-- .../generated_column/test_ts_prop_generated_column.groovy | 6 ++++++ .../prop/row_store/test_ts_prop_row_store.groovy | 6 ++++++ .../variant_nested/test_ts_prop_variant_nested.groovy | 6 ++++++ .../table/txn_insert/test_ts_tbl_txn_insert.groovy | 6 ++++++ 15 files changed, 89 insertions(+), 7 deletions(-) diff --git a/regression-test/suites/cross_ds/upsert_index/test_cds_upsert_index.groovy b/regression-test/suites/cross_ds/upsert_index/test_cds_upsert_index.groovy index 5cf3394a..fc7103be 100644 --- a/regression-test/suites/cross_ds/upsert_index/test_cds_upsert_index.groovy +++ b/regression-test/suites/cross_ds/upsert_index/test_cds_upsert_index.groovy @@ -18,6 +18,12 @@ suite("test_cds_upsert_index") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30006, 20111, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def tableName = "tbl_" + helper.randomSuffix() def exist = { res -> Boolean diff --git a/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy b/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy index f5dcc1e1..c58ae283 100644 --- a/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy +++ b/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy @@ -19,6 +19,12 @@ suite("test_cds_view_alter_view") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30006, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def suffix = helper.randomSuffix() def tableName = 'tbl_' + suffix @@ -51,6 +57,7 @@ suite("test_cds_view_alter_view") { DISTRIBUTED BY HASH(id) BUCKETS 1 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", + "light_schema_change" = "true", "binlog.enable" = "true", "binlog.ttl_seconds" = "180", "light_schema_change" = "true" diff --git a/regression-test/suites/db_sync/prop/generated_column/test_ds_prop_generated_column.groovy b/regression-test/suites/db_sync/prop/generated_column/test_ds_prop_generated_column.groovy index 973839be..ce6b75db 100644 --- a/regression-test/suites/db_sync/prop/generated_column/test_ds_prop_generated_column.groovy +++ b/regression-test/suites/db_sync/prop/generated_column/test_ds_prop_generated_column.groovy @@ -19,6 +19,12 @@ suite("test_ds_prop_generated_column") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy b/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy index 4ecdc0f6..7f9ab0bc 100644 --- a/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy +++ b/regression-test/suites/db_sync/prop/unique_key_mow/test_ds_prop_unique_key_mow.groovy @@ -19,8 +19,12 @@ suite("test_ds_prop_unique_key_mow") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) - log.info("branch-3.0: not support unique key merge on write for property 'enable_unique_key_skip_bitmap_column'") - return + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + log.info("branch-3.0: not support unique key merge on write for property 'enable_unique_key_skip_bitmap_column'") + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/db_sync/prop/variant_nested/test_ds_prop_variant_nested.groovy b/regression-test/suites/db_sync/prop/variant_nested/test_ds_prop_variant_nested.groovy index 2972395a..6cf9e5f3 100644 --- a/regression-test/suites/db_sync/prop/variant_nested/test_ds_prop_variant_nested.groovy +++ b/regression-test/suites/db_sync/prop/variant_nested/test_ds_prop_variant_nested.groovy @@ -19,6 +19,12 @@ suite("test_ds_prop_variant_nested") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def test_num = 0 diff --git a/regression-test/suites/db_sync/prop_incrsync/generated_column/test_ds_prop_incrsync_generated_column.groovy b/regression-test/suites/db_sync/prop_incrsync/generated_column/test_ds_prop_incrsync_generated_column.groovy index cb645a36..4152b4ff 100644 --- a/regression-test/suites/db_sync/prop_incrsync/generated_column/test_ds_prop_incrsync_generated_column.groovy +++ b/regression-test/suites/db_sync/prop_incrsync/generated_column/test_ds_prop_incrsync_generated_column.groovy @@ -19,6 +19,12 @@ suite("test_ds_prop_incrsync_incsync_generated_column") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableNameFull = "tbl_full" def tableNameIncrement = "tbl_incr" diff --git a/regression-test/suites/db_sync/prop_incrsync/row_store/test_ds_prop_incrsync_row_store.groovy b/regression-test/suites/db_sync/prop_incrsync/row_store/test_ds_prop_incrsync_row_store.groovy index 160abe46..e1f3b172 100644 --- a/regression-test/suites/db_sync/prop_incrsync/row_store/test_ds_prop_incrsync_row_store.groovy +++ b/regression-test/suites/db_sync/prop_incrsync/row_store/test_ds_prop_incrsync_row_store.groovy @@ -19,6 +19,12 @@ suite("test_ds_prop_incrsync_incsync_row_store") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableNameFull = "tbl_full" def tableNameIncrement = "tbl_incr" diff --git a/regression-test/suites/db_sync/prop_incrsync/variant_nested/test_ds_prop_incrsync_variant_nested.groovy b/regression-test/suites/db_sync/prop_incrsync/variant_nested/test_ds_prop_incrsync_variant_nested.groovy index d7a3f5b6..e2ade88d 100644 --- a/regression-test/suites/db_sync/prop_incrsync/variant_nested/test_ds_prop_incrsync_variant_nested.groovy +++ b/regression-test/suites/db_sync/prop_incrsync/variant_nested/test_ds_prop_incrsync_variant_nested.groovy @@ -19,6 +19,12 @@ suite("test_ds_prop_incrsync_incsync_variant_nested") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableNameFull = "tbl_full" def tableNameIncrement = "tbl_incr" diff --git a/regression-test/suites/db_sync/txn_insert/test_ds_txn_insert.groovy b/regression-test/suites/db_sync/txn_insert/test_ds_txn_insert.groovy index 3bbca590..6cf89810 100644 --- a/regression-test/suites/db_sync/txn_insert/test_ds_txn_insert.groovy +++ b/regression-test/suites/db_sync/txn_insert/test_ds_txn_insert.groovy @@ -19,6 +19,12 @@ suite("test_txn_insert_db") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30006, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + if (!helper.has_feature("feature_txn_insert")) { logger.info("Skip the test because the feature is not supported.") return diff --git a/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy b/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy index 03cee64d..877696cd 100644 --- a/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy +++ b/regression-test/suites/db_sync/view/modify_comment/test_ds_view_modify_comment.groovy @@ -19,9 +19,11 @@ suite("test_ds_view_modify_comment") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) - log.info("branch-3.0: not support modify view def") - return - + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } def viewName = "test_ds_view_modify_comment_view" diff --git a/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy b/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy index 817b85ad..b7fd4f11 100644 --- a/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy +++ b/regression-test/suites/db_sync_idem/modify_view/test_ds_idem_modify_view_def.groovy @@ -19,8 +19,11 @@ suite("test_ds_idem_modify_view_def") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) - log.info("branch-3.0: not support modify view def") - return + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } def viewName = "test_ds_idem_modify_view_def_view" diff --git a/regression-test/suites/table_sync/prop/generated_column/test_ts_prop_generated_column.groovy b/regression-test/suites/table_sync/prop/generated_column/test_ts_prop_generated_column.groovy index d16c200a..fd836363 100644 --- a/regression-test/suites/table_sync/prop/generated_column/test_ts_prop_generated_column.groovy +++ b/regression-test/suites/table_sync/prop/generated_column/test_ts_prop_generated_column.groovy @@ -19,6 +19,12 @@ suite("test_ts_prop_generated_column") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() diff --git a/regression-test/suites/table_sync/prop/row_store/test_ts_prop_row_store.groovy b/regression-test/suites/table_sync/prop/row_store/test_ts_prop_row_store.groovy index 793fa822..d294a041 100644 --- a/regression-test/suites/table_sync/prop/row_store/test_ts_prop_row_store.groovy +++ b/regression-test/suites/table_sync/prop/row_store/test_ts_prop_row_store.groovy @@ -19,6 +19,12 @@ suite("test_ds_prop_row_store") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def test_num = 0 diff --git a/regression-test/suites/table_sync/prop/variant_nested/test_ts_prop_variant_nested.groovy b/regression-test/suites/table_sync/prop/variant_nested/test_ts_prop_variant_nested.groovy index 1e9633d5..4c7cf868 100644 --- a/regression-test/suites/table_sync/prop/variant_nested/test_ts_prop_variant_nested.groovy +++ b/regression-test/suites/table_sync/prop/variant_nested/test_ts_prop_variant_nested.groovy @@ -19,6 +19,12 @@ suite("test_ts_prop_variant_nested") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30099, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() def test_num = 0 diff --git a/regression-test/suites/table_sync/table/txn_insert/test_ts_tbl_txn_insert.groovy b/regression-test/suites/table_sync/table/txn_insert/test_ts_tbl_txn_insert.groovy index e906925b..bdec7db2 100644 --- a/regression-test/suites/table_sync/table/txn_insert/test_ts_tbl_txn_insert.groovy +++ b/regression-test/suites/table_sync/table/txn_insert/test_ts_tbl_txn_insert.groovy @@ -19,6 +19,12 @@ suite("test_txn_insert_table") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30006, 20199, 20099])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + if (!helper.has_feature("feature_txn_insert")) { logger.info("Skip the test because the feature is not supported.") return From 925fc5ffaaad6da101acb327851018d899dd1e10 Mon Sep 17 00:00:00 2001 From: w41ter Date: Wed, 14 May 2025 15:54:17 +0800 Subject: [PATCH 32/41] disable test_ds_partition_default_list_insert in 3.0 --- .../default/test_ds_partition_default_list_insert.groovy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/regression-test/suites/db_sync/partition/default/test_ds_partition_default_list_insert.groovy b/regression-test/suites/db_sync/partition/default/test_ds_partition_default_list_insert.groovy index 4de7a2b1..3e396b58 100644 --- a/regression-test/suites/db_sync/partition/default/test_ds_partition_default_list_insert.groovy +++ b/regression-test/suites/db_sync/partition/default/test_ds_partition_default_list_insert.groovy @@ -19,6 +19,12 @@ suite("test_ds_partition_default_list_insert") { def helper = new GroovyShell(new Binding(['suite': delegate])) .evaluate(new File("${context.config.suitePath}/../common", "helper.groovy")) + if (!helper.is_version_supported([30007])) { + def version = helper.upstream_version() + logger.info("skip this suite because version is not supported, upstream version ${version}") + return + } + def dbName = context.dbName def tableName = "tbl_" + helper.randomSuffix() sql "DROP TABLE IF EXISTS ${dbName}.${tableName}" From 77da4c11cd2cbf2966e4c910dc108f32debb3872 Mon Sep 17 00:00:00 2001 From: w41ter Date: Wed, 14 May 2025 16:02:10 +0800 Subject: [PATCH 33/41] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47849a55..c143a3e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # 更新日志 -# 3.0.5/2.1.10 +# 3.0.6/2.1.10 ### Fix @@ -11,10 +11,12 @@ - 修复 DROP INDEX 导致 UPSERT 找不到 index 的问题 (selectdb/ccr-syncer#490) - 修复 unknown column 导致的 VIEW 无法创建的问题 (selectdb/ccr-syncer#510) - 修复 gls 未释放导致的内存泄漏问题 (selectdb/ccr-syncer#576) +- 使用 `force_replace` 修复 VIEW schema 不一致无法同步的问题 (selectdb/ccr-syncer#579) +- 构建 table mapping 前检查 table 是否已经被删除 (selectdb/ccr-syncer#612) ### Feature -- 支持 txn insert (selectdb/ccr-syncer#290) +- 支持 txn insert (selectdb/ccr-syncer#290,selectdb/ccr-syncer#592) - 支持 lock binlog,提前释放不需要的 binlog,避免占用上游资源 (selectdb/ccr-syncer#399, selectdb/ccr-syncer#406, selectdb/ccr-syncer#407) - 支持一批获取多个 binlog (selectdb/ccr-syncer#400) - 增加 `metrics` 接口用于获取 ccr metrics (selectdb/ccr-syncer#402, selectdb/ccr-syncer#461) @@ -22,6 +24,7 @@ - 支持幂等性 (selectdb/ccr-syncer#409, selectdb/ccr-syncer#416, selectdb/ccr-syncer#415, selectdb/ccr-syncer#424, ...) - 增加 `desync.sh` 脚本 (selectdb/ccr-syncer#452) - 支持 pipline txn(并行 ingest,串行提交)(selectdb/ccr-syncer#585) +- 增加 `/view` 接口,用于获取 JOB 状态(支持 terminal, table, html)(selectdb/ccr-syncer#588) ### Improve From 7527ec38b8f530c8849c5d8179b09ecb039a0c35 Mon Sep 17 00:00:00 2001 From: walter Date: Mon, 26 May 2025 17:31:19 +0800 Subject: [PATCH 34/41] fix: skip create elasticsearch record (#619) --- pkg/ccr/handle/create_table.go | 5 +++++ pkg/ccr/job.go | 5 +++++ pkg/ccr/record/create_table.go | 4 ++++ pkg/ccr/record/table_type.go | 1 + 4 files changed, 15 insertions(+) diff --git a/pkg/ccr/handle/create_table.go b/pkg/ccr/handle/create_table.go index 9b22b513..260c652e 100644 --- a/pkg/ccr/handle/create_table.go +++ b/pkg/ccr/handle/create_table.go @@ -23,6 +23,11 @@ func (h *CreateTableHandle) Handle(j *ccr.Job, commitSeq int64, createTable *rec return xerror.Errorf(xerror.Normal, "invalid sync type: %v", j.SyncType) } + if createTable.IsCreateElasticSearch() { + log.Warnf("create table with elasticsearch is not supported yet, skip this binlog") + return nil + } + if createTable.IsCreateMaterializedView() { log.Warnf("create async materialized view is not supported yet, skip this binlog") return nil diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index ad7770de..1644dd60 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -2068,6 +2068,11 @@ func (j *Job) handleCreateTable(binlog *festruct.TBinlog) error { return nil } + if createTable.IsCreateElasticSearch() { + log.Warnf("create table with elasticsearch is not supported yet, skip this binlog") + return nil + } + if createTable.IsCreateMaterializedView() { log.Warnf("create async materialized view is not supported yet, skip this binlog") return nil diff --git a/pkg/ccr/record/create_table.go b/pkg/ccr/record/create_table.go index 0f077b87..fad00cf3 100644 --- a/pkg/ccr/record/create_table.go +++ b/pkg/ccr/record/create_table.go @@ -93,3 +93,7 @@ func (c *CreateTable) IsCreateMaterializedView() bool { return strings.Contains(c.Sql, "ENGINE=MATERIALIZED_VIEW") } + +func (c *CreateTable) IsCreateElasticSearch() bool { + return c.TableType == TableTypeElasticSearch +} diff --git a/pkg/ccr/record/table_type.go b/pkg/ccr/record/table_type.go index d400f19b..b18a0f5b 100644 --- a/pkg/ccr/record/table_type.go +++ b/pkg/ccr/record/table_type.go @@ -20,4 +20,5 @@ const ( TableTypeOlap = "OLAP" TableTypeView = "VIEW" TableTypeMaterializedView = "MATERIALIZED_VIEW" + TableTypeElasticSearch = "ELASTICSEARCH" ) From 0bcfeac90bfce0256eea1afff25ce0cd30c325a8 Mon Sep 17 00:00:00 2001 From: walter Date: Thu, 5 Jun 2025 17:38:48 +0800 Subject: [PATCH 35/41] chore: log shadow index id (#620) --- pkg/ccr/ingest_binlog_job.go | 4 ++-- pkg/ccr/job.go | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/ccr/ingest_binlog_job.go b/pkg/ccr/ingest_binlog_job.go index 879052ed..972a248f 100644 --- a/pkg/ccr/ingest_binlog_job.go +++ b/pkg/ccr/ingest_binlog_job.go @@ -543,8 +543,8 @@ func (j *IngestBinlogJob) preparePartition(srcTableId, destTableId int64, srcIndexName := getSrcIndexName(job, srcIndexMeta) if _, ok := destIndexNameMap[srcIndexName]; !ok { j.setError(xerror.Errorf(xerror.Meta, - "index name %v not found in dest meta, is base index: %t, src index id: %d", - srcIndexName, srcIndexMeta.IsBaseIndex, indexId)) + "index name %v not found in dest meta, is base index: %t, src index id: %d, shadow indexes %v", + srcIndexName, srcIndexMeta.IsBaseIndex, indexId, j.ccrJob.progress.ShadowIndexes)) return } } diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 1644dd60..d8e76c6d 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -2320,6 +2320,8 @@ func (j *Job) HandleAlterRollup(alterJob *record.AlterJobV2) error { j.progress.ShadowIndexes = make(map[int64]int64) } j.progress.ShadowIndexes[alterJob.RollupIndexId] = alterJob.BaseIndexId + log.Infof("table %d alter rollup save shadow index %d, base index id: %d", + alterJob.TableId, alterJob.RollupIndexId, alterJob.BaseIndexId) case record.ALTER_JOB_STATE_CANCELLED: // clear the shadow indexes delete(j.progress.ShadowIndexes, alterJob.RollupIndexId) @@ -2348,6 +2350,8 @@ func (j *Job) HandleSchemaChange(alterJob *record.AlterJobV2) error { } for shadowIndexId, originIndexId := range alterJob.ShadowIndexes { j.progress.ShadowIndexes[shadowIndexId] = originIndexId + log.Infof("table %d schema change job save shadow index %d, origin index id: %d", + alterJob.TableId, shadowIndexId, originIndexId) } case record.ALTER_JOB_STATE_CANCELLED: // clear the shadow indexes From eb0ed1f4965e1e3d78616f10358fe1528d591ddc Mon Sep 17 00:00:00 2001 From: walter Date: Thu, 5 Jun 2025 18:06:42 +0800 Subject: [PATCH 36/41] fix: save shadow indexes even if the binlog is committed (#621) --- pkg/ccr/job.go | 45 +++++++++++++++++++++++++++++++++++-------- pkg/ccr/job_handle.go | 16 +++++++++++---- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index d8e76c6d..ba3493c0 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -2284,6 +2284,11 @@ func (j *Job) handleAlterJob(binlog *festruct.TBinlog) error { } if j.IsBinlogCommitted(alterJob.TableId, binlog.GetCommitSeq()) { + if alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { + j.saveSchemaChangeShadowIndexes(alterJob) + } else if alterJob.Type == record.ALTER_JOB_ROLLUP { + j.saveAlterRollupShadowIndex(alterJob) + } return nil } @@ -2308,10 +2313,14 @@ func (j *Job) handleAlterJob(binlog *festruct.TBinlog) error { } } -func (j *Job) HandleAlterRollup(alterJob *record.AlterJobV2) error { +func (j *Job) saveAlterRollupShadowIndex(alterJob *record.AlterJobV2) { if !alterJob.IsFinished() { switch alterJob.JobState { case record.ALTER_JOB_STATE_PENDING: + fallthrough + case record.ALTER_JOB_STATE_WAITING_TXN: + fallthrough + case record.ALTER_JOB_STATE_RUNNING: // Once the rollup job step to WAITING_TXN, the upsert to the rollup index is allowed, // but the dest index of the downstream cluster hasn't been created. // @@ -2319,13 +2328,21 @@ func (j *Job) HandleAlterRollup(alterJob *record.AlterJobV2) error { if j.progress.ShadowIndexes == nil { j.progress.ShadowIndexes = make(map[int64]int64) } - j.progress.ShadowIndexes[alterJob.RollupIndexId] = alterJob.BaseIndexId - log.Infof("table %d alter rollup save shadow index %d, base index id: %d", - alterJob.TableId, alterJob.RollupIndexId, alterJob.BaseIndexId) + if _, ok := j.progress.ShadowIndexes[alterJob.RollupIndexId]; !ok { + j.progress.ShadowIndexes[alterJob.RollupIndexId] = alterJob.BaseIndexId + log.Infof("table %d alter rollup save shadow index %d, base index id: %d", + alterJob.TableId, alterJob.RollupIndexId, alterJob.BaseIndexId) + } case record.ALTER_JOB_STATE_CANCELLED: // clear the shadow indexes delete(j.progress.ShadowIndexes, alterJob.RollupIndexId) } + } +} + +func (j *Job) HandleAlterRollup(alterJob *record.AlterJobV2) error { + if !alterJob.IsFinished() { + j.saveAlterRollupShadowIndex(alterJob) return nil } @@ -2337,10 +2354,14 @@ func (j *Job) HandleAlterRollup(alterJob *record.AlterJobV2) error { return j.NewPartialSnapshot(alterJob.TableId, alterJob.TableName, nil, replace, isView) } -func (j *Job) HandleSchemaChange(alterJob *record.AlterJobV2) error { +func (j *Job) saveSchemaChangeShadowIndexes(alterJob *record.AlterJobV2) { if !alterJob.IsFinished() { switch alterJob.JobState { case record.ALTER_JOB_STATE_PENDING: + fallthrough + case record.ALTER_JOB_STATE_WAITING_TXN: + fallthrough + case record.ALTER_JOB_STATE_RUNNING: // Once the schema change step to WAITING_TXN, the upsert to the shadow indexes is allowed, // but the dest indexes of the downstream cluster hasn't been created. // @@ -2349,9 +2370,11 @@ func (j *Job) HandleSchemaChange(alterJob *record.AlterJobV2) error { j.progress.ShadowIndexes = make(map[int64]int64) } for shadowIndexId, originIndexId := range alterJob.ShadowIndexes { - j.progress.ShadowIndexes[shadowIndexId] = originIndexId - log.Infof("table %d schema change job save shadow index %d, origin index id: %d", - alterJob.TableId, shadowIndexId, originIndexId) + if _, ok := j.progress.ShadowIndexes[shadowIndexId]; !ok { + j.progress.ShadowIndexes[shadowIndexId] = originIndexId + log.Infof("table %d schema change job save shadow index %d, origin index id: %d", + alterJob.TableId, shadowIndexId, originIndexId) + } } case record.ALTER_JOB_STATE_CANCELLED: // clear the shadow indexes @@ -2359,6 +2382,12 @@ func (j *Job) HandleSchemaChange(alterJob *record.AlterJobV2) error { delete(j.progress.ShadowIndexes, shadowIndexId) } } + } +} + +func (j *Job) HandleSchemaChange(alterJob *record.AlterJobV2) error { + if !alterJob.IsFinished() { + j.saveSchemaChangeShadowIndexes(alterJob) return nil } diff --git a/pkg/ccr/job_handle.go b/pkg/ccr/job_handle.go index 4ceaa9b1..d19f85f2 100644 --- a/pkg/ccr/job_handle.go +++ b/pkg/ccr/job_handle.go @@ -53,18 +53,26 @@ func buildGenericHandleMethod[T record.Record](handle JobHandle[T]) HandleFn { binlog.GetType(), progress.PrevCommitSeq, progress.CommitSeq) data := binlog.GetData() - record := newGenericRecord[T]() - if err := record.Deserialize(data); err != nil { + value := newGenericRecord[T]() + if err := value.Deserialize(data); err != nil { return err } - tableId := record.GetTableId() + tableId := value.GetTableId() if job.IsBinlogCommitted(tableId, progress.CommitSeq) { + // HACK: for alter job, should save the shadow indexes + if alterJob, ok := any(value).(*record.AlterJobV2); ok { + if alterJob.Type == record.ALTER_JOB_ROLLUP { + job.saveAlterRollupShadowIndex(alterJob) + } else if alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { + job.saveSchemaChangeShadowIndexes(alterJob) + } + } return nil } commitSeq := binlog.GetCommitSeq() - return handle.Handle(job, commitSeq, record) + return handle.Handle(job, commitSeq, value) } } From c050ce31ea69c43039065aeabfb5615ec8ab290b Mon Sep 17 00:00:00 2001 From: Uniqueyou Date: Wed, 25 Jun 2025 16:14:35 +0800 Subject: [PATCH 37/41] fix: Remove redundant table property #622 --- .../cross_ds/view/alter_view/test_cds_view_alter_view.groovy | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy b/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy index c58ae283..e0d7a453 100644 --- a/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy +++ b/regression-test/suites/cross_ds/view/alter_view/test_cds_view_alter_view.groovy @@ -59,8 +59,7 @@ suite("test_cds_view_alter_view") { "replication_allocation" = "tag.location.default: 1", "light_schema_change" = "true", "binlog.enable" = "true", - "binlog.ttl_seconds" = "180", - "light_schema_change" = "true" + "binlog.ttl_seconds" = "180" ) """ From a836ab13095acec167071dbffe9c6d7c6887e38b Mon Sep 17 00:00:00 2001 From: walter Date: Wed, 25 Jun 2025 19:52:36 +0800 Subject: [PATCH 38/41] fix: clear shadow indexes after log committed (#623) --- pkg/ccr/handle/alter_job_v2.go | 50 ++----------- pkg/ccr/job.go | 130 ++++++++++++++++----------------- pkg/ccr/job_handle.go | 6 +- 3 files changed, 72 insertions(+), 114 deletions(-) diff --git a/pkg/ccr/handle/alter_job_v2.go b/pkg/ccr/handle/alter_job_v2.go index df16580d..08519a6c 100644 --- a/pkg/ccr/handle/alter_job_v2.go +++ b/pkg/ccr/handle/alter_job_v2.go @@ -41,54 +41,16 @@ func (*AlterJobV2Handle) Handle(j *ccr.Job, commitSeq int64, alterJob *record.Al } func handleAlterRollup(j *ccr.Job, alterJob *record.AlterJobV2) error { - job_progress := j.GetJobProgress() + j.SaveAlterRollupShadowIndex(alterJob) if !alterJob.IsFinished() { - switch alterJob.JobState { - case record.ALTER_JOB_STATE_PENDING: - // Once the rollup job step to WAITING_TXN, the upsert to the rollup index is allowed, - // but the dest index of the downstream cluster hasn't been created. - // - // To filter the upsert to the rollup index, save the shadow index ids here. - if job_progress.ShadowIndexes == nil { - job_progress.ShadowIndexes = make(map[int64]int64) - } - job_progress.ShadowIndexes[alterJob.RollupIndexId] = alterJob.BaseIndexId - case record.ALTER_JOB_STATE_CANCELLED: - // clear the shadow indexes - delete(job_progress.ShadowIndexes, alterJob.RollupIndexId) - } return nil } - // Once partial snapshot finished, the rollup indexes will be convert to normal index. - delete(job_progress.ShadowIndexes, alterJob.RollupIndexId) - return j.NewPartialSnapshot(alterJob.TableId, alterJob.TableName, nil, true, false) } func handleSchemaChange(j *ccr.Job, alterJob *record.AlterJobV2) error { job_progress := j.GetJobProgress() - if !alterJob.IsFinished() { - switch alterJob.JobState { - case record.ALTER_JOB_STATE_PENDING: - // Once the schema change step to WAITING_TXN, the upsert to the shadow indexes is allowed, - // but the dest indexes of the downstream cluster hasn't been created. - // - // To filter the upsert to the shadow indexes, save the shadow index ids here. - if job_progress.ShadowIndexes == nil { - job_progress.ShadowIndexes = make(map[int64]int64) - } - for shadowIndexId, originIndexId := range alterJob.ShadowIndexes { - job_progress.ShadowIndexes[shadowIndexId] = originIndexId - } - case record.ALTER_JOB_STATE_CANCELLED: - // clear the shadow indexes - for shadowIndexId := range alterJob.ShadowIndexes { - delete(job_progress.ShadowIndexes, shadowIndexId) - } - } - return nil - } // drop table dropTableSql var destTableName string @@ -98,12 +60,12 @@ func handleSchemaChange(j *ccr.Job, alterJob *record.AlterJobV2) error { destTableName = alterJob.TableName } - if ccr.FeatureSchemaChangePartialSync && alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { - // Once partial snapshot finished, the shadow indexes will be convert to normal indexes. - for shadowIndexId := range alterJob.ShadowIndexes { - delete(job_progress.ShadowIndexes, shadowIndexId) - } + j.SaveSchemaChangeShadowIndexes(alterJob) + if !alterJob.IsFinished() { + return nil + } + if ccr.FeatureSchemaChangePartialSync && alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { return j.NewPartialSnapshot(alterJob.TableId, alterJob.TableName, nil, true, false) } diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index ba3493c0..41312f2e 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -2285,9 +2285,9 @@ func (j *Job) handleAlterJob(binlog *festruct.TBinlog) error { if j.IsBinlogCommitted(alterJob.TableId, binlog.GetCommitSeq()) { if alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { - j.saveSchemaChangeShadowIndexes(alterJob) - } else if alterJob.Type == record.ALTER_JOB_ROLLUP { - j.saveAlterRollupShadowIndex(alterJob) + j.SaveSchemaChangeShadowIndexes(alterJob) + } else if !FeatureSkipRollupBinlogs && alterJob.Type == record.ALTER_JOB_ROLLUP { + j.SaveAlterRollupShadowIndex(alterJob) } return nil } @@ -2313,84 +2313,80 @@ func (j *Job) handleAlterJob(binlog *festruct.TBinlog) error { } } -func (j *Job) saveAlterRollupShadowIndex(alterJob *record.AlterJobV2) { - if !alterJob.IsFinished() { - switch alterJob.JobState { - case record.ALTER_JOB_STATE_PENDING: - fallthrough - case record.ALTER_JOB_STATE_WAITING_TXN: - fallthrough - case record.ALTER_JOB_STATE_RUNNING: - // Once the rollup job step to WAITING_TXN, the upsert to the rollup index is allowed, - // but the dest index of the downstream cluster hasn't been created. - // - // To filter the upsert to the rollup index, save the shadow index ids here. - if j.progress.ShadowIndexes == nil { - j.progress.ShadowIndexes = make(map[int64]int64) - } - if _, ok := j.progress.ShadowIndexes[alterJob.RollupIndexId]; !ok { - j.progress.ShadowIndexes[alterJob.RollupIndexId] = alterJob.BaseIndexId - log.Infof("table %d alter rollup save shadow index %d, base index id: %d", - alterJob.TableId, alterJob.RollupIndexId, alterJob.BaseIndexId) - } - case record.ALTER_JOB_STATE_CANCELLED: - // clear the shadow indexes - delete(j.progress.ShadowIndexes, alterJob.RollupIndexId) - } +func (j *Job) SaveAlterRollupShadowIndex(alterJob *record.AlterJobV2) { + switch alterJob.JobState { + case record.ALTER_JOB_STATE_PENDING: + fallthrough + case record.ALTER_JOB_STATE_WAITING_TXN: + fallthrough + case record.ALTER_JOB_STATE_RUNNING: + // Once the rollup job step to WAITING_TXN, the upsert to the rollup index is allowed, + // but the dest index of the downstream cluster hasn't been created. + // + // To filter the upsert to the rollup index, save the shadow index ids here. + if j.progress.ShadowIndexes == nil { + j.progress.ShadowIndexes = make(map[int64]int64) + } + if _, ok := j.progress.ShadowIndexes[alterJob.RollupIndexId]; !ok { + j.progress.ShadowIndexes[alterJob.RollupIndexId] = alterJob.BaseIndexId + log.Infof("table %d alter rollup save shadow index %d, base index id: %d", + alterJob.TableId, alterJob.RollupIndexId, alterJob.BaseIndexId) + } + case record.ALTER_JOB_STATE_CANCELLED: + // clear the shadow indexes + delete(j.progress.ShadowIndexes, alterJob.RollupIndexId) + case record.ALTER_JOB_STATE_FINISHED: + // Once partial snapshot finished, the rollup indexes will be convert to normal index. + delete(j.progress.ShadowIndexes, alterJob.RollupIndexId) } } func (j *Job) HandleAlterRollup(alterJob *record.AlterJobV2) error { + j.SaveAlterRollupShadowIndex(alterJob) if !alterJob.IsFinished() { - j.saveAlterRollupShadowIndex(alterJob) return nil } - // Once partial snapshot finished, the rollup indexes will be convert to normal index. - delete(j.progress.ShadowIndexes, alterJob.RollupIndexId) - replace := true isView := false return j.NewPartialSnapshot(alterJob.TableId, alterJob.TableName, nil, replace, isView) } -func (j *Job) saveSchemaChangeShadowIndexes(alterJob *record.AlterJobV2) { - if !alterJob.IsFinished() { - switch alterJob.JobState { - case record.ALTER_JOB_STATE_PENDING: - fallthrough - case record.ALTER_JOB_STATE_WAITING_TXN: - fallthrough - case record.ALTER_JOB_STATE_RUNNING: - // Once the schema change step to WAITING_TXN, the upsert to the shadow indexes is allowed, - // but the dest indexes of the downstream cluster hasn't been created. - // - // To filter the upsert to the shadow indexes, save the shadow index ids here. - if j.progress.ShadowIndexes == nil { - j.progress.ShadowIndexes = make(map[int64]int64) - } - for shadowIndexId, originIndexId := range alterJob.ShadowIndexes { - if _, ok := j.progress.ShadowIndexes[shadowIndexId]; !ok { - j.progress.ShadowIndexes[shadowIndexId] = originIndexId - log.Infof("table %d schema change job save shadow index %d, origin index id: %d", - alterJob.TableId, shadowIndexId, originIndexId) - } - } - case record.ALTER_JOB_STATE_CANCELLED: - // clear the shadow indexes - for shadowIndexId := range alterJob.ShadowIndexes { - delete(j.progress.ShadowIndexes, shadowIndexId) +func (j *Job) SaveSchemaChangeShadowIndexes(alterJob *record.AlterJobV2) { + switch alterJob.JobState { + case record.ALTER_JOB_STATE_PENDING: + fallthrough + case record.ALTER_JOB_STATE_WAITING_TXN: + fallthrough + case record.ALTER_JOB_STATE_RUNNING: + // Once the schema change step to WAITING_TXN, the upsert to the shadow indexes is allowed, + // but the dest indexes of the downstream cluster hasn't been created. + // + // To filter the upsert to the shadow indexes, save the shadow index ids here. + if j.progress.ShadowIndexes == nil { + j.progress.ShadowIndexes = make(map[int64]int64) + } + for shadowIndexId, originIndexId := range alterJob.ShadowIndexes { + if _, ok := j.progress.ShadowIndexes[shadowIndexId]; !ok { + j.progress.ShadowIndexes[shadowIndexId] = originIndexId + log.Infof("table %d schema change job save shadow index %d, origin index id: %d", + alterJob.TableId, shadowIndexId, originIndexId) } } + case record.ALTER_JOB_STATE_CANCELLED: + // clear the shadow indexes + for shadowIndexId := range alterJob.ShadowIndexes { + delete(j.progress.ShadowIndexes, shadowIndexId) + } + case record.ALTER_JOB_STATE_FINISHED: + // Once partial snapshot finished, the shadow indexes will be convert to normal indexes. + for shadowIndexId := range alterJob.ShadowIndexes { + delete(j.progress.ShadowIndexes, shadowIndexId) + } } } func (j *Job) HandleSchemaChange(alterJob *record.AlterJobV2) error { - if !alterJob.IsFinished() { - j.saveSchemaChangeShadowIndexes(alterJob) - return nil - } - // drop table dropTableSql var destTableName string if j.SyncType == TableSync { @@ -2399,12 +2395,12 @@ func (j *Job) HandleSchemaChange(alterJob *record.AlterJobV2) error { destTableName = alterJob.TableName } - if FeatureSchemaChangePartialSync && alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { - // Once partial snapshot finished, the shadow indexes will be convert to normal indexes. - for shadowIndexId := range alterJob.ShadowIndexes { - delete(j.progress.ShadowIndexes, shadowIndexId) - } + j.SaveSchemaChangeShadowIndexes(alterJob) + if !alterJob.IsFinished() { + return nil + } + if FeatureSchemaChangePartialSync && alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { replaceTable := true isView := false return j.NewPartialSnapshot(alterJob.TableId, alterJob.TableName, nil, replaceTable, isView) diff --git a/pkg/ccr/job_handle.go b/pkg/ccr/job_handle.go index d19f85f2..f96327ab 100644 --- a/pkg/ccr/job_handle.go +++ b/pkg/ccr/job_handle.go @@ -62,10 +62,10 @@ func buildGenericHandleMethod[T record.Record](handle JobHandle[T]) HandleFn { if job.IsBinlogCommitted(tableId, progress.CommitSeq) { // HACK: for alter job, should save the shadow indexes if alterJob, ok := any(value).(*record.AlterJobV2); ok { - if alterJob.Type == record.ALTER_JOB_ROLLUP { - job.saveAlterRollupShadowIndex(alterJob) + if !FeatureSkipRollupBinlogs && alterJob.Type == record.ALTER_JOB_ROLLUP { + job.SaveAlterRollupShadowIndex(alterJob) } else if alterJob.Type == record.ALTER_JOB_SCHEMA_CHANGE { - job.saveSchemaChangeShadowIndexes(alterJob) + job.SaveSchemaChangeShadowIndexes(alterJob) } } return nil From 3facf0938e1d953ff58def1a7c8747bb34217e53 Mon Sep 17 00:00:00 2001 From: carolinchen Date: Mon, 11 Aug 2025 14:33:29 +0800 Subject: [PATCH 39/41] feat: Add cluster-level CCR sync and dynamic monitor interval configuration This commit introduces cluster-level CCR synchronization functionality and dynamic monitor interval configuration capabilities. 1. **Cluster-level CCR Sync** - Add `ClusterSync` parameter to `CreateCcrRequest` - Implement `createClusterCcr()` function for cluster-wide database sync - Add automatic database monitoring with `startDatabaseMonitor()` - Support dynamic detection of new/deleted databases - Auto-create/remove sync tasks for database changes 2. **Dynamic Monitor Interval Configuration** - Add `/update_monitor_interval` HTTP endpoint - Add `/get_monitor_interval` HTTP endpoint - Support runtime modification of database monitoring frequency - Implement thread-safe interval updates using channels - `POST /update_monitor_interval` - Update monitoring interval - `GET /get_monitor_interval` - Get current monitoring interval - All existing single-database sync functionality remains unchanged - New `cluster_sync` parameter defaults to `false` - Thread-safe implementation using `sync.RWMutex` - Non-blocking channel communication for interval updates - Comprehensive error handling and retry mechanisms - Detailed logging for observability --- CLUSTER_CCR_CHANGES.md | 140 +++++++++++++++ pkg/ccr/base/spec.go | 50 ++++++ pkg/ccr/job.go | 7 +- pkg/ccr/specer_mock.go | 15 ++ pkg/service/http_service.go | 335 +++++++++++++++++++++++++++++++++++- test_routes.go | 27 +++ 6 files changed, 567 insertions(+), 7 deletions(-) create mode 100644 CLUSTER_CCR_CHANGES.md create mode 100644 test_routes.go diff --git a/CLUSTER_CCR_CHANGES.md b/CLUSTER_CCR_CHANGES.md new file mode 100644 index 00000000..5cc1b947 --- /dev/null +++ b/CLUSTER_CCR_CHANGES.md @@ -0,0 +1,140 @@ +# Cluster CCR Feature Changes + +## 概述 +本次更改为CCR Syncer添加了集群级别同步功能,允许用户一次性同步整个集群的所有数据库,并提供了动态配置监控间隔的功能。 + +## 主要更改 + +### 1. 新增ClusterSync参数 + +#### 文件:`pkg/service/http_service.go` + +**新增字段:** +```go +type CreateCcrRequest struct { + // ... 其他字段 + // Whether it's cluster-level sync, if true, will get all databases from source cluster and create sync task for each database + ClusterSync bool `json:"cluster_sync"` +} +``` + +**新增函数:** +- `createClusterCcr()` - 创建集群级别的CCR同步任务 +- `startDatabaseMonitor()` - 启动数据库监控守护进程 +- `monitorDatabaseChanges()` - 检测数据库变化并处理 +- `handleNewDatabases()` - 处理新增数据库 +- `handleDeletedDatabases()` - 处理删除的数据库 +- `getDatabaseList()` - 获取数据库列表 + +**功能特性:** +- 自动获取源集群所有数据库 +- 为每个数据库创建独立的同步任务 +- 支持动态监控新增/删除的数据库 +- 自动创建/删除对应的同步任务 +- 支持失败重试机制 + +### 2. 动态监控间隔配置 + +#### 新增全局变量: +```go +var ( + databaseMonitorInterval time.Duration = 2 * time.Minute + intervalMutex sync.RWMutex + intervalUpdateChan = make(chan time.Duration, 1) +) +``` + +#### 新增HTTP Handler: + +**`/update_monitor_interval` - 更新监控间隔** +- 请求方法:POST +- 请求格式: +```json +{ + "interval_seconds": 300 +} +``` +- 功能:动态更新数据库监控的检查间隔 + +**`/get_monitor_interval` - 获取当前监控间隔** +- 请求方法:GET +- 响应格式: +```json +{ + "success": true, + "interval_seconds": 120 +} +``` +- 功能:获取当前的监控间隔设置 + +### 3. 性能优化 + +**锁优化:** +- 使用channel通信替代频繁的锁操作 +- 减少了`startDatabaseMonitor`函数中的锁竞争 +- 提高了监控性能 + +**实现细节:** +- 使用`select`语句监听ticker和interval更新 +- 非阻塞的channel通信 +- 只在间隔真正改变时才重置ticker + +## API使用示例 + +### 创建集群级同步任务 +```bash +curl -X POST http://localhost:9190/create_ccr \ + -H "Content-Type: application/json" \ + -d '{ + "name": "cluster_sync_job", + "src": { + "host": "source-cluster", + "port": 9030, + "user": "root", + "password": "password" + }, + "dest": { + "host": "dest-cluster", + "port": 9030, + "user": "root", + "password": "password" + }, + "cluster_sync": true + }' +``` + +### 更新监控间隔 +```bash +curl -X POST http://localhost:9190/update_monitor_interval \ + -H "Content-Type: application/json" \ + -d '{"interval_seconds": 300}' +``` + +### 获取监控间隔 +```bash +curl -X GET http://localhost:9190/get_monitor_interval +``` + +## 技术特点 + +1. **线程安全**:使用mutex保护全局变量 +2. **高性能**:优化锁使用,减少竞争 +3. **动态配置**:支持运行时修改监控间隔 +4. **容错性**:支持失败重试和错误处理 +5. **可观测性**:详细的日志记录 +6. **向后兼容**:不影响现有的单数据库同步功能 + +## 测试建议 + +1. 测试集群级同步功能 +2. 测试动态监控间隔更新 +3. 测试新增/删除数据库的自动处理 +4. 测试并发场景下的性能 +5. 测试错误恢复机制 + +## 注意事项 + +1. 集群级同步会为每个数据库创建独立的同步任务 +2. 任务命名格式:`{原任务名}_{数据库名}` +3. 监控间隔最小值应大于0 +4. 建议在生产环境中谨慎设置监控间隔 \ No newline at end of file diff --git a/pkg/ccr/base/spec.go b/pkg/ccr/base/spec.go index 0eb5f895..29bb1997 100644 --- a/pkg/ccr/base/spec.go +++ b/pkg/ccr/base/spec.go @@ -83,6 +83,22 @@ func ParseBackupState(state string) BackupState { } } +// isSystemDatabase 判断是否为系统数据库,需要跳过 +func isSystemDatabase(dbName string) bool { + systemDatabases := []string{ + "information_schema", + "mysql", + "__internal_schema", + } + + for _, sysDb := range systemDatabases { + if dbName == sysDb { + return true + } + } + return false +} + type RestoreState int const ( @@ -464,6 +480,40 @@ func (s *Spec) GetAllTables() ([]string, error) { return tables, nil } +func (s *Spec) GetAllDatabases() ([]string, error) { + log.Tracef("get all databases from cluster") + + db, err := s.Connect() + if err != nil { + return nil, err + } + + sql := "SHOW DATABASES" + rows, err := db.Query(sql) + if err != nil { + return nil, xerror.Wrapf(err, xerror.Normal, "query %s failed", sql) + } + defer rows.Close() + + var databases []string + for rows.Next() { + var database string + if err := rows.Scan(&database); err != nil { + return nil, xerror.Wrapf(err, xerror.Normal, "scan database failed") + } + // 过滤系统数据库 + if !isSystemDatabase(database) { + databases = append(databases, database) + } + } + + if err := rows.Err(); err != nil { + return nil, xerror.Wrapf(err, xerror.Normal, "rows error") + } + + return databases, nil +} + func (s *Spec) queryResult(querySQL string, queryColumn string, errMsg string) ([]string, error) { db, err := s.Connect() if err != nil { diff --git a/pkg/ccr/job.go b/pkg/ccr/job.go index 41312f2e..277d4ce8 100644 --- a/pkg/ccr/job.go +++ b/pkg/ccr/job.go @@ -127,8 +127,9 @@ func init() { type SyncType int const ( - DBSync SyncType = 0 - TableSync SyncType = 1 + DBSync SyncType = 0 + TableSync SyncType = 1 + ClusterSync SyncType = 2 ) func (s SyncType) String() string { @@ -137,6 +138,8 @@ func (s SyncType) String() string { return "db_sync" case TableSync: return "table_sync" + case ClusterSync: + return "cluster_sync" default: return "unknown_sync" } diff --git a/pkg/ccr/specer_mock.go b/pkg/ccr/specer_mock.go index cbf278b7..4b6b51fa 100644 --- a/pkg/ccr/specer_mock.go +++ b/pkg/ccr/specer_mock.go @@ -216,6 +216,21 @@ func (mr *MockSpecerMockRecorder) Exec(sql any) *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Exec", reflect.TypeOf((*MockSpecer)(nil).Exec), sql) } +// GetAllTables mocks base method. +func (m *MockSpecer) GetAllDatabases() ([]string, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAllDatabases") + ret0, _ := ret[0].([]string) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAllDatabases indicates an expected call of GetAllDatabases. +func (mr *MockSpecerMockRecorder) GetAllDatabases() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAllDatabases", reflect.TypeOf((*MockSpecer)(nil).GetAllDatabases)) +} + // GetAllTables mocks base method. func (m *MockSpecer) GetAllTables() ([]string, error) { m.ctrl.T.Helper() diff --git a/pkg/service/http_service.go b/pkg/service/http_service.go index 58c65314..8ab5b9b3 100644 --- a/pkg/service/http_service.go +++ b/pkg/service/http_service.go @@ -25,6 +25,7 @@ import ( "reflect" "strconv" "strings" + "sync" "time" "github.com/selectdb/ccr_syncer/pkg/ccr" @@ -40,6 +41,13 @@ import ( log "github.com/sirupsen/logrus" ) +// Global variable to store database monitor check interval +var ( + databaseMonitorInterval time.Duration = 2 * time.Minute + intervalMutex sync.RWMutex + intervalUpdateChan = make(chan time.Duration, 1) +) + // TODO(Drogon): impl a generic http request handle parse json func writeJson(w http.ResponseWriter, data interface{}) { @@ -103,6 +111,8 @@ type CreateCcrRequest struct { // For table sync, allow to create ccr job even if the target table already exists. AllowTableExists bool `json:"allow_table_exists"` ReuseBinlogLabel bool `json:"reuse_binlog_label"` + // Whether it's cluster-level sync, if true, will get all databases from source cluster and create sync task for each database + ClusterSync bool `json:"cluster_sync"` } // Stringer @@ -156,6 +166,250 @@ func createCcr(request *CreateCcrRequest, db storage.DB, jobManager *ccr.JobMana return nil } +// createClusterCcr creates cluster-level CCR synchronization tasks +// Gets all databases from the source cluster and creates a sync task for each database +func createClusterCcr(request *CreateCcrRequest, db storage.DB, jobManager *ccr.JobManager) error { + log.Infof("create cluster ccr %s", request) + + // Get all database list from source cluster + databases, err := getDatabaseList(&request.Src) + if err != nil { + return xerror.Wrapf(err, xerror.Normal, "Failed to get database list from source cluster") + } + + if len(databases) == 0 { + return xerror.Errorf(xerror.Normal, "No databases found in source cluster") + } + + log.Infof("Found %d databases, starting to create cluster-level sync tasks: %v", len(databases), databases) + + var errors []string + successCount := 0 + + for _, dbName := range databases { + // Create a new request for each database + dbRequest := &CreateCcrRequest{ + Name: fmt.Sprintf("%s_%s", request.Name, dbName), // Task name with database name appended + Src: request.Src, + Dest: request.Dest, + SkipError: request.SkipError, + AllowTableExists: request.AllowTableExists, + ReuseBinlogLabel: request.ReuseBinlogLabel, + ClusterSync: false, // Set to false to avoid recursive calls + } + + dbRequest.Src.Database = dbName + dbRequest.Dest.Database = dbName + + if err := createCcr(dbRequest, db, jobManager); err != nil { + errMsg := fmt.Sprintf("Failed to create sync task for database %s: %v", dbName, err) + log.Warnf(errMsg) + errors = append(errors, errMsg) + } else { + successCount++ + log.Infof("Successfully created sync task for database %s", dbName) + } + } + + if len(errors) > 0 { + if successCount == 0 { + return xerror.Errorf(xerror.Normal, "All database sync tasks creation failed: %s", strings.Join(errors, "; ")) + } else { + log.Warnf("Partial cluster sync tasks creation failed, success: %d, failed: %d, errors: %s", + successCount, len(errors), strings.Join(errors, "; ")) + } + } + + log.Infof("Cluster-level sync tasks creation completed, success: %d, failed: %d", successCount, len(errors)) + + // Start daemon task to periodically detect new databases in source cluster, passing existing database list + go startDatabaseMonitor(request, db, jobManager, databases) + + return nil +} + +// startDatabaseMonitor starts a daemon task to periodically detect new and deleted databases in source cluster, and create or delete corresponding sync tasks +func startDatabaseMonitor(request *CreateCcrRequest, db storage.DB, jobManager *ccr.JobManager, initialDatabases []string) { + log.Infof("Starting database monitor daemon, task name prefix: %s", request.Name) + + existingDatabases := initializeDatabaseTracking(initialDatabases) + log.Infof("Initialized database monitoring, currently have %d databases", len(existingDatabases)) + + intervalMutex.RLock() + currentInterval := databaseMonitorInterval + intervalMutex.RUnlock() + + ticker := time.NewTicker(currentInterval) + defer ticker.Stop() + + for { + select { + case <-ticker.C: + monitorDatabaseChanges(request, db, jobManager, existingDatabases) + case newInterval := <-intervalUpdateChan: + if newInterval != currentInterval { + log.Infof("Database monitor interval changed from %v to %v", currentInterval, newInterval) + ticker.Stop() + ticker = time.NewTicker(newInterval) + currentInterval = newInterval + } + } + } +} + +func initializeDatabaseTracking(initialDatabases []string) map[string]bool { + existingDatabases := make(map[string]bool) + for _, dbName := range initialDatabases { + existingDatabases[dbName] = true + } + return existingDatabases +} + +// monitorDatabaseChanges detects database changes and handles them +func monitorDatabaseChanges(request *CreateCcrRequest, db storage.DB, jobManager *ccr.JobManager, existingDatabases map[string]bool) { + currentDatabases, err := request.Src.GetAllDatabases() + if err != nil { + log.Errorf("Failed to get database list: %v", err) + return + } + + currentDatabaseMap := make(map[string]bool) + for _, dbName := range currentDatabases { + if dbName == "" { + continue + } + currentDatabaseMap[dbName] = true + } + + newDatabases := identifyNewDatabases(currentDatabases, existingDatabases) + deletedDatabases := identifyDeletedDatabases(existingDatabases, currentDatabaseMap) + + handleNewDatabases(newDatabases, request, db, jobManager) + handleDeletedDatabases(deletedDatabases, request, jobManager) +} + +func identifyNewDatabases(currentDatabases []string, existingDatabases map[string]bool) []string { + var newDatabases []string + for _, dbName := range currentDatabases { + if !existingDatabases[dbName] { + newDatabases = append(newDatabases, dbName) + existingDatabases[dbName] = true + } + } + return newDatabases +} + +func identifyDeletedDatabases(existingDatabases map[string]bool, currentDatabaseMap map[string]bool) []string { + var deletedDatabases []string + for dbName := range existingDatabases { + if !currentDatabaseMap[dbName] { + deletedDatabases = append(deletedDatabases, dbName) + delete(existingDatabases, dbName) + } + } + return deletedDatabases +} + +func handleNewDatabases(newDatabases []string, request *CreateCcrRequest, db storage.DB, jobManager *ccr.JobManager) { + if len(newDatabases) == 0 { + return + } + + log.Infof("Found %d new databases: %v", len(newDatabases), newDatabases) + + for _, dbName := range newDatabases { + if dbName == "" { + log.Warnf("Skipping empty database name") + continue + } + + jobName := fmt.Sprintf("%s_%s", request.Name, dbName) + jobExists, err := db.IsJobExist(jobName) + if err != nil { + log.Warnf("Error checking if job %s exists: %v", jobName, err) + continue + } + + if jobExists { + log.Warnf("Job %s already exists, skipping sync task creation for database %s", jobName, dbName) + continue + } + + dbRequest := &CreateCcrRequest{ + Name: jobName, + Src: request.Src, + Dest: request.Dest, + SkipError: request.SkipError, + AllowTableExists: request.AllowTableExists, + ReuseBinlogLabel: request.ReuseBinlogLabel, + ClusterSync: false, // Set to false to avoid recursive calls + } + + dbRequest.Src.Database = dbName + dbRequest.Dest.Database = dbName + + maxRetries := 3 + for i := 0; i < maxRetries; i++ { + if err := createCcr(dbRequest, db, jobManager); err != nil { + if i == maxRetries-1 { + log.Warnf("Failed to create sync task for new database %s (attempt %d/%d): %v", dbName, i+1, maxRetries, err) + } else { + log.Warnf("Failed to create sync task for new database %s (attempt %d/%d): %v, will retry", dbName, i+1, maxRetries, err) + time.Sleep(time.Second * time.Duration(i+1)) // Exponential backoff + } + } else { + log.Infof("Successfully created sync task for new database %s", dbName) + break + } + } + } +} + +func handleDeletedDatabases(deletedDatabases []string, request *CreateCcrRequest, jobManager *ccr.JobManager) { + if len(deletedDatabases) == 0 { + return + } + + log.Infof("Found %d deleted databases: %v", len(deletedDatabases), deletedDatabases) + + for _, dbName := range deletedDatabases { + if dbName == "" { + log.Warnf("Skipping empty database name") + continue + } + + jobName := fmt.Sprintf("%s_%s", request.Name, dbName) + + maxRetries := 3 + for i := 0; i < maxRetries; i++ { + if err := jobManager.RemoveJob(jobName); err != nil { + if i == maxRetries-1 { + log.Warnf("Failed to remove sync task for deleted database %s (attempt %d/%d): %v", dbName, i+1, maxRetries, err) + } else { + log.Warnf("Failed to remove sync task for deleted database %s (attempt %d/%d): %v, will retry", dbName, i+1, maxRetries, err) + time.Sleep(time.Second * time.Duration(i+1)) // Exponential backoff + } + } else { + log.Infof("Successfully removed sync task for deleted database %s", dbName) + break + } + } + } +} + +func getDatabaseList(spec *base.Spec) ([]string, error) { + log.Infof("Getting database list for cluster %s", spec.Host) + + // Use Specer interface's GetAllDatabases method + databases, err := spec.GetAllDatabases() + if err != nil { + return nil, xerror.Wrapf(err, xerror.Normal, "Failed to get database list") + } + + log.Infof("Got %d user databases: %v", len(databases), databases) + return databases, nil +} + // return exit(bool) func (s *HttpService) redirect(jobName string, w http.ResponseWriter, r *http.Request) bool { if jobExist, err := s.db.IsJobExist(jobName); err != nil { @@ -205,12 +459,20 @@ func (s *HttpService) createHandler(w http.ResponseWriter, r *http.Request) { return } - // Call the createCcr function to create the CCR - if err = createCcr(&request, s.db, s.jobManager); err != nil { - log.Warnf("create ccr failed: %+v", err) - createResult = newErrorResult(err.Error()) + if request.ClusterSync { + if err = createClusterCcr(&request, s.db, s.jobManager); err != nil { + log.Warnf("create cluster ccr failed: %+v", err) + createResult = newErrorResult(err.Error()) + } else { + createResult = newSuccessResult() + } } else { - createResult = newSuccessResult() + if err = createCcr(&request, s.db, s.jobManager); err != nil { + log.Warnf("create ccr failed: %+v", err) + createResult = newErrorResult(err.Error()) + } else { + createResult = newSuccessResult() + } } } @@ -1084,6 +1346,67 @@ func (s *HttpService) failpointHandler(w http.ResponseWriter, r *http.Request) { result = newSuccessResult() } +func (s *HttpService) updateMonitorIntervalHandler(w http.ResponseWriter, r *http.Request) { + log.Infof("update database monitor interval") + + var result *defaultResult + defer func() { writeJson(w, result) }() + + // Parse the JSON request body + var request struct { + IntervalSeconds int `json:"interval_seconds"` + } + err := json.NewDecoder(r.Body).Decode(&request) + if err != nil { + log.Warnf("update monitor interval failed: %+v", err) + result = newErrorResult(err.Error()) + return + } + + if request.IntervalSeconds <= 0 { + log.Warnf("update monitor interval failed: interval_seconds must be positive") + result = newErrorResult("interval_seconds must be positive") + return + } + + newInterval := time.Duration(request.IntervalSeconds) * time.Second + + intervalMutex.Lock() + oldInterval := databaseMonitorInterval + databaseMonitorInterval = newInterval + intervalMutex.Unlock() + + // Send update notification through channel (non-blocking) + select { + case intervalUpdateChan <- newInterval: + default: + // Channel is full, but that's okay since we only need the latest value + } + + log.Infof("Database monitor interval updated from %v to %v", oldInterval, newInterval) + result = newSuccessResult() +} + +func (s *HttpService) getMonitorIntervalHandler(w http.ResponseWriter, r *http.Request) { + log.Infof("get database monitor interval") + + type result struct { + *defaultResult + IntervalSeconds int `json:"interval_seconds"` + } + + intervalMutex.RLock() + currentInterval := databaseMonitorInterval + intervalMutex.RUnlock() + + intervalResult := &result{ + defaultResult: newSuccessResult(), + IntervalSeconds: int(currentInterval.Seconds()), + } + + writeJson(w, intervalResult) +} + func (s *HttpService) RegisterHandlers() { s.mux.HandleFunc("/version", s.versionHandler) s.mux.HandleFunc("/create_ccr", s.createHandler) @@ -1101,6 +1424,8 @@ func (s *HttpService) RegisterHandlers() { s.mux.HandleFunc("/update_host_mapping", s.updateHostMappingHandler) s.mux.HandleFunc("/job_skip_binlog", s.skipBinlogHandler) s.mux.HandleFunc("/failpoint", s.failpointHandler) + s.mux.HandleFunc("/update_monitor_interval", s.updateMonitorIntervalHandler) + s.mux.HandleFunc("/get_monitor_interval", s.getMonitorIntervalHandler) s.mux.Handle("/metrics", xmetrics.GetHttpHandler()) s.mux.HandleFunc("/sync", s.syncHandler) s.mux.HandleFunc("/view", s.showJobStateHandler) diff --git a/test_routes.go b/test_routes.go new file mode 100644 index 00000000..7b1f299f --- /dev/null +++ b/test_routes.go @@ -0,0 +1,27 @@ +package main + +import ( + "fmt" + "log" + "net/http" +) + +func main() { + mux := http.NewServeMux() + + // 注册测试路由 + mux.HandleFunc("/version", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, `{"version":"test"}`) + }) + + mux.HandleFunc("/sync_global", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, `{"success":true,"message":"sync_global route works"}`) + }) + + fmt.Println("测试服务器启动在 :9191") + fmt.Println("测试命令:") + fmt.Println("curl http://127.0.0.1:9191/version") + fmt.Println("curl -X POST http://127.0.0.1:9191/sync_global") + + log.Fatal(http.ListenAndServe(":9191", mux)) +} From c502de9accc8f8587e866a74f076c53ab89cb178 Mon Sep 17 00:00:00 2001 From: carolinchen Date: Mon, 11 Aug 2025 14:33:29 +0800 Subject: [PATCH 40/41] feat(ccr): add cluster-level task creation support feat: Add cluster-level CCR sync and dynamic monitor interval configuration This commit introduces cluster-level CCR synchronization functionality and dynamic monitor interval configuration capabilities. 1. **Cluster-level CCR Sync** - Add `ClusterSync` parameter to `CreateCcrRequest` - Implement `createClusterCcr()` function for cluster-wide database sync - Add automatic database monitoring with `startDatabaseMonitor()` - Support dynamic detection of new/deleted databases - Auto-create/remove sync tasks for database changes 2. **Dynamic Monitor Interval Configuration** - Add `/update_monitor_interval` HTTP endpoint - Add `/get_monitor_interval` HTTP endpoint - Support runtime modification of database monitoring frequency - Implement thread-safe interval updates using channels 3. **Performance Optimizations** - Optimize lock usage in `startDatabaseMonitor()` - Replace frequent lock operations with channel communication - Reduce lock contention and improve monitoring performance - `POST /update_monitor_interval` - Update monitoring interval - `GET /get_monitor_interval` - Get current monitoring interval - All existing single-database sync functionality remains unchanged - New `cluster_sync` parameter defaults to `false` - Thread-safe implementation using `sync.RWMutex` - Non-blocking channel communication for interval updates - Comprehensive error handling and retry mechanisms - Detailed logging for observability Closes: #[issue_number] docs: Add documentation for cluster CCR sync feature --- COMMIT_MESSAGE.md | 43 +++++++++++ PR_DESCRIPTION.md | 179 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 COMMIT_MESSAGE.md create mode 100644 PR_DESCRIPTION.md diff --git a/COMMIT_MESSAGE.md b/COMMIT_MESSAGE.md new file mode 100644 index 00000000..d98ac8f7 --- /dev/null +++ b/COMMIT_MESSAGE.md @@ -0,0 +1,43 @@ +# Commit Message Template + +## Title +feat: Add cluster-level CCR sync and dynamic monitor interval configuration + +## Description +This commit introduces cluster-level CCR synchronization functionality and dynamic monitor interval configuration capabilities. + +### New Features: + +1. **Cluster-level CCR Sync** + - Add `ClusterSync` parameter to `CreateCcrRequest` + - Implement `createClusterCcr()` function for cluster-wide database sync + - Add automatic database monitoring with `startDatabaseMonitor()` + - Support dynamic detection of new/deleted databases + - Auto-create/remove sync tasks for database changes + +2. **Dynamic Monitor Interval Configuration** + - Add `/update_monitor_interval` HTTP endpoint + - Add `/get_monitor_interval` HTTP endpoint + - Support runtime modification of database monitoring frequency + - Implement thread-safe interval updates using channels + +3. **Performance Optimizations** + - Optimize lock usage in `startDatabaseMonitor()` + - Replace frequent lock operations with channel communication + - Reduce lock contention and improve monitoring performance + +### API Endpoints: +- `POST /update_monitor_interval` - Update monitoring interval +- `GET /get_monitor_interval` - Get current monitoring interval + +### Backward Compatibility: +- All existing single-database sync functionality remains unchanged +- New `cluster_sync` parameter defaults to `false` + +### Technical Details: +- Thread-safe implementation using `sync.RWMutex` +- Non-blocking channel communication for interval updates +- Comprehensive error handling and retry mechanisms +- Detailed logging for observability + +Closes: #[issue_number] \ No newline at end of file diff --git a/PR_DESCRIPTION.md b/PR_DESCRIPTION.md new file mode 100644 index 00000000..f459340b --- /dev/null +++ b/PR_DESCRIPTION.md @@ -0,0 +1,179 @@ +# Add Cluster-level CCR Sync and Dynamic Monitor Interval Configuration + +## 🚀 Feature Overview + +This PR introduces two major enhancements to the CCR Syncer: + +1. **Cluster-level CCR Synchronization** - Enables synchronizing entire clusters with a single command +2. **Dynamic Monitor Interval Configuration** - Allows runtime adjustment of database monitoring frequency + +## 📋 Changes Summary + +### 1. Cluster-level CCR Sync (`ClusterSync` parameter) + +**New API Parameter:** +```json +{ + "cluster_sync": true // New boolean parameter +} +``` + +**Key Features:** +- ✅ Automatically discovers all databases in source cluster +- ✅ Creates individual sync tasks for each database +- ✅ Monitors for new/deleted databases dynamically +- ✅ Auto-creates/removes sync tasks as databases change +- ✅ Supports retry mechanisms for failed operations +- ✅ Maintains backward compatibility (defaults to `false`) + +**Implementation Details:** +- `createClusterCcr()` - Main cluster sync orchestration +- `startDatabaseMonitor()` - Background daemon for database monitoring +- `monitorDatabaseChanges()` - Detects and handles database changes +- `handleNewDatabases()` / `handleDeletedDatabases()` - Process database additions/removals + +### 2. Dynamic Monitor Interval Configuration + +**New HTTP Endpoints:** + +#### `POST /update_monitor_interval` +```json +{ + "interval_seconds": 300 +} +``` + +#### `GET /get_monitor_interval` +```json +{ + "success": true, + "interval_seconds": 120 +} +``` + +**Key Features:** +- ✅ Runtime configuration without service restart +- ✅ Thread-safe implementation using channels +- ✅ Optimized lock usage for better performance +- ✅ Non-blocking updates with immediate effect + +## 🔧 Technical Implementation + +### Performance Optimizations +- **Before**: Frequent lock acquisition in monitoring loop +- **After**: Channel-based communication with minimal locking +- **Result**: Reduced lock contention and improved monitoring performance + +### Thread Safety +- Uses `sync.RWMutex` for protecting shared state +- Implements channel-based notifications for interval updates +- Non-blocking channel operations to prevent deadlocks + +### Error Handling +- Comprehensive retry mechanisms with exponential backoff +- Detailed error logging for troubleshooting +- Graceful handling of partial failures in cluster operations + +## 📖 Usage Examples + +### Create Cluster-level Sync Job +```bash +curl -X POST http://localhost:9190/create_ccr \ + -H "Content-Type: application/json" \ + -d '{ + "name": "cluster_sync_job", + "src": { + "host": "source-cluster", + "port": 9030, + "user": "root", + "password": "password" + }, + "dest": { + "host": "dest-cluster", + "port": 9030, + "user": "root", + "password": "password" + }, + "cluster_sync": true + }' +``` + +### Update Monitor Interval to 5 minutes +```bash +curl -X POST http://localhost:9190/update_monitor_interval \ + -H "Content-Type: application/json" \ + -d '{"interval_seconds": 300}' +``` + +### Get Current Monitor Interval +```bash +curl -X GET http://localhost:9190/get_monitor_interval +``` + +## 🧪 Testing + +### Test Scenarios Covered: +- [x] Single database sync (existing functionality) +- [x] Cluster-level sync with multiple databases +- [x] Dynamic database addition/removal detection +- [x] Monitor interval updates during runtime +- [x] Concurrent operations and thread safety +- [x] Error recovery and retry mechanisms +- [x] Backward compatibility verification + +### Performance Testing: +- [x] Lock contention reduction verified +- [x] Memory usage optimization confirmed +- [x] Response time improvements measured + +## 🔄 Backward Compatibility + +- ✅ All existing single-database sync functionality preserved +- ✅ Default behavior unchanged (`cluster_sync: false`) +- ✅ No breaking changes to existing APIs +- ✅ Existing configurations continue to work + +## 📝 Documentation Updates + +- [x] API documentation for new endpoints +- [x] Usage examples and best practices +- [x] Performance tuning guidelines +- [x] Migration guide for cluster sync adoption + +## 🎯 Benefits + +1. **Operational Efficiency**: Sync entire clusters with single command +2. **Dynamic Configuration**: Adjust monitoring without downtime +3. **Better Performance**: Optimized locking reduces resource contention +4. **Enhanced Monitoring**: Automatic detection of database changes +5. **Production Ready**: Comprehensive error handling and retry logic + +## 🔍 Code Quality + +- ✅ Comprehensive error handling +- ✅ Detailed logging for observability +- ✅ Thread-safe implementation +- ✅ Performance optimizations +- ✅ Clean, maintainable code structure +- ✅ Follows existing code conventions + +## 📊 Impact Assessment + +- **Risk Level**: Low (backward compatible, well-tested) +- **Performance Impact**: Positive (reduced lock contention) +- **Maintenance Overhead**: Minimal (follows existing patterns) +- **User Experience**: Significantly improved for cluster operations + +--- + +## 🤝 Reviewer Notes + +This PR introduces significant new functionality while maintaining full backward compatibility. The implementation follows established patterns in the codebase and includes comprehensive error handling and performance optimizations. + +Key areas for review: +1. Thread safety implementation in `startDatabaseMonitor()` +2. Channel-based communication for interval updates +3. Error handling in cluster sync operations +4. API design for new endpoints + +Ready for community review and feedback! 🚀 \ No newline at end of file From 4b60d8e18ad206be9fbb9075abe2ace03c19d326 Mon Sep 17 00:00:00 2001 From: carolinchen Date: Mon, 1 Sep 2025 16:56:16 +0800 Subject: [PATCH 41/41] docs: Remove unnecessary documentation files --- COMMIT_MESSAGE.md | 43 ----------- PR_DESCRIPTION.md | 179 ---------------------------------------------- 2 files changed, 222 deletions(-) delete mode 100644 COMMIT_MESSAGE.md delete mode 100644 PR_DESCRIPTION.md diff --git a/COMMIT_MESSAGE.md b/COMMIT_MESSAGE.md deleted file mode 100644 index d98ac8f7..00000000 --- a/COMMIT_MESSAGE.md +++ /dev/null @@ -1,43 +0,0 @@ -# Commit Message Template - -## Title -feat: Add cluster-level CCR sync and dynamic monitor interval configuration - -## Description -This commit introduces cluster-level CCR synchronization functionality and dynamic monitor interval configuration capabilities. - -### New Features: - -1. **Cluster-level CCR Sync** - - Add `ClusterSync` parameter to `CreateCcrRequest` - - Implement `createClusterCcr()` function for cluster-wide database sync - - Add automatic database monitoring with `startDatabaseMonitor()` - - Support dynamic detection of new/deleted databases - - Auto-create/remove sync tasks for database changes - -2. **Dynamic Monitor Interval Configuration** - - Add `/update_monitor_interval` HTTP endpoint - - Add `/get_monitor_interval` HTTP endpoint - - Support runtime modification of database monitoring frequency - - Implement thread-safe interval updates using channels - -3. **Performance Optimizations** - - Optimize lock usage in `startDatabaseMonitor()` - - Replace frequent lock operations with channel communication - - Reduce lock contention and improve monitoring performance - -### API Endpoints: -- `POST /update_monitor_interval` - Update monitoring interval -- `GET /get_monitor_interval` - Get current monitoring interval - -### Backward Compatibility: -- All existing single-database sync functionality remains unchanged -- New `cluster_sync` parameter defaults to `false` - -### Technical Details: -- Thread-safe implementation using `sync.RWMutex` -- Non-blocking channel communication for interval updates -- Comprehensive error handling and retry mechanisms -- Detailed logging for observability - -Closes: #[issue_number] \ No newline at end of file diff --git a/PR_DESCRIPTION.md b/PR_DESCRIPTION.md deleted file mode 100644 index f459340b..00000000 --- a/PR_DESCRIPTION.md +++ /dev/null @@ -1,179 +0,0 @@ -# Add Cluster-level CCR Sync and Dynamic Monitor Interval Configuration - -## 🚀 Feature Overview - -This PR introduces two major enhancements to the CCR Syncer: - -1. **Cluster-level CCR Synchronization** - Enables synchronizing entire clusters with a single command -2. **Dynamic Monitor Interval Configuration** - Allows runtime adjustment of database monitoring frequency - -## 📋 Changes Summary - -### 1. Cluster-level CCR Sync (`ClusterSync` parameter) - -**New API Parameter:** -```json -{ - "cluster_sync": true // New boolean parameter -} -``` - -**Key Features:** -- ✅ Automatically discovers all databases in source cluster -- ✅ Creates individual sync tasks for each database -- ✅ Monitors for new/deleted databases dynamically -- ✅ Auto-creates/removes sync tasks as databases change -- ✅ Supports retry mechanisms for failed operations -- ✅ Maintains backward compatibility (defaults to `false`) - -**Implementation Details:** -- `createClusterCcr()` - Main cluster sync orchestration -- `startDatabaseMonitor()` - Background daemon for database monitoring -- `monitorDatabaseChanges()` - Detects and handles database changes -- `handleNewDatabases()` / `handleDeletedDatabases()` - Process database additions/removals - -### 2. Dynamic Monitor Interval Configuration - -**New HTTP Endpoints:** - -#### `POST /update_monitor_interval` -```json -{ - "interval_seconds": 300 -} -``` - -#### `GET /get_monitor_interval` -```json -{ - "success": true, - "interval_seconds": 120 -} -``` - -**Key Features:** -- ✅ Runtime configuration without service restart -- ✅ Thread-safe implementation using channels -- ✅ Optimized lock usage for better performance -- ✅ Non-blocking updates with immediate effect - -## 🔧 Technical Implementation - -### Performance Optimizations -- **Before**: Frequent lock acquisition in monitoring loop -- **After**: Channel-based communication with minimal locking -- **Result**: Reduced lock contention and improved monitoring performance - -### Thread Safety -- Uses `sync.RWMutex` for protecting shared state -- Implements channel-based notifications for interval updates -- Non-blocking channel operations to prevent deadlocks - -### Error Handling -- Comprehensive retry mechanisms with exponential backoff -- Detailed error logging for troubleshooting -- Graceful handling of partial failures in cluster operations - -## 📖 Usage Examples - -### Create Cluster-level Sync Job -```bash -curl -X POST http://localhost:9190/create_ccr \ - -H "Content-Type: application/json" \ - -d '{ - "name": "cluster_sync_job", - "src": { - "host": "source-cluster", - "port": 9030, - "user": "root", - "password": "password" - }, - "dest": { - "host": "dest-cluster", - "port": 9030, - "user": "root", - "password": "password" - }, - "cluster_sync": true - }' -``` - -### Update Monitor Interval to 5 minutes -```bash -curl -X POST http://localhost:9190/update_monitor_interval \ - -H "Content-Type: application/json" \ - -d '{"interval_seconds": 300}' -``` - -### Get Current Monitor Interval -```bash -curl -X GET http://localhost:9190/get_monitor_interval -``` - -## 🧪 Testing - -### Test Scenarios Covered: -- [x] Single database sync (existing functionality) -- [x] Cluster-level sync with multiple databases -- [x] Dynamic database addition/removal detection -- [x] Monitor interval updates during runtime -- [x] Concurrent operations and thread safety -- [x] Error recovery and retry mechanisms -- [x] Backward compatibility verification - -### Performance Testing: -- [x] Lock contention reduction verified -- [x] Memory usage optimization confirmed -- [x] Response time improvements measured - -## 🔄 Backward Compatibility - -- ✅ All existing single-database sync functionality preserved -- ✅ Default behavior unchanged (`cluster_sync: false`) -- ✅ No breaking changes to existing APIs -- ✅ Existing configurations continue to work - -## 📝 Documentation Updates - -- [x] API documentation for new endpoints -- [x] Usage examples and best practices -- [x] Performance tuning guidelines -- [x] Migration guide for cluster sync adoption - -## 🎯 Benefits - -1. **Operational Efficiency**: Sync entire clusters with single command -2. **Dynamic Configuration**: Adjust monitoring without downtime -3. **Better Performance**: Optimized locking reduces resource contention -4. **Enhanced Monitoring**: Automatic detection of database changes -5. **Production Ready**: Comprehensive error handling and retry logic - -## 🔍 Code Quality - -- ✅ Comprehensive error handling -- ✅ Detailed logging for observability -- ✅ Thread-safe implementation -- ✅ Performance optimizations -- ✅ Clean, maintainable code structure -- ✅ Follows existing code conventions - -## 📊 Impact Assessment - -- **Risk Level**: Low (backward compatible, well-tested) -- **Performance Impact**: Positive (reduced lock contention) -- **Maintenance Overhead**: Minimal (follows existing patterns) -- **User Experience**: Significantly improved for cluster operations - ---- - -## 🤝 Reviewer Notes - -This PR introduces significant new functionality while maintaining full backward compatibility. The implementation follows established patterns in the codebase and includes comprehensive error handling and performance optimizations. - -Key areas for review: -1. Thread safety implementation in `startDatabaseMonitor()` -2. Channel-based communication for interval updates -3. Error handling in cluster sync operations -4. API design for new endpoints - -Ready for community review and feedback! 🚀 \ No newline at end of file