diff --git a/.github/workflows/build-cloudberry.yml b/.github/workflows/build-cloudberry.yml index adb57fb85ec..8484331998f 100644 --- a/.github/workflows/build-cloudberry.yml +++ b/.github/workflows/build-cloudberry.yml @@ -271,6 +271,10 @@ jobs: }, "enable_core_check":false }, + {"test":"gpcontrib-yagp-hooks-collector", + "make_configs":["gpcontrib/yagp_hooks_collector:installcheck"], + "extension":"yagp_hooks_collector" + }, {"test":"ic-expandshrink", "make_configs":["src/test/isolation2:installcheck-expandshrink"] }, @@ -535,10 +539,11 @@ jobs: if: needs.check-skip.outputs.should_skip != 'true' env: SRC_DIR: ${{ github.workspace }} + CONFIGURE_EXTRA_OPTS: --with-yagp-hooks-collector run: | set -eo pipefail chmod +x "${SRC_DIR}"/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh - if ! time su - gpadmin -c "cd ${SRC_DIR} && SRC_DIR=${SRC_DIR} ENABLE_DEBUG=${{ env.ENABLE_DEBUG }} ${SRC_DIR}/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh"; then + if ! time su - gpadmin -c "cd ${SRC_DIR} && SRC_DIR=${SRC_DIR} ENABLE_DEBUG=${{ env.ENABLE_DEBUG }} CONFIGURE_EXTRA_OPTS=${{ env.CONFIGURE_EXTRA_OPTS }} ${SRC_DIR}/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh"; then echo "::error::Configure script failed" exit 1 fi @@ -1403,6 +1408,7 @@ jobs: if: success() && needs.check-skip.outputs.should_skip != 'true' env: SRC_DIR: ${{ github.workspace }} + BUILD_DESTINATION: /usr/local/cloudberry-db shell: bash {0} run: | set -o pipefail @@ -1432,6 +1438,30 @@ jobs: PG_OPTS="$PG_OPTS -c optimizer=${{ matrix.pg_settings.optimizer }}" fi + # Create extension if required + if [[ "${{ matrix.extension != '' }}" == "true" ]]; then + case "${{ matrix.extension }}" in + yagp_hooks_collector) + if ! su - gpadmin -c "source ${BUILD_DESTINATION}/cloudberry-env.sh && \ + source ${SRC_DIR}/gpAux/gpdemo/gpdemo-env.sh && \ + gpconfig -c shared_preload_libraries -v 'yagp_hooks_collector' && \ + gpstop -ra && \ + echo 'CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; \ + SHOW shared_preload_libraries; \ + TABLE pg_extension;' | \ + psql postgres" + then + echo "Error creating yagp_hooks_collector extension" + exit 1 + fi + ;; + *) + echo "Unknown extension: ${{ matrix.extension }}" + exit 1 + ;; + esac + fi + if [[ "${{ matrix.pg_settings.default_table_access_method != '' }}" == "true" ]]; then PG_OPTS="$PG_OPTS -c default_table_access_method=${{ matrix.pg_settings.default_table_access_method }}" fi diff --git a/.gitignore b/.gitignore index 5c21989c4ab..29b40ee096c 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,9 @@ lib*.pc /compile_commands.json /tmp_install/ /.cache/ -/install/ \ No newline at end of file +/install/ +*.o +*.so +src/protos/ +.vscode +compile_commands.json diff --git a/Makefile b/Makefile index e9ab3fbf2d4..15c5dabb70e 100644 --- a/Makefile +++ b/Makefile @@ -3,14 +3,12 @@ # to build Postgres with a different make, we have this make file # that, as a service, will look for a GNU make and invoke it, or show # an error message if none could be found. - # If the user were using GNU make now, this file would not get used # because GNU make uses a make file named "GNUmakefile" in preference # to "Makefile" if it exists. PostgreSQL is shipped with a # "GNUmakefile". If the user hasn't run the configure script yet, the # GNUmakefile won't exist yet, so we catch that case as well. - # AIX make defaults to building *every* target of the first rule. Start with # a single-target, empty rule to make the other targets non-default. all: diff --git a/configure b/configure index c9ce3d46302..598114a4b7f 100755 --- a/configure +++ b/configure @@ -722,6 +722,7 @@ with_apr_config with_libcurl with_rt with_zstd +with_yagp_hooks_collector with_libbz2 LZ4_LIBS LZ4_CFLAGS @@ -942,6 +943,7 @@ with_zlib with_lz4 with_libbz2 with_zstd +with_yagp_hooks_collector with_rt with_libcurl with_apr_config @@ -11150,6 +11152,32 @@ $as_echo "yes" >&6; } fi fi +# +# yagp_hooks_collector +# + + + +# Check whether --with-yagp-hooks-collector was given. +if test "${with_yagp_hooks_collector+set}" = set; then : + withval=$with_yagp_hooks_collector; + case $withval in + yes) + : + ;; + no) + : + ;; + *) + as_fn_error $? "no argument expected for --with-yagp-hooks-collector option" "$LINENO" 5 + ;; + esac + +else + with_yagp_hooks_collector=no + +fi + # # Realtime library # diff --git a/configure.ac b/configure.ac index 246edc4846e..792878fde4b 100644 --- a/configure.ac +++ b/configure.ac @@ -1365,6 +1365,13 @@ PGAC_ARG_BOOL(with, zstd, yes, [do not build with Zstandard], AC_MSG_RESULT([$with_zstd]) AC_SUBST(with_zstd) +# +# yagp_hooks_collector +# +PGAC_ARG_BOOL(with, yagp_hooks_collector, no, + [build with YAGP hooks collector extension]) +AC_SUBST(with_yagp_hooks_collector) + if test "$with_zstd" = yes; then dnl zstd_errors.h was renamed from error_public.h in v1.4.0 PKG_CHECK_MODULES([ZSTD], [libzstd >= 1.4.0]) diff --git a/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh b/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh index 32a9f3d8657..3c6377f763b 100755 --- a/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh +++ b/devops/build/automation/cloudberry/scripts/configure-cloudberry.sh @@ -53,6 +53,7 @@ # # Optional Environment Variables: # LOG_DIR - Directory for logs (defaults to ${SRC_DIR}/build-logs) +# CONFIGURE_EXTRA_OPTS - Args to pass to configure command # ENABLE_DEBUG - Enable debug build options (true/false, defaults to # false) # @@ -177,7 +178,8 @@ execute_cmd ./configure --prefix=${BUILD_DESTINATION} \ --with-uuid=e2fs \ ${CONFIGURE_MDBLOCALES_OPTS} \ --with-includes=/usr/local/xerces-c/include \ - --with-libraries=${BUILD_DESTINATION}/lib || exit 4 + --with-libraries=${BUILD_DESTINATION}/lib \ + ${CONFIGURE_EXTRA_OPTS:-""} || exit 4 log_section_end "Configure" # Capture version information diff --git a/gpcontrib/Makefile b/gpcontrib/Makefile index 8d95a14f876..8b98dc9142c 100644 --- a/gpcontrib/Makefile +++ b/gpcontrib/Makefile @@ -35,6 +35,9 @@ else diskquota endif +ifeq "$(with_yagp_hooks_collector)" "yes" + recurse_targets += yagp_hooks_collector +endif ifeq "$(with_zstd)" "yes" recurse_targets += zstd endif diff --git a/gpcontrib/yagp_hooks_collector/.clang-format b/gpcontrib/yagp_hooks_collector/.clang-format new file mode 100644 index 00000000000..99130575c9a --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/.clang-format @@ -0,0 +1,2 @@ +BasedOnStyle: LLVM +SortIncludes: false diff --git a/gpcontrib/yagp_hooks_collector/Makefile b/gpcontrib/yagp_hooks_collector/Makefile new file mode 100644 index 00000000000..49825c55f35 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/Makefile @@ -0,0 +1,41 @@ +MODULE_big = yagp_hooks_collector +EXTENSION = yagp_hooks_collector +DATA = $(wildcard *--*.sql) +REGRESS = yagp_cursors yagp_dist yagp_select yagp_utf8_trim yagp_utility yagp_guc_cache yagp_uds yagp_locale + +PROTO_BASES = yagpcc_plan yagpcc_metrics yagpcc_set_service +PROTO_OBJS = $(patsubst %,src/protos/%.pb.o,$(PROTO_BASES)) + +C_OBJS = $(patsubst %.c,%.o,$(wildcard src/*.c src/*/*.c)) +CPP_OBJS = $(patsubst %.cpp,%.o,$(wildcard src/*.cpp src/*/*.cpp)) +OBJS = $(C_OBJS) $(CPP_OBJS) $(PROTO_OBJS) + +override CXXFLAGS = -Werror -fPIC -g3 -Wall -Wpointer-arith -Wendif-labels \ + -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv \ + -Wno-unused-but-set-variable -Wno-address -Wno-format-truncation \ + -Wno-stringop-truncation -g -ggdb -std=c++17 -Iinclude -Isrc/protos -Isrc -DGPBUILD + +PG_CXXFLAGS += -Isrc -Iinclude +SHLIB_LINK += -lprotobuf -lpthread -lstdc++ +EXTRA_CLEAN = src/protos + +ifdef USE_PGXS +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) +else +subdir = gpcontrib/yagp_hooks_collector +top_builddir = ../.. +include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif + +src/protos/%.pb.cpp src/protos/%.pb.h: protos/%.proto + @mkdir -p src/protos + sed -i 's/optional //g' $^ + sed -i 's|cloud/mdb/yagpcc/api/proto/common/|protos/|g' $^ + protoc -I /usr/include -I /usr/local/include -I . --cpp_out=src $^ + mv src/protos/$*.pb.cc src/protos/$*.pb.cpp + +$(CPP_OBJS): src/protos/yagpcc_metrics.pb.h src/protos/yagpcc_plan.pb.h src/protos/yagpcc_set_service.pb.h +src/protos/yagpcc_set_service.pb.o: src/protos/yagpcc_metrics.pb.h diff --git a/gpcontrib/yagp_hooks_collector/README.md b/gpcontrib/yagp_hooks_collector/README.md new file mode 100644 index 00000000000..9f465a190cb --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/README.md @@ -0,0 +1,28 @@ +## YAGP Hooks Collector + +An extension for collecting greenplum query execution metrics and reporting them to an external agent. + +### Collected Statistics + +#### 1. Query Lifecycle +- **What:** Captures query text, normalized query text, timestamps (submit, start, end, done), and user/database info. +- **GUC:** `yagpcc.enable`. + +#### 2. `EXPLAIN` data +- **What:** Triggers generation of the `EXPLAIN (TEXT, COSTS, VERBOSE)` and captures it. +- **GUC:** `yagpcc.enable`. + +#### 3. `EXPLAIN ANALYZE` data +- **What:** Triggers generation of the `EXPLAIN (TEXT, ANALYZE, BUFFERS, TIMING, VERBOSE)` and captures it. +- **GUCs:** `yagpcc.enable`, `yagpcc.min_analyze_time`, `yagpcc.enable_cdbstats`(ANALYZE), `yagpcc.enable_analyze`(BUFFERS, TIMING, VERBOSE). + +#### 4. Other Metrics +- **What:** Captures Instrument, Greenplum, System, Network, Interconnect, Spill metrics. +- **GUC:** `yagpcc.enable`. + +### General Configuration +- **Nested Queries:** When `yagpcc.report_nested_queries` is `false`, only top-level queries are reported from the coordinator and segments, when `true`, both top-level and nested queries are reported from the coordinator, from segments collected as aggregates. +- **Data Destination:** All collected data is sent to a Unix Domain Socket. Configure the path with `yagpcc.uds_path`. +- **User Filtering:** To exclude activity from certain roles, add them to the comma-separated list in `yagpcc.ignored_users_list`. +- **Trimming plans:** Query texts and execution plans are trimmed based on `yagpcc.max_text_size` and `yagpcc.max_plan_size` (default: 1024KB). For now, it is not recommended to set these GUCs higher than 1024KB. +- **Analyze collection:** Analyze is sent if execution time exceeds `yagpcc.min_analyze_time`, which is 10 seconds by default. Analyze is collected if `yagpcc.enable_analyze` is true. diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_cursors.out b/gpcontrib/yagp_hooks_collector/expected/yagp_cursors.out new file mode 100644 index 00000000000..df12e3e1b66 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_cursors.out @@ -0,0 +1,163 @@ +CREATE EXTENSION yagp_hooks_collector; +CREATE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; +-- DECLARE +SET yagpcc.logging_mode to 'TBL'; +BEGIN; +DECLARE cursor_stats_0 CURSOR FOR SELECT 0; +CLOSE cursor_stats_0; +COMMIT; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+---------------------------------------------+--------------------- + -1 | BEGIN; | QUERY_STATUS_SUBMIT + -1 | BEGIN; | QUERY_STATUS_DONE + -1 | DECLARE cursor_stats_0 CURSOR FOR SELECT 0; | QUERY_STATUS_SUBMIT + -1 | DECLARE cursor_stats_0 CURSOR FOR SELECT 0; | QUERY_STATUS_DONE + -1 | CLOSE cursor_stats_0; | QUERY_STATUS_SUBMIT + -1 | CLOSE cursor_stats_0; | QUERY_STATUS_DONE + -1 | COMMIT; | QUERY_STATUS_SUBMIT + -1 | COMMIT; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(10 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- DECLARE WITH HOLD +SET yagpcc.logging_mode to 'TBL'; +BEGIN; +DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 1; +CLOSE cursor_stats_1; +DECLARE cursor_stats_2 CURSOR WITH HOLD FOR SELECT 2; +CLOSE cursor_stats_2; +COMMIT; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+-------------------------------------------------------+--------------------- + -1 | BEGIN; | QUERY_STATUS_SUBMIT + -1 | BEGIN; | QUERY_STATUS_DONE + -1 | DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 1; | QUERY_STATUS_SUBMIT + -1 | DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 1; | QUERY_STATUS_DONE + -1 | CLOSE cursor_stats_1; | QUERY_STATUS_SUBMIT + -1 | CLOSE cursor_stats_1; | QUERY_STATUS_DONE + -1 | DECLARE cursor_stats_2 CURSOR WITH HOLD FOR SELECT 2; | QUERY_STATUS_SUBMIT + -1 | DECLARE cursor_stats_2 CURSOR WITH HOLD FOR SELECT 2; | QUERY_STATUS_DONE + -1 | CLOSE cursor_stats_2; | QUERY_STATUS_SUBMIT + -1 | CLOSE cursor_stats_2; | QUERY_STATUS_DONE + -1 | COMMIT; | QUERY_STATUS_SUBMIT + -1 | COMMIT; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(14 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- ROLLBACK +SET yagpcc.logging_mode to 'TBL'; +BEGIN; +DECLARE cursor_stats_3 CURSOR FOR SELECT 1; +CLOSE cursor_stats_3; +DECLARE cursor_stats_4 CURSOR FOR SELECT 1; +ROLLBACK; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+---------------------------------------------+--------------------- + -1 | BEGIN; | QUERY_STATUS_SUBMIT + -1 | BEGIN; | QUERY_STATUS_DONE + -1 | DECLARE cursor_stats_3 CURSOR FOR SELECT 1; | QUERY_STATUS_SUBMIT + -1 | DECLARE cursor_stats_3 CURSOR FOR SELECT 1; | QUERY_STATUS_DONE + -1 | CLOSE cursor_stats_3; | QUERY_STATUS_SUBMIT + -1 | CLOSE cursor_stats_3; | QUERY_STATUS_DONE + -1 | DECLARE cursor_stats_4 CURSOR FOR SELECT 1; | QUERY_STATUS_SUBMIT + -1 | DECLARE cursor_stats_4 CURSOR FOR SELECT 1; | QUERY_STATUS_DONE + -1 | ROLLBACK; | QUERY_STATUS_SUBMIT + -1 | ROLLBACK; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(12 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- FETCH +SET yagpcc.logging_mode to 'TBL'; +BEGIN; +DECLARE cursor_stats_5 CURSOR WITH HOLD FOR SELECT 2; +DECLARE cursor_stats_6 CURSOR WITH HOLD FOR SELECT 3; +FETCH 1 IN cursor_stats_5; + ?column? +---------- + 2 +(1 row) + +FETCH 1 IN cursor_stats_6; + ?column? +---------- + 3 +(1 row) + +CLOSE cursor_stats_5; +CLOSE cursor_stats_6; +COMMIT; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+-------------------------------------------------------+--------------------- + -1 | BEGIN; | QUERY_STATUS_SUBMIT + -1 | BEGIN; | QUERY_STATUS_DONE + -1 | DECLARE cursor_stats_5 CURSOR WITH HOLD FOR SELECT 2; | QUERY_STATUS_SUBMIT + -1 | DECLARE cursor_stats_5 CURSOR WITH HOLD FOR SELECT 2; | QUERY_STATUS_DONE + -1 | DECLARE cursor_stats_6 CURSOR WITH HOLD FOR SELECT 3; | QUERY_STATUS_SUBMIT + -1 | DECLARE cursor_stats_6 CURSOR WITH HOLD FOR SELECT 3; | QUERY_STATUS_DONE + -1 | FETCH 1 IN cursor_stats_5; | QUERY_STATUS_SUBMIT + -1 | FETCH 1 IN cursor_stats_5; | QUERY_STATUS_DONE + -1 | FETCH 1 IN cursor_stats_6; | QUERY_STATUS_SUBMIT + -1 | FETCH 1 IN cursor_stats_6; | QUERY_STATUS_DONE + -1 | CLOSE cursor_stats_5; | QUERY_STATUS_SUBMIT + -1 | CLOSE cursor_stats_5; | QUERY_STATUS_DONE + -1 | CLOSE cursor_stats_6; | QUERY_STATUS_SUBMIT + -1 | CLOSE cursor_stats_6; | QUERY_STATUS_DONE + -1 | COMMIT; | QUERY_STATUS_SUBMIT + -1 | COMMIT; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(18 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_dist.out b/gpcontrib/yagp_hooks_collector/expected/yagp_dist.out new file mode 100644 index 00000000000..3b1e3504923 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_dist.out @@ -0,0 +1,175 @@ +CREATE EXTENSION yagp_hooks_collector; +CREATE OR REPLACE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; +SET yagpcc.enable_utility TO FALSE; +-- Hash distributed table +CREATE TABLE test_hash_dist (id int) DISTRIBUTED BY (id); +INSERT INTO test_hash_dist SELECT 1; +SET yagpcc.logging_mode to 'TBL'; +SET optimizer_enable_direct_dispatch TO TRUE; +-- Direct dispatch is used here, only one segment is scanned. +select * from test_hash_dist where id = 1; + id +---- + 1 +(1 row) + +RESET optimizer_enable_direct_dispatch; +RESET yagpcc.logging_mode; +-- Should see 8 rows. +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+--------------------------------------------+--------------------- + -1 | select * from test_hash_dist where id = 1; | QUERY_STATUS_SUBMIT + -1 | select * from test_hash_dist where id = 1; | QUERY_STATUS_START + -1 | select * from test_hash_dist where id = 1; | QUERY_STATUS_END + -1 | select * from test_hash_dist where id = 1; | QUERY_STATUS_DONE + 1 | | QUERY_STATUS_SUBMIT + 1 | | QUERY_STATUS_START + 1 | | QUERY_STATUS_END + 1 | | QUERY_STATUS_DONE +(8 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +SET yagpcc.logging_mode to 'TBL'; +-- Scan all segments. +select * from test_hash_dist; + id +---- + 1 +(1 row) + +DROP TABLE test_hash_dist; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+-------------------------------+--------------------- + -1 | select * from test_hash_dist; | QUERY_STATUS_SUBMIT + -1 | select * from test_hash_dist; | QUERY_STATUS_START + -1 | select * from test_hash_dist; | QUERY_STATUS_END + -1 | select * from test_hash_dist; | QUERY_STATUS_DONE + 1 | | QUERY_STATUS_SUBMIT + 1 | | QUERY_STATUS_START + 1 | | QUERY_STATUS_END + 1 | | QUERY_STATUS_DONE + 2 | | QUERY_STATUS_SUBMIT + 2 | | QUERY_STATUS_START + 2 | | QUERY_STATUS_END + 2 | | QUERY_STATUS_DONE + | | QUERY_STATUS_SUBMIT + | | QUERY_STATUS_START + | | QUERY_STATUS_END + | | QUERY_STATUS_DONE +(16 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Replicated table +CREATE FUNCTION force_segments() RETURNS SETOF text AS $$ +BEGIN + RETURN NEXT 'seg'; +END; +$$ LANGUAGE plpgsql VOLATILE EXECUTE ON ALL SEGMENTS; +CREATE TABLE test_replicated (id int) DISTRIBUTED REPLICATED; +INSERT INTO test_replicated SELECT 1; +SET yagpcc.logging_mode to 'TBL'; +SELECT COUNT(*) FROM test_replicated, force_segments(); + count +------- + 3 +(1 row) + +DROP TABLE test_replicated; +DROP FUNCTION force_segments(); +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+---------------------------------------------------------+--------------------- + -1 | SELECT COUNT(*) FROM test_replicated, force_segments(); | QUERY_STATUS_SUBMIT + -1 | SELECT COUNT(*) FROM test_replicated, force_segments(); | QUERY_STATUS_START + -1 | SELECT COUNT(*) FROM test_replicated, force_segments(); | QUERY_STATUS_END + -1 | SELECT COUNT(*) FROM test_replicated, force_segments(); | QUERY_STATUS_DONE + 1 | | QUERY_STATUS_SUBMIT + 1 | | QUERY_STATUS_START + 1 | | QUERY_STATUS_END + 1 | | QUERY_STATUS_DONE + 2 | | QUERY_STATUS_SUBMIT + 2 | | QUERY_STATUS_START + 2 | | QUERY_STATUS_END + 2 | | QUERY_STATUS_DONE + | | QUERY_STATUS_SUBMIT + | | QUERY_STATUS_START + | | QUERY_STATUS_END + | | QUERY_STATUS_DONE +(16 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Partially distributed table (2 numsegments) +SET allow_system_table_mods = ON; +CREATE TABLE test_partial_dist (id int, data text) DISTRIBUTED BY (id); +UPDATE gp_distribution_policy SET numsegments = 2 WHERE localoid = 'test_partial_dist'::regclass; +INSERT INTO test_partial_dist SELECT * FROM generate_series(1, 100); +SET yagpcc.logging_mode to 'TBL'; +SELECT COUNT(*) FROM test_partial_dist; + count +------- + 100 +(1 row) + +RESET yagpcc.logging_mode; +DROP TABLE test_partial_dist; +RESET allow_system_table_mods; +-- Should see 12 rows. +SELECT query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + query_text | query_status +-----------------------------------------+--------------------- + SELECT COUNT(*) FROM test_partial_dist; | QUERY_STATUS_SUBMIT + SELECT COUNT(*) FROM test_partial_dist; | QUERY_STATUS_START + SELECT COUNT(*) FROM test_partial_dist; | QUERY_STATUS_END + SELECT COUNT(*) FROM test_partial_dist; | QUERY_STATUS_DONE + | QUERY_STATUS_SUBMIT + | QUERY_STATUS_START + | QUERY_STATUS_END + | QUERY_STATUS_DONE + | QUERY_STATUS_SUBMIT + | QUERY_STATUS_START + | QUERY_STATUS_END + | QUERY_STATUS_DONE +(12 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_guc_cache.out b/gpcontrib/yagp_hooks_collector/expected/yagp_guc_cache.out new file mode 100644 index 00000000000..3085cfa42e1 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_guc_cache.out @@ -0,0 +1,57 @@ +-- +-- Test GUC caching for query lifecycle consistency. +-- +-- The extension logs SUBMIT and DONE events for each query. +-- GUC values that control logging (enable_utility, ignored_users_list, ...) +-- must be cached at SUBMIT time to ensure DONE uses the same filtering +-- criteria. Otherwise, a SET command that modifies these GUCs would +-- have its DONE event rejected, creating orphaned SUBMIT entries. +-- This is due to query being actually executed between SUBMIT and DONE. +-- start_ignore +CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; +SELECT yagpcc.truncate_log(); +-- end_ignore +CREATE OR REPLACE FUNCTION print_last_query(query text) +RETURNS TABLE(query_status text) AS $$ + SELECT query_status + FROM yagpcc.log + WHERE segid = -1 AND query_text = query + ORDER BY ccnt DESC +$$ LANGUAGE sql; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.logging_mode TO 'TBL'; +-- SET below disables utility logging and DONE must still be logged. +SET yagpcc.enable_utility TO FALSE; +SELECT * FROM print_last_query('SET yagpcc.enable_utility TO FALSE;'); + query_status +--------------------- + QUERY_STATUS_SUBMIT + QUERY_STATUS_DONE +(2 rows) + +-- SELECT below adds current user to ignore list and DONE must still be logged. +-- start_ignore +SELECT set_config('yagpcc.ignored_users_list', current_user, false); + set_config +------------ + gpadmin +(1 row) + +-- end_ignore +SELECT * FROM print_last_query('SELECT set_config(''yagpcc.ignored_users_list'', current_user, false);'); + query_status +--------------------- + QUERY_STATUS_SUBMIT + QUERY_STATUS_START + QUERY_STATUS_END + QUERY_STATUS_DONE +(4 rows) + +DROP FUNCTION print_last_query(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; +RESET yagpcc.logging_mode; diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_locale.out b/gpcontrib/yagp_hooks_collector/expected/yagp_locale.out new file mode 100644 index 00000000000..6689b6a4ed3 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_locale.out @@ -0,0 +1,23 @@ +-- The extension generates normalized query text and plan using jumbling functions. +-- Those functions may fail when translating to wide character if the current locale +-- cannot handle the character set. This test checks that even when those functions +-- fail, the plan is still generated and executed. This test is partially taken from +-- gp_locale. +-- start_ignore +DROP DATABASE IF EXISTS yagp_test_locale; +-- end_ignore +CREATE DATABASE yagp_test_locale WITH LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0; +\c yagp_test_locale +CREATE EXTENSION yagp_hooks_collector; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.enable TO TRUE; +CREATE TABLE yagp_hi_안녕세계 (a int, 안녕세계1 text, 안녕세계2 text, 안녕세계3 text) DISTRIBUTED BY (a); +INSERT INTO yagp_hi_안녕세계 VALUES(1, '안녕세계1 first', '안녕세2 first', '안녕세계3 first'); +-- Should not see error here +UPDATE yagp_hi_안녕세계 SET 안녕세계1='안녕세계1 first UPDATE' WHERE 안녕세계1='안녕세계1 first'; +RESET yagpcc.enable; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; +DROP TABLE yagp_hi_안녕세계; +DROP EXTENSION yagp_hooks_collector; diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_select.out b/gpcontrib/yagp_hooks_collector/expected/yagp_select.out new file mode 100644 index 00000000000..af08f2d1def --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_select.out @@ -0,0 +1,136 @@ +CREATE EXTENSION yagp_hooks_collector; +CREATE OR REPLACE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; +SET yagpcc.enable_utility TO FALSE; +-- Basic SELECT tests +SET yagpcc.logging_mode to 'TBL'; +SELECT 1; + ?column? +---------- + 1 +(1 row) + +SELECT COUNT(*) FROM generate_series(1,10); + count +------- + 10 +(1 row) + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+---------------------------------------------+--------------------- + -1 | SELECT 1; | QUERY_STATUS_SUBMIT + -1 | SELECT 1; | QUERY_STATUS_START + -1 | SELECT 1; | QUERY_STATUS_END + -1 | SELECT 1; | QUERY_STATUS_DONE + -1 | SELECT COUNT(*) FROM generate_series(1,10); | QUERY_STATUS_SUBMIT + -1 | SELECT COUNT(*) FROM generate_series(1,10); | QUERY_STATUS_START + -1 | SELECT COUNT(*) FROM generate_series(1,10); | QUERY_STATUS_END + -1 | SELECT COUNT(*) FROM generate_series(1,10); | QUERY_STATUS_DONE +(8 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Transaction test +SET yagpcc.logging_mode to 'TBL'; +BEGIN; +SELECT 1; + ?column? +---------- + 1 +(1 row) + +COMMIT; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+------------+--------------------- + -1 | SELECT 1; | QUERY_STATUS_SUBMIT + -1 | SELECT 1; | QUERY_STATUS_START + -1 | SELECT 1; | QUERY_STATUS_END + -1 | SELECT 1; | QUERY_STATUS_DONE +(4 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- CTE test +SET yagpcc.logging_mode to 'TBL'; +WITH t AS (VALUES (1), (2)) +SELECT * FROM t; + column1 +--------- + 1 + 2 +(2 rows) + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+-----------------------------+--------------------- + -1 | WITH t AS (VALUES (1), (2))+| QUERY_STATUS_SUBMIT + | SELECT * FROM t; | + -1 | WITH t AS (VALUES (1), (2))+| QUERY_STATUS_START + | SELECT * FROM t; | + -1 | WITH t AS (VALUES (1), (2))+| QUERY_STATUS_END + | SELECT * FROM t; | + -1 | WITH t AS (VALUES (1), (2))+| QUERY_STATUS_DONE + | SELECT * FROM t; | +(4 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Prepared statement test +SET yagpcc.logging_mode to 'TBL'; +PREPARE test_stmt AS SELECT 1; +EXECUTE test_stmt; + ?column? +---------- + 1 +(1 row) + +DEALLOCATE test_stmt; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+--------------------------------+--------------------- + -1 | PREPARE test_stmt AS SELECT 1; | QUERY_STATUS_SUBMIT + -1 | PREPARE test_stmt AS SELECT 1; | QUERY_STATUS_START + -1 | PREPARE test_stmt AS SELECT 1; | QUERY_STATUS_END + -1 | PREPARE test_stmt AS SELECT 1; | QUERY_STATUS_DONE +(4 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_uds.out b/gpcontrib/yagp_hooks_collector/expected/yagp_uds.out new file mode 100644 index 00000000000..d04929ffb4a --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_uds.out @@ -0,0 +1,42 @@ +-- Test UDS socket +-- start_ignore +CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; +-- end_ignore +\set UDS_PATH '/tmp/yagpcc_test.sock' +-- Configure extension to send via UDS +SET yagpcc.uds_path TO :'UDS_PATH'; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.logging_mode TO 'UDS'; +-- Start receiver +SELECT yagpcc.__test_uds_start_server(:'UDS_PATH'); + __test_uds_start_server +------------------------- +(0 rows) + +-- Send +SELECT 1; + ?column? +---------- + 1 +(1 row) + +-- Receive +SELECT yagpcc.__test_uds_receive() > 0 as received; + received +---------- + t +(1 row) + +-- Stop receiver +SELECT yagpcc.__test_uds_stop_server(); + __test_uds_stop_server +------------------------ +(0 rows) + +-- Cleanup +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.uds_path; +RESET yagpcc.ignored_users_list; +RESET yagpcc.enable; +RESET yagpcc.logging_mode; diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_utf8_trim.out b/gpcontrib/yagp_hooks_collector/expected/yagp_utf8_trim.out new file mode 100644 index 00000000000..9de126dd882 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_utf8_trim.out @@ -0,0 +1,68 @@ +CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; +CREATE OR REPLACE FUNCTION get_marked_query(marker TEXT) +RETURNS TEXT AS $$ + SELECT query_text + FROM yagpcc.log + WHERE query_text LIKE '%' || marker || '%' + ORDER BY datetime DESC + LIMIT 1 +$$ LANGUAGE sql VOLATILE; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +-- Test 1: 1 byte chars +SET yagpcc.max_text_size to 19; +SET yagpcc.logging_mode to 'TBL'; +SELECT /*test1*/ 'HelloWorld'; + ?column? +------------ + HelloWorld +(1 row) + +RESET yagpcc.logging_mode; +SELECT octet_length(get_marked_query('test1')) = 19 AS correct_length; + correct_length +---------------- + t +(1 row) + +-- Test 2: 2 byte chars +SET yagpcc.max_text_size to 19; +SET yagpcc.logging_mode to 'TBL'; +SELECT /*test2*/ 'РУССКИЙЯЗЫК'; + ?column? +------------- + РУССКИЙЯЗЫК +(1 row) + +RESET yagpcc.logging_mode; +-- Character 'Р' has two bytes and cut in the middle => not included. +SELECT octet_length(get_marked_query('test2')) = 18 AS correct_length; + correct_length +---------------- + t +(1 row) + +-- Test 3: 4 byte chars +SET yagpcc.max_text_size to 21; +SET yagpcc.logging_mode to 'TBL'; +SELECT /*test3*/ '😀'; + ?column? +---------- + 😀 +(1 row) + +RESET yagpcc.logging_mode; +-- Emoji has 4 bytes and cut before the last byte => not included. +SELECT octet_length(get_marked_query('test3')) = 18 AS correct_length; + correct_length +---------------- + t +(1 row) + +-- Cleanup +DROP FUNCTION get_marked_query(TEXT); +RESET yagpcc.max_text_size; +RESET yagpcc.logging_mode; +RESET yagpcc.enable; +RESET yagpcc.ignored_users_list; +DROP EXTENSION yagp_hooks_collector; diff --git a/gpcontrib/yagp_hooks_collector/expected/yagp_utility.out b/gpcontrib/yagp_hooks_collector/expected/yagp_utility.out new file mode 100644 index 00000000000..7df1d2816eb --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/expected/yagp_utility.out @@ -0,0 +1,248 @@ +CREATE EXTENSION yagp_hooks_collector; +CREATE OR REPLACE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; +SET yagpcc.logging_mode to 'TBL'; +CREATE TABLE test_table (a int, b text); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +CREATE INDEX test_idx ON test_table(a); +ALTER TABLE test_table ADD COLUMN c int DEFAULT 1; +DROP TABLE test_table; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+----------------------------------------------------+--------------------- + -1 | CREATE TABLE test_table (a int, b text); | QUERY_STATUS_SUBMIT + -1 | CREATE TABLE test_table (a int, b text); | QUERY_STATUS_DONE + -1 | CREATE INDEX test_idx ON test_table(a); | QUERY_STATUS_SUBMIT + -1 | CREATE INDEX test_idx ON test_table(a); | QUERY_STATUS_DONE + -1 | ALTER TABLE test_table ADD COLUMN c int DEFAULT 1; | QUERY_STATUS_SUBMIT + -1 | ALTER TABLE test_table ADD COLUMN c int DEFAULT 1; | QUERY_STATUS_DONE + -1 | DROP TABLE test_table; | QUERY_STATUS_SUBMIT + -1 | DROP TABLE test_table; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(10 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Partitioning +SET yagpcc.logging_mode to 'TBL'; +CREATE TABLE pt_test (a int, b int) +DISTRIBUTED BY (a) +PARTITION BY RANGE (a) +(START (0) END (100) EVERY (50)); +DROP TABLE pt_test; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+-------------------------------------+--------------------- + -1 | CREATE TABLE pt_test (a int, b int)+| QUERY_STATUS_SUBMIT + | DISTRIBUTED BY (a) +| + | PARTITION BY RANGE (a) +| + | (START (0) END (100) EVERY (50)); | + -1 | CREATE TABLE pt_test (a int, b int)+| QUERY_STATUS_DONE + | DISTRIBUTED BY (a) +| + | PARTITION BY RANGE (a) +| + | (START (0) END (100) EVERY (50)); | + -1 | DROP TABLE pt_test; | QUERY_STATUS_SUBMIT + -1 | DROP TABLE pt_test; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(6 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Views and Functions +SET yagpcc.logging_mode to 'TBL'; +CREATE VIEW test_view AS SELECT 1 AS a; +CREATE FUNCTION test_func(i int) RETURNS int AS $$ SELECT $1 + 1; $$ LANGUAGE SQL; +DROP VIEW test_view; +DROP FUNCTION test_func(int); +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+------------------------------------------------------------------------------------+--------------------- + -1 | CREATE VIEW test_view AS SELECT 1 AS a; | QUERY_STATUS_SUBMIT + -1 | CREATE VIEW test_view AS SELECT 1 AS a; | QUERY_STATUS_DONE + -1 | CREATE FUNCTION test_func(i int) RETURNS int AS $$ SELECT $1 + 1; $$ LANGUAGE SQL; | QUERY_STATUS_SUBMIT + -1 | CREATE FUNCTION test_func(i int) RETURNS int AS $$ SELECT $1 + 1; $$ LANGUAGE SQL; | QUERY_STATUS_DONE + -1 | DROP VIEW test_view; | QUERY_STATUS_SUBMIT + -1 | DROP VIEW test_view; | QUERY_STATUS_DONE + -1 | DROP FUNCTION test_func(int); | QUERY_STATUS_SUBMIT + -1 | DROP FUNCTION test_func(int); | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(10 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Transaction Operations +SET yagpcc.logging_mode to 'TBL'; +BEGIN; +SAVEPOINT sp1; +ROLLBACK TO sp1; +COMMIT; +BEGIN; +SAVEPOINT sp2; +ABORT; +BEGIN; +ROLLBACK; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+----------------------------+--------------------- + -1 | BEGIN; | QUERY_STATUS_SUBMIT + -1 | BEGIN; | QUERY_STATUS_DONE + -1 | SAVEPOINT sp1; | QUERY_STATUS_SUBMIT + -1 | ROLLBACK TO sp1; | QUERY_STATUS_SUBMIT + -1 | ROLLBACK TO sp1; | QUERY_STATUS_DONE + -1 | COMMIT; | QUERY_STATUS_SUBMIT + -1 | COMMIT; | QUERY_STATUS_DONE + -1 | BEGIN; | QUERY_STATUS_SUBMIT + -1 | BEGIN; | QUERY_STATUS_DONE + -1 | SAVEPOINT sp2; | QUERY_STATUS_SUBMIT + -1 | ABORT; | QUERY_STATUS_SUBMIT + -1 | ABORT; | QUERY_STATUS_DONE + -1 | BEGIN; | QUERY_STATUS_SUBMIT + -1 | BEGIN; | QUERY_STATUS_DONE + -1 | ROLLBACK; | QUERY_STATUS_SUBMIT + -1 | ROLLBACK; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(18 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- DML Operations +SET yagpcc.logging_mode to 'TBL'; +CREATE TABLE dml_test (a int, b text); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +INSERT INTO dml_test VALUES (1, 'test'); +UPDATE dml_test SET b = 'updated' WHERE a = 1; +DELETE FROM dml_test WHERE a = 1; +DROP TABLE dml_test; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+----------------------------------------+--------------------- + -1 | CREATE TABLE dml_test (a int, b text); | QUERY_STATUS_SUBMIT + -1 | CREATE TABLE dml_test (a int, b text); | QUERY_STATUS_DONE + -1 | DROP TABLE dml_test; | QUERY_STATUS_SUBMIT + -1 | DROP TABLE dml_test; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(6 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- COPY Operations +SET yagpcc.logging_mode to 'TBL'; +CREATE TABLE copy_test (a int); +NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'a' as the Apache Cloudberry data distribution key for this table. +HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew. +COPY (SELECT 1) TO STDOUT; +1 +DROP TABLE copy_test; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+---------------------------------+--------------------- + -1 | CREATE TABLE copy_test (a int); | QUERY_STATUS_SUBMIT + -1 | CREATE TABLE copy_test (a int); | QUERY_STATUS_DONE + -1 | COPY (SELECT 1) TO STDOUT; | QUERY_STATUS_SUBMIT + -1 | COPY (SELECT 1) TO STDOUT; | QUERY_STATUS_DONE + -1 | DROP TABLE copy_test; | QUERY_STATUS_SUBMIT + -1 | DROP TABLE copy_test; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(8 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- Prepared Statements and error during execute +SET yagpcc.logging_mode to 'TBL'; +PREPARE test_prep(int) AS SELECT $1/0 AS value; +EXECUTE test_prep(0::int); +ERROR: division by zero +DEALLOCATE test_prep; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+-------------------------------------------------+--------------------- + -1 | PREPARE test_prep(int) AS SELECT $1/0 AS value; | QUERY_STATUS_SUBMIT + -1 | PREPARE test_prep(int) AS SELECT $1/0 AS value; | QUERY_STATUS_DONE + -1 | EXECUTE test_prep(0::int); | QUERY_STATUS_SUBMIT + -1 | EXECUTE test_prep(0::int); | QUERY_STATUS_ERROR + -1 | DEALLOCATE test_prep; | QUERY_STATUS_SUBMIT + -1 | DEALLOCATE test_prep; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(8 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +-- GUC Settings +SET yagpcc.logging_mode to 'TBL'; +SET yagpcc.report_nested_queries TO FALSE; +RESET yagpcc.report_nested_queries; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; + segid | query_text | query_status +-------+--------------------------------------------+--------------------- + -1 | SET yagpcc.report_nested_queries TO FALSE; | QUERY_STATUS_SUBMIT + -1 | SET yagpcc.report_nested_queries TO FALSE; | QUERY_STATUS_DONE + -1 | RESET yagpcc.report_nested_queries; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.report_nested_queries; | QUERY_STATUS_DONE + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_SUBMIT + -1 | RESET yagpcc.logging_mode; | QUERY_STATUS_DONE +(6 rows) + +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + t +--- +(0 rows) + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/metric.md b/gpcontrib/yagp_hooks_collector/metric.md new file mode 100644 index 00000000000..5df56877edb --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/metric.md @@ -0,0 +1,126 @@ +## YAGP Hooks Collector Metrics + +### States +A Postgres process goes through 4 executor functions to execute a query: +1) `ExecutorStart()` - resource allocation for the query. +2) `ExecutorRun()` - query execution. +3) `ExecutorFinish()` - cleanup. +4) `ExecutorEnd()` - cleanup. + +yagp-hooks-collector sends messages with 4 states, from _Dispatcher_ and/or _Execute_ processes: `submit`, `start`, `end`, `done`, in this order: +``` +submit -> ExecutorStart() -> start -> ExecutorRun() -> ExecutorFinish() -> end -> ExecutorEnd() -> done +``` + +### Key Points +- Some queries may skip the _end_ state, then the _end_ statistics is sent during _done_. +- If a query finishes with an error (`METRICS_QUERY_ERROR`), or is cancelled (`METRICS_QUERY_CANCELLED`), statistics is sent at _done_. +- Some statistics is calculated as the difference between the current global metric and the previous. The initial snapshot is taken at submit, and at _end_/_done_ the diff is calculated. +- Nested queries on _Dispatcher_ become top-level on _Execute_. +- Each process (_Dispatcher_/_Execute_) sends its own statistics + +### Notations +- **S** = Submit event. +- **T** = Start event. +- **E** = End event. +- **D** = Done event. +- **DIFF** = current_value - submit_value (submit event). +- **ABS** = Absolute value, or where diff is not applicable, the value taken. +- **Local*** - Statistics that starts counting from zero for each new query. A nested query is also considered new. +- **Node** - PG process, either a `Query Dispatcher` (on master) or an `Execute` (on segment). + +### Statistics Table + +| Proto Field | Type | When | DIFF/ABS | Local* | Scope | Dispatcher | Execute | Units | Notes | +| :--------------------------- | :----- | :------ | :------- | ------ | :------ | :--------: | :-----: | :------ | :-------------------------------------------------- | +| **SystemStat** | | | | | | | | | | +| `runningTimeSeconds` | double | E, D | DIFF | - | Node | + | + | seconds | Wall clock time | +| `userTimeSeconds` | double | E, D | DIFF | - | Node | + | + | seconds | /proc/pid/stat utime | +| `kernelTimeSeconds` | double | E, D | DIFF | - | Node | + | + | seconds | /proc/pid/stat stime | +| `vsize` | uint64 | E, D | ABS | - | Node | + | + | bytes | /proc/pid/stat vsize | +| `rss` | uint64 | E, D | ABS | - | Node | + | + | pages | /proc/pid/stat rss | +| `VmSizeKb` | uint64 | E, D | ABS | - | Node | + | + | KB | /proc/pid/status VmSize | +| `VmPeakKb` | uint64 | E, D | ABS | - | Node | + | + | KB | /proc/pid/status VmPeak | +| `rchar` | uint64 | E, D | DIFF | - | Node | + | + | bytes | /proc/pid/io rchar | +| `wchar` | uint64 | E, D | DIFF | - | Node | + | + | bytes | /proc/pid/io wchar | +| `syscr` | uint64 | E, D | DIFF | - | Node | + | + | count | /proc/pid/io syscr | +| `syscw` | uint64 | E, D | DIFF | - | Node | + | + | count | /proc/pid/io syscw | +| `read_bytes` | uint64 | E, D | DIFF | - | Node | + | + | bytes | /proc/pid/io read_bytes | +| `write_bytes` | uint64 | E, D | DIFF | - | Node | + | + | bytes | /proc/pid/io write_bytes | +| `cancelled_write_bytes` | uint64 | E, D | DIFF | - | Node | + | + | bytes | /proc/pid/io cancelled_write_bytes | +| **MetricInstrumentation** | | | | | | | | | | +| `ntuples` | uint64 | E, D | ABS | + | Node | + | + | tuples | Accumulated total tuples | +| `nloops` | uint64 | E, D | ABS | + | Node | + | + | count | Number of cycles | +| `tuplecount` | uint64 | E, D | ABS | + | Node | + | + | tuples | Accumulated tuples per cycle | +| `firsttuple` | double | E, D | ABS | + | Node | + | + | seconds | Time for first tuple of this cycle | +| `startup` | double | E, D | ABS | + | Node | + | + | seconds | Start time of current iteration | +| `total` | double | E, D | ABS | + | Node | + | + | seconds | Total time taken | +| `shared_blks_hit` | uint64 | E, D | ABS | + | Node | + | + | blocks | Shared buffer blocks found in cache | +| `shared_blks_read` | uint64 | E, D | ABS | + | Node | + | + | blocks | Shared buffer blocks read from disk | +| `shared_blks_dirtied` | uint64 | E, D | ABS | + | Node | + | + | blocks | Shared blocks dirtied | +| `shared_blks_written` | uint64 | E, D | ABS | + | Node | + | + | blocks | Dirty shared buffer blocks written to disk | +| `local_blks_hit` | uint64 | E, D | ABS | + | Node | + | + | blocks | Local buffer hits | +| `local_blks_read` | uint64 | E, D | ABS | + | Node | + | + | blocks | Disk blocks read | +| `local_blks_dirtied` | uint64 | E, D | ABS | + | Node | + | + | blocks | Local blocks dirtied | +| `local_blks_written` | uint64 | E, D | ABS | + | Node | + | + | blocks | Local blocks written to disk | +| `temp_blks_read` | uint64 | E, D | ABS | + | Node | + | + | blocks | Temp file blocks read | +| `temp_blks_written` | uint64 | E, D | ABS | + | Node | + | + | blocks | Temp file blocks written | +| `blk_read_time` | double | E, D | ABS | + | Node | + | + | seconds | Time reading data blocks | +| `blk_write_time` | double | E, D | ABS | + | Node | + | + | seconds | Time writing data blocks | +| `inherited_calls` | uint64 | E, D | ABS | - | Node | + | + | count | Nested query count (YAGPCC-specific) | +| `inherited_time` | double | E, D | ABS | - | Node | + | + | seconds | Nested query time (YAGPCC-specific) | +| **NetworkStat (sent)** | | | | | | | | | | +| `sent.total_bytes` | uint32 | D | ABS | - | Node | + | + | bytes | Bytes sent, including headers | +| `sent.tuple_bytes` | uint32 | D | ABS | - | Node | + | + | bytes | Bytes of pure tuple-data sent | +| `sent.chunks` | uint32 | D | ABS | - | Node | + | + | count | Tuple-chunks sent | +| **NetworkStat (received)** | | | | | | | | | | +| `received.total_bytes` | uint32 | D | ABS | - | Node | + | + | bytes | Bytes of pure tuple-data received | +| `received.tuple_bytes` | uint32 | D | ABS | - | Node | + | + | bytes | Bytes of pure tuple-data received | +| `received.chunks` | uint32 | D | ABS | - | Node | + | + | count | Tuple-chunks received | +| **InterconnectStat** | | | | | | | | | | +| `total_recv_queue_size` | uint64 | D | DIFF | - | Node | + | + | bytes | Receive queue size sum | +| `recv_queue_size_counting_t` | uint64 | D | DIFF | - | Node | + | + | count | Counting times when computing total_recv_queue_size | +| `total_capacity` | uint64 | D | DIFF | - | Node | + | + | bytes | the capacity sum for sent packets | +| `capacity_counting_time` | uint64 | D | DIFF | - | Node | + | + | count | counting times used to compute total_capacity | +| `total_buffers` | uint64 | D | DIFF | - | Node | + | + | count | Available buffers | +| `buffer_counting_time` | uint64 | D | DIFF | - | Node | + | + | count | counting times when compute total_buffers | +| `active_connections_num` | uint64 | D | DIFF | - | Node | + | + | count | Active connections | +| `retransmits` | int64 | D | DIFF | - | Node | + | + | count | Packet retransmits | +| `startup_cached_pkt_num` | int64 | D | DIFF | - | Node | + | + | count | Startup cached packets | +| `mismatch_num` | int64 | D | DIFF | - | Node | + | + | count | Mismatched packets received | +| `crc_errors` | int64 | D | DIFF | - | Node | + | + | count | CRC errors | +| `snd_pkt_num` | int64 | D | DIFF | - | Node | + | + | count | Packets sent | +| `recv_pkt_num` | int64 | D | DIFF | - | Node | + | + | count | Packets received | +| `disordered_pkt_num` | int64 | D | DIFF | - | Node | + | + | count | Out-of-order packets | +| `duplicated_pkt_num` | int64 | D | DIFF | - | Node | + | + | count | Duplicate packets | +| `recv_ack_num` | int64 | D | DIFF | - | Node | + | + | count | ACKs received | +| `status_query_msg_num` | int64 | D | DIFF | - | Node | + | + | count | Status query messages sent | +| **SpillInfo** | | | | | | | | | | +| `fileCount` | int32 | E, D | DIFF | - | Node | + | + | count | Spill (temp) files created | +| `totalBytes` | int64 | E, D | DIFF | - | Node | + | + | bytes | Spill bytes written | +| **QueryInfo** | | | | | | | | | | +| `generator` | enum | T, E, D | ABS | - | Cluster | + | - | enum | Planner/Optimizer | +| `query_id` | uint64 | T, E, D | ABS | - | Cluster | + | - | id | Query ID | +| `plan_id` | uint64 | T, E, D | ABS | - | Cluster | + | - | id | Hash of normalized plan | +| `query_text` | string | S | ABS | - | Cluster | + | - | text | Query text | +| `plan_text` | string | T | ABS | - | Cluster | + | - | text | EXPLAIN text | +| `template_query_text` | string | S | ABS | - | Cluster | + | - | text | Normalized query text | +| `template_plan_text` | string | T | ABS | - | Cluster | + | - | text | Normalized plan text | +| `userName` | string | All | ABS | - | Cluster | + | - | text | Session user | +| `databaseName` | string | All | ABS | - | Cluster | + | - | text | Database name | +| `rsgname` | string | All | ABS | - | Cluster | + | - | text | Resource group name | +| `analyze_text` | string | D | ABS | - | Cluster | + | - | text | EXPLAIN ANALYZE | +| **AdditionalQueryInfo** | | | | | | | | | | +| `nested_level` | int64 | All | ABS | - | Node | + | + | count | Current nesting level | +| `error_message` | string | D | ABS | - | Node | + | + | text | Error message | +| `slice_id` | int64 | All | ABS | - | Node | + | + | id | Slice ID | +| **QueryKey** | | | | | | | | | | +| `tmid` | int32 | All | ABS | - | Node | + | + | id | Transaction start time | +| `ssid` | int32 | All | ABS | - | Node | + | + | id | Session ID | +| `ccnt` | int32 | All | ABS | - | Node | + | + | count | Command counter | +| **SegmentKey** | | | | | | | | | | +| `dbid` | int32 | All | ABS | - | Node | + | + | id | Database ID | +| `segment_index` | int32 | All | ABS | - | Node | + | + | id | Segment index (-1=coordinator) | + +--- + diff --git a/gpcontrib/yagp_hooks_collector/protos/yagpcc_metrics.proto b/gpcontrib/yagp_hooks_collector/protos/yagpcc_metrics.proto new file mode 100644 index 00000000000..91ac0c4941a --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/protos/yagpcc_metrics.proto @@ -0,0 +1,185 @@ +syntax = "proto3"; + +package yagpcc; +option java_outer_classname = "SegmentYAGPCCM"; +option go_package = "a.yandex-team.ru/cloud/mdb/yagpcc/api/proto/common;greenplum"; + +enum QueryStatus { + QUERY_STATUS_UNSPECIFIED = 0; + QUERY_STATUS_SUBMIT = 1; + QUERY_STATUS_START = 2; + QUERY_STATUS_DONE = 3; + QUERY_STATUS_QUERY_DONE = 4; + QUERY_STATUS_ERROR = 5; + QUERY_STATUS_CANCELLING = 6; + QUERY_STATUS_CANCELED = 7; + QUERY_STATUS_END = 8; +} + +enum PlanNodeStatus { + PLAN_NODE_STATUS_UNSPECIFIED = 0; + PLAN_NODE_STATUS_INITIALIZED = 1; + PLAN_NODE_STATUS_EXECUTING = 2; + PLAN_NODE_STATUS_FINISHED = 3; +} + +message QueryInfo { + PlanGenerator generator = 1; + uint64 query_id = 2; + uint64 plan_id = 3; + string query_text = 4; + string plan_text = 5; + string template_query_text = 6; + string template_plan_text = 7; + string userName = 8; + string databaseName = 9; + string rsgname = 10; + string analyze_text = 11; +} + +message AdditionalQueryInfo { + int64 nested_level = 1; + string error_message = 2; + int64 slice_id = 3; +} + +message AdditionalQueryStat { + string error_message = 1; + repeated int64 slices = 2; +} + +enum PlanGenerator +{ + PLAN_GENERATOR_UNSPECIFIED = 0; + PLAN_GENERATOR_PLANNER = 1; /* plan produced by the planner*/ + PLAN_GENERATOR_OPTIMIZER = 2; /* plan produced by the optimizer*/ +} + +message GPMetrics { + SystemStat systemStat = 1; + MetricInstrumentation instrumentation = 2; + SpillInfo spill = 3; +} + +message QueryKey { + int32 tmid = 1; /* A time identifier for a particular query. All records associated with the query will have the same tmid. */ + int32 ssid = 2; /* The session id as shown by gp_session_id. All records associated with the query will have the same ssid */ + int32 ccnt = 3; /* The command number within this session as shown by gp_command_count. All records associated with the query will have the same ccnt */ +} + +message SegmentKey { + int32 dbid = 1; /* the dbid of this database */ + int32 segindex = 2; /* content indicator: -1 for entry database, + * 0, ..., n-1 for segment database * + * a primary and its mirror have the same segIndex */ +} + +message SystemStat { + /* CPU stat*/ + double runningTimeSeconds = 1; + double userTimeSeconds = 2; + double kernelTimeSeconds = 3; + + /* Memory stat */ + uint64 vsize = 4; + uint64 rss = 5; + uint64 VmSizeKb = 6; + uint64 VmPeakKb = 7; + + /* Storage stat */ + uint64 rchar = 8; + uint64 wchar = 9; + uint64 syscr = 10; + uint64 syscw = 11; + uint64 read_bytes = 12; + uint64 write_bytes = 13; + uint64 cancelled_write_bytes = 14; +} + +message NetworkStat { + uint32 total_bytes = 1; + uint32 tuple_bytes = 2; + uint32 chunks = 3; +} + +message InterconnectStat { + // Receive queue size sum when main thread is trying to get a packet + uint64 total_recv_queue_size = 1; + // Counting times when computing total_recv_queue_size + uint64 recv_queue_size_counting_time = 2; + + // The capacity sum when packets are tried to be sent + uint64 total_capacity = 3; + // Counting times used to compute total_capacity + uint64 capacity_counting_time = 4; + + // Total buffers available when sending packets + uint64 total_buffers = 5; + // Counting times when compute total_buffers + uint64 buffer_counting_time = 6; + + // The number of active connections + uint64 active_connections_num = 7; + + // The number of packet retransmits + int64 retransmits = 8; + + // The number of cached future packets + int64 startup_cached_pkt_num = 9; + + // The number of mismatched packets received + int64 mismatch_num = 10; + + // The number of crc errors + int64 crc_errors = 11; + + // The number of packets sent by sender + int64 snd_pkt_num = 12; + + // The number of packets received by receiver + int64 recv_pkt_num = 13; + + // Disordered packet number + int64 disordered_pkt_num = 14; + + // Duplicate packet number + int64 duplicated_pkt_num = 15; + + // The number of Acks received + int64 recv_ack_num = 16; + + // The number of status query messages sent + int64 status_query_msg_num = 17; +} + +message MetricInstrumentation { + uint64 ntuples = 1; /* Total tuples produced */ + uint64 nloops = 2; /* # of run cycles for this node */ + uint64 tuplecount = 3; /* Tuples emitted so far this cycle */ + double firsttuple = 4; /* Time for first tuple of this cycle */ + double startup = 5; /* Total startup time (in seconds) (optimiser's cost estimation) */ + double total = 6; /* Total total time (in seconds) */ + uint64 shared_blks_hit = 7; /* shared blocks stats*/ + uint64 shared_blks_read = 8; + uint64 shared_blks_dirtied = 9; + uint64 shared_blks_written = 10; + uint64 local_blks_hit = 11; /* data read from disks */ + uint64 local_blks_read = 12; + uint64 local_blks_dirtied = 13; + uint64 local_blks_written = 14; + uint64 temp_blks_read = 15; /* temporary tables read stat */ + uint64 temp_blks_written = 16; + double blk_read_time = 17; /* measured read/write time */ + double blk_write_time = 18; + NetworkStat sent = 19; + NetworkStat received = 20; + double startup_time = 21; /* real query startup time (planning + queue time) */ + uint64 inherited_calls = 22; /* the number of executed sub-queries */ + double inherited_time = 23; /* total time spend on inherited execution */ + InterconnectStat interconnect = 24; +} + +message SpillInfo { + int32 fileCount = 1; + int64 totalBytes = 2; +} diff --git a/gpcontrib/yagp_hooks_collector/protos/yagpcc_plan.proto b/gpcontrib/yagp_hooks_collector/protos/yagpcc_plan.proto new file mode 100644 index 00000000000..962fab4bbdd --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/protos/yagpcc_plan.proto @@ -0,0 +1,570 @@ +syntax = "proto3"; + +package yagpcc; +option java_outer_classname = "SegmentYAGPCCP"; +option go_package = "a.yandex-team.ru/cloud/mdb/yagpcc/api/proto/common;greenplum"; + +message MetricPlan { + GpdbNodeType type = 1; + + int32 plan_node_id = 2; + int32 parent_plan_node_id = 3; // Valid only for QueryInfoMetricQuerySubmit + + double startup_cost = 4; /* cost expended before fetching any tuples */ + double total_cost = 5; /* total cost (assuming all tuples fetched) */ + double plan_rows = 6; /* number of rows plan is expected to emit */ + int32 plan_width = 7; /* average row width in bytes */ + + int32 arg1 = 8; // for some nodes it's additional opperand type + int32 arg2 = 9; // for some nodes it's additional opperand type + + MetricMotionInfo motion_info = 10; + MetricRelationInfo relation_info = 11; + + string scan_index_name = 12; + ScanDirection scan_direction = 13; + MetricSliceInfo slice_info = 14; + string statement = 15; +} + +message MetricMotionInfo { + MotionType type = 1; + bool isBroadcast = 2; + CdbLocusType locusType = 3; + + int32 sliceId = 4; + int32 parentSliceId = 5; +} + +message MetricRelationInfo { + int32 oid = 1; + string name = 2; + string schema = 3; + string alias = 4; + int32 dynamicScanId = 5; +} + +message MetricSliceInfo { + int32 slice = 1; + int32 segments = 2; + GangType gangType = 3; + int32 gang = 4; +} + +enum ScanDirection +{ + SCAN_DIRECTION_UNSPECIFIED = 0; + SCAN_DIRECTION_BACKWARD = 1; + SCAN_DIRECTION_FORWARD = 2; +} + +/* GangType enumeration is used in several structures related to CDB + * slice plan support. + */ +enum GangType +{ + GANG_TYPE_UNSPECIFIED = 0; + GANG_TYPE_UNALLOCATED = 1; /* a root slice executed by the qDisp */ + GANG_TYPE_ENTRYDB_READER = 2; /* a 1-gang with read access to the entry db */ + GANG_TYPE_SINGLETON_READER = 3; /* a 1-gang to read the segment dbs */ + GANG_TYPE_PRIMARY_READER = 4; /* a 1-gang or N-gang to read the segment dbs */ + GANG_TYPE_PRIMARY_WRITER = 5; /* the N-gang that can update the segment dbs */ +} + + +enum CdbLocusType +{ + CDB_LOCUS_TYPE_UNSPECIFIED = 0; + CDB_LOCUS_TYPE_ENTRY = 1; /* a single backend process on the entry db: + * usually the qDisp itself, but could be a + * qExec started by the entry postmaster. + */ + + CDB_LOCUS_TYPE_SINGLE_QE = 2; /* a single backend process on any db: the + * qDisp itself, or a qExec started by a + * segment postmaster or the entry postmaster. + */ + + CDB_LOCUS_TYPE_GENERAL = 3; /* compatible with any locus (data is + * self-contained in the query plan or + * generally available in any qExec or qDisp) */ + + CDB_LOCUS_TYPE_SEGMENT_GENERAL = 4; /* generally available in any qExec, but not + * available in qDisp */ + + CDB_LOCUS_TYPE_REPLICATED = 5; /* replicated over all qExecs of an N-gang */ + CDB_LOCUS_TYPE_HASHED = 6; /* hash partitioned over all qExecs of N-gang */ + CDB_LOCUS_TYPE_HASHED_OJ = 7; /* result of hash partitioned outer join, NULLs can be anywhere */ + CDB_LOCUS_TYPE_STREWN = 8; /* partitioned on no known function */ + CDB_LOCUS_TYPE_END = 9; /* = last valid CdbLocusType + 1 */ +} + +enum MotionType +{ + MOTION_TYPE_UNSPECIFIED = 0; + MOTION_TYPE_HASH = 1; // Use hashing to select a segindex destination + MOTION_TYPE_FIXED = 2; // Send tuples to a fixed set of segindexes + MOTION_TYPE_EXPLICIT = 3; // Send tuples to the segment explicitly specified in their segid column +} + +enum GpdbNodeType { + GPDB_NODE_TYPE_UNSPECIFIED = 0; + INDEX_INFO = 1; + EXPR_CONTEXT = 2; + PROJECTION_INFO = 3; + JUNK_FILTER = 4; + RESULT_REL_INFO = 5; + E_STATE = 6; + TUPLE_TABLE_SLOT = 7; + CDB_PROCESS = 8; + SLICE = 9; + SLICE_TABLE = 10; + CURSOR_POS_INFO = 11; + SHARE_NODE_ENTRY = 12; + PARTITION_STATE = 13; + QUERY_DISPATCH_DESC = 14; + OID_ASSIGNMENT = 15; + PLAN = 16; + SCAN = 17; + JOIN = 18; + RESULT = 19; + MODIFY_TABLE = 20; + APPEND = 21; + MERGE_APPEND = 22; + RECURSIVE_UNION = 23; + SEQUENCE = 24; + BITMAP_AND = 25; + BITMAP_OR = 26; + SEQ_SCAN = 27; + DYNAMIC_SEQ_SCAN = 28; + EXTERNAL_SCAN = 29; + INDEX_SCAN = 30; + DYNAMIC_INDEX_SCAN = 31; + INDEX_ONLY_SCAN = 32; + BITMAP_INDEX_SCAN = 33; + DYNAMIC_BITMAP_INDEX_SCAN = 34; + BITMAP_HEAP_SCAN = 35; + DYNAMIC_BITMAP_HEAP_SCAN = 36; + TID_SCAN = 37; + SUBQUERY_SCAN = 38; + FUNCTION_SCAN = 39; + TABLE_FUNCTION_SCAN = 40; + VALUES_SCAN = 41; + CTE_SCAN = 42; + WORK_TABLE_SCAN = 43; + FOREIGN_SCAN = 44; + NEST_LOOP = 45; + MERGE_JOIN = 46; + HASH_JOIN = 47; + MATERIAL = 48; + SORT = 49; + AGG = 50; + WINDOW_AGG = 51; + UNIQUE = 52; + HASH = 53; + SET_OP = 54; + LOCK_ROWS = 55; + LIMIT = 56; + MOTION = 57; + SHARE_INPUT_SCAN = 58; + REPEAT = 59; + DML = 60; + SPLIT_UPDATE = 61; + ROW_TRIGGER = 62; + ASSERT_OP = 63; + PARTITION_SELECTOR = 64; + PLAN_END = 65; + NEST_LOOP_PARAM = 66; + PLAN_ROW_MARK = 67; + PLAN_INVAL_ITEM = 68; + PLAN_STATE = 69; + SCAN_STATE = 70; + JOIN_STATE = 71; + RESULT_STATE = 72; + MODIFY_TABLE_STATE = 73; + APPEND_STATE = 74; + MERGE_APPEND_STATE = 75; + RECURSIVE_UNION_STATE = 76; + SEQUENCE_STATE = 77; + BITMAP_AND_STATE = 78; + BITMAP_OR_STATE = 79; + SEQ_SCAN_STATE = 80; + DYNAMIC_SEQ_SCAN_STATE = 81; + EXTERNAL_SCAN_STATE = 82; + INDEX_SCAN_STATE = 83; + DYNAMIC_INDEX_SCAN_STATE = 84; + INDEX_ONLY_SCAN_STATE = 85; + BITMAP_INDEX_SCAN_STATE = 86; + DYNAMIC_BITMAP_INDEX_SCAN_STATE = 87; + BITMAP_HEAP_SCAN_STATE = 88; + DYNAMIC_BITMAP_HEAP_SCAN_STATE = 89; + TID_SCAN_STATE = 90; + SUBQUERY_SCAN_STATE = 91; + FUNCTION_SCAN_STATE = 92; + TABLE_FUNCTION_STATE = 93; + VALUES_SCAN_STATE = 94; + CTE_SCAN_STATE = 95; + WORK_TABLE_SCAN_STATE = 96; + FOREIGN_SCAN_STATE = 97; + NEST_LOOP_STATE = 98; + MERGE_JOIN_STATE = 99; + HASH_JOIN_STATE = 100; + MATERIAL_STATE = 101; + SORT_STATE = 102; + AGG_STATE = 103; + WINDOW_AGG_STATE = 104; + UNIQUE_STATE = 105; + HASH_STATE = 106; + SET_OP_STATE = 107; + LOCK_ROWS_STATE = 108; + LIMIT_STATE = 109; + MOTION_STATE = 110; + SHARE_INPUT_SCAN_STATE = 111; + REPEAT_STATE = 112; + DML_STATE = 113; + SPLIT_UPDATE_STATE = 114; + ROW_TRIGGER_STATE = 115; + ASSERT_OP_STATE = 116; + PARTITION_SELECTOR_STATE = 117; + TUPLE_DESC_NODE = 118; + SERIALIZED_PARAM_EXTERN_DATA = 119; + ALIAS = 120; + RANGE_VAR = 121; + EXPR = 122; + VAR = 123; + CONST = 124; + PARAM = 125; + AGGREF = 126; + WINDOW_FUNC = 127; + ARRAY_REF = 128; + FUNC_EXPR = 129; + NAMED_ARG_EXPR = 130; + OP_EXPR = 131; + DISTINCT_EXPR = 132; + NULL_IF_EXPR = 133; + SCALAR_ARRAY_OP_EXPR = 134; + BOOL_EXPR = 135; + SUB_LINK = 136; + SUB_PLAN = 137; + ALTERNATIVE_SUB_PLAN = 138; + FIELD_SELECT = 139; + FIELD_STORE = 140; + RELABEL_TYPE = 141; + COERCE_VIA_IO = 142; + ARRAY_COERCE_EXPR = 143; + CONVERT_ROWTYPE_EXPR = 144; + COLLATE_EXPR = 145; + CASE_EXPR = 146; + CASE_WHEN = 147; + CASE_TEST_EXPR = 148; + ARRAY_EXPR = 149; + ROW_EXPR = 150; + ROW_COMPARE_EXPR = 151; + COALESCE_EXPR = 152; + MIN_MAX_EXPR = 153; + XML_EXPR = 154; + NULL_TEST = 155; + BOOLEAN_TEST = 156; + COERCE_TO_DOMAIN = 157; + COERCE_TO_DOMAIN_VALUES = 158; + SET_TO_DEFAULT = 159; + CURRENT_OF_EXPR = 160; + TARGET_ENTRY = 161; + RANGE_TBL_REF = 162; + JOIN_EXPR = 163; + FROM_EXPR = 164; + INTO_CLAUSE = 165; + COPY_INTO_CLAUSE = 166; + REFRESH_CLAUSE = 167; + FLOW = 168; + GROUPING = 169; + GROUP_ID = 170; + DISTRIBUTED_BY = 171; + DML_ACTION_EXPR = 172; + PART_SELECTED_EXPR = 173; + PART_DEFAULT_EXPR = 174; + PART_BOUND_EXPR = 175; + PART_BOUND_INCLUSION_EXPR = 176; + PART_BOUND_OPEN_EXPR = 177; + PART_LIST_RULE_EXPR = 178; + PART_LIST_NULL_TEST_EXPR = 179; + TABLE_OID_INFO = 180; + EXPR_STATE = 181; + GENERIC_EXPR_STATE = 182; + WHOLE_ROW_VAR_EXPR_STATE = 183; + AGGREF_EXPR_STATE = 184; + WINDOW_FUNC_EXPR_STATE = 185; + ARRAY_REF_EXPR_STATE = 186; + FUNC_EXPR_STATE = 187; + SCALAR_ARRAY_OP_EXPR_STATE = 188; + BOOL_EXPR_STATE = 189; + SUB_PLAN_STATE = 190; + ALTERNATIVE_SUB_PLAN_STATE = 191; + FIELD_SELECT_STATE = 192; + FIELD_STORE_STATE = 193; + COERCE_VIA_IO_STATE = 194; + ARRAY_COERCE_EXPR_STATE = 195; + CONVERT_ROWTYPE_EXPR_STATE = 196; + CASE_EXPR_STATE = 197; + CASE_WHEN_STATE = 198; + ARRAY_EXPR_STATE = 199; + ROW_EXPR_STATE = 200; + ROW_COMPARE_EXPR_STATE = 201; + COALESCE_EXPR_STATE = 202; + MIN_MAX_EXPR_STATE = 203; + XML_EXPR_STATE = 204; + NULL_TEST_STATE = 205; + COERCE_TO_DOMAIN_STATE = 206; + DOMAIN_CONSTRAINT_STATE = 207; + GROUPING_FUNC_EXPR_STATE = 208; + PART_SELECTED_EXPR_STATE = 209; + PART_DEFAULT_EXPR_STATE = 210; + PART_BOUND_EXPR_STATE = 211; + PART_BOUND_INCLUSION_EXPR_STATE = 212; + PART_BOUND_OPEN_EXPR_STATE = 213; + PART_LIST_RULE_EXPR_STATE = 214; + PART_LIST_NULL_TEST_EXPR_STATE = 215; + PLANNER_INFO = 216; + PLANNER_GLOBAL = 217; + REL_OPT_INFO = 218; + INDEX_OPT_INFO = 219; + PARAM_PATH_INFO = 220; + PATH = 221; + APPEND_ONLY_PATH = 222; + AOCS_PATH = 223; + EXTERNAL_PATH = 224; + INDEX_PATH = 225; + BITMAP_HEAP_PATH = 226; + BITMAP_AND_PATH = 227; + BITMAP_OR_PATH = 228; + NEST_PATH = 229; + MERGE_PATH = 230; + HASH_PATH = 231; + TID_PATH = 232; + FOREIGN_PATH = 233; + APPEND_PATH = 234; + MERGE_APPEND_PATH = 235; + RESULT_PATH = 236; + MATERIAL_PATH = 237; + UNIQUE_PATH = 238; + PROJECTION_PATH = 239; + EQUIVALENCE_CLASS = 240; + EQUIVALENCE_MEMBER = 241; + PATH_KEY = 242; + RESTRICT_INFO = 243; + PLACE_HOLDER_VAR = 244; + SPECIAL_JOIN_INFO = 245; + LATERAL_JOIN_INFO = 246; + APPEND_REL_INFO = 247; + PLACE_HOLDER_INFO = 248; + MIN_MAX_AGG_INFO = 249; + PARTITION = 250; + PARTITION_RULE = 251; + PARTITION_NODE = 252; + PG_PART_RULE = 253; + SEGFILE_MAP_NODE = 254; + PLANNER_PARAM_ITEM = 255; + CDB_MOTION_PATH = 256; + PARTITION_SELECTOR_PATH = 257; + CDB_REL_COLUMN_INFO = 258; + DISTRIBUTION_KEY = 259; + MEMORY_CONTEXT = 260; + ALLOC_SET_CONTEXT = 261; + MEMORY_ACCOUNT = 262; + VALUE = 263; + INTEGER = 264; + FLOAT = 265; + STRING = 266; + BIT_STRING = 267; + NULL_VALUE = 268; + LIST = 269; + INT_LIST = 270; + OID_LIST = 271; + QUERY = 272; + PLANNED_STMT = 273; + INSERT_STMT = 274; + DELETE_STMT = 275; + UPDATE_STMT = 276; + SELECT_STMT = 277; + ALTER_TABLE_STMT = 278; + ALTER_TABLE_CMD = 279; + ALTER_DOMAIN_STMT = 280; + SET_OPERATION_STMT = 281; + GRANT_STMT = 282; + GRANT_ROLE_STMT = 283; + ALTER_DEFAULT_PRIVILEGES_STMT = 284; + CLOSE_PORTAL_STMT = 285; + CLUSTER_STMT = 286; + COPY_STMT = 287; + CREATE_STMT = 288; + SINGLE_ROW_ERROR_DESC = 289; + EXT_TABLE_TYPE_DESC = 290; + CREATE_EXTERNAL_STMT = 291; + DEFINE_STMT = 292; + DROP_STMT = 293; + TRUNCATE_STMT = 294; + COMMENT_STMT = 295; + FETCH_STMT = 296; + INDEX_STMT = 297; + CREATE_FUNCTION_STMT = 298; + ALTER_FUNCTION_STMT = 299; + DO_STMT = 300; + RENAME_STMT = 301; + RULE_STMT = 302; + NOTIFY_STMT = 303; + LISTEN_STMT = 304; + UNLISTEN_STMT = 305; + TRANSACTION_STMT = 306; + VIEW_STMT = 307; + LOAD_STMT = 308; + CREATE_DOMAIN_STMT = 309; + CREATEDB_STMT = 310; + DROPDB_STMT = 311; + VACUUM_STMT = 312; + EXPLAIN_STMT = 313; + CREATE_TABLE_AS_STMT = 314; + CREATE_SEQ_STMT = 315; + ALTER_SEQ_STMT = 316; + VARIABLE_SET_STMT = 317; + VARIABLE_SHOW_STMT = 318; + DISCARD_STMT = 319; + CREATE_TRIG_STMT = 320; + CREATE_P_LANG_STMT = 321; + CREATE_ROLE_STMT = 322; + ALTER_ROLE_STMT = 323; + DROP_ROLE_STMT = 324; + CREATE_QUEUE_STMT = 325; + ALTER_QUEUE_STMT = 326; + DROP_QUEUE_STMT = 327; + CREATE_RESOURCE_GROUP_STMT = 328; + DROP_RESOURCE_GROUP_STMT = 329; + ALTER_RESOURCE_GROUP_STMT = 330; + LOCK_STMT = 331; + CONSTRAINTS_SET_STMT = 332; + REINDEX_STMT = 333; + CHECK_POINT_STMT = 334; + CREATE_SCHEMA_STMT = 335; + ALTER_DATABASE_STMT = 336; + ALTER_DATABASE_SET_STMT = 337; + ALTER_ROLE_SET_STMT = 338; + CREATE_CONVERSION_STMT = 339; + CREATE_CAST_STMT = 340; + CREATE_OP_CLASS_STMT = 341; + CREATE_OP_FAMILY_STMT = 342; + ALTER_OP_FAMILY_STMT = 343; + PREPARE_STMT = 344; + EXECUTE_STMT = 345; + DEALLOCATE_STMT = 346; + DECLARE_CURSOR_STMT = 347; + CREATE_TABLE_SPACE_STMT = 348; + DROP_TABLE_SPACE_STMT = 349; + ALTER_OBJECT_SCHEMA_STMT = 350; + ALTER_OWNER_STMT = 351; + DROP_OWNED_STMT = 352; + REASSIGN_OWNED_STMT = 353; + COMPOSITE_TYPE_STMT = 354; + CREATE_ENUM_STMT = 355; + CREATE_RANGE_STMT = 356; + ALTER_ENUM_STMT = 357; + ALTER_TS_DICTIONARY_STMT = 358; + ALTER_TS_CONFIGURATION_STMT = 359; + CREATE_FDW_STMT = 360; + ALTER_FDW_STMT = 361; + CREATE_FOREIGN_SERVER_STMT = 362; + ALTER_FOREIGN_SERVER_STMT = 363; + CREATE_USER_MAPPING_STMT = 364; + ALTER_USER_MAPPING_STMT = 365; + DROP_USER_MAPPING_STMT = 366; + ALTER_TABLE_SPACE_OPTIONS_STMT = 367; + ALTER_TABLE_MOVE_ALL_STMT = 368; + SEC_LABEL_STMT = 369; + CREATE_FOREIGN_TABLE_STMT = 370; + CREATE_EXTENSION_STMT = 371; + ALTER_EXTENSION_STMT = 372; + ALTER_EXTENSION_CONTENTS_STMT = 373; + CREATE_EVENT_TRIG_STMT = 374; + ALTER_EVENT_TRIG_STMT = 375; + REFRESH_MAT_VIEW_STMT = 376; + REPLICA_IDENTITY_STMT = 377; + ALTER_SYSTEM_STMT = 378; + PARTITION_BY = 379; + PARTITION_ELEM = 380; + PARTITION_RANGE_ITEM = 381; + PARTITION_BOUND_SPEC = 382; + PARTITION_SPEC = 383; + PARTITION_VALUES_SPEC = 384; + ALTER_PARTITION_ID = 385; + ALTER_PARTITION_CMD = 386; + INHERIT_PARTITION_CMD = 387; + CREATE_FILE_SPACE_STMT = 388; + FILE_SPACE_ENTRY = 389; + DROP_FILE_SPACE_STMT = 390; + TABLE_VALUE_EXPR = 391; + DENY_LOGIN_INTERVAL = 392; + DENY_LOGIN_POINT = 393; + ALTER_TYPE_STMT = 394; + SET_DISTRIBUTION_CMD = 395; + EXPAND_STMT_SPEC = 396; + A_EXPR = 397; + COLUMN_REF = 398; + PARAM_REF = 399; + A_CONST = 400; + FUNC_CALL = 401; + A_STAR = 402; + A_INDICES = 403; + A_INDIRECTION = 404; + A_ARRAY_EXPR = 405; + RES_TARGET = 406; + TYPE_CAST = 407; + COLLATE_CLAUSE = 408; + SORT_BY = 409; + WINDOW_DEF = 410; + RANGE_SUBSELECT = 411; + RANGE_FUNCTION = 412; + TYPE_NAME = 413; + COLUMN_DEF = 414; + INDEX_ELEM = 415; + CONSTRAINT = 416; + DEF_ELEM = 417; + RANGE_TBL_ENTRY = 418; + RANGE_TBL_FUNCTION = 419; + WITH_CHECK_OPTION = 420; + GROUPING_CLAUSE = 421; + GROUPING_FUNC = 422; + SORT_GROUP_CLAUSE = 423; + WINDOW_CLAUSE = 424; + PRIV_GRANTEE = 425; + FUNC_WITH_ARGS = 426; + ACCESS_PRIV = 427; + CREATE_OP_CLASS_ITEM = 428; + TABLE_LIKE_CLAUSE = 429; + FUNCTION_PARAMETER = 430; + LOCKING_CLAUSE = 431; + ROW_MARK_CLAUSE = 432; + XML_SERIALIZE = 433; + WITH_CLAUSE = 434; + COMMON_TABLE_EXPR = 435; + COLUMN_REFERENCE_STORAGE_DIRECTIVE = 436; + IDENTIFY_SYSTEM_CMD = 437; + BASE_BACKUP_CMD = 438; + CREATE_REPLICATION_SLOT_CMD = 439; + DROP_REPLICATION_SLOT_CMD = 440; + START_REPLICATION_CMD = 441; + TIME_LINE_HISTORY_CMD = 442; + TRIGGER_DATA = 443; + EVENT_TRIGGER_DATA = 444; + RETURN_SET_INFO = 445; + WINDOW_OBJECT_DATA = 446; + TID_BITMAP = 447; + INLINE_CODE_BLOCK = 448; + FDW_ROUTINE = 449; + STREAM_BITMAP = 450; + FORMATTER_DATA = 451; + EXT_PROTOCOL_DATA = 452; + EXT_PROTOCOL_VALIDATOR_DATA = 453; + SELECTED_PARTS = 454; + COOKED_CONSTRAINT = 455; + CDB_EXPLAIN_STAT_HDR = 456; + GP_POLICY = 457; + RETRIEVE_STMT = 458; +} diff --git a/gpcontrib/yagp_hooks_collector/protos/yagpcc_set_service.proto b/gpcontrib/yagp_hooks_collector/protos/yagpcc_set_service.proto new file mode 100644 index 00000000000..0b9e34df49d --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/protos/yagpcc_set_service.proto @@ -0,0 +1,53 @@ +syntax = "proto3"; + +import "google/protobuf/timestamp.proto"; + +import "protos/yagpcc_metrics.proto"; +import "protos/yagpcc_plan.proto"; + +package yagpcc; +option java_outer_classname = "SegmentYAGPCCAS"; +option go_package = "a.yandex-team.ru/cloud/mdb/yagpcc/api/proto/agent_segment;greenplum"; + +service SetQueryInfo { + rpc SetMetricPlanNode (SetPlanNodeReq) returns (MetricResponse) {} + + rpc SetMetricQuery (SetQueryReq) returns (MetricResponse) {} +} + +message MetricResponse { + MetricResponseStatusCode error_code = 1; + string error_text = 2; +} + +enum MetricResponseStatusCode { + METRIC_RESPONSE_STATUS_CODE_UNSPECIFIED = 0; + METRIC_RESPONSE_STATUS_CODE_SUCCESS = 1; + METRIC_RESPONSE_STATUS_CODE_ERROR = 2; +} + +message SetQueryReq { + QueryStatus query_status = 1; + google.protobuf.Timestamp datetime = 2; + QueryKey query_key = 3; + SegmentKey segment_key = 4; + QueryInfo query_info = 5; + GPMetrics query_metrics = 6; + repeated MetricPlan plan_tree = 7; + google.protobuf.Timestamp submit_time = 8; + google.protobuf.Timestamp start_time = 9; + google.protobuf.Timestamp end_time = 10; + AdditionalQueryInfo add_info = 11; +} + +message SetPlanNodeReq { + PlanNodeStatus node_status = 1; + google.protobuf.Timestamp datetime = 2; + QueryKey query_key = 3; + SegmentKey segment_key = 4; + GPMetrics node_metrics = 5; + MetricPlan plan_node = 6; + google.protobuf.Timestamp submit_time = 7; + google.protobuf.Timestamp start_time = 8; + google.protobuf.Timestamp end_time = 9; +} diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_cursors.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_cursors.sql new file mode 100644 index 00000000000..f56351e0d43 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_cursors.sql @@ -0,0 +1,85 @@ +CREATE EXTENSION yagp_hooks_collector; + +CREATE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; + +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; + +-- DECLARE +SET yagpcc.logging_mode to 'TBL'; + +BEGIN; +DECLARE cursor_stats_0 CURSOR FOR SELECT 0; +CLOSE cursor_stats_0; +COMMIT; + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- DECLARE WITH HOLD +SET yagpcc.logging_mode to 'TBL'; + +BEGIN; +DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 1; +CLOSE cursor_stats_1; +DECLARE cursor_stats_2 CURSOR WITH HOLD FOR SELECT 2; +CLOSE cursor_stats_2; +COMMIT; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- ROLLBACK +SET yagpcc.logging_mode to 'TBL'; + +BEGIN; +DECLARE cursor_stats_3 CURSOR FOR SELECT 1; +CLOSE cursor_stats_3; +DECLARE cursor_stats_4 CURSOR FOR SELECT 1; +ROLLBACK; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- FETCH +SET yagpcc.logging_mode to 'TBL'; + +BEGIN; +DECLARE cursor_stats_5 CURSOR WITH HOLD FOR SELECT 2; +DECLARE cursor_stats_6 CURSOR WITH HOLD FOR SELECT 3; +FETCH 1 IN cursor_stats_5; +FETCH 1 IN cursor_stats_6; +CLOSE cursor_stats_5; +CLOSE cursor_stats_6; +COMMIT; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_dist.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_dist.sql new file mode 100644 index 00000000000..d5519d0cd96 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_dist.sql @@ -0,0 +1,88 @@ +CREATE EXTENSION yagp_hooks_collector; + +CREATE OR REPLACE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; + +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; +SET yagpcc.enable_utility TO FALSE; + +-- Hash distributed table + +CREATE TABLE test_hash_dist (id int) DISTRIBUTED BY (id); +INSERT INTO test_hash_dist SELECT 1; + +SET yagpcc.logging_mode to 'TBL'; +SET optimizer_enable_direct_dispatch TO TRUE; +-- Direct dispatch is used here, only one segment is scanned. +select * from test_hash_dist where id = 1; +RESET optimizer_enable_direct_dispatch; + +RESET yagpcc.logging_mode; +-- Should see 8 rows. +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +SET yagpcc.logging_mode to 'TBL'; + +-- Scan all segments. +select * from test_hash_dist; + +DROP TABLE test_hash_dist; +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Replicated table +CREATE FUNCTION force_segments() RETURNS SETOF text AS $$ +BEGIN + RETURN NEXT 'seg'; +END; +$$ LANGUAGE plpgsql VOLATILE EXECUTE ON ALL SEGMENTS; + +CREATE TABLE test_replicated (id int) DISTRIBUTED REPLICATED; +INSERT INTO test_replicated SELECT 1; + +SET yagpcc.logging_mode to 'TBL'; +SELECT COUNT(*) FROM test_replicated, force_segments(); +DROP TABLE test_replicated; +DROP FUNCTION force_segments(); + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Partially distributed table (2 numsegments) +SET allow_system_table_mods = ON; +CREATE TABLE test_partial_dist (id int, data text) DISTRIBUTED BY (id); +UPDATE gp_distribution_policy SET numsegments = 2 WHERE localoid = 'test_partial_dist'::regclass; +INSERT INTO test_partial_dist SELECT * FROM generate_series(1, 100); + +SET yagpcc.logging_mode to 'TBL'; +SELECT COUNT(*) FROM test_partial_dist; +RESET yagpcc.logging_mode; + +DROP TABLE test_partial_dist; +RESET allow_system_table_mods; +-- Should see 12 rows. +SELECT query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_guc_cache.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_guc_cache.sql new file mode 100644 index 00000000000..9e6de69d61e --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_guc_cache.sql @@ -0,0 +1,43 @@ +-- +-- Test GUC caching for query lifecycle consistency. +-- +-- The extension logs SUBMIT and DONE events for each query. +-- GUC values that control logging (enable_utility, ignored_users_list, ...) +-- must be cached at SUBMIT time to ensure DONE uses the same filtering +-- criteria. Otherwise, a SET command that modifies these GUCs would +-- have its DONE event rejected, creating orphaned SUBMIT entries. +-- This is due to query being actually executed between SUBMIT and DONE. +-- start_ignore +CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; +SELECT yagpcc.truncate_log(); +-- end_ignore + +CREATE OR REPLACE FUNCTION print_last_query(query text) +RETURNS TABLE(query_status text) AS $$ + SELECT query_status + FROM yagpcc.log + WHERE segid = -1 AND query_text = query + ORDER BY ccnt DESC +$$ LANGUAGE sql; + +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.logging_mode TO 'TBL'; + +-- SET below disables utility logging and DONE must still be logged. +SET yagpcc.enable_utility TO FALSE; +SELECT * FROM print_last_query('SET yagpcc.enable_utility TO FALSE;'); + +-- SELECT below adds current user to ignore list and DONE must still be logged. +-- start_ignore +SELECT set_config('yagpcc.ignored_users_list', current_user, false); +-- end_ignore +SELECT * FROM print_last_query('SELECT set_config(''yagpcc.ignored_users_list'', current_user, false);'); + +DROP FUNCTION print_last_query(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; +RESET yagpcc.logging_mode; diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_locale.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_locale.sql new file mode 100644 index 00000000000..65d867d1680 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_locale.sql @@ -0,0 +1,29 @@ +-- The extension generates normalized query text and plan using jumbling functions. +-- Those functions may fail when translating to wide character if the current locale +-- cannot handle the character set. This test checks that even when those functions +-- fail, the plan is still generated and executed. This test is partially taken from +-- gp_locale. + +-- start_ignore +DROP DATABASE IF EXISTS yagp_test_locale; +-- end_ignore + +CREATE DATABASE yagp_test_locale WITH LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0; +\c yagp_test_locale + +CREATE EXTENSION yagp_hooks_collector; + +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.enable TO TRUE; + +CREATE TABLE yagp_hi_안녕세계 (a int, 안녕세계1 text, 안녕세계2 text, 안녕세계3 text) DISTRIBUTED BY (a); +INSERT INTO yagp_hi_안녕세계 VALUES(1, '안녕세계1 first', '안녕세2 first', '안녕세계3 first'); +-- Should not see error here +UPDATE yagp_hi_안녕세계 SET 안녕세계1='안녕세계1 first UPDATE' WHERE 안녕세계1='안녕세계1 first'; + +RESET yagpcc.enable; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; +DROP TABLE yagp_hi_안녕세계; +DROP EXTENSION yagp_hooks_collector; diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_select.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_select.sql new file mode 100644 index 00000000000..90e972ae4c1 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_select.sql @@ -0,0 +1,69 @@ +CREATE EXTENSION yagp_hooks_collector; + +CREATE OR REPLACE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; + +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; +SET yagpcc.enable_utility TO FALSE; + +-- Basic SELECT tests +SET yagpcc.logging_mode to 'TBL'; + +SELECT 1; +SELECT COUNT(*) FROM generate_series(1,10); + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Transaction test +SET yagpcc.logging_mode to 'TBL'; + +BEGIN; +SELECT 1; +COMMIT; + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- CTE test +SET yagpcc.logging_mode to 'TBL'; + +WITH t AS (VALUES (1), (2)) +SELECT * FROM t; + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Prepared statement test +SET yagpcc.logging_mode to 'TBL'; + +PREPARE test_stmt AS SELECT 1; +EXECUTE test_stmt; +DEALLOCATE test_stmt; + +RESET yagpcc.logging_mode; +SELECT segid, query_text, query_status FROM yagpcc.log ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_uds.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_uds.sql new file mode 100644 index 00000000000..3eef697a4e7 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_uds.sql @@ -0,0 +1,31 @@ +-- Test UDS socket +-- start_ignore +CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; +-- end_ignore + +\set UDS_PATH '/tmp/yagpcc_test.sock' + +-- Configure extension to send via UDS +SET yagpcc.uds_path TO :'UDS_PATH'; +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.logging_mode TO 'UDS'; + +-- Start receiver +SELECT yagpcc.__test_uds_start_server(:'UDS_PATH'); + +-- Send +SELECT 1; + +-- Receive +SELECT yagpcc.__test_uds_receive() > 0 as received; + +-- Stop receiver +SELECT yagpcc.__test_uds_stop_server(); + +-- Cleanup +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.uds_path; +RESET yagpcc.ignored_users_list; +RESET yagpcc.enable; +RESET yagpcc.logging_mode; diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_utf8_trim.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_utf8_trim.sql new file mode 100644 index 00000000000..c3053e4af0c --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_utf8_trim.sql @@ -0,0 +1,45 @@ +CREATE EXTENSION IF NOT EXISTS yagp_hooks_collector; + +CREATE OR REPLACE FUNCTION get_marked_query(marker TEXT) +RETURNS TEXT AS $$ + SELECT query_text + FROM yagpcc.log + WHERE query_text LIKE '%' || marker || '%' + ORDER BY datetime DESC + LIMIT 1 +$$ LANGUAGE sql VOLATILE; + +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; + +-- Test 1: 1 byte chars +SET yagpcc.max_text_size to 19; +SET yagpcc.logging_mode to 'TBL'; +SELECT /*test1*/ 'HelloWorld'; +RESET yagpcc.logging_mode; +SELECT octet_length(get_marked_query('test1')) = 19 AS correct_length; + +-- Test 2: 2 byte chars +SET yagpcc.max_text_size to 19; +SET yagpcc.logging_mode to 'TBL'; +SELECT /*test2*/ 'РУССКИЙЯЗЫК'; +RESET yagpcc.logging_mode; +-- Character 'Р' has two bytes and cut in the middle => not included. +SELECT octet_length(get_marked_query('test2')) = 18 AS correct_length; + +-- Test 3: 4 byte chars +SET yagpcc.max_text_size to 21; +SET yagpcc.logging_mode to 'TBL'; +SELECT /*test3*/ '😀'; +RESET yagpcc.logging_mode; +-- Emoji has 4 bytes and cut before the last byte => not included. +SELECT octet_length(get_marked_query('test3')) = 18 AS correct_length; + +-- Cleanup +DROP FUNCTION get_marked_query(TEXT); +RESET yagpcc.max_text_size; +RESET yagpcc.logging_mode; +RESET yagpcc.enable; +RESET yagpcc.ignored_users_list; + +DROP EXTENSION yagp_hooks_collector; diff --git a/gpcontrib/yagp_hooks_collector/sql/yagp_utility.sql b/gpcontrib/yagp_hooks_collector/sql/yagp_utility.sql new file mode 100644 index 00000000000..cf9c1d253d0 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/sql/yagp_utility.sql @@ -0,0 +1,135 @@ +CREATE EXTENSION yagp_hooks_collector; + +CREATE OR REPLACE FUNCTION yagp_status_order(status text) +RETURNS integer +AS $$ +BEGIN + RETURN CASE status + WHEN 'QUERY_STATUS_SUBMIT' THEN 1 + WHEN 'QUERY_STATUS_START' THEN 2 + WHEN 'QUERY_STATUS_END' THEN 3 + WHEN 'QUERY_STATUS_DONE' THEN 4 + ELSE 999 + END; +END; +$$ LANGUAGE plpgsql IMMUTABLE; + +SET yagpcc.ignored_users_list TO ''; +SET yagpcc.enable TO TRUE; +SET yagpcc.enable_utility TO TRUE; +SET yagpcc.report_nested_queries TO TRUE; + +SET yagpcc.logging_mode to 'TBL'; + +CREATE TABLE test_table (a int, b text); +CREATE INDEX test_idx ON test_table(a); +ALTER TABLE test_table ADD COLUMN c int DEFAULT 1; +DROP TABLE test_table; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Partitioning +SET yagpcc.logging_mode to 'TBL'; + +CREATE TABLE pt_test (a int, b int) +DISTRIBUTED BY (a) +PARTITION BY RANGE (a) +(START (0) END (100) EVERY (50)); +DROP TABLE pt_test; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Views and Functions +SET yagpcc.logging_mode to 'TBL'; + +CREATE VIEW test_view AS SELECT 1 AS a; +CREATE FUNCTION test_func(i int) RETURNS int AS $$ SELECT $1 + 1; $$ LANGUAGE SQL; +DROP VIEW test_view; +DROP FUNCTION test_func(int); + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Transaction Operations +SET yagpcc.logging_mode to 'TBL'; + +BEGIN; +SAVEPOINT sp1; +ROLLBACK TO sp1; +COMMIT; + +BEGIN; +SAVEPOINT sp2; +ABORT; + +BEGIN; +ROLLBACK; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- DML Operations +SET yagpcc.logging_mode to 'TBL'; + +CREATE TABLE dml_test (a int, b text); +INSERT INTO dml_test VALUES (1, 'test'); +UPDATE dml_test SET b = 'updated' WHERE a = 1; +DELETE FROM dml_test WHERE a = 1; +DROP TABLE dml_test; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- COPY Operations +SET yagpcc.logging_mode to 'TBL'; + +CREATE TABLE copy_test (a int); +COPY (SELECT 1) TO STDOUT; +DROP TABLE copy_test; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- Prepared Statements and error during execute +SET yagpcc.logging_mode to 'TBL'; + +PREPARE test_prep(int) AS SELECT $1/0 AS value; +EXECUTE test_prep(0::int); +DEALLOCATE test_prep; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +-- GUC Settings +SET yagpcc.logging_mode to 'TBL'; + +SET yagpcc.report_nested_queries TO FALSE; +RESET yagpcc.report_nested_queries; + +RESET yagpcc.logging_mode; + +SELECT segid, query_text, query_status FROM yagpcc.log WHERE segid = -1 AND utility = true ORDER BY segid, ccnt, yagp_status_order(query_status) ASC; +SELECT yagpcc.truncate_log() IS NOT NULL AS t; + +DROP FUNCTION yagp_status_order(text); +DROP EXTENSION yagp_hooks_collector; +RESET yagpcc.enable; +RESET yagpcc.report_nested_queries; +RESET yagpcc.enable_utility; +RESET yagpcc.ignored_users_list; diff --git a/gpcontrib/yagp_hooks_collector/src/Config.cpp b/gpcontrib/yagp_hooks_collector/src/Config.cpp new file mode 100644 index 00000000000..62c16e91d1f --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/Config.cpp @@ -0,0 +1,177 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * Config.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/Config.cpp + * + *------------------------------------------------------------------------- + */ + +#include "Config.h" +#include "memory/gpdbwrappers.h" +#include +#include +#include +#include + +extern "C" { +#include "postgres.h" +#include "utils/guc.h" +} + +static char *guc_uds_path = nullptr; +static bool guc_enable_analyze = true; +static bool guc_enable_cdbstats = true; +static bool guc_enable_collector = true; +static bool guc_report_nested_queries = true; +static char *guc_ignored_users = nullptr; +static int guc_max_text_size = 1 << 20; // in bytes (1MB) +static int guc_max_plan_size = 1024; // in KB +static int guc_min_analyze_time = 10000; // in ms +static int guc_logging_mode = LOG_MODE_UDS; +static bool guc_enable_utility = false; + +static const struct config_enum_entry logging_mode_options[] = { + {"uds", LOG_MODE_UDS, false /* hidden */}, + {"tbl", LOG_MODE_TBL, false}, + {NULL, 0, false}}; + +static bool ignored_users_guc_dirty = false; + +static void assign_ignored_users_hook(const char *, void *) { + ignored_users_guc_dirty = true; +} + +void Config::init_gucs() { + DefineCustomStringVariable( + "yagpcc.uds_path", "Sets filesystem path of the agent socket", 0LL, + &guc_uds_path, "/tmp/yagpcc_agent.sock", PGC_SUSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, 0LL, 0LL, 0LL); + + DefineCustomBoolVariable( + "yagpcc.enable", "Enable metrics collector", 0LL, &guc_enable_collector, + true, PGC_SUSET, GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, 0LL, 0LL, 0LL); + + DefineCustomBoolVariable( + "yagpcc.enable_analyze", "Collect analyze metrics in yagpcc", 0LL, + &guc_enable_analyze, true, PGC_SUSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, 0LL, 0LL, 0LL); + + DefineCustomBoolVariable( + "yagpcc.enable_cdbstats", "Collect CDB metrics in yagpcc", 0LL, + &guc_enable_cdbstats, true, PGC_SUSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, 0LL, 0LL, 0LL); + + DefineCustomBoolVariable( + "yagpcc.report_nested_queries", "Collect stats on nested queries", 0LL, + &guc_report_nested_queries, true, PGC_USERSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, 0LL, 0LL, 0LL); + + DefineCustomStringVariable("yagpcc.ignored_users_list", + "Make yagpcc ignore queries issued by given users", + 0LL, &guc_ignored_users, + "gpadmin,repl,gpperfmon,monitor", PGC_SUSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, 0LL, + assign_ignored_users_hook, 0LL); + + DefineCustomIntVariable( + "yagpcc.max_text_size", + "Make yagpcc trim query texts longer than configured size in bytes", NULL, + &guc_max_text_size, 1 << 20 /* 1MB */, 0, INT_MAX, PGC_SUSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, NULL, NULL, NULL); + + DefineCustomIntVariable( + "yagpcc.max_plan_size", + "Make yagpcc trim plan longer than configured size", NULL, + &guc_max_plan_size, 1024, 0, INT_MAX / 1024, PGC_SUSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC | GUC_UNIT_KB, NULL, NULL, NULL); + + DefineCustomIntVariable( + "yagpcc.min_analyze_time", + "Sets the minimum execution time above which plans will be logged.", + "Zero prints all plans. -1 turns this feature off.", + &guc_min_analyze_time, 10000, -1, INT_MAX, PGC_USERSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC | GUC_UNIT_MS, NULL, NULL, NULL); + + DefineCustomEnumVariable( + "yagpcc.logging_mode", "Logging mode: UDS or PG Table", NULL, + &guc_logging_mode, LOG_MODE_UDS, logging_mode_options, PGC_SUSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC | GUC_SUPERUSER_ONLY, NULL, NULL, + NULL); + + DefineCustomBoolVariable( + "yagpcc.enable_utility", "Collect utility statement stats", NULL, + &guc_enable_utility, false, PGC_USERSET, + GUC_NOT_IN_SAMPLE | GUC_GPDB_NEED_SYNC, NULL, NULL, NULL); +} + +void Config::update_ignored_users(const char *new_guc_ignored_users) { + auto new_ignored_users_set = std::make_unique(); + if (new_guc_ignored_users != nullptr && new_guc_ignored_users[0] != '\0') { + /* Need a modifiable copy of string */ + char *rawstring = ya_gpdb::pstrdup(new_guc_ignored_users); + List *elemlist; + ListCell *l; + + /* Parse string into list of identifiers */ + if (!ya_gpdb::split_identifier_string(rawstring, ',', &elemlist)) { + /* syntax error in list */ + ya_gpdb::pfree(rawstring); + ya_gpdb::list_free(elemlist); + ereport( + LOG, + (errcode(ERRCODE_SYNTAX_ERROR), + errmsg( + "invalid list syntax in parameter yagpcc.ignored_users_list"))); + return; + } + foreach (l, elemlist) { + new_ignored_users_set->insert((char *)lfirst(l)); + } + ya_gpdb::pfree(rawstring); + ya_gpdb::list_free(elemlist); + } + ignored_users_ = std::move(new_ignored_users_set); +} + +bool Config::filter_user(const std::string &username) const { + if (!ignored_users_) { + return true; + } + return ignored_users_->find(username) != ignored_users_->end(); +} + +void Config::sync() { + if (ignored_users_guc_dirty) { + update_ignored_users(guc_ignored_users); + ignored_users_guc_dirty = false; + } + uds_path_ = guc_uds_path; + enable_analyze_ = guc_enable_analyze; + enable_cdbstats_ = guc_enable_cdbstats; + enable_collector_ = guc_enable_collector; + enable_utility_ = guc_enable_utility; + report_nested_queries_ = guc_report_nested_queries; + max_text_size_ = guc_max_text_size; + max_plan_size_ = guc_max_plan_size; + min_analyze_time_ = guc_min_analyze_time; + logging_mode_ = guc_logging_mode; +} diff --git a/gpcontrib/yagp_hooks_collector/src/Config.h b/gpcontrib/yagp_hooks_collector/src/Config.h new file mode 100644 index 00000000000..01ae5ea328e --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/Config.h @@ -0,0 +1,71 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * Config.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/Config.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#include +#include +#include + +#define LOG_MODE_UDS 0 +#define LOG_MODE_TBL 1 + +using IgnoredUsers = std::unordered_set; + +class Config { +public: + static void init_gucs(); + + void sync(); + + const std::string &uds_path() const { return uds_path_; } + bool enable_analyze() const { return enable_analyze_; } + bool enable_cdbstats() const { return enable_cdbstats_; } + bool enable_collector() const { return enable_collector_; } + bool enable_utility() const { return enable_utility_; } + bool report_nested_queries() const { return report_nested_queries_; } + int max_text_size() const { return max_text_size_; } + int max_plan_size() const { return max_plan_size_ * 1024; } + int min_analyze_time() const { return min_analyze_time_; } + int logging_mode() const { return logging_mode_; } + bool filter_user(const std::string &username) const; + +private: + void update_ignored_users(const char *new_guc_ignored_users); + + std::unique_ptr ignored_users_; + std::string uds_path_; + bool enable_analyze_; + bool enable_cdbstats_; + bool enable_collector_; + bool enable_utility_; + bool report_nested_queries_; + int max_text_size_; + int max_plan_size_; + int min_analyze_time_; + int logging_mode_; +}; diff --git a/gpcontrib/yagp_hooks_collector/src/EventSender.cpp b/gpcontrib/yagp_hooks_collector/src/EventSender.cpp new file mode 100644 index 00000000000..6993814ffbf --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/EventSender.cpp @@ -0,0 +1,531 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * EventSender.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/EventSender.cpp + * + *------------------------------------------------------------------------- + */ + +#include "UDSConnector.h" +#include "memory/gpdbwrappers.h" +#include "log/LogOps.h" + +#define typeid __typeid +extern "C" { +#include "postgres.h" + +#include "executor/executor.h" +#include "utils/elog.h" +#include "utils/guc.h" + +#include "cdb/cdbexplain.h" +#include "cdb/cdbvars.h" +#include "cdb/ml_ipc.h" +} +#undef typeid + +#include "EventSender.h" +#include "PgUtils.h" +#include "ProtoUtils.h" + +#define need_collect_analyze() \ + (Gp_role == GP_ROLE_DISPATCH && config.min_analyze_time() >= 0 && \ + config.enable_analyze()) + +bool EventSender::verify_query(QueryDesc *query_desc, QueryState state, + bool utility) { + if (!proto_verified) { + return false; + } + if (Gp_role != GP_ROLE_DISPATCH && Gp_role != GP_ROLE_EXECUTE) { + return false; + } + + switch (state) { + case QueryState::SUBMIT: + // Cache GUCs once at SUBMIT. Synced GUCs are visible to all subsequent + // states. Without caching, a query that unsets/sets filtering GUCs would + // see different filter criteria at DONE, because at SUBMIT the query was + // not executed yet, causing DONE to be skipped/added. + config.sync(); + + if (utility && !config.enable_utility()) { + return false; + } + + // Register qkey for a nested query we won't report, + // so we can detect nesting_level > 0 and skip reporting at end/done. + if (!need_report_nested_query() && nesting_level > 0) { + QueryKey::register_qkey(query_desc, nesting_level); + return false; + } + if (is_top_level_query(query_desc, nesting_level)) { + nested_timing = 0; + nested_calls = 0; + } + break; + case QueryState::START: + if (!qdesc_submitted(query_desc)) { + collect_query_submit(query_desc, false /* utility */); + } + break; + case QueryState::DONE: + if (utility && !config.enable_utility()) { + return false; + } + default: + break; + } + + if (filter_query(query_desc)) { + return false; + } + if (!nesting_is_valid(query_desc, nesting_level)) { + return false; + } + + return true; +} + +bool EventSender::log_query_req(const yagpcc::SetQueryReq &req, + const std::string &event, bool utility) { + bool clear_big_fields = false; + switch (config.logging_mode()) { + case LOG_MODE_UDS: + clear_big_fields = UDSConnector::report_query(req, event, config); + break; + case LOG_MODE_TBL: + ya_gpdb::insert_log(req, utility); + clear_big_fields = false; + break; + default: + Assert(false); + } + return clear_big_fields; +} + +void EventSender::query_metrics_collect(QueryMetricsStatus status, void *arg, + bool utility, ErrorData *edata) { + auto *query_desc = reinterpret_cast(arg); + switch (status) { + case METRICS_PLAN_NODE_INITIALIZE: + case METRICS_PLAN_NODE_EXECUTING: + case METRICS_PLAN_NODE_FINISHED: + // TODO + break; + case METRICS_QUERY_SUBMIT: + collect_query_submit(query_desc, utility); + break; + case METRICS_QUERY_START: + // no-op: executor_after_start is enough + break; + case METRICS_QUERY_CANCELING: + // it appears we're only interested in the actual CANCELED event. + // for now we will ignore CANCELING state unless otherwise requested from + // end users + break; + case METRICS_QUERY_DONE: + case METRICS_QUERY_ERROR: + case METRICS_QUERY_CANCELED: + case METRICS_INNER_QUERY_DONE: + collect_query_done(query_desc, utility, status, edata); + break; + default: + ereport(FATAL, (errmsg("Unknown query status: %d", status))); + } +} + +void EventSender::executor_before_start(QueryDesc *query_desc, int eflags) { + if (!verify_query(query_desc, QueryState::START, false /* utility*/)) { + return; + } + + if (Gp_role == GP_ROLE_DISPATCH && config.enable_analyze() && + (eflags & EXEC_FLAG_EXPLAIN_ONLY) == 0) { + query_desc->instrument_options |= INSTRUMENT_BUFFERS; + query_desc->instrument_options |= INSTRUMENT_ROWS; + query_desc->instrument_options |= INSTRUMENT_TIMER; + if (config.enable_cdbstats()) { + query_desc->instrument_options |= INSTRUMENT_CDB; + if (!query_desc->showstatctx) { + instr_time starttime; + INSTR_TIME_SET_CURRENT(starttime); + query_desc->showstatctx = + ya_gpdb::cdbexplain_showExecStatsBegin(query_desc, starttime); + } + } + } +} + +void EventSender::executor_after_start(QueryDesc *query_desc, int /* eflags*/) { + if (!verify_query(query_desc, QueryState::START, false /* utility */)) { + return; + } + + auto &query = get_query(query_desc); + auto query_msg = query.message.get(); + *query_msg->mutable_start_time() = current_ts(); + update_query_state(query, QueryState::START, false /* utility */); + set_query_plan(query_msg, query_desc, config); + if (need_collect_analyze()) { + // Set up to track total elapsed time during query run. + // Make sure the space is allocated in the per-query + // context so it will go away at executor_end. + if (query_desc->totaltime == NULL) { + MemoryContext oldcxt = + ya_gpdb::mem_ctx_switch_to(query_desc->estate->es_query_cxt); + query_desc->totaltime = ya_gpdb::instr_alloc(1, INSTRUMENT_ALL, false); + ya_gpdb::mem_ctx_switch_to(oldcxt); + } + } + yagpcc::GPMetrics stats; + std::swap(stats, *query_msg->mutable_query_metrics()); + if (log_query_req(*query_msg, "started", false /* utility */)) { + clear_big_fields(query_msg); + } + std::swap(stats, *query_msg->mutable_query_metrics()); +} + +void EventSender::executor_end(QueryDesc *query_desc) { + if (!verify_query(query_desc, QueryState::END, false /* utility */)) { + return; + } + + auto &query = get_query(query_desc); + auto *query_msg = query.message.get(); + *query_msg->mutable_end_time() = current_ts(); + update_query_state(query, QueryState::END, false /* utility */); + if (is_top_level_query(query_desc, nesting_level)) { + set_gp_metrics(query_msg->mutable_query_metrics(), query_desc, nested_calls, + nested_timing); + } else { + set_gp_metrics(query_msg->mutable_query_metrics(), query_desc, 0, 0); + } + if (log_query_req(*query_msg, "ended", false /* utility */)) { + clear_big_fields(query_msg); + } +} + +void EventSender::collect_query_submit(QueryDesc *query_desc, bool utility) { + if (!verify_query(query_desc, QueryState::SUBMIT, utility)) { + return; + } + + submit_query(query_desc); + auto &query = get_query(query_desc); + auto *query_msg = query.message.get(); + *query_msg = create_query_req(yagpcc::QueryStatus::QUERY_STATUS_SUBMIT); + *query_msg->mutable_submit_time() = current_ts(); + set_query_info(query_msg); + set_qi_nesting_level(query_msg, nesting_level); + set_qi_slice_id(query_msg); + set_query_text(query_msg, query_desc, config); + if (log_query_req(*query_msg, "submit", utility)) { + clear_big_fields(query_msg); + } + // take initial metrics snapshot so that we can safely take diff afterwards + // in END or DONE events. + set_gp_metrics(query_msg->mutable_query_metrics(), query_desc, 0, 0); +#ifdef IC_TEARDOWN_HOOK + // same for interconnect statistics + ic_metrics_collect(); + set_ic_stats(query_msg->mutable_query_metrics()->mutable_instrumentation(), + &ic_statistics); +#endif +} + +void EventSender::report_query_done(QueryDesc *query_desc, QueryItem &query, + QueryMetricsStatus status, bool utility, + ErrorData *edata) { + yagpcc::QueryStatus query_status; + std::string msg; + switch (status) { + case METRICS_QUERY_DONE: + case METRICS_INNER_QUERY_DONE: + query_status = yagpcc::QueryStatus::QUERY_STATUS_DONE; + msg = "done"; + break; + case METRICS_QUERY_ERROR: + query_status = yagpcc::QueryStatus::QUERY_STATUS_ERROR; + msg = "error"; + break; + case METRICS_QUERY_CANCELING: + // at the moment we don't track this event, but I`ll leave this code + // here just in case + Assert(false); + query_status = yagpcc::QueryStatus::QUERY_STATUS_CANCELLING; + msg = "cancelling"; + break; + case METRICS_QUERY_CANCELED: + query_status = yagpcc::QueryStatus::QUERY_STATUS_CANCELED; + msg = "cancelled"; + break; + default: + ereport(FATAL, + (errmsg("Unexpected query status in query_done hook: %d", status))); + } + auto prev_state = query.state; + update_query_state(query, QueryState::DONE, utility, + query_status == yagpcc::QueryStatus::QUERY_STATUS_DONE); + auto query_msg = query.message.get(); + query_msg->set_query_status(query_status); + if (status == METRICS_QUERY_ERROR) { + bool error_flushed = elog_message() == NULL; + if (error_flushed && (edata == NULL || edata->message == NULL)) { + ereport(WARNING, (errmsg("YAGPCC missing error message"))); + ereport(DEBUG3, + (errmsg("YAGPCC query sourceText: %s", query_desc->sourceText))); + } else { + set_qi_error_message( + query_msg, error_flushed ? edata->message : elog_message(), config); + } + } + if (prev_state == START) { + // We've missed ExecutorEnd call due to query cancel or error. It's + // fine, but now we need to collect and report execution stats + *query_msg->mutable_end_time() = current_ts(); + set_gp_metrics(query_msg->mutable_query_metrics(), query_desc, nested_calls, + nested_timing); + } +#ifdef IC_TEARDOWN_HOOK + ic_metrics_collect(); + set_ic_stats(query_msg->mutable_query_metrics()->mutable_instrumentation(), + &ic_statistics); +#endif + (void)log_query_req(*query_msg, msg, utility); +} + +void EventSender::collect_query_done(QueryDesc *query_desc, bool utility, + QueryMetricsStatus status, + ErrorData *edata) { + if (!verify_query(query_desc, QueryState::DONE, utility)) { + return; + } + + // Skip sending done message if query errored before submit. + if (!qdesc_submitted(query_desc)) { + if (status != METRICS_QUERY_ERROR) { + ereport(WARNING, (errmsg("YAGPCC trying to process DONE hook for " + "unsubmitted and unerrored query"))); + ereport(DEBUG3, + (errmsg("YAGPCC query sourceText: %s", query_desc->sourceText))); + } + return; + } + + if (queries.empty()) { + ereport(WARNING, (errmsg("YAGPCC cannot find query to process DONE hook"))); + ereport(DEBUG3, + (errmsg("YAGPCC query sourceText: %s", query_desc->sourceText))); + return; + } + auto &query = get_query(query_desc); + + report_query_done(query_desc, query, status, utility, edata); + + if (need_report_nested_query()) + update_nested_counters(query_desc); + + queries.erase(QueryKey::from_qdesc(query_desc)); + pfree(query_desc->yagp_query_key); + query_desc->yagp_query_key = NULL; +} + +void EventSender::ic_metrics_collect() { +#ifdef IC_TEARDOWN_HOOK + if (Gp_interconnect_type != INTERCONNECT_TYPE_UDPIFC) { + return; + } + if (!proto_verified || gp_command_count == 0 || !config.enable_collector() || + config.filter_user(get_user_name())) { + return; + } + // we also would like to know nesting level here and filter queries BUT we + // don't have this kind of information from this callback. Will have to + // collect stats anyways and throw it away later, if necessary + auto metrics = UDPIFCGetICStats(); + ic_statistics.totalRecvQueueSize += metrics.totalRecvQueueSize; + ic_statistics.recvQueueSizeCountingTime += metrics.recvQueueSizeCountingTime; + ic_statistics.totalCapacity += metrics.totalCapacity; + ic_statistics.capacityCountingTime += metrics.capacityCountingTime; + ic_statistics.totalBuffers += metrics.totalBuffers; + ic_statistics.bufferCountingTime += metrics.bufferCountingTime; + ic_statistics.activeConnectionsNum += metrics.activeConnectionsNum; + ic_statistics.retransmits += metrics.retransmits; + ic_statistics.startupCachedPktNum += metrics.startupCachedPktNum; + ic_statistics.mismatchNum += metrics.mismatchNum; + ic_statistics.crcErrors += metrics.crcErrors; + ic_statistics.sndPktNum += metrics.sndPktNum; + ic_statistics.recvPktNum += metrics.recvPktNum; + ic_statistics.disorderedPktNum += metrics.disorderedPktNum; + ic_statistics.duplicatedPktNum += metrics.duplicatedPktNum; + ic_statistics.recvAckNum += metrics.recvAckNum; + ic_statistics.statusQueryMsgNum += metrics.statusQueryMsgNum; +#endif +} + +void EventSender::analyze_stats_collect(QueryDesc *query_desc) { + if (!verify_query(query_desc, QueryState::END, false /* utility */)) { + return; + } + if (Gp_role != GP_ROLE_DISPATCH) { + return; + } + if (!query_desc->totaltime || !need_collect_analyze()) { + return; + } + // Make sure stats accumulation is done. + // (Note: it's okay if several levels of hook all do this.) + ya_gpdb::instr_end_loop(query_desc->totaltime); + + double ms = query_desc->totaltime->total * 1000.0; + if (ms >= config.min_analyze_time()) { + auto &query = get_query(query_desc); + auto *query_msg = query.message.get(); + set_analyze_plan_text(query_desc, query_msg, config); + } +} + +EventSender::EventSender() { + // Perform initial sync to get default GUC values + config.sync(); + + if (config.enable_collector()) { + try { + GOOGLE_PROTOBUF_VERIFY_VERSION; + proto_verified = true; + } catch (const std::exception &e) { + ereport(INFO, (errmsg("Unable to start query tracing %s", e.what()))); + } + } +#ifdef IC_TEARDOWN_HOOK + memset(&ic_statistics, 0, sizeof(ICStatistics)); +#endif +} + +EventSender::~EventSender() { + for (const auto &[qkey, _] : queries) { + ereport(LOG, (errmsg("YAGPCC query with missing done event: " + "tmid=%d ssid=%d ccnt=%d nlvl=%d", + qkey.tmid, qkey.ssid, qkey.ccnt, qkey.nesting_level))); + } +} + +// That's basically a very simplistic state machine to fix or highlight any bugs +// coming from GP +void EventSender::update_query_state(QueryItem &query, QueryState new_state, + bool utility, bool success) { + switch (new_state) { + case QueryState::SUBMIT: + Assert(false); + break; + case QueryState::START: + if (query.state == QueryState::SUBMIT) { + query.message->set_query_status(yagpcc::QueryStatus::QUERY_STATUS_START); + } else { + Assert(false); + } + break; + case QueryState::END: + // Example of below assert triggering: CURSOR closes before ever being + // executed Assert(query->state == QueryState::START || + // IsAbortInProgress()); + query.message->set_query_status(yagpcc::QueryStatus::QUERY_STATUS_END); + break; + case QueryState::DONE: + Assert(query.state == QueryState::END || !success || utility); + query.message->set_query_status(yagpcc::QueryStatus::QUERY_STATUS_DONE); + break; + default: + Assert(false); + } + query.state = new_state; +} + +EventSender::QueryItem &EventSender::get_query(QueryDesc *query_desc) { + if (!qdesc_submitted(query_desc)) { + ereport(WARNING, + (errmsg("YAGPCC attempting to get query that was not submitted"))); + ereport(DEBUG3, + (errmsg("YAGPCC query sourceText: %s", query_desc->sourceText))); + throw std::runtime_error("Attempting to get query that was not submitted"); + } + return queries.find(QueryKey::from_qdesc(query_desc))->second; +} + +void EventSender::submit_query(QueryDesc *query_desc) { + if (query_desc->yagp_query_key) { + ereport(WARNING, + (errmsg("YAGPCC trying to submit already submitted query"))); + ereport(DEBUG3, + (errmsg("YAGPCC query sourceText: %s", query_desc->sourceText))); + } + QueryKey::register_qkey(query_desc, nesting_level); + auto key = QueryKey::from_qdesc(query_desc); + auto [_, inserted] = queries.emplace(key, QueryItem(QueryState::SUBMIT)); + if (!inserted) { + ereport(WARNING, (errmsg("YAGPCC duplicate query submit detected"))); + ereport(DEBUG3, + (errmsg("YAGPCC query sourceText: %s", query_desc->sourceText))); + } +} + +void EventSender::update_nested_counters(QueryDesc *query_desc) { + if (!is_top_level_query(query_desc, nesting_level)) { + auto &query = get_query(query_desc); + nested_calls++; + double end_time = protots_to_double(query.message->end_time()); + double start_time = protots_to_double(query.message->start_time()); + if (end_time >= start_time) { + nested_timing += end_time - start_time; + } else { + ereport(WARNING, (errmsg("YAGPCC query start_time > end_time (%f > %f)", + start_time, end_time))); + ereport(DEBUG3, + (errmsg("YAGPCC nested query text %s", query_desc->sourceText))); + } + } +} + +bool EventSender::qdesc_submitted(QueryDesc *query_desc) { + if (query_desc->yagp_query_key == NULL) { + return false; + } + return queries.find(QueryKey::from_qdesc(query_desc)) != queries.end(); +} + +bool EventSender::nesting_is_valid(QueryDesc *query_desc, int nesting_level) { + return need_report_nested_query() || + is_top_level_query(query_desc, nesting_level); +} + +bool EventSender::need_report_nested_query() { + return config.report_nested_queries() && Gp_role == GP_ROLE_DISPATCH; +} + +bool EventSender::filter_query(QueryDesc *query_desc) { + return gp_command_count == 0 || query_desc->sourceText == nullptr || + !config.enable_collector() || config.filter_user(get_user_name()); +} + +EventSender::QueryItem::QueryItem(QueryState st) + : message(std::make_unique()), state(st) {} diff --git a/gpcontrib/yagp_hooks_collector/src/EventSender.h b/gpcontrib/yagp_hooks_collector/src/EventSender.h new file mode 100644 index 00000000000..ef7dcb0bf8c --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/EventSender.h @@ -0,0 +1,168 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * EventSender.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/EventSender.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#include +#include +#include + +#define typeid __typeid +extern "C" { +#include "utils/metrics_utils.h" +#ifdef IC_TEARDOWN_HOOK +#include "cdb/ic_udpifc.h" +#endif +} +#undef typeid + +#include "memory/gpdbwrappers.h" +#include "Config.h" + +class UDSConnector; +struct QueryDesc; +namespace yagpcc { +class SetQueryReq; +} + +#include + +extern void gp_gettmid(int32 *); + +struct QueryKey { + int tmid; + int ssid; + int ccnt; + int nesting_level; + uintptr_t query_desc_addr; + + bool operator==(const QueryKey &other) const { + return std::tie(tmid, ssid, ccnt, nesting_level, query_desc_addr) == + std::tie(other.tmid, other.ssid, other.ccnt, other.nesting_level, + other.query_desc_addr); + } + + static void register_qkey(QueryDesc *query_desc, size_t nesting_level) { + query_desc->yagp_query_key = + (YagpQueryKey *)ya_gpdb::palloc0(sizeof(YagpQueryKey)); + int32 tmid; + gp_gettmid(&tmid); + query_desc->yagp_query_key->tmid = tmid; + query_desc->yagp_query_key->ssid = gp_session_id; + query_desc->yagp_query_key->ccnt = gp_command_count; + query_desc->yagp_query_key->nesting_level = nesting_level; + query_desc->yagp_query_key->query_desc_addr = (uintptr_t)query_desc; + } + + static QueryKey from_qdesc(QueryDesc *query_desc) { + return { + .tmid = query_desc->yagp_query_key->tmid, + .ssid = query_desc->yagp_query_key->ssid, + .ccnt = query_desc->yagp_query_key->ccnt, + .nesting_level = query_desc->yagp_query_key->nesting_level, + .query_desc_addr = query_desc->yagp_query_key->query_desc_addr, + }; + } +}; + +// https://www.boost.org/doc/libs/1_35_0/doc/html/boost/hash_combine_id241013.html +template inline void hash_combine(std::size_t &seed, const T &v) { + std::hash hasher; + seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2); +} + +namespace std { +template <> struct hash { + size_t operator()(const QueryKey &k) const noexcept { + size_t seed = hash{}(k.tmid); + hash_combine(seed, k.ssid); + hash_combine(seed, k.ccnt); + hash_combine(seed, k.nesting_level); + uintptr_t addr = k.query_desc_addr; + if constexpr (SIZE_MAX < UINTPTR_MAX) { + addr %= SIZE_MAX; + } + hash_combine(seed, addr); + return seed; + } +}; +} // namespace std + +class EventSender { +public: + void executor_before_start(QueryDesc *query_desc, int eflags); + void executor_after_start(QueryDesc *query_desc, int eflags); + void executor_end(QueryDesc *query_desc); + void query_metrics_collect(QueryMetricsStatus status, void *arg, bool utility, + ErrorData *edata = NULL); + void ic_metrics_collect(); + void analyze_stats_collect(QueryDesc *query_desc); + void incr_depth() { nesting_level++; } + void decr_depth() { nesting_level--; } + EventSender(); + ~EventSender(); + +private: + enum QueryState { SUBMIT, START, END, DONE }; + + struct QueryItem { + std::unique_ptr message; + QueryState state; + + explicit QueryItem(QueryState st); + }; + + bool log_query_req(const yagpcc::SetQueryReq &req, const std::string &event, + bool utility); + bool verify_query(QueryDesc *query_desc, QueryState state, bool utility); + void update_query_state(QueryItem &query, QueryState new_state, bool utility, + bool success = true); + QueryItem &get_query(QueryDesc *query_desc); + void submit_query(QueryDesc *query_desc); + void collect_query_submit(QueryDesc *query_desc, bool utility); + void report_query_done(QueryDesc *query_desc, QueryItem &query, + QueryMetricsStatus status, bool utility, + ErrorData *edata = NULL); + void collect_query_done(QueryDesc *query_desc, bool utility, + QueryMetricsStatus status, ErrorData *edata = NULL); + void update_nested_counters(QueryDesc *query_desc); + bool qdesc_submitted(QueryDesc *query_desc); + bool nesting_is_valid(QueryDesc *query_desc, int nesting_level); + bool need_report_nested_query(); + bool filter_query(QueryDesc *query_desc); + + bool proto_verified = false; + int nesting_level = 0; + int64_t nested_calls = 0; + double nested_timing = 0; +#ifdef IC_TEARDOWN_HOOK + ICStatistics ic_statistics; +#endif + std::unordered_map queries; + + Config config; +}; \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/PgUtils.cpp b/gpcontrib/yagp_hooks_collector/src/PgUtils.cpp new file mode 100644 index 00000000000..ed4bf4d7e64 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/PgUtils.cpp @@ -0,0 +1,94 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * PgUtils.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/PgUtils.cpp + * + *------------------------------------------------------------------------- + */ + +#include "PgUtils.h" +#include "Config.h" +#include "memory/gpdbwrappers.h" + +extern "C" { +#include "commands/resgroupcmds.h" +#include "cdb/cdbvars.h" +} + +std::string get_user_name() { + // username is allocated on stack, we don't need to pfree it. + const char *username = + ya_gpdb::get_config_option("session_authorization", false, false); + return username ? std::string(username) : ""; +} + +std::string get_db_name() { + char *dbname = ya_gpdb::get_database_name(MyDatabaseId); + if (dbname) { + std::string result(dbname); + ya_gpdb::pfree(dbname); + return result; + } + return ""; +} + +std::string get_rg_name() { + auto groupId = ya_gpdb::get_rg_id_by_session_id(MySessionState->sessionId); + if (!OidIsValid(groupId)) + return ""; + + char *rgname = ya_gpdb::get_rg_name_for_id(groupId); + if (rgname == nullptr) + return ""; + + std::string result(rgname); + ya_gpdb::pfree(rgname); + return result; +} + +/** + * Things get tricky with nested queries. + * a) A nested query on master is a real query optimized and executed from + * master. An example would be `select some_insert_function();`, where + * some_insert_function does something like `insert into tbl values (1)`. Master + * will create two statements. Outer select statement and inner insert statement + * with nesting level 1. + * For segments both statements are top-level statements with nesting level 0. + * b) A nested query on segment is something executed as sub-statement on + * segment. An example would be `select a from tbl where is_good_value(b);`. In + * this case master will issue one top-level statement, but segments will change + * contexts for UDF execution and execute is_good_value(b) once for each tuple + * as a nested query. Creating massive load on gpcc agent. + * + * Hence, here is a decision: + * 1) ignore all queries that are nested on segments + * 2) record (if enabled) all queries that are nested on master + * NODE: The truth is, we can't really ignore nested master queries, because + * segment sees those as top-level. + */ + +bool is_top_level_query(QueryDesc *query_desc, int nesting_level) { + if (query_desc->yagp_query_key == NULL) { + return nesting_level == 0; + } + return query_desc->yagp_query_key->nesting_level == 0; +} diff --git a/gpcontrib/yagp_hooks_collector/src/PgUtils.h b/gpcontrib/yagp_hooks_collector/src/PgUtils.h new file mode 100644 index 00000000000..5113fadbff2 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/PgUtils.h @@ -0,0 +1,38 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * PgUtils.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/PgUtils.h + * + *------------------------------------------------------------------------- + */ + +extern "C" { +#include "postgres.h" +#include "commands/explain.h" +} + +#include + +std::string get_user_name(); +std::string get_db_name(); +std::string get_rg_name(); +bool is_top_level_query(QueryDesc *query_desc, int nesting_level); diff --git a/gpcontrib/yagp_hooks_collector/src/ProcStats.cpp b/gpcontrib/yagp_hooks_collector/src/ProcStats.cpp new file mode 100644 index 00000000000..72a12e8ca00 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/ProcStats.cpp @@ -0,0 +1,125 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * ProcStats.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/ProcStats.cpp + * + *------------------------------------------------------------------------- + */ + +#include "ProcStats.h" +#include "yagpcc_metrics.pb.h" +#include +#include +#include + +extern "C" { +#include "postgres.h" +#include "utils/elog.h" +} + +namespace { +#define FILL_IO_STAT(stat_name) \ + uint64_t stat_name; \ + proc_stat >> tmp >> stat_name; \ + stats->set_##stat_name(stat_name - stats->stat_name()); + +void fill_io_stats(yagpcc::SystemStat *stats) { + std::ifstream proc_stat("/proc/self/io"); + std::string tmp; + FILL_IO_STAT(rchar); + FILL_IO_STAT(wchar); + FILL_IO_STAT(syscr); + FILL_IO_STAT(syscw); + FILL_IO_STAT(read_bytes); + FILL_IO_STAT(write_bytes); + FILL_IO_STAT(cancelled_write_bytes); +} + +void fill_cpu_stats(yagpcc::SystemStat *stats) { + static const int UTIME_ID = 13; + static const int STIME_ID = 14; + static const int VSIZE_ID = 22; + static const int RSS_ID = 23; + static const double tps = sysconf(_SC_CLK_TCK); + + std::ifstream proc_stat("/proc/self/stat"); + std::string trash; + for (int i = 0; i <= RSS_ID; ++i) { + switch (i) { + case UTIME_ID: + double utime; + proc_stat >> utime; + stats->set_usertimeseconds(utime / tps - stats->usertimeseconds()); + break; + case STIME_ID: + double stime; + proc_stat >> stime; + stats->set_kerneltimeseconds(stime / tps - stats->kerneltimeseconds()); + break; + case VSIZE_ID: + uint64_t vsize; + proc_stat >> vsize; + stats->set_vsize(vsize); + break; + case RSS_ID: + uint64_t rss; + proc_stat >> rss; + // NOTE: this is a double AFAIU, need to double-check + stats->set_rss(rss); + break; + default: + proc_stat >> trash; + } + } +} + +void fill_status_stats(yagpcc::SystemStat *stats) { + std::ifstream proc_stat("/proc/self/status"); + std::string key, measure; + while (proc_stat >> key) { + if (key == "VmPeak:") { + uint64_t value; + proc_stat >> value; + stats->set_vmpeakkb(value); + proc_stat >> measure; + if (measure != "kB") { + throw std::runtime_error("Expected memory sizes in kB, but got in " + + measure); + } + } else if (key == "VmSize:") { + uint64_t value; + proc_stat >> value; + stats->set_vmsizekb(value); + if (measure != "kB") { + throw std::runtime_error("Expected memory sizes in kB, but got in " + + measure); + } + } + } +} +} // namespace + +void fill_self_stats(yagpcc::SystemStat *stats) { + fill_io_stats(stats); + fill_cpu_stats(stats); + fill_status_stats(stats); +} \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/ProcStats.h b/gpcontrib/yagp_hooks_collector/src/ProcStats.h new file mode 100644 index 00000000000..7629edd0aea --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/ProcStats.h @@ -0,0 +1,34 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * ProcStats.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/ProcStats.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +namespace yagpcc { +class SystemStat; +} + +void fill_self_stats(yagpcc::SystemStat *stats); \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/ProtoUtils.cpp b/gpcontrib/yagp_hooks_collector/src/ProtoUtils.cpp new file mode 100644 index 00000000000..b449ae20900 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/ProtoUtils.cpp @@ -0,0 +1,317 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * ProtoUtils.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/ProtoUtils.cpp + * + *------------------------------------------------------------------------- + */ + +#include "ProtoUtils.h" +#include "PgUtils.h" +#include "ProcStats.h" +#include "Config.h" +#include "memory/gpdbwrappers.h" + +#define typeid __typeid +#define operator __operator +extern "C" { +#include "postgres.h" +#include "access/hash.h" +#include "access/xact.h" +#include "cdb/cdbinterconnect.h" +#include "cdb/cdbvars.h" +#include "cdb/ml_ipc.h" +#ifdef IC_TEARDOWN_HOOK +#include "cdb/ic_udpifc.h" +#endif +#include "utils/workfile_mgr.h" +} +#undef typeid +#undef operator + +#include +#include + +extern void gp_gettmid(int32 *); + +namespace { +constexpr uint8_t UTF8_CONTINUATION_BYTE_MASK = (1 << 7) | (1 << 6); +constexpr uint8_t UTF8_CONTINUATION_BYTE = (1 << 7); +constexpr uint8_t UTF8_MAX_SYMBOL_BYTES = 4; + +// Returns true if byte is the starting byte of utf8 +// character, false if byte is the continuation (10xxxxxx). +inline bool utf8_start_byte(uint8_t byte) { + return (byte & UTF8_CONTINUATION_BYTE_MASK) != UTF8_CONTINUATION_BYTE; +} +} // namespace + +google::protobuf::Timestamp current_ts() { + google::protobuf::Timestamp current_ts; + struct timeval tv; + gettimeofday(&tv, nullptr); + current_ts.set_seconds(tv.tv_sec); + current_ts.set_nanos(static_cast(tv.tv_usec * 1000)); + return current_ts; +} + +void set_query_key(yagpcc::QueryKey *key) { + key->set_ccnt(gp_command_count); + key->set_ssid(gp_session_id); + int32 tmid = 0; + gp_gettmid(&tmid); + key->set_tmid(tmid); +} + +void set_segment_key(yagpcc::SegmentKey *key) { + key->set_dbid(GpIdentity.dbid); + key->set_segindex(GpIdentity.segindex); +} + +std::string trim_str_shrink_utf8(const char *str, size_t len, size_t lim) { + if (unlikely(str == nullptr)) { + return std::string(); + } + if (likely(len <= lim || GetDatabaseEncoding() != PG_UTF8)) { + return std::string(str, std::min(len, lim)); + } + + // Handle trimming of utf8 correctly, do not cut multi-byte characters. + size_t cut_pos = lim; + size_t visited_bytes = 1; + while (visited_bytes < UTF8_MAX_SYMBOL_BYTES && cut_pos > 0) { + if (utf8_start_byte(static_cast(str[cut_pos]))) { + break; + } + ++visited_bytes; + --cut_pos; + } + + return std::string(str, cut_pos); +} + +void set_query_plan(yagpcc::SetQueryReq *req, QueryDesc *query_desc, + const Config &config) { + if (Gp_role == GP_ROLE_DISPATCH && query_desc->plannedstmt) { + auto qi = req->mutable_query_info(); + qi->set_generator(query_desc->plannedstmt->planGen == PLANGEN_OPTIMIZER + ? yagpcc::PlanGenerator::PLAN_GENERATOR_OPTIMIZER + : yagpcc::PlanGenerator::PLAN_GENERATOR_PLANNER); + MemoryContext oldcxt = + ya_gpdb::mem_ctx_switch_to(query_desc->estate->es_query_cxt); + ExplainState es = ya_gpdb::get_explain_state(query_desc, true); + if (es.str) { + *qi->mutable_plan_text() = trim_str_shrink_utf8(es.str->data, es.str->len, + config.max_plan_size()); + StringInfo norm_plan = ya_gpdb::gen_normplan(es.str->data); + if (norm_plan) { + *qi->mutable_template_plan_text() = trim_str_shrink_utf8( + norm_plan->data, norm_plan->len, config.max_plan_size()); + qi->set_plan_id( + hash_any((unsigned char *)norm_plan->data, norm_plan->len)); + ya_gpdb::pfree(norm_plan->data); + } + qi->set_query_id(query_desc->plannedstmt->queryId); + ya_gpdb::pfree(es.str->data); + } + ya_gpdb::mem_ctx_switch_to(oldcxt); + } +} + +void set_query_text(yagpcc::SetQueryReq *req, QueryDesc *query_desc, + const Config &config) { + if (Gp_role == GP_ROLE_DISPATCH && query_desc->sourceText) { + auto qi = req->mutable_query_info(); + *qi->mutable_query_text() = trim_str_shrink_utf8( + query_desc->sourceText, strlen(query_desc->sourceText), + config.max_text_size()); + char *norm_query = ya_gpdb::gen_normquery(query_desc->sourceText); + if (norm_query) { + *qi->mutable_template_query_text() = trim_str_shrink_utf8( + norm_query, strlen(norm_query), config.max_text_size()); + ya_gpdb::pfree(norm_query); + } + } +} + +void clear_big_fields(yagpcc::SetQueryReq *req) { + if (Gp_role == GP_ROLE_DISPATCH) { + auto qi = req->mutable_query_info(); + qi->clear_plan_text(); + qi->clear_template_plan_text(); + qi->clear_query_text(); + qi->clear_template_query_text(); + qi->clear_analyze_text(); + } +} + +void set_query_info(yagpcc::SetQueryReq *req) { + if (Gp_role == GP_ROLE_DISPATCH) { + auto qi = req->mutable_query_info(); + qi->set_username(get_user_name()); + if (IsTransactionState()) + qi->set_databasename(get_db_name()); + qi->set_rsgname(get_rg_name()); + } +} + +void set_qi_nesting_level(yagpcc::SetQueryReq *req, int nesting_level) { + auto aqi = req->mutable_add_info(); + aqi->set_nested_level(nesting_level); +} + +void set_qi_slice_id(yagpcc::SetQueryReq *req) { + auto aqi = req->mutable_add_info(); + aqi->set_slice_id(currentSliceId); +} + +void set_qi_error_message(yagpcc::SetQueryReq *req, const char *err_msg, + const Config &config) { + auto aqi = req->mutable_add_info(); + *aqi->mutable_error_message() = + trim_str_shrink_utf8(err_msg, strlen(err_msg), config.max_text_size()); +} + +void set_metric_instrumentation(yagpcc::MetricInstrumentation *metrics, + QueryDesc *query_desc, int nested_calls, + double nested_time) { + auto instrument = query_desc->planstate->instrument; + if (instrument) { + metrics->set_ntuples(instrument->ntuples); + metrics->set_nloops(instrument->nloops); + metrics->set_tuplecount(instrument->tuplecount); + metrics->set_firsttuple(instrument->firsttuple); + metrics->set_startup(instrument->startup); + metrics->set_total(instrument->total); + auto &buffusage = instrument->bufusage; + metrics->set_shared_blks_hit(buffusage.shared_blks_hit); + metrics->set_shared_blks_read(buffusage.shared_blks_read); + metrics->set_shared_blks_dirtied(buffusage.shared_blks_dirtied); + metrics->set_shared_blks_written(buffusage.shared_blks_written); + metrics->set_local_blks_hit(buffusage.local_blks_hit); + metrics->set_local_blks_read(buffusage.local_blks_read); + metrics->set_local_blks_dirtied(buffusage.local_blks_dirtied); + metrics->set_local_blks_written(buffusage.local_blks_written); + metrics->set_temp_blks_read(buffusage.temp_blks_read); + metrics->set_temp_blks_written(buffusage.temp_blks_written); + metrics->set_blk_read_time(INSTR_TIME_GET_DOUBLE(buffusage.blk_read_time)); + metrics->set_blk_write_time( + INSTR_TIME_GET_DOUBLE(buffusage.blk_write_time)); + } + if (query_desc->estate && query_desc->estate->motionlayer_context) { + MotionLayerState *mlstate = + (MotionLayerState *)query_desc->estate->motionlayer_context; + metrics->mutable_sent()->set_total_bytes(mlstate->stat_total_bytes_sent); + metrics->mutable_sent()->set_tuple_bytes(mlstate->stat_tuple_bytes_sent); + metrics->mutable_sent()->set_chunks(mlstate->stat_total_chunks_sent); + metrics->mutable_received()->set_total_bytes( + mlstate->stat_total_bytes_recvd); + metrics->mutable_received()->set_tuple_bytes( + mlstate->stat_tuple_bytes_recvd); + metrics->mutable_received()->set_chunks(mlstate->stat_total_chunks_recvd); + } + metrics->set_inherited_calls(nested_calls); + metrics->set_inherited_time(nested_time); +} + +void set_gp_metrics(yagpcc::GPMetrics *metrics, QueryDesc *query_desc, + int nested_calls, double nested_time) { + if (query_desc->planstate && query_desc->planstate->instrument) { + set_metric_instrumentation(metrics->mutable_instrumentation(), query_desc, + nested_calls, nested_time); + } + fill_self_stats(metrics->mutable_systemstat()); + metrics->mutable_systemstat()->set_runningtimeseconds( + time(NULL) - metrics->mutable_systemstat()->runningtimeseconds()); + metrics->mutable_spill()->set_filecount( + WorkfileTotalFilesCreated() - metrics->mutable_spill()->filecount()); + metrics->mutable_spill()->set_totalbytes( + WorkfileTotalBytesWritten() - metrics->mutable_spill()->totalbytes()); +} + +#define UPDATE_IC_STATS(proto_name, stat_name) \ + metrics->mutable_interconnect()->set_##proto_name( \ + ic_statistics->stat_name - \ + metrics->mutable_interconnect()->proto_name()); \ + Assert(metrics->mutable_interconnect()->proto_name() >= 0 && \ + metrics->mutable_interconnect()->proto_name() <= \ + ic_statistics->stat_name) + +void set_ic_stats(yagpcc::MetricInstrumentation *metrics, + const ICStatistics *ic_statistics) { +#ifdef IC_TEARDOWN_HOOK + UPDATE_IC_STATS(total_recv_queue_size, totalRecvQueueSize); + UPDATE_IC_STATS(recv_queue_size_counting_time, recvQueueSizeCountingTime); + UPDATE_IC_STATS(total_capacity, totalCapacity); + UPDATE_IC_STATS(capacity_counting_time, capacityCountingTime); + UPDATE_IC_STATS(total_buffers, totalBuffers); + UPDATE_IC_STATS(buffer_counting_time, bufferCountingTime); + UPDATE_IC_STATS(active_connections_num, activeConnectionsNum); + UPDATE_IC_STATS(retransmits, retransmits); + UPDATE_IC_STATS(startup_cached_pkt_num, startupCachedPktNum); + UPDATE_IC_STATS(mismatch_num, mismatchNum); + UPDATE_IC_STATS(crc_errors, crcErrors); + UPDATE_IC_STATS(snd_pkt_num, sndPktNum); + UPDATE_IC_STATS(recv_pkt_num, recvPktNum); + UPDATE_IC_STATS(disordered_pkt_num, disorderedPktNum); + UPDATE_IC_STATS(duplicated_pkt_num, duplicatedPktNum); + UPDATE_IC_STATS(recv_ack_num, recvAckNum); + UPDATE_IC_STATS(status_query_msg_num, statusQueryMsgNum); +#endif +} + +yagpcc::SetQueryReq create_query_req(yagpcc::QueryStatus status) { + yagpcc::SetQueryReq req; + req.set_query_status(status); + *req.mutable_datetime() = current_ts(); + set_query_key(req.mutable_query_key()); + set_segment_key(req.mutable_segment_key()); + return req; +} + +double protots_to_double(const google::protobuf::Timestamp &ts) { + return double(ts.seconds()) + double(ts.nanos()) / 1000000000.0; +} + +void set_analyze_plan_text(QueryDesc *query_desc, yagpcc::SetQueryReq *req, + const Config &config) { + // Make sure it is a valid txn and it is not an utility + // statement for ExplainPrintPlan() later. + if (!IsTransactionState() || !query_desc->plannedstmt) { + return; + } + MemoryContext oldcxt = + ya_gpdb::mem_ctx_switch_to(query_desc->estate->es_query_cxt); + ExplainState es = ya_gpdb::get_analyze_state( + query_desc, query_desc->instrument_options && config.enable_analyze()); + ya_gpdb::mem_ctx_switch_to(oldcxt); + if (es.str) { + // Remove last line break. + if (es.str->len > 0 && es.str->data[es.str->len - 1] == '\n') { + es.str->data[--es.str->len] = '\0'; + } + auto trimmed_analyze = + trim_str_shrink_utf8(es.str->data, es.str->len, config.max_plan_size()); + req->mutable_query_info()->set_analyze_text(trimmed_analyze); + ya_gpdb::pfree(es.str->data); + } +} diff --git a/gpcontrib/yagp_hooks_collector/src/ProtoUtils.h b/gpcontrib/yagp_hooks_collector/src/ProtoUtils.h new file mode 100644 index 00000000000..c954545494f --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/ProtoUtils.h @@ -0,0 +1,54 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * ProtoUtils.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/ProtoUtils.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#include "protos/yagpcc_set_service.pb.h" + +struct QueryDesc; +struct ICStatistics; +class Config; + +google::protobuf::Timestamp current_ts(); +void set_query_plan(yagpcc::SetQueryReq *req, QueryDesc *query_desc, + const Config &config); +void set_query_text(yagpcc::SetQueryReq *req, QueryDesc *query_desc, + const Config &config); +void clear_big_fields(yagpcc::SetQueryReq *req); +void set_query_info(yagpcc::SetQueryReq *req); +void set_qi_nesting_level(yagpcc::SetQueryReq *req, int nesting_level); +void set_qi_slice_id(yagpcc::SetQueryReq *req); +void set_qi_error_message(yagpcc::SetQueryReq *req, const char *err_msg, + const Config &config); +void set_gp_metrics(yagpcc::GPMetrics *metrics, QueryDesc *query_desc, + int nested_calls, double nested_time); +void set_ic_stats(yagpcc::MetricInstrumentation *metrics, + const ICStatistics *ic_statistics); +yagpcc::SetQueryReq create_query_req(yagpcc::QueryStatus status); +double protots_to_double(const google::protobuf::Timestamp &ts); +void set_analyze_plan_text(QueryDesc *query_desc, yagpcc::SetQueryReq *message, + const Config &config); diff --git a/gpcontrib/yagp_hooks_collector/src/UDSConnector.cpp b/gpcontrib/yagp_hooks_collector/src/UDSConnector.cpp new file mode 100644 index 00000000000..d13a82a5ca9 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/UDSConnector.cpp @@ -0,0 +1,130 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * UDSConnector.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/UDSConnector.cpp + * + *------------------------------------------------------------------------- + */ + +#include "UDSConnector.h" +#include "Config.h" +#include "YagpStat.h" +#include "memory/gpdbwrappers.h" +#include "log/LogOps.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { +#include "postgres.h" +} + +static void inline log_tracing_failure(const yagpcc::SetQueryReq &req, + const std::string &event) { + ereport(LOG, (errmsg("Query {%d-%d-%d} %s tracing failed with error %m", + req.query_key().tmid(), req.query_key().ssid(), + req.query_key().ccnt(), event.c_str()))); +} + +bool UDSConnector::report_query(const yagpcc::SetQueryReq &req, + const std::string &event, + const Config &config) { + sockaddr_un address{}; + address.sun_family = AF_UNIX; + const auto &uds_path = config.uds_path(); + + if (uds_path.size() >= sizeof(address.sun_path)) { + ereport(WARNING, (errmsg("UDS path is too long for socket buffer"))); + YagpStat::report_error(); + return false; + } + strcpy(address.sun_path, uds_path.c_str()); + + const auto sockfd = socket(AF_UNIX, SOCK_STREAM, 0); + if (sockfd == -1) { + log_tracing_failure(req, event); + YagpStat::report_error(); + return false; + } + + // Close socket automatically on error path. + struct SockGuard { + int fd; + ~SockGuard() { close(fd); } + } sock_guard{sockfd}; + + if (fcntl(sockfd, F_SETFL, O_NONBLOCK) == -1) { + // That's a very important error that should never happen, so make it + // visible to an end-user and admins. + ereport(WARNING, + (errmsg("Unable to create non-blocking socket connection %m"))); + YagpStat::report_error(); + return false; + } + + if (connect(sockfd, reinterpret_cast(&address), + sizeof(address)) == -1) { + log_tracing_failure(req, event); + YagpStat::report_bad_connection(); + return false; + } + + const auto data_size = req.ByteSizeLong(); + const auto total_size = data_size + sizeof(uint32_t); + auto *buf = static_cast(ya_gpdb::palloc(total_size)); + // Free buf automatically on error path. + struct BufGuard { + void *p; + ~BufGuard() { ya_gpdb::pfree(p); } + } buf_guard{buf}; + + *reinterpret_cast(buf) = data_size; + req.SerializeWithCachedSizesToArray(buf + sizeof(uint32_t)); + + int64_t sent = 0, sent_total = 0; + do { + sent = + send(sockfd, buf + sent_total, total_size - sent_total, MSG_DONTWAIT); + if (sent > 0) + sent_total += sent; + } while (sent > 0 && size_t(sent_total) != total_size && + // the line below is a small throttling hack: + // if a message does not fit a single packet, we take a nap + // before sending the next one. + // Otherwise, MSG_DONTWAIT send might overflow the UDS + (std::this_thread::sleep_for(std::chrono::milliseconds(1)), true)); + + if (sent < 0) { + log_tracing_failure(req, event); + YagpStat::report_bad_send(total_size); + return false; + } + + YagpStat::report_send(total_size); + return true; +} diff --git a/gpcontrib/yagp_hooks_collector/src/UDSConnector.h b/gpcontrib/yagp_hooks_collector/src/UDSConnector.h new file mode 100644 index 00000000000..be5ab1ef413 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/UDSConnector.h @@ -0,0 +1,38 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * UDSConnector.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/UDSConnector.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#include "protos/yagpcc_set_service.pb.h" + +class Config; + +class UDSConnector { +public: + bool static report_query(const yagpcc::SetQueryReq &req, + const std::string &event, const Config &config); +}; diff --git a/gpcontrib/yagp_hooks_collector/src/YagpStat.cpp b/gpcontrib/yagp_hooks_collector/src/YagpStat.cpp new file mode 100644 index 00000000000..3a760b6ea97 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/YagpStat.cpp @@ -0,0 +1,118 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * YagpStat.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/YagpStat.cpp + * + *------------------------------------------------------------------------- + */ + +#include "YagpStat.h" + +#include + +extern "C" { +#include "postgres.h" +#include "miscadmin.h" +#include "storage/ipc.h" +#include "storage/lwlock.h" +#include "storage/shmem.h" +#include "storage/spin.h" +} + +namespace { +struct ProtectedData { + slock_t mutex; + YagpStat::Data data; +}; +shmem_startup_hook_type prev_shmem_startup_hook = NULL; +ProtectedData *data = nullptr; + +void yagp_shmem_startup() { + if (prev_shmem_startup_hook) + prev_shmem_startup_hook(); + LWLockAcquire(AddinShmemInitLock, LW_EXCLUSIVE); + bool found; + data = reinterpret_cast( + ShmemInitStruct("yagp_stat_messages", sizeof(ProtectedData), &found)); + if (!found) { + SpinLockInit(&data->mutex); + data->data = YagpStat::Data(); + } + LWLockRelease(AddinShmemInitLock); +} + +class LockGuard { +public: + LockGuard(slock_t *mutex) : mutex_(mutex) { SpinLockAcquire(mutex_); } + ~LockGuard() { SpinLockRelease(mutex_); } + +private: + slock_t *mutex_; +}; +} // namespace + +void YagpStat::init() { + if (!process_shared_preload_libraries_in_progress) + return; + RequestAddinShmemSpace(sizeof(ProtectedData)); + prev_shmem_startup_hook = shmem_startup_hook; + shmem_startup_hook = yagp_shmem_startup; +} + +void YagpStat::deinit() { shmem_startup_hook = prev_shmem_startup_hook; } + +void YagpStat::reset() { + LockGuard lg(&data->mutex); + data->data = YagpStat::Data(); +} + +void YagpStat::report_send(int32_t msg_size) { + LockGuard lg(&data->mutex); + data->data.total++; + data->data.max_message_size = std::max(msg_size, data->data.max_message_size); +} + +void YagpStat::report_bad_connection() { + LockGuard lg(&data->mutex); + data->data.total++; + data->data.failed_connects++; +} + +void YagpStat::report_bad_send(int32_t msg_size) { + LockGuard lg(&data->mutex); + data->data.total++; + data->data.failed_sends++; + data->data.max_message_size = std::max(msg_size, data->data.max_message_size); +} + +void YagpStat::report_error() { + LockGuard lg(&data->mutex); + data->data.total++; + data->data.failed_other++; +} + +YagpStat::Data YagpStat::get_stats() { + LockGuard lg(&data->mutex); + return data->data; +} + +bool YagpStat::loaded() { return data != nullptr; } diff --git a/gpcontrib/yagp_hooks_collector/src/YagpStat.h b/gpcontrib/yagp_hooks_collector/src/YagpStat.h new file mode 100644 index 00000000000..57fc90cd4d1 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/YagpStat.h @@ -0,0 +1,48 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * YagpStat.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/YagpStat.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#include + +class YagpStat { +public: + struct Data { + int64_t total, failed_sends, failed_connects, failed_other; + int32_t max_message_size; + }; + + static void init(); + static void deinit(); + static void reset(); + static void report_send(int32_t msg_size); + static void report_bad_connection(); + static void report_bad_send(int32_t msg_size); + static void report_error(); + static Data get_stats(); + static bool loaded(); +}; \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/hook_wrappers.cpp b/gpcontrib/yagp_hooks_collector/src/hook_wrappers.cpp new file mode 100644 index 00000000000..cb4970d60d9 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/hook_wrappers.cpp @@ -0,0 +1,414 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * hook_wrappers.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/hook_wrappers.cpp + * + *------------------------------------------------------------------------- + */ + +#define typeid __typeid +extern "C" { +#include "postgres.h" +#include "funcapi.h" +#include "executor/executor.h" +#include "executor/execUtils.h" +#include "utils/elog.h" +#include "utils/builtins.h" +#include "utils/metrics_utils.h" +#include "cdb/cdbvars.h" +#include "cdb/ml_ipc.h" +#include "tcop/utility.h" +#include "stat_statements_parser/pg_stat_statements_ya_parser.h" + +#include +#include +#include +#include +#include +} +#undef typeid + +#include "Config.h" +#include "YagpStat.h" +#include "EventSender.h" +#include "hook_wrappers.h" +#include "memory/gpdbwrappers.h" + +static ExecutorStart_hook_type previous_ExecutorStart_hook = nullptr; +static ExecutorRun_hook_type previous_ExecutorRun_hook = nullptr; +static ExecutorFinish_hook_type previous_ExecutorFinish_hook = nullptr; +static ExecutorEnd_hook_type previous_ExecutorEnd_hook = nullptr; +static query_info_collect_hook_type previous_query_info_collect_hook = nullptr; +#ifdef ANALYZE_STATS_COLLECT_HOOK +static analyze_stats_collect_hook_type previous_analyze_stats_collect_hook = + nullptr; +#endif +#ifdef IC_TEARDOWN_HOOK +static ic_teardown_hook_type previous_ic_teardown_hook = nullptr; +#endif +static ProcessUtility_hook_type previous_ProcessUtility_hook = nullptr; + +static void ya_ExecutorStart_hook(QueryDesc *query_desc, int eflags); +static void ya_ExecutorRun_hook(QueryDesc *query_desc, ScanDirection direction, + uint64 count, bool execute_once); +static void ya_ExecutorFinish_hook(QueryDesc *query_desc); +static void ya_ExecutorEnd_hook(QueryDesc *query_desc); +static void ya_query_info_collect_hook(QueryMetricsStatus status, void *arg); +#ifdef IC_TEARDOWN_HOOK +static void ya_ic_teardown_hook(ChunkTransportState *transportStates, + bool hasErrors); +#endif +#ifdef ANALYZE_STATS_COLLECT_HOOK +static void ya_analyze_stats_collect_hook(QueryDesc *query_desc); +#endif +static void ya_process_utility_hook(PlannedStmt *pstmt, const char *queryString, + bool readOnlyTree, + ProcessUtilityContext context, + ParamListInfo params, + QueryEnvironment *queryEnv, + DestReceiver *dest, QueryCompletion *qc); + +#define TEST_MAX_CONNECTIONS 4 +#define TEST_RCV_BUF_SIZE 8192 +#define TEST_POLL_TIMEOUT_MS 200 + +static int test_server_fd = -1; +static char *test_sock_path = NULL; + +static EventSender *sender = nullptr; + +static inline EventSender *get_sender() { + if (!sender) { + sender = new EventSender(); + } + return sender; +} + +template +R cpp_call(T *obj, R (T::*func)(Args...), Args... args) { + try { + return (obj->*func)(args...); + } catch (const std::exception &e) { + ereport(FATAL, (errmsg("Unexpected exception in yagpcc %s", e.what()))); + } +} + +void hooks_init() { + Config::init_gucs(); + YagpStat::init(); + previous_ExecutorStart_hook = ExecutorStart_hook; + ExecutorStart_hook = ya_ExecutorStart_hook; + previous_ExecutorRun_hook = ExecutorRun_hook; + ExecutorRun_hook = ya_ExecutorRun_hook; + previous_ExecutorFinish_hook = ExecutorFinish_hook; + ExecutorFinish_hook = ya_ExecutorFinish_hook; + previous_ExecutorEnd_hook = ExecutorEnd_hook; + ExecutorEnd_hook = ya_ExecutorEnd_hook; + previous_query_info_collect_hook = query_info_collect_hook; + query_info_collect_hook = ya_query_info_collect_hook; +#ifdef IC_TEARDOWN_HOOK + previous_ic_teardown_hook = ic_teardown_hook; + ic_teardown_hook = ya_ic_teardown_hook; +#endif +#ifdef ANALYZE_STATS_COLLECT_HOOK + previous_analyze_stats_collect_hook = analyze_stats_collect_hook; + analyze_stats_collect_hook = ya_analyze_stats_collect_hook; +#endif + stat_statements_parser_init(); + previous_ProcessUtility_hook = ProcessUtility_hook; + ProcessUtility_hook = ya_process_utility_hook; +} + +void hooks_deinit() { + ExecutorStart_hook = previous_ExecutorStart_hook; + ExecutorEnd_hook = previous_ExecutorEnd_hook; + ExecutorRun_hook = previous_ExecutorRun_hook; + ExecutorFinish_hook = previous_ExecutorFinish_hook; + query_info_collect_hook = previous_query_info_collect_hook; +#ifdef IC_TEARDOWN_HOOK + ic_teardown_hook = previous_ic_teardown_hook; +#endif +#ifdef ANALYZE_STATS_COLLECT_HOOK + analyze_stats_collect_hook = previous_analyze_stats_collect_hook; +#endif + stat_statements_parser_deinit(); + if (sender) { + delete sender; + } + YagpStat::deinit(); + ProcessUtility_hook = previous_ProcessUtility_hook; +} + +void ya_ExecutorStart_hook(QueryDesc *query_desc, int eflags) { + cpp_call(get_sender(), &EventSender::executor_before_start, query_desc, + eflags); + if (previous_ExecutorStart_hook) { + (*previous_ExecutorStart_hook)(query_desc, eflags); + } else { + standard_ExecutorStart(query_desc, eflags); + } + cpp_call(get_sender(), &EventSender::executor_after_start, query_desc, + eflags); +} + +void ya_ExecutorRun_hook(QueryDesc *query_desc, ScanDirection direction, + uint64 count, bool execute_once) { + get_sender()->incr_depth(); + PG_TRY(); + { + if (previous_ExecutorRun_hook) + previous_ExecutorRun_hook(query_desc, direction, count, execute_once); + else + standard_ExecutorRun(query_desc, direction, count, execute_once); + get_sender()->decr_depth(); + } + PG_CATCH(); + { + get_sender()->decr_depth(); + PG_RE_THROW(); + } + PG_END_TRY(); +} + +void ya_ExecutorFinish_hook(QueryDesc *query_desc) { + get_sender()->incr_depth(); + PG_TRY(); + { + if (previous_ExecutorFinish_hook) + previous_ExecutorFinish_hook(query_desc); + else + standard_ExecutorFinish(query_desc); + get_sender()->decr_depth(); + } + PG_CATCH(); + { + get_sender()->decr_depth(); + PG_RE_THROW(); + } + PG_END_TRY(); +} + +void ya_ExecutorEnd_hook(QueryDesc *query_desc) { + cpp_call(get_sender(), &EventSender::executor_end, query_desc); + if (previous_ExecutorEnd_hook) { + (*previous_ExecutorEnd_hook)(query_desc); + } else { + standard_ExecutorEnd(query_desc); + } +} + +void ya_query_info_collect_hook(QueryMetricsStatus status, void *arg) { + cpp_call(get_sender(), &EventSender::query_metrics_collect, status, + arg /* queryDesc */, false /* utility */, (ErrorData *)NULL); + if (previous_query_info_collect_hook) { + (*previous_query_info_collect_hook)(status, arg); + } +} + +#ifdef IC_TEARDOWN_HOOK +void ya_ic_teardown_hook(ChunkTransportState *transportStates, bool hasErrors) { + cpp_call(get_sender(), &EventSender::ic_metrics_collect); + if (previous_ic_teardown_hook) { + (*previous_ic_teardown_hook)(transportStates, hasErrors); + } +} +#endif + +#ifdef ANALYZE_STATS_COLLECT_HOOK +void ya_analyze_stats_collect_hook(QueryDesc *query_desc) { + cpp_call(get_sender(), &EventSender::analyze_stats_collect, query_desc); + if (previous_analyze_stats_collect_hook) { + (*previous_analyze_stats_collect_hook)(query_desc); + } +} +#endif + +static void ya_process_utility_hook(PlannedStmt *pstmt, const char *queryString, + bool readOnlyTree, + ProcessUtilityContext context, + ParamListInfo params, + QueryEnvironment *queryEnv, + DestReceiver *dest, QueryCompletion *qc) { + /* Project utility data on QueryDesc to use existing logic */ + QueryDesc *query_desc = (QueryDesc *)palloc0(sizeof(QueryDesc)); + query_desc->sourceText = queryString; + + cpp_call(get_sender(), &EventSender::query_metrics_collect, + METRICS_QUERY_SUBMIT, (void *)query_desc, true /* utility */, + (ErrorData *)NULL); + + get_sender()->incr_depth(); + PG_TRY(); + { + if (previous_ProcessUtility_hook) { + (*previous_ProcessUtility_hook)(pstmt, queryString, readOnlyTree, context, + params, queryEnv, dest, qc); + } else { + standard_ProcessUtility(pstmt, queryString, readOnlyTree, context, params, + queryEnv, dest, qc); + } + + get_sender()->decr_depth(); + cpp_call(get_sender(), &EventSender::query_metrics_collect, + METRICS_QUERY_DONE, (void *)query_desc, true /* utility */, + (ErrorData *)NULL); + + pfree(query_desc); + } + PG_CATCH(); + { + ErrorData *edata; + MemoryContext oldctx; + + oldctx = MemoryContextSwitchTo(TopMemoryContext); + edata = CopyErrorData(); + FlushErrorState(); + MemoryContextSwitchTo(oldctx); + + get_sender()->decr_depth(); + cpp_call(get_sender(), &EventSender::query_metrics_collect, + METRICS_QUERY_ERROR, (void *)query_desc, true /* utility */, + edata); + + pfree(query_desc); + ReThrowError(edata); + } + PG_END_TRY(); +} + +static void check_stats_loaded() { + if (!YagpStat::loaded()) { + ereport(ERROR, (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE), + errmsg("yagp_hooks_collector must be loaded via " + "shared_preload_libraries"))); + } +} + +void yagp_functions_reset() { + check_stats_loaded(); + YagpStat::reset(); +} + +Datum yagp_functions_get(FunctionCallInfo fcinfo) { + const int ATTNUM = 6; + check_stats_loaded(); + auto stats = YagpStat::get_stats(); + TupleDesc tupdesc = CreateTemplateTupleDesc(ATTNUM); + TupleDescInitEntry(tupdesc, (AttrNumber)1, "segid", INT4OID, -1 /* typmod */, + 0 /* attdim */); + TupleDescInitEntry(tupdesc, (AttrNumber)2, "total_messages", INT8OID, + -1 /* typmod */, 0 /* attdim */); + TupleDescInitEntry(tupdesc, (AttrNumber)3, "send_failures", INT8OID, + -1 /* typmod */, 0 /* attdim */); + TupleDescInitEntry(tupdesc, (AttrNumber)4, "connection_failures", INT8OID, + -1 /* typmod */, 0 /* attdim */); + TupleDescInitEntry(tupdesc, (AttrNumber)5, "other_errors", INT8OID, + -1 /* typmod */, 0 /* attdim */); + TupleDescInitEntry(tupdesc, (AttrNumber)6, "max_message_size", INT4OID, + -1 /* typmod */, 0 /* attdim */); + tupdesc = BlessTupleDesc(tupdesc); + Datum values[ATTNUM]; + bool nulls[ATTNUM]; + MemSet(nulls, 0, sizeof(nulls)); + values[0] = Int32GetDatum(GpIdentity.segindex); + values[1] = Int64GetDatum(stats.total); + values[2] = Int64GetDatum(stats.failed_sends); + values[3] = Int64GetDatum(stats.failed_connects); + values[4] = Int64GetDatum(stats.failed_other); + values[5] = Int32GetDatum(stats.max_message_size); + HeapTuple tuple = ya_gpdb::heap_form_tuple(tupdesc, values, nulls); + Datum result = HeapTupleGetDatum(tuple); + PG_RETURN_DATUM(result); +} + +void test_uds_stop_server() { + if (test_server_fd >= 0) { + close(test_server_fd); + test_server_fd = -1; + } + if (test_sock_path) { + unlink(test_sock_path); + pfree(test_sock_path); + test_sock_path = NULL; + } +} + +void test_uds_start_server(const char *path) { + struct sockaddr_un addr = {.sun_family = AF_UNIX}; + + if (strlen(path) >= sizeof(addr.sun_path)) + ereport(ERROR, (errmsg("path too long"))); + + test_uds_stop_server(); + + strlcpy(addr.sun_path, path, sizeof(addr.sun_path)); + test_sock_path = MemoryContextStrdup(TopMemoryContext, path); + unlink(path); + + if ((test_server_fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0 || + bind(test_server_fd, (struct sockaddr *)&addr, sizeof(addr)) < 0 || + listen(test_server_fd, TEST_MAX_CONNECTIONS) < 0) { + test_uds_stop_server(); + ereport(ERROR, (errmsg("socket setup failed: %m"))); + } +} + +int64 test_uds_receive(int timeout_ms) { + char buf[TEST_RCV_BUF_SIZE]; + int rc; + struct pollfd pfd = {.fd = test_server_fd, .events = POLLIN}; + int64 total = 0; + + if (test_server_fd < 0) + ereport(ERROR, (errmsg("server not started"))); + + for (;;) { + CHECK_FOR_INTERRUPTS(); + rc = poll(&pfd, 1, Min(timeout_ms, TEST_POLL_TIMEOUT_MS)); + if (rc > 0) + break; + if (rc < 0 && errno != EINTR) + ereport(ERROR, (errmsg("poll: %m"))); + timeout_ms -= TEST_POLL_TIMEOUT_MS; + if (timeout_ms <= 0) + return total; + } + + if (pfd.revents & POLLIN) { + int client = accept(test_server_fd, NULL, NULL); + ssize_t n; + + if (client < 0) + ereport(ERROR, (errmsg("accept: %m"))); + + while ((n = recv(client, buf, sizeof(buf), 0)) != 0) { + if (n > 0) + total += n; + else if (errno != EINTR) + break; + } + + close(client); + } + + return total; +} \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/hook_wrappers.h b/gpcontrib/yagp_hooks_collector/src/hook_wrappers.h new file mode 100644 index 00000000000..443406a5259 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/hook_wrappers.h @@ -0,0 +1,48 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * hook_wrappers.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/hook_wrappers.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +extern void hooks_init(); +extern void hooks_deinit(); +extern void yagp_functions_reset(); +extern Datum yagp_functions_get(FunctionCallInfo fcinfo); + +extern void init_log(); +extern void truncate_log(); + +extern void test_uds_start_server(const char *path); +extern int64_t test_uds_receive(int timeout_ms); +extern void test_uds_stop_server(); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/log/LogOps.cpp b/gpcontrib/yagp_hooks_collector/src/log/LogOps.cpp new file mode 100644 index 00000000000..e8c927ece84 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/log/LogOps.cpp @@ -0,0 +1,158 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * LogOps.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/log/LogOps.cpp + * + *------------------------------------------------------------------------- + */ + +#include "protos/yagpcc_set_service.pb.h" + +#include "LogOps.h" +#include "LogSchema.h" + +extern "C" { +#include "postgres.h" + +#include "access/heapam.h" +#include "access/htup_details.h" +#include "access/xact.h" +#include "catalog/dependency.h" +#include "catalog/heap.h" +#include "catalog/namespace.h" +#include "catalog/pg_namespace.h" +#include "catalog/pg_type.h" +#include "cdb/cdbvars.h" +#include "commands/tablecmds.h" +#include "funcapi.h" +#include "fmgr.h" +#include "utils/builtins.h" +#include "utils/lsyscache.h" +#include "utils/rel.h" +#include "utils/snapmgr.h" +#include "utils/timestamp.h" +} + +void init_log() { + Oid namespaceId; + Oid relationId; + ObjectAddress tableAddr; + ObjectAddress schemaAddr; + + namespaceId = get_namespace_oid(schema_name.data(), false /* missing_ok */); + + /* Create table */ + relationId = heap_create_with_catalog( + log_relname.data() /* relname */, namespaceId /* namespace */, + 0 /* tablespace */, InvalidOid /* relid */, InvalidOid /* reltype oid */, + InvalidOid /* reloftypeid */, GetUserId() /* owner */, HEAP_TABLE_AM_OID, + DescribeTuple() /* rel tuple */, NIL /* cooked_constraints */, RELKIND_RELATION, + RELPERSISTENCE_PERMANENT, false /* shared_relation */, false /* mapped_relation */, ONCOMMIT_NOOP, + NULL /* GP Policy */, (Datum)0 /* reloptions */, false /* use_user_acl */, true /* allow_system_table_mods */, true /* is_internal */, + InvalidOid /* relrewrite */, NULL /* typaddress */, + false /* valid_opts */); + + /* Make the table visible */ + CommandCounterIncrement(); + + /* Record dependency of the table on the schema */ + if (OidIsValid(relationId) && OidIsValid(namespaceId)) { + ObjectAddressSet(tableAddr, RelationRelationId, relationId); + ObjectAddressSet(schemaAddr, NamespaceRelationId, namespaceId); + + /* Table can be dropped only via DROP EXTENSION */ + recordDependencyOn(&tableAddr, &schemaAddr, DEPENDENCY_EXTENSION); + } else { + ereport(NOTICE, (errmsg("YAGPCC failed to create log table or schema"))); + } + + /* Make changes visible */ + CommandCounterIncrement(); +} + +void insert_log(const yagpcc::SetQueryReq &req, bool utility) { + Oid namespaceId; + Oid relationId; + Relation rel; + HeapTuple tuple; + + /* Return if xact is not valid (needed for catalog lookups). */ + if (!IsTransactionState()) { + return; + } + + /* Return if extension was not loaded */ + namespaceId = get_namespace_oid(schema_name.data(), true /* missing_ok */); + if (!OidIsValid(namespaceId)) { + return; + } + + /* Return if the table was not created yet */ + relationId = get_relname_relid(log_relname.data(), namespaceId); + if (!OidIsValid(relationId)) { + return; + } + + bool nulls[natts_yagp_log]; + Datum values[natts_yagp_log]; + + memset(nulls, true, sizeof(nulls)); + memset(values, 0, sizeof(values)); + + extract_query_req(req, "", values, nulls); + nulls[attnum_yagp_log_utility] = false; + values[attnum_yagp_log_utility] = BoolGetDatum(utility); + + rel = heap_open(relationId, RowExclusiveLock); + + /* Insert the tuple as a frozen one to ensure it is logged even if txn rolls + * back or aborts */ + tuple = heap_form_tuple(RelationGetDescr(rel), values, nulls); + frozen_heap_insert(rel, tuple); + + heap_freetuple(tuple); + /* Keep lock on rel until end of xact */ + heap_close(rel, NoLock); + + /* Make changes visible */ + CommandCounterIncrement(); +} + +void truncate_log() { + Oid namespaceId; + Oid relationId; + Relation relation; + + namespaceId = get_namespace_oid(schema_name.data(), false /* missing_ok */); + relationId = get_relname_relid(log_relname.data(), namespaceId); + + relation = heap_open(relationId, AccessExclusiveLock); + + /* Truncate the main table */ + heap_truncate_one_rel(relation); + + /* Keep lock on rel until end of xact */ + heap_close(relation, NoLock); + + /* Make changes visible */ + CommandCounterIncrement(); +} \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/log/LogOps.h b/gpcontrib/yagp_hooks_collector/src/log/LogOps.h new file mode 100644 index 00000000000..1fc30c21030 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/log/LogOps.h @@ -0,0 +1,46 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * LogOps.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/log/LogOps.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#include + +extern "C" { +#include "postgres.h" +#include "fmgr.h" +} + +extern "C" { +/* CREATE TABLE yagpcc.__log (...); */ +void init_log(); + +/* TRUNCATE yagpcc.__log */ +void truncate_log(); +} + +/* INSERT INTO yagpcc.__log VALUES (...) */ +void insert_log(const yagpcc::SetQueryReq &req, bool utility); diff --git a/gpcontrib/yagp_hooks_collector/src/log/LogSchema.cpp b/gpcontrib/yagp_hooks_collector/src/log/LogSchema.cpp new file mode 100644 index 00000000000..a391b1a2209 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/log/LogSchema.cpp @@ -0,0 +1,162 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * LogSchema.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/log/LogSchema.cpp + * + *------------------------------------------------------------------------- + */ + +#include "google/protobuf/reflection.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/timestamp.pb.h" + +#include "LogSchema.h" + +const std::unordered_map &proto_name_to_col_idx() { + static const auto name_col_idx = [] { + std::unordered_map map; + map.reserve(log_tbl_desc.size()); + + for (size_t idx = 0; idx < natts_yagp_log; ++idx) { + map.emplace(log_tbl_desc[idx].proto_field_name, idx); + } + + return map; + }(); + return name_col_idx; +} + +TupleDesc DescribeTuple() { + TupleDesc tupdesc = CreateTemplateTupleDesc(natts_yagp_log); + + for (size_t anum = 1; anum <= natts_yagp_log; ++anum) { + TupleDescInitEntry(tupdesc, anum, log_tbl_desc[anum - 1].pg_att_name.data(), + log_tbl_desc[anum - 1].type_oid, -1 /* typmod */, + 0 /* attdim */); + } + + return tupdesc; +} + +Datum protots_to_timestamptz(const google::protobuf::Timestamp &ts) { + TimestampTz pgtimestamp = + (TimestampTz)ts.seconds() * USECS_PER_SEC + (ts.nanos() / 1000); + pgtimestamp -= (POSTGRES_EPOCH_JDATE - UNIX_EPOCH_JDATE) * USECS_PER_DAY; + return TimestampTzGetDatum(pgtimestamp); +} + +Datum field_to_datum(const google::protobuf::FieldDescriptor *field, + const google::protobuf::Reflection *reflection, + const google::protobuf::Message &msg) { + using namespace google::protobuf; + + switch (field->cpp_type()) { + case FieldDescriptor::CPPTYPE_INT32: + return Int32GetDatum(reflection->GetInt32(msg, field)); + case FieldDescriptor::CPPTYPE_INT64: + return Int64GetDatum(reflection->GetInt64(msg, field)); + case FieldDescriptor::CPPTYPE_UINT32: + return Int64GetDatum(reflection->GetUInt32(msg, field)); + case FieldDescriptor::CPPTYPE_UINT64: + return Int64GetDatum( + static_cast(reflection->GetUInt64(msg, field))); + case FieldDescriptor::CPPTYPE_DOUBLE: + return Float8GetDatum(reflection->GetDouble(msg, field)); + case FieldDescriptor::CPPTYPE_FLOAT: + return Float4GetDatum(reflection->GetFloat(msg, field)); + case FieldDescriptor::CPPTYPE_BOOL: + return BoolGetDatum(reflection->GetBool(msg, field)); + case FieldDescriptor::CPPTYPE_ENUM: + return CStringGetTextDatum(reflection->GetEnum(msg, field)->name().data()); + case FieldDescriptor::CPPTYPE_STRING: + return CStringGetTextDatum(reflection->GetString(msg, field).c_str()); + default: + return (Datum)0; + } +} + +void process_field(const google::protobuf::FieldDescriptor *field, + const google::protobuf::Reflection *reflection, + const google::protobuf::Message &msg, + const std::string &field_name, Datum *values, bool *nulls) { + + auto proto_idx_map = proto_name_to_col_idx(); + auto it = proto_idx_map.find(field_name); + + if (it == proto_idx_map.end()) { + ereport(NOTICE, + (errmsg("YAGPCC protobuf field %s is not registered in log table", + field_name.c_str()))); + return; + } + + int idx = it->second; + + if (!reflection->HasField(msg, field)) { + nulls[idx] = true; + return; + } + + if (field->cpp_type() == google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE && + field->message_type()->full_name() == "google.protobuf.Timestamp") { + const auto &ts = static_cast( + reflection->GetMessage(msg, field)); + values[idx] = protots_to_timestamptz(ts); + } else { + values[idx] = field_to_datum(field, reflection, msg); + } + nulls[idx] = false; + + return; +} + +void extract_query_req(const google::protobuf::Message &msg, + const std::string &prefix, Datum *values, bool *nulls) { + using namespace google::protobuf; + + const Descriptor *descriptor = msg.GetDescriptor(); + const Reflection *reflection = msg.GetReflection(); + + for (int i = 0; i < descriptor->field_count(); ++i) { + const FieldDescriptor *field = descriptor->field(i); + + // For now, we do not log any repeated fields plus they need special + // treatment. + if (field->is_repeated()) { + continue; + } + + std::string curr_pref = prefix.empty() ? "" : prefix + "."; + std::string field_name = curr_pref + field->name().data(); + + if (field->cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE && + field->message_type()->full_name() != "google.protobuf.Timestamp") { + + if (reflection->HasField(msg, field)) { + const Message &nested = reflection->GetMessage(msg, field); + extract_query_req(nested, field_name, values, nulls); + } + } else { + process_field(field, reflection, msg, field_name, values, nulls); + } + } +} diff --git a/gpcontrib/yagp_hooks_collector/src/log/LogSchema.h b/gpcontrib/yagp_hooks_collector/src/log/LogSchema.h new file mode 100644 index 00000000000..f78acec7ce9 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/log/LogSchema.h @@ -0,0 +1,193 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * LogSchema.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/log/LogSchema.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#include +#include +#include +#include + +extern "C" { +#include "postgres.h" +#include "access/htup_details.h" +#include "access/tupdesc.h" +#include "catalog/pg_type.h" +#include "utils/timestamp.h" +#include "utils/builtins.h" +} + +namespace google { +namespace protobuf { +class FieldDescriptor; +class Message; +class Reflection; +class Timestamp; +} // namespace protobuf +} // namespace google + +inline constexpr std::string_view schema_name = "yagpcc"; +inline constexpr std::string_view log_relname = "__log"; + +struct LogDesc { + std::string_view pg_att_name; + std::string_view proto_field_name; + Oid type_oid; +}; + +/* + * Definition of the log table structure. + * + * System stats collected as %lu (unsigned) may + * overflow INT8OID (signed), but this is acceptable. + */ +/* clang-format off */ +inline constexpr std::array log_tbl_desc = { + /* 8-byte aligned types first - Query Info */ + LogDesc{"query_id", "query_info.query_id", INT8OID}, + LogDesc{"plan_id", "query_info.plan_id", INT8OID}, + LogDesc{"nested_level", "add_info.nested_level", INT8OID}, + LogDesc{"slice_id", "add_info.slice_id", INT8OID}, + /* 8-byte aligned types - System Stats */ + LogDesc{"systemstat_vsize", "query_metrics.systemStat.vsize", INT8OID}, + LogDesc{"systemstat_rss", "query_metrics.systemStat.rss", INT8OID}, + LogDesc{"systemstat_vmsizekb", "query_metrics.systemStat.VmSizeKb", INT8OID}, + LogDesc{"systemstat_vmpeakkb", "query_metrics.systemStat.VmPeakKb", INT8OID}, + LogDesc{"systemstat_rchar", "query_metrics.systemStat.rchar", INT8OID}, + LogDesc{"systemstat_wchar", "query_metrics.systemStat.wchar", INT8OID}, + LogDesc{"systemstat_syscr", "query_metrics.systemStat.syscr", INT8OID}, + LogDesc{"systemstat_syscw", "query_metrics.systemStat.syscw", INT8OID}, + LogDesc{"systemstat_read_bytes", "query_metrics.systemStat.read_bytes", INT8OID}, + LogDesc{"systemstat_write_bytes", "query_metrics.systemStat.write_bytes", INT8OID}, + LogDesc{"systemstat_cancelled_write_bytes", "query_metrics.systemStat.cancelled_write_bytes", INT8OID}, + /* 8-byte aligned types - Metric Instrumentation */ + LogDesc{"instrumentation_ntuples", "query_metrics.instrumentation.ntuples", INT8OID}, + LogDesc{"instrumentation_nloops", "query_metrics.instrumentation.nloops", INT8OID}, + LogDesc{"instrumentation_tuplecount", "query_metrics.instrumentation.tuplecount", INT8OID}, + LogDesc{"instrumentation_shared_blks_hit", "query_metrics.instrumentation.shared_blks_hit", INT8OID}, + LogDesc{"instrumentation_shared_blks_read", "query_metrics.instrumentation.shared_blks_read", INT8OID}, + LogDesc{"instrumentation_shared_blks_dirtied", "query_metrics.instrumentation.shared_blks_dirtied", INT8OID}, + LogDesc{"instrumentation_shared_blks_written", "query_metrics.instrumentation.shared_blks_written", INT8OID}, + LogDesc{"instrumentation_local_blks_hit", "query_metrics.instrumentation.local_blks_hit", INT8OID}, + LogDesc{"instrumentation_local_blks_read", "query_metrics.instrumentation.local_blks_read", INT8OID}, + LogDesc{"instrumentation_local_blks_dirtied", "query_metrics.instrumentation.local_blks_dirtied", INT8OID}, + LogDesc{"instrumentation_local_blks_written", "query_metrics.instrumentation.local_blks_written", INT8OID}, + LogDesc{"instrumentation_temp_blks_read", "query_metrics.instrumentation.temp_blks_read", INT8OID}, + LogDesc{"instrumentation_temp_blks_written", "query_metrics.instrumentation.temp_blks_written", INT8OID}, + LogDesc{"instrumentation_inherited_calls", "query_metrics.instrumentation.inherited_calls", INT8OID}, + /* 8-byte aligned types - Network Stats */ + LogDesc{"instrumentation_sent_total_bytes", "query_metrics.instrumentation.sent.total_bytes", INT8OID}, + LogDesc{"instrumentation_sent_tuple_bytes", "query_metrics.instrumentation.sent.tuple_bytes", INT8OID}, + LogDesc{"instrumentation_sent_chunks", "query_metrics.instrumentation.sent.chunks", INT8OID}, + LogDesc{"instrumentation_received_total_bytes", "query_metrics.instrumentation.received.total_bytes", INT8OID}, + LogDesc{"instrumentation_received_tuple_bytes", "query_metrics.instrumentation.received.tuple_bytes", INT8OID}, + LogDesc{"instrumentation_received_chunks", "query_metrics.instrumentation.received.chunks", INT8OID}, + /* 8-byte aligned types - Interconnect Stats and spilled bytes */ + LogDesc{"interconnect_total_recv_queue_size", "query_metrics.instrumentation.interconnect.total_recv_queue_size", INT8OID}, + LogDesc{"interconnect_recv_queue_size_counting_time", "query_metrics.instrumentation.interconnect.recv_queue_size_counting_time", INT8OID}, + LogDesc{"interconnect_total_capacity", "query_metrics.instrumentation.interconnect.total_capacity", INT8OID}, + LogDesc{"interconnect_capacity_counting_time", "query_metrics.instrumentation.interconnect.capacity_counting_time", INT8OID}, + LogDesc{"interconnect_total_buffers", "query_metrics.instrumentation.interconnect.total_buffers", INT8OID}, + LogDesc{"interconnect_buffer_counting_time", "query_metrics.instrumentation.interconnect.buffer_counting_time", INT8OID}, + LogDesc{"interconnect_active_connections_num", "query_metrics.instrumentation.interconnect.active_connections_num", INT8OID}, + LogDesc{"interconnect_retransmits", "query_metrics.instrumentation.interconnect.retransmits", INT8OID}, + LogDesc{"interconnect_startup_cached_pkt_num", "query_metrics.instrumentation.interconnect.startup_cached_pkt_num", INT8OID}, + LogDesc{"interconnect_mismatch_num", "query_metrics.instrumentation.interconnect.mismatch_num", INT8OID}, + LogDesc{"interconnect_crc_errors", "query_metrics.instrumentation.interconnect.crc_errors", INT8OID}, + LogDesc{"interconnect_snd_pkt_num", "query_metrics.instrumentation.interconnect.snd_pkt_num", INT8OID}, + LogDesc{"interconnect_recv_pkt_num", "query_metrics.instrumentation.interconnect.recv_pkt_num", INT8OID}, + LogDesc{"interconnect_disordered_pkt_num", "query_metrics.instrumentation.interconnect.disordered_pkt_num", INT8OID}, + LogDesc{"interconnect_duplicated_pkt_num", "query_metrics.instrumentation.interconnect.duplicated_pkt_num", INT8OID}, + LogDesc{"interconnect_recv_ack_num", "query_metrics.instrumentation.interconnect.recv_ack_num", INT8OID}, + LogDesc{"interconnect_status_query_msg_num", "query_metrics.instrumentation.interconnect.status_query_msg_num", INT8OID}, + LogDesc{"spill_totalbytes", "query_metrics.spill.totalBytes", INT8OID}, + /* 8-byte aligned types - Float and Timestamp */ + LogDesc{"systemstat_runningtimeseconds", "query_metrics.systemStat.runningTimeSeconds", FLOAT8OID}, + LogDesc{"systemstat_usertimeseconds", "query_metrics.systemStat.userTimeSeconds", FLOAT8OID}, + LogDesc{"systemstat_kerneltimeseconds", "query_metrics.systemStat.kernelTimeSeconds", FLOAT8OID}, + LogDesc{"instrumentation_firsttuple", "query_metrics.instrumentation.firsttuple", FLOAT8OID}, + LogDesc{"instrumentation_startup", "query_metrics.instrumentation.startup", FLOAT8OID}, + LogDesc{"instrumentation_total", "query_metrics.instrumentation.total", FLOAT8OID}, + LogDesc{"instrumentation_blk_read_time", "query_metrics.instrumentation.blk_read_time", FLOAT8OID}, + LogDesc{"instrumentation_blk_write_time", "query_metrics.instrumentation.blk_write_time", FLOAT8OID}, + LogDesc{"instrumentation_startup_time", "query_metrics.instrumentation.startup_time", FLOAT8OID}, + LogDesc{"instrumentation_inherited_time", "query_metrics.instrumentation.inherited_time", FLOAT8OID}, + LogDesc{"datetime", "datetime", TIMESTAMPTZOID}, + LogDesc{"submit_time", "submit_time", TIMESTAMPTZOID}, + LogDesc{"start_time", "start_time", TIMESTAMPTZOID}, + LogDesc{"end_time", "end_time", TIMESTAMPTZOID}, + /* 4-byte aligned types - Query Key */ + LogDesc{"tmid", "query_key.tmid", INT4OID}, + LogDesc{"ssid", "query_key.ssid", INT4OID}, + LogDesc{"ccnt", "query_key.ccnt", INT4OID}, + /* 4-byte aligned types - Segment Key */ + LogDesc{"dbid", "segment_key.dbid", INT4OID}, + LogDesc{"segid", "segment_key.segindex", INT4OID}, + LogDesc{"spill_filecount", "query_metrics.spill.fileCount", INT4OID}, + /* Variable-length types - Query Info */ + LogDesc{"generator", "query_info.generator", TEXTOID}, + LogDesc{"query_text", "query_info.query_text", TEXTOID}, + LogDesc{"plan_text", "query_info.plan_text", TEXTOID}, + LogDesc{"template_query_text", "query_info.template_query_text", TEXTOID}, + LogDesc{"template_plan_text", "query_info.template_plan_text", TEXTOID}, + LogDesc{"user_name", "query_info.userName", TEXTOID}, + LogDesc{"database_name", "query_info.databaseName", TEXTOID}, + LogDesc{"rsgname", "query_info.rsgname", TEXTOID}, + LogDesc{"analyze_text", "query_info.analyze_text", TEXTOID}, + LogDesc{"error_message", "add_info.error_message", TEXTOID}, + LogDesc{"query_status", "query_status", TEXTOID}, + /* Extra field */ + LogDesc{"utility", "", BOOLOID}, +}; +/* clang-format on */ + +inline constexpr size_t natts_yagp_log = log_tbl_desc.size(); +inline constexpr size_t attnum_yagp_log_utility = natts_yagp_log - 1; + +const std::unordered_map &proto_name_to_col_idx(); + +TupleDesc DescribeTuple(); + +Datum protots_to_timestamptz(const google::protobuf::Timestamp &ts); + +Datum field_to_datum(const google::protobuf::FieldDescriptor *field, + const google::protobuf::Reflection *reflection, + const google::protobuf::Message &msg); + +/* Process a single proto field and store in values/nulls arrays */ +void process_field(const google::protobuf::FieldDescriptor *field, + const google::protobuf::Reflection *reflection, + const google::protobuf::Message &msg, + const std::string &field_name, Datum *values, bool *nulls); + +/* + * Extracts values from msg into values/nulls arrays. Caller must + * pre-init nulls[] to true (this function does net set nulls + * to true for nested messages if parent message is missing). + */ +void extract_query_req(const google::protobuf::Message &msg, + const std::string &prefix, Datum *values, bool *nulls); diff --git a/gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.cpp b/gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.cpp new file mode 100644 index 00000000000..22083e8bdaf --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.cpp @@ -0,0 +1,252 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * gpdbwrappers.cpp + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.cpp + * + *------------------------------------------------------------------------- + */ + +#include "gpdbwrappers.h" +#include "log/LogOps.h" + +extern "C" { +#include "postgres.h" +#include "utils/guc.h" +#include "commands/dbcommands.h" +#include "commands/resgroupcmds.h" +#include "utils/builtins.h" +#include "utils/varlena.h" +#include "nodes/pg_list.h" +#include "commands/explain.h" +#include "executor/instrument.h" +#include "access/tupdesc.h" +#include "access/htup.h" +#include "utils/elog.h" +#include "cdb/cdbexplain.h" +#include "stat_statements_parser/pg_stat_statements_ya_parser.h" +} + +namespace { + +template +auto wrap(Func &&func, Args &&...args) noexcept(!Throws) + -> decltype(func(std::forward(args)...)) { + + using RetType = decltype(func(std::forward(args)...)); + + // Empty struct for void return type. + struct VoidResult {}; + using ResultHolder = std::conditional_t, VoidResult, + std::optional>; + + bool success; + ErrorData *edata; + ResultHolder result_holder; + + PG_TRY(); + { + if constexpr (!std::is_void_v) { + result_holder.emplace(func(std::forward(args)...)); + } else { + func(std::forward(args)...); + } + edata = NULL; + success = true; + } + PG_CATCH(); + { + MemoryContext oldctx = MemoryContextSwitchTo(TopMemoryContext); + edata = CopyErrorData(); + MemoryContextSwitchTo(oldctx); + FlushErrorState(); + success = false; + } + PG_END_TRY(); + + if (!success) { + std::string err; + if (edata && edata->message) { + err = std::string(edata->message); + } else { + err = "Unknown error occurred"; + } + + if (edata) { + FreeErrorData(edata); + } + + if constexpr (Throws) { + throw std::runtime_error(err); + } + + if constexpr (!std::is_void_v) { + return RetType{}; + } else { + return; + } + } + + if constexpr (!std::is_void_v) { + return *std::move(result_holder); + } else { + return; + } +} + +template +auto wrap_throw(Func &&func, Args &&...args) + -> decltype(func(std::forward(args)...)) { + return wrap(std::forward(func), std::forward(args)...); +} + +template +auto wrap_noexcept(Func &&func, Args &&...args) noexcept + -> decltype(func(std::forward(args)...)) { + return wrap(std::forward(func), std::forward(args)...); +} +} // namespace + +void *ya_gpdb::palloc(Size size) { return wrap_throw(::palloc, size); } + +void *ya_gpdb::palloc0(Size size) { return wrap_throw(::palloc0, size); } + +char *ya_gpdb::pstrdup(const char *str) { return wrap_throw(::pstrdup, str); } + +char *ya_gpdb::get_database_name(Oid dbid) noexcept { + return wrap_noexcept(::get_database_name, dbid); +} + +bool ya_gpdb::split_identifier_string(char *rawstring, char separator, + List **namelist) noexcept { + return wrap_noexcept(SplitIdentifierString, rawstring, separator, namelist); +} + +ExplainState ya_gpdb::get_explain_state(QueryDesc *query_desc, + bool costs) noexcept { + return wrap_noexcept([&]() { + ExplainState *es = NewExplainState(); + es->costs = costs; + es->verbose = true; + es->format = EXPLAIN_FORMAT_TEXT; + ExplainBeginOutput(es); + ExplainPrintPlan(es, query_desc); + ExplainEndOutput(es); + return *es; + }); +} + +ExplainState ya_gpdb::get_analyze_state(QueryDesc *query_desc, + bool analyze) noexcept { + return wrap_noexcept([&]() { + ExplainState *es = NewExplainState(); + es->analyze = analyze; + es->verbose = true; + es->buffers = es->analyze; + es->timing = es->analyze; + es->summary = es->analyze; + es->format = EXPLAIN_FORMAT_TEXT; + ExplainBeginOutput(es); + if (analyze) { + ExplainPrintPlan(es, query_desc); + ExplainPrintExecStatsEnd(es, query_desc); + } + ExplainEndOutput(es); + return *es; + }); +} + +Instrumentation *ya_gpdb::instr_alloc(size_t n, int instrument_options, + bool async_mode) { + return wrap_throw(InstrAlloc, n, instrument_options, async_mode); +} + +HeapTuple ya_gpdb::heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, + bool *isnull) { + if (!tupleDescriptor || !values || !isnull) + throw std::runtime_error( + "Invalid input parameters for heap tuple formation"); + + return wrap_throw(::heap_form_tuple, tupleDescriptor, values, isnull); +} + +void ya_gpdb::pfree(void *pointer) noexcept { + // Note that ::pfree asserts that pointer != NULL. + if (!pointer) + return; + + wrap_noexcept(::pfree, pointer); +} + +MemoryContext ya_gpdb::mem_ctx_switch_to(MemoryContext context) noexcept { + return MemoryContextSwitchTo(context); +} + +const char *ya_gpdb::get_config_option(const char *name, bool missing_ok, + bool restrict_superuser) noexcept { + if (!name) + return nullptr; + + return wrap_noexcept(GetConfigOption, name, missing_ok, restrict_superuser); +} + +void ya_gpdb::list_free(List *list) noexcept { + if (!list) + return; + + wrap_noexcept(::list_free, list); +} + +CdbExplain_ShowStatCtx * +ya_gpdb::cdbexplain_showExecStatsBegin(QueryDesc *query_desc, + instr_time starttime) { + if (!query_desc) + throw std::runtime_error("Invalid query descriptor"); + + return wrap_throw(::cdbexplain_showExecStatsBegin, query_desc, starttime); +} + +void ya_gpdb::instr_end_loop(Instrumentation *instr) { + if (!instr) + throw std::runtime_error("Invalid instrumentation pointer"); + + wrap_throw(::InstrEndLoop, instr); +} + +char *ya_gpdb::gen_normquery(const char *query) noexcept { + return wrap_noexcept(::gen_normquery, query); +} + +StringInfo ya_gpdb::gen_normplan(const char *exec_plan) noexcept { + return wrap_noexcept(::gen_normplan, exec_plan); +} + +char *ya_gpdb::get_rg_name_for_id(Oid group_id) { + return wrap_throw(GetResGroupNameForId, group_id); +} + +Oid ya_gpdb::get_rg_id_by_session_id(int session_id) { + return wrap_throw(ResGroupGetGroupIdBySessionId, session_id); +} + +void ya_gpdb::insert_log(const yagpcc::SetQueryReq &req, bool utility) { + return wrap_throw(::insert_log, req, utility); +} diff --git a/gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.h b/gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.h new file mode 100644 index 00000000000..fe9b3ba0487 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.h @@ -0,0 +1,81 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * gpdbwrappers.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/memory/gpdbwrappers.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +extern "C" { +#include "postgres.h" +#include "nodes/pg_list.h" +#include "commands/explain.h" +#include "executor/instrument.h" +#include "access/htup.h" +#include "utils/elog.h" +#include "utils/memutils.h" +} + +#include +#include +#include +#include +#include + +namespace yagpcc { +class SetQueryReq; +} // namespace yagpcc + +namespace ya_gpdb { + +// Functions that call palloc(). +// Make sure correct memory context is set. +void *palloc(Size size); +void *palloc0(Size size); +char *pstrdup(const char *str); +char *get_database_name(Oid dbid) noexcept; +bool split_identifier_string(char *rawstring, char separator, + List **namelist) noexcept; +ExplainState get_explain_state(QueryDesc *query_desc, bool costs) noexcept; +ExplainState get_analyze_state(QueryDesc *query_desc, bool analyze) noexcept; +Instrumentation *instr_alloc(size_t n, int instrument_options, bool async_mode); +HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, Datum *values, + bool *isnull); +CdbExplain_ShowStatCtx *cdbexplain_showExecStatsBegin(QueryDesc *query_desc, + instr_time starttime); +void instr_end_loop(Instrumentation *instr); +char *gen_normquery(const char *query) noexcept; +StringInfo gen_normplan(const char *executionPlan) noexcept; +char *get_rg_name_for_id(Oid group_id); +void insert_log(const yagpcc::SetQueryReq &req, bool utility); + +// Palloc-free functions. +void pfree(void *pointer) noexcept; +MemoryContext mem_ctx_switch_to(MemoryContext context) noexcept; +const char *get_config_option(const char *name, bool missing_ok, + bool restrict_superuser) noexcept; +void list_free(List *list) noexcept; +Oid get_rg_id_by_session_id(int session_id); + +} // namespace ya_gpdb diff --git a/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_metrics.pb.cpp b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_metrics.pb.cpp new file mode 100644 index 00000000000..096f6d9d479 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_metrics.pb.cpp @@ -0,0 +1,4803 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/yagpcc_metrics.proto + +#include "protos/yagpcc_metrics.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_InterconnectStat_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_MetricInstrumentation_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_NetworkStat_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SpillInfo_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SystemStat_protos_2fyagpcc_5fmetrics_2eproto; +namespace yagpcc { +class QueryInfoDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _QueryInfo_default_instance_; +class AdditionalQueryInfoDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _AdditionalQueryInfo_default_instance_; +class AdditionalQueryStatDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _AdditionalQueryStat_default_instance_; +class GPMetricsDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _GPMetrics_default_instance_; +class QueryKeyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _QueryKey_default_instance_; +class SegmentKeyDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _SegmentKey_default_instance_; +class SystemStatDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _SystemStat_default_instance_; +class NetworkStatDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _NetworkStat_default_instance_; +class InterconnectStatDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _InterconnectStat_default_instance_; +class MetricInstrumentationDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _MetricInstrumentation_default_instance_; +class SpillInfoDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _SpillInfo_default_instance_; +} // namespace yagpcc +static void InitDefaultsscc_info_AdditionalQueryInfo_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_AdditionalQueryInfo_default_instance_; + new (ptr) ::yagpcc::AdditionalQueryInfo(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::AdditionalQueryInfo::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AdditionalQueryInfo_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_AdditionalQueryInfo_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_AdditionalQueryStat_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_AdditionalQueryStat_default_instance_; + new (ptr) ::yagpcc::AdditionalQueryStat(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::AdditionalQueryStat::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AdditionalQueryStat_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_AdditionalQueryStat_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_GPMetrics_default_instance_; + new (ptr) ::yagpcc::GPMetrics(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::GPMetrics::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, 0, InitDefaultsscc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto}, { + &scc_info_SystemStat_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_MetricInstrumentation_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_SpillInfo_protos_2fyagpcc_5fmetrics_2eproto.base,}}; + +static void InitDefaultsscc_info_InterconnectStat_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_InterconnectStat_default_instance_; + new (ptr) ::yagpcc::InterconnectStat(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::InterconnectStat::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_InterconnectStat_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_InterconnectStat_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_MetricInstrumentation_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_MetricInstrumentation_default_instance_; + new (ptr) ::yagpcc::MetricInstrumentation(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::MetricInstrumentation::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<2> scc_info_MetricInstrumentation_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 2, 0, InitDefaultsscc_info_MetricInstrumentation_protos_2fyagpcc_5fmetrics_2eproto}, { + &scc_info_NetworkStat_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_InterconnectStat_protos_2fyagpcc_5fmetrics_2eproto.base,}}; + +static void InitDefaultsscc_info_NetworkStat_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_NetworkStat_default_instance_; + new (ptr) ::yagpcc::NetworkStat(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::NetworkStat::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_NetworkStat_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_NetworkStat_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_QueryInfo_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_QueryInfo_default_instance_; + new (ptr) ::yagpcc::QueryInfo(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::QueryInfo::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_QueryInfo_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_QueryInfo_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_QueryKey_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_QueryKey_default_instance_; + new (ptr) ::yagpcc::QueryKey(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::QueryKey::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_QueryKey_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_QueryKey_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_SegmentKey_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_SegmentKey_default_instance_; + new (ptr) ::yagpcc::SegmentKey(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::SegmentKey::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SegmentKey_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SegmentKey_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_SpillInfo_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_SpillInfo_default_instance_; + new (ptr) ::yagpcc::SpillInfo(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::SpillInfo::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SpillInfo_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SpillInfo_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static void InitDefaultsscc_info_SystemStat_protos_2fyagpcc_5fmetrics_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_SystemStat_default_instance_; + new (ptr) ::yagpcc::SystemStat(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::SystemStat::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SystemStat_protos_2fyagpcc_5fmetrics_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_SystemStat_protos_2fyagpcc_5fmetrics_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_protos_2fyagpcc_5fmetrics_2eproto[11]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_protos_2fyagpcc_5fmetrics_2eproto[3]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_protos_2fyagpcc_5fmetrics_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_protos_2fyagpcc_5fmetrics_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, generator_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, query_id_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, plan_id_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, query_text_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, plan_text_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, template_query_text_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, template_plan_text_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, username_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, databasename_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, rsgname_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryInfo, analyze_text_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::AdditionalQueryInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::AdditionalQueryInfo, nested_level_), + PROTOBUF_FIELD_OFFSET(::yagpcc::AdditionalQueryInfo, error_message_), + PROTOBUF_FIELD_OFFSET(::yagpcc::AdditionalQueryInfo, slice_id_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::AdditionalQueryStat, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::AdditionalQueryStat, error_message_), + PROTOBUF_FIELD_OFFSET(::yagpcc::AdditionalQueryStat, slices_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::GPMetrics, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::GPMetrics, systemstat_), + PROTOBUF_FIELD_OFFSET(::yagpcc::GPMetrics, instrumentation_), + PROTOBUF_FIELD_OFFSET(::yagpcc::GPMetrics, spill_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryKey, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryKey, tmid_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryKey, ssid_), + PROTOBUF_FIELD_OFFSET(::yagpcc::QueryKey, ccnt_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SegmentKey, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SegmentKey, dbid_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SegmentKey, segindex_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, runningtimeseconds_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, usertimeseconds_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, kerneltimeseconds_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, vsize_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, rss_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, vmsizekb_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, vmpeakkb_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, rchar_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, wchar_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, syscr_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, syscw_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, read_bytes_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, write_bytes_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SystemStat, cancelled_write_bytes_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::NetworkStat, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::NetworkStat, total_bytes_), + PROTOBUF_FIELD_OFFSET(::yagpcc::NetworkStat, tuple_bytes_), + PROTOBUF_FIELD_OFFSET(::yagpcc::NetworkStat, chunks_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, total_recv_queue_size_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, recv_queue_size_counting_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, total_capacity_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, capacity_counting_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, total_buffers_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, buffer_counting_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, active_connections_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, retransmits_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, startup_cached_pkt_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, mismatch_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, crc_errors_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, snd_pkt_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, recv_pkt_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, disordered_pkt_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, duplicated_pkt_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, recv_ack_num_), + PROTOBUF_FIELD_OFFSET(::yagpcc::InterconnectStat, status_query_msg_num_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, ntuples_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, nloops_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, tuplecount_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, firsttuple_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, startup_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, total_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, shared_blks_hit_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, shared_blks_read_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, shared_blks_dirtied_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, shared_blks_written_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, local_blks_hit_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, local_blks_read_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, local_blks_dirtied_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, local_blks_written_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, temp_blks_read_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, temp_blks_written_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, blk_read_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, blk_write_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, sent_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, received_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, startup_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, inherited_calls_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, inherited_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricInstrumentation, interconnect_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SpillInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SpillInfo, filecount_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SpillInfo, totalbytes_), +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::yagpcc::QueryInfo)}, + { 16, -1, sizeof(::yagpcc::AdditionalQueryInfo)}, + { 24, -1, sizeof(::yagpcc::AdditionalQueryStat)}, + { 31, -1, sizeof(::yagpcc::GPMetrics)}, + { 39, -1, sizeof(::yagpcc::QueryKey)}, + { 47, -1, sizeof(::yagpcc::SegmentKey)}, + { 54, -1, sizeof(::yagpcc::SystemStat)}, + { 73, -1, sizeof(::yagpcc::NetworkStat)}, + { 81, -1, sizeof(::yagpcc::InterconnectStat)}, + { 103, -1, sizeof(::yagpcc::MetricInstrumentation)}, + { 132, -1, sizeof(::yagpcc::SpillInfo)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::yagpcc::_QueryInfo_default_instance_), + reinterpret_cast(&::yagpcc::_AdditionalQueryInfo_default_instance_), + reinterpret_cast(&::yagpcc::_AdditionalQueryStat_default_instance_), + reinterpret_cast(&::yagpcc::_GPMetrics_default_instance_), + reinterpret_cast(&::yagpcc::_QueryKey_default_instance_), + reinterpret_cast(&::yagpcc::_SegmentKey_default_instance_), + reinterpret_cast(&::yagpcc::_SystemStat_default_instance_), + reinterpret_cast(&::yagpcc::_NetworkStat_default_instance_), + reinterpret_cast(&::yagpcc::_InterconnectStat_default_instance_), + reinterpret_cast(&::yagpcc::_MetricInstrumentation_default_instance_), + reinterpret_cast(&::yagpcc::_SpillInfo_default_instance_), +}; + +const char descriptor_table_protodef_protos_2fyagpcc_5fmetrics_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\033protos/yagpcc_metrics.proto\022\006yagpcc\"\207\002" + "\n\tQueryInfo\022(\n\tgenerator\030\001 \001(\0162\025.yagpcc." + "PlanGenerator\022\020\n\010query_id\030\002 \001(\004\022\017\n\007plan_" + "id\030\003 \001(\004\022\022\n\nquery_text\030\004 \001(\t\022\021\n\tplan_tex" + "t\030\005 \001(\t\022\033\n\023template_query_text\030\006 \001(\t\022\032\n\022" + "template_plan_text\030\007 \001(\t\022\020\n\010userName\030\010 \001" + "(\t\022\024\n\014databaseName\030\t \001(\t\022\017\n\007rsgname\030\n \001(" + "\t\022\024\n\014analyze_text\030\013 \001(\t\"T\n\023AdditionalQue" + "ryInfo\022\024\n\014nested_level\030\001 \001(\003\022\025\n\rerror_me" + "ssage\030\002 \001(\t\022\020\n\010slice_id\030\003 \001(\003\"<\n\023Additio" + "nalQueryStat\022\025\n\rerror_message\030\001 \001(\t\022\016\n\006s" + "lices\030\002 \003(\003\"\215\001\n\tGPMetrics\022&\n\nsystemStat\030" + "\001 \001(\0132\022.yagpcc.SystemStat\0226\n\017instrumenta" + "tion\030\002 \001(\0132\035.yagpcc.MetricInstrumentatio" + "n\022 \n\005spill\030\003 \001(\0132\021.yagpcc.SpillInfo\"4\n\010Q" + "ueryKey\022\014\n\004tmid\030\001 \001(\005\022\014\n\004ssid\030\002 \001(\005\022\014\n\004c" + "cnt\030\003 \001(\005\",\n\nSegmentKey\022\014\n\004dbid\030\001 \001(\005\022\020\n" + "\010segindex\030\002 \001(\005\"\240\002\n\nSystemStat\022\032\n\022runnin" + "gTimeSeconds\030\001 \001(\001\022\027\n\017userTimeSeconds\030\002 " + "\001(\001\022\031\n\021kernelTimeSeconds\030\003 \001(\001\022\r\n\005vsize\030" + "\004 \001(\004\022\013\n\003rss\030\005 \001(\004\022\020\n\010VmSizeKb\030\006 \001(\004\022\020\n\010" + "VmPeakKb\030\007 \001(\004\022\r\n\005rchar\030\010 \001(\004\022\r\n\005wchar\030\t" + " \001(\004\022\r\n\005syscr\030\n \001(\004\022\r\n\005syscw\030\013 \001(\004\022\022\n\nre" + "ad_bytes\030\014 \001(\004\022\023\n\013write_bytes\030\r \001(\004\022\035\n\025c" + "ancelled_write_bytes\030\016 \001(\004\"G\n\013NetworkSta" + "t\022\023\n\013total_bytes\030\001 \001(\r\022\023\n\013tuple_bytes\030\002 " + "\001(\r\022\016\n\006chunks\030\003 \001(\r\"\333\003\n\020InterconnectStat" + "\022\035\n\025total_recv_queue_size\030\001 \001(\004\022%\n\035recv_" + "queue_size_counting_time\030\002 \001(\004\022\026\n\016total_" + "capacity\030\003 \001(\004\022\036\n\026capacity_counting_time" + "\030\004 \001(\004\022\025\n\rtotal_buffers\030\005 \001(\004\022\034\n\024buffer_" + "counting_time\030\006 \001(\004\022\036\n\026active_connection" + "s_num\030\007 \001(\004\022\023\n\013retransmits\030\010 \001(\003\022\036\n\026star" + "tup_cached_pkt_num\030\t \001(\003\022\024\n\014mismatch_num" + "\030\n \001(\003\022\022\n\ncrc_errors\030\013 \001(\003\022\023\n\013snd_pkt_nu" + "m\030\014 \001(\003\022\024\n\014recv_pkt_num\030\r \001(\003\022\032\n\022disorde" + "red_pkt_num\030\016 \001(\003\022\032\n\022duplicated_pkt_num\030" + "\017 \001(\003\022\024\n\014recv_ack_num\030\020 \001(\003\022\034\n\024status_qu" + "ery_msg_num\030\021 \001(\003\"\371\004\n\025MetricInstrumentat" + "ion\022\017\n\007ntuples\030\001 \001(\004\022\016\n\006nloops\030\002 \001(\004\022\022\n\n" + "tuplecount\030\003 \001(\004\022\022\n\nfirsttuple\030\004 \001(\001\022\017\n\007" + "startup\030\005 \001(\001\022\r\n\005total\030\006 \001(\001\022\027\n\017shared_b" + "lks_hit\030\007 \001(\004\022\030\n\020shared_blks_read\030\010 \001(\004\022" + "\033\n\023shared_blks_dirtied\030\t \001(\004\022\033\n\023shared_b" + "lks_written\030\n \001(\004\022\026\n\016local_blks_hit\030\013 \001(" + "\004\022\027\n\017local_blks_read\030\014 \001(\004\022\032\n\022local_blks" + "_dirtied\030\r \001(\004\022\032\n\022local_blks_written\030\016 \001" + "(\004\022\026\n\016temp_blks_read\030\017 \001(\004\022\031\n\021temp_blks_" + "written\030\020 \001(\004\022\025\n\rblk_read_time\030\021 \001(\001\022\026\n\016" + "blk_write_time\030\022 \001(\001\022!\n\004sent\030\023 \001(\0132\023.yag" + "pcc.NetworkStat\022%\n\010received\030\024 \001(\0132\023.yagp" + "cc.NetworkStat\022\024\n\014startup_time\030\025 \001(\001\022\027\n\017" + "inherited_calls\030\026 \001(\004\022\026\n\016inherited_time\030" + "\027 \001(\001\022.\n\014interconnect\030\030 \001(\0132\030.yagpcc.Int" + "erconnectStat\"2\n\tSpillInfo\022\021\n\tfileCount\030" + "\001 \001(\005\022\022\n\ntotalBytes\030\002 \001(\003*\366\001\n\013QueryStatu" + "s\022\034\n\030QUERY_STATUS_UNSPECIFIED\020\000\022\027\n\023QUERY" + "_STATUS_SUBMIT\020\001\022\026\n\022QUERY_STATUS_START\020\002" + "\022\025\n\021QUERY_STATUS_DONE\020\003\022\033\n\027QUERY_STATUS_" + "QUERY_DONE\020\004\022\026\n\022QUERY_STATUS_ERROR\020\005\022\033\n\027" + "QUERY_STATUS_CANCELLING\020\006\022\031\n\025QUERY_STATU" + "S_CANCELED\020\007\022\024\n\020QUERY_STATUS_END\020\010*\223\001\n\016P" + "lanNodeStatus\022 \n\034PLAN_NODE_STATUS_UNSPEC" + "IFIED\020\000\022 \n\034PLAN_NODE_STATUS_INITIALIZED\020" + "\001\022\036\n\032PLAN_NODE_STATUS_EXECUTING\020\002\022\035\n\031PLA" + "N_NODE_STATUS_FINISHED\020\003*i\n\rPlanGenerato" + "r\022\036\n\032PLAN_GENERATOR_UNSPECIFIED\020\000\022\032\n\026PLA" + "N_GENERATOR_PLANNER\020\001\022\034\n\030PLAN_GENERATOR_" + "OPTIMIZER\020\002BNB\016SegmentYAGPCCMZ(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_protos_2fyagpcc_5fmetrics_2eproto)), true); +namespace yagpcc { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* QueryStatus_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fmetrics_2eproto[0]; +} +bool QueryStatus_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PlanNodeStatus_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fmetrics_2eproto[1]; +} +bool PlanNodeStatus_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PlanGenerator_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fmetrics_2eproto[2]; +} +bool PlanGenerator_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + + +// =================================================================== + +void QueryInfo::InitAsDefaultInstance() { +} +class QueryInfo::_Internal { + public: +}; + +QueryInfo::QueryInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.QueryInfo) +} +QueryInfo::QueryInfo(const QueryInfo& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + query_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_query_text().empty()) { + query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_query_text(), + GetArena()); + } + plan_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_plan_text().empty()) { + plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_plan_text(), + GetArena()); + } + template_query_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_template_query_text().empty()) { + template_query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_template_query_text(), + GetArena()); + } + template_plan_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_template_plan_text().empty()) { + template_plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_template_plan_text(), + GetArena()); + } + username_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_username().empty()) { + username_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_username(), + GetArena()); + } + databasename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_databasename().empty()) { + databasename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_databasename(), + GetArena()); + } + rsgname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_rsgname().empty()) { + rsgname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_rsgname(), + GetArena()); + } + analyze_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_analyze_text().empty()) { + analyze_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_analyze_text(), + GetArena()); + } + ::memcpy(&query_id_, &from.query_id_, + static_cast(reinterpret_cast(&generator_) - + reinterpret_cast(&query_id_)) + sizeof(generator_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.QueryInfo) +} + +void QueryInfo::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_QueryInfo_protos_2fyagpcc_5fmetrics_2eproto.base); + query_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + plan_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + template_query_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + template_plan_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + username_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + databasename_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + rsgname_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + analyze_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&query_id_, 0, static_cast( + reinterpret_cast(&generator_) - + reinterpret_cast(&query_id_)) + sizeof(generator_)); +} + +QueryInfo::~QueryInfo() { + // @@protoc_insertion_point(destructor:yagpcc.QueryInfo) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void QueryInfo::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + query_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + plan_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + template_query_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + template_plan_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + username_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + databasename_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + rsgname_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + analyze_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void QueryInfo::ArenaDtor(void* object) { + QueryInfo* _this = reinterpret_cast< QueryInfo* >(object); + (void)_this; +} +void QueryInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void QueryInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const QueryInfo& QueryInfo::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_QueryInfo_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void QueryInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.QueryInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + query_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + plan_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + template_query_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + template_plan_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + username_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + databasename_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + rsgname_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + analyze_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::memset(&query_id_, 0, static_cast( + reinterpret_cast(&generator_) - + reinterpret_cast(&query_id_)) + sizeof(generator_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* QueryInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .yagpcc.PlanGenerator generator = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_generator(static_cast<::yagpcc::PlanGenerator>(val)); + } else goto handle_unusual; + continue; + // uint64 query_id = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + query_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 plan_id = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + plan_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string query_text = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + auto str = _internal_mutable_query_text(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.query_text")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string plan_text = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + auto str = _internal_mutable_plan_text(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.plan_text")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string template_query_text = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + auto str = _internal_mutable_template_query_text(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.template_query_text")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string template_plan_text = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + auto str = _internal_mutable_template_plan_text(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.template_plan_text")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string userName = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + auto str = _internal_mutable_username(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.userName")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string databaseName = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + auto str = _internal_mutable_databasename(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.databaseName")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string rsgname = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + auto str = _internal_mutable_rsgname(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.rsgname")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string analyze_text = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + auto str = _internal_mutable_analyze_text(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.QueryInfo.analyze_text")); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* QueryInfo::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.QueryInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .yagpcc.PlanGenerator generator = 1; + if (this->generator() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_generator(), target); + } + + // uint64 query_id = 2; + if (this->query_id() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_query_id(), target); + } + + // uint64 plan_id = 3; + if (this->plan_id() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(3, this->_internal_plan_id(), target); + } + + // string query_text = 4; + if (this->query_text().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_query_text().data(), static_cast(this->_internal_query_text().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.query_text"); + target = stream->WriteStringMaybeAliased( + 4, this->_internal_query_text(), target); + } + + // string plan_text = 5; + if (this->plan_text().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_plan_text().data(), static_cast(this->_internal_plan_text().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.plan_text"); + target = stream->WriteStringMaybeAliased( + 5, this->_internal_plan_text(), target); + } + + // string template_query_text = 6; + if (this->template_query_text().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_template_query_text().data(), static_cast(this->_internal_template_query_text().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.template_query_text"); + target = stream->WriteStringMaybeAliased( + 6, this->_internal_template_query_text(), target); + } + + // string template_plan_text = 7; + if (this->template_plan_text().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_template_plan_text().data(), static_cast(this->_internal_template_plan_text().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.template_plan_text"); + target = stream->WriteStringMaybeAliased( + 7, this->_internal_template_plan_text(), target); + } + + // string userName = 8; + if (this->username().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_username().data(), static_cast(this->_internal_username().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.userName"); + target = stream->WriteStringMaybeAliased( + 8, this->_internal_username(), target); + } + + // string databaseName = 9; + if (this->databasename().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_databasename().data(), static_cast(this->_internal_databasename().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.databaseName"); + target = stream->WriteStringMaybeAliased( + 9, this->_internal_databasename(), target); + } + + // string rsgname = 10; + if (this->rsgname().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_rsgname().data(), static_cast(this->_internal_rsgname().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.rsgname"); + target = stream->WriteStringMaybeAliased( + 10, this->_internal_rsgname(), target); + } + + // string analyze_text = 11; + if (this->analyze_text().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_analyze_text().data(), static_cast(this->_internal_analyze_text().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.QueryInfo.analyze_text"); + target = stream->WriteStringMaybeAliased( + 11, this->_internal_analyze_text(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.QueryInfo) + return target; +} + +size_t QueryInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.QueryInfo) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string query_text = 4; + if (this->query_text().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_query_text()); + } + + // string plan_text = 5; + if (this->plan_text().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_plan_text()); + } + + // string template_query_text = 6; + if (this->template_query_text().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_template_query_text()); + } + + // string template_plan_text = 7; + if (this->template_plan_text().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_template_plan_text()); + } + + // string userName = 8; + if (this->username().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_username()); + } + + // string databaseName = 9; + if (this->databasename().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_databasename()); + } + + // string rsgname = 10; + if (this->rsgname().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_rsgname()); + } + + // string analyze_text = 11; + if (this->analyze_text().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_analyze_text()); + } + + // uint64 query_id = 2; + if (this->query_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_query_id()); + } + + // uint64 plan_id = 3; + if (this->plan_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_plan_id()); + } + + // .yagpcc.PlanGenerator generator = 1; + if (this->generator() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_generator()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void QueryInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.QueryInfo) + GOOGLE_DCHECK_NE(&from, this); + const QueryInfo* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.QueryInfo) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.QueryInfo) + MergeFrom(*source); + } +} + +void QueryInfo::MergeFrom(const QueryInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.QueryInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.query_text().size() > 0) { + _internal_set_query_text(from._internal_query_text()); + } + if (from.plan_text().size() > 0) { + _internal_set_plan_text(from._internal_plan_text()); + } + if (from.template_query_text().size() > 0) { + _internal_set_template_query_text(from._internal_template_query_text()); + } + if (from.template_plan_text().size() > 0) { + _internal_set_template_plan_text(from._internal_template_plan_text()); + } + if (from.username().size() > 0) { + _internal_set_username(from._internal_username()); + } + if (from.databasename().size() > 0) { + _internal_set_databasename(from._internal_databasename()); + } + if (from.rsgname().size() > 0) { + _internal_set_rsgname(from._internal_rsgname()); + } + if (from.analyze_text().size() > 0) { + _internal_set_analyze_text(from._internal_analyze_text()); + } + if (from.query_id() != 0) { + _internal_set_query_id(from._internal_query_id()); + } + if (from.plan_id() != 0) { + _internal_set_plan_id(from._internal_plan_id()); + } + if (from.generator() != 0) { + _internal_set_generator(from._internal_generator()); + } +} + +void QueryInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.QueryInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void QueryInfo::CopyFrom(const QueryInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.QueryInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool QueryInfo::IsInitialized() const { + return true; +} + +void QueryInfo::InternalSwap(QueryInfo* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + query_text_.Swap(&other->query_text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + plan_text_.Swap(&other->plan_text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + template_query_text_.Swap(&other->template_query_text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + template_plan_text_.Swap(&other->template_plan_text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + username_.Swap(&other->username_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + databasename_.Swap(&other->databasename_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + rsgname_.Swap(&other->rsgname_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + analyze_text_.Swap(&other->analyze_text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(QueryInfo, generator_) + + sizeof(QueryInfo::generator_) + - PROTOBUF_FIELD_OFFSET(QueryInfo, query_id_)>( + reinterpret_cast(&query_id_), + reinterpret_cast(&other->query_id_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata QueryInfo::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void AdditionalQueryInfo::InitAsDefaultInstance() { +} +class AdditionalQueryInfo::_Internal { + public: +}; + +AdditionalQueryInfo::AdditionalQueryInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.AdditionalQueryInfo) +} +AdditionalQueryInfo::AdditionalQueryInfo(const AdditionalQueryInfo& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_error_message().empty()) { + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_error_message(), + GetArena()); + } + ::memcpy(&nested_level_, &from.nested_level_, + static_cast(reinterpret_cast(&slice_id_) - + reinterpret_cast(&nested_level_)) + sizeof(slice_id_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.AdditionalQueryInfo) +} + +void AdditionalQueryInfo::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AdditionalQueryInfo_protos_2fyagpcc_5fmetrics_2eproto.base); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&nested_level_, 0, static_cast( + reinterpret_cast(&slice_id_) - + reinterpret_cast(&nested_level_)) + sizeof(slice_id_)); +} + +AdditionalQueryInfo::~AdditionalQueryInfo() { + // @@protoc_insertion_point(destructor:yagpcc.AdditionalQueryInfo) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void AdditionalQueryInfo::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + error_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void AdditionalQueryInfo::ArenaDtor(void* object) { + AdditionalQueryInfo* _this = reinterpret_cast< AdditionalQueryInfo* >(object); + (void)_this; +} +void AdditionalQueryInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void AdditionalQueryInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const AdditionalQueryInfo& AdditionalQueryInfo::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AdditionalQueryInfo_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void AdditionalQueryInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.AdditionalQueryInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + error_message_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::memset(&nested_level_, 0, static_cast( + reinterpret_cast(&slice_id_) - + reinterpret_cast(&nested_level_)) + sizeof(slice_id_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* AdditionalQueryInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // int64 nested_level = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + nested_level_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string error_message = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + auto str = _internal_mutable_error_message(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.AdditionalQueryInfo.error_message")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 slice_id = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + slice_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* AdditionalQueryInfo::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.AdditionalQueryInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int64 nested_level = 1; + if (this->nested_level() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(1, this->_internal_nested_level(), target); + } + + // string error_message = 2; + if (this->error_message().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_error_message().data(), static_cast(this->_internal_error_message().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.AdditionalQueryInfo.error_message"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_error_message(), target); + } + + // int64 slice_id = 3; + if (this->slice_id() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(3, this->_internal_slice_id(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.AdditionalQueryInfo) + return target; +} + +size_t AdditionalQueryInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.AdditionalQueryInfo) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string error_message = 2; + if (this->error_message().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_error_message()); + } + + // int64 nested_level = 1; + if (this->nested_level() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_nested_level()); + } + + // int64 slice_id = 3; + if (this->slice_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_slice_id()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AdditionalQueryInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.AdditionalQueryInfo) + GOOGLE_DCHECK_NE(&from, this); + const AdditionalQueryInfo* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.AdditionalQueryInfo) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.AdditionalQueryInfo) + MergeFrom(*source); + } +} + +void AdditionalQueryInfo::MergeFrom(const AdditionalQueryInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.AdditionalQueryInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.error_message().size() > 0) { + _internal_set_error_message(from._internal_error_message()); + } + if (from.nested_level() != 0) { + _internal_set_nested_level(from._internal_nested_level()); + } + if (from.slice_id() != 0) { + _internal_set_slice_id(from._internal_slice_id()); + } +} + +void AdditionalQueryInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.AdditionalQueryInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AdditionalQueryInfo::CopyFrom(const AdditionalQueryInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.AdditionalQueryInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AdditionalQueryInfo::IsInitialized() const { + return true; +} + +void AdditionalQueryInfo::InternalSwap(AdditionalQueryInfo* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + error_message_.Swap(&other->error_message_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(AdditionalQueryInfo, slice_id_) + + sizeof(AdditionalQueryInfo::slice_id_) + - PROTOBUF_FIELD_OFFSET(AdditionalQueryInfo, nested_level_)>( + reinterpret_cast(&nested_level_), + reinterpret_cast(&other->nested_level_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata AdditionalQueryInfo::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void AdditionalQueryStat::InitAsDefaultInstance() { +} +class AdditionalQueryStat::_Internal { + public: +}; + +AdditionalQueryStat::AdditionalQueryStat(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + slices_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.AdditionalQueryStat) +} +AdditionalQueryStat::AdditionalQueryStat(const AdditionalQueryStat& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + slices_(from.slices_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_error_message().empty()) { + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_error_message(), + GetArena()); + } + // @@protoc_insertion_point(copy_constructor:yagpcc.AdditionalQueryStat) +} + +void AdditionalQueryStat::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_AdditionalQueryStat_protos_2fyagpcc_5fmetrics_2eproto.base); + error_message_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +AdditionalQueryStat::~AdditionalQueryStat() { + // @@protoc_insertion_point(destructor:yagpcc.AdditionalQueryStat) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void AdditionalQueryStat::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + error_message_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void AdditionalQueryStat::ArenaDtor(void* object) { + AdditionalQueryStat* _this = reinterpret_cast< AdditionalQueryStat* >(object); + (void)_this; +} +void AdditionalQueryStat::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void AdditionalQueryStat::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const AdditionalQueryStat& AdditionalQueryStat::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_AdditionalQueryStat_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void AdditionalQueryStat::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.AdditionalQueryStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + slices_.Clear(); + error_message_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* AdditionalQueryStat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // string error_message = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + auto str = _internal_mutable_error_message(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.AdditionalQueryStat.error_message")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // repeated int64 slices = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_slices(), ptr, ctx); + CHK_(ptr); + } else if (static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16) { + _internal_add_slices(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr)); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* AdditionalQueryStat::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.AdditionalQueryStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // string error_message = 1; + if (this->error_message().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_error_message().data(), static_cast(this->_internal_error_message().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.AdditionalQueryStat.error_message"); + target = stream->WriteStringMaybeAliased( + 1, this->_internal_error_message(), target); + } + + // repeated int64 slices = 2; + { + int byte_size = _slices_cached_byte_size_.load(std::memory_order_relaxed); + if (byte_size > 0) { + target = stream->WriteInt64Packed( + 2, _internal_slices(), byte_size, target); + } + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.AdditionalQueryStat) + return target; +} + +size_t AdditionalQueryStat::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.AdditionalQueryStat) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated int64 slices = 2; + { + size_t data_size = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + Int64Size(this->slices_); + if (data_size > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + static_cast<::PROTOBUF_NAMESPACE_ID::int32>(data_size)); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(data_size); + _slices_cached_byte_size_.store(cached_size, + std::memory_order_relaxed); + total_size += data_size; + } + + // string error_message = 1; + if (this->error_message().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_error_message()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void AdditionalQueryStat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.AdditionalQueryStat) + GOOGLE_DCHECK_NE(&from, this); + const AdditionalQueryStat* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.AdditionalQueryStat) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.AdditionalQueryStat) + MergeFrom(*source); + } +} + +void AdditionalQueryStat::MergeFrom(const AdditionalQueryStat& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.AdditionalQueryStat) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + slices_.MergeFrom(from.slices_); + if (from.error_message().size() > 0) { + _internal_set_error_message(from._internal_error_message()); + } +} + +void AdditionalQueryStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.AdditionalQueryStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void AdditionalQueryStat::CopyFrom(const AdditionalQueryStat& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.AdditionalQueryStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool AdditionalQueryStat::IsInitialized() const { + return true; +} + +void AdditionalQueryStat::InternalSwap(AdditionalQueryStat* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + slices_.InternalSwap(&other->slices_); + error_message_.Swap(&other->error_message_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} + +::PROTOBUF_NAMESPACE_ID::Metadata AdditionalQueryStat::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void GPMetrics::InitAsDefaultInstance() { + ::yagpcc::_GPMetrics_default_instance_._instance.get_mutable()->systemstat_ = const_cast< ::yagpcc::SystemStat*>( + ::yagpcc::SystemStat::internal_default_instance()); + ::yagpcc::_GPMetrics_default_instance_._instance.get_mutable()->instrumentation_ = const_cast< ::yagpcc::MetricInstrumentation*>( + ::yagpcc::MetricInstrumentation::internal_default_instance()); + ::yagpcc::_GPMetrics_default_instance_._instance.get_mutable()->spill_ = const_cast< ::yagpcc::SpillInfo*>( + ::yagpcc::SpillInfo::internal_default_instance()); +} +class GPMetrics::_Internal { + public: + static const ::yagpcc::SystemStat& systemstat(const GPMetrics* msg); + static const ::yagpcc::MetricInstrumentation& instrumentation(const GPMetrics* msg); + static const ::yagpcc::SpillInfo& spill(const GPMetrics* msg); +}; + +const ::yagpcc::SystemStat& +GPMetrics::_Internal::systemstat(const GPMetrics* msg) { + return *msg->systemstat_; +} +const ::yagpcc::MetricInstrumentation& +GPMetrics::_Internal::instrumentation(const GPMetrics* msg) { + return *msg->instrumentation_; +} +const ::yagpcc::SpillInfo& +GPMetrics::_Internal::spill(const GPMetrics* msg) { + return *msg->spill_; +} +GPMetrics::GPMetrics(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.GPMetrics) +} +GPMetrics::GPMetrics(const GPMetrics& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_systemstat()) { + systemstat_ = new ::yagpcc::SystemStat(*from.systemstat_); + } else { + systemstat_ = nullptr; + } + if (from._internal_has_instrumentation()) { + instrumentation_ = new ::yagpcc::MetricInstrumentation(*from.instrumentation_); + } else { + instrumentation_ = nullptr; + } + if (from._internal_has_spill()) { + spill_ = new ::yagpcc::SpillInfo(*from.spill_); + } else { + spill_ = nullptr; + } + // @@protoc_insertion_point(copy_constructor:yagpcc.GPMetrics) +} + +void GPMetrics::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto.base); + ::memset(&systemstat_, 0, static_cast( + reinterpret_cast(&spill_) - + reinterpret_cast(&systemstat_)) + sizeof(spill_)); +} + +GPMetrics::~GPMetrics() { + // @@protoc_insertion_point(destructor:yagpcc.GPMetrics) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void GPMetrics::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete systemstat_; + if (this != internal_default_instance()) delete instrumentation_; + if (this != internal_default_instance()) delete spill_; +} + +void GPMetrics::ArenaDtor(void* object) { + GPMetrics* _this = reinterpret_cast< GPMetrics* >(object); + (void)_this; +} +void GPMetrics::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void GPMetrics::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const GPMetrics& GPMetrics::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void GPMetrics::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.GPMetrics) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArena() == nullptr && systemstat_ != nullptr) { + delete systemstat_; + } + systemstat_ = nullptr; + if (GetArena() == nullptr && instrumentation_ != nullptr) { + delete instrumentation_; + } + instrumentation_ = nullptr; + if (GetArena() == nullptr && spill_ != nullptr) { + delete spill_; + } + spill_ = nullptr; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* GPMetrics::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .yagpcc.SystemStat systemStat = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) { + ptr = ctx->ParseMessage(_internal_mutable_systemstat(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.MetricInstrumentation instrumentation = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_instrumentation(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.SpillInfo spill = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_spill(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* GPMetrics::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.GPMetrics) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .yagpcc.SystemStat systemStat = 1; + if (this->has_systemstat()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 1, _Internal::systemstat(this), target, stream); + } + + // .yagpcc.MetricInstrumentation instrumentation = 2; + if (this->has_instrumentation()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 2, _Internal::instrumentation(this), target, stream); + } + + // .yagpcc.SpillInfo spill = 3; + if (this->has_spill()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 3, _Internal::spill(this), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.GPMetrics) + return target; +} + +size_t GPMetrics::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.GPMetrics) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .yagpcc.SystemStat systemStat = 1; + if (this->has_systemstat()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *systemstat_); + } + + // .yagpcc.MetricInstrumentation instrumentation = 2; + if (this->has_instrumentation()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *instrumentation_); + } + + // .yagpcc.SpillInfo spill = 3; + if (this->has_spill()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *spill_); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void GPMetrics::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.GPMetrics) + GOOGLE_DCHECK_NE(&from, this); + const GPMetrics* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.GPMetrics) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.GPMetrics) + MergeFrom(*source); + } +} + +void GPMetrics::MergeFrom(const GPMetrics& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.GPMetrics) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_systemstat()) { + _internal_mutable_systemstat()->::yagpcc::SystemStat::MergeFrom(from._internal_systemstat()); + } + if (from.has_instrumentation()) { + _internal_mutable_instrumentation()->::yagpcc::MetricInstrumentation::MergeFrom(from._internal_instrumentation()); + } + if (from.has_spill()) { + _internal_mutable_spill()->::yagpcc::SpillInfo::MergeFrom(from._internal_spill()); + } +} + +void GPMetrics::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.GPMetrics) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void GPMetrics::CopyFrom(const GPMetrics& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.GPMetrics) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool GPMetrics::IsInitialized() const { + return true; +} + +void GPMetrics::InternalSwap(GPMetrics* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(GPMetrics, spill_) + + sizeof(GPMetrics::spill_) + - PROTOBUF_FIELD_OFFSET(GPMetrics, systemstat_)>( + reinterpret_cast(&systemstat_), + reinterpret_cast(&other->systemstat_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata GPMetrics::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void QueryKey::InitAsDefaultInstance() { +} +class QueryKey::_Internal { + public: +}; + +QueryKey::QueryKey(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.QueryKey) +} +QueryKey::QueryKey(const QueryKey& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&tmid_, &from.tmid_, + static_cast(reinterpret_cast(&ccnt_) - + reinterpret_cast(&tmid_)) + sizeof(ccnt_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.QueryKey) +} + +void QueryKey::SharedCtor() { + ::memset(&tmid_, 0, static_cast( + reinterpret_cast(&ccnt_) - + reinterpret_cast(&tmid_)) + sizeof(ccnt_)); +} + +QueryKey::~QueryKey() { + // @@protoc_insertion_point(destructor:yagpcc.QueryKey) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void QueryKey::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void QueryKey::ArenaDtor(void* object) { + QueryKey* _this = reinterpret_cast< QueryKey* >(object); + (void)_this; +} +void QueryKey::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void QueryKey::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const QueryKey& QueryKey::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_QueryKey_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void QueryKey::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.QueryKey) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&tmid_, 0, static_cast( + reinterpret_cast(&ccnt_) - + reinterpret_cast(&tmid_)) + sizeof(ccnt_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* QueryKey::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // int32 tmid = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + tmid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 ssid = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + ssid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 ccnt = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + ccnt_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* QueryKey::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.QueryKey) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 tmid = 1; + if (this->tmid() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_tmid(), target); + } + + // int32 ssid = 2; + if (this->ssid() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_ssid(), target); + } + + // int32 ccnt = 3; + if (this->ccnt() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_ccnt(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.QueryKey) + return target; +} + +size_t QueryKey::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.QueryKey) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int32 tmid = 1; + if (this->tmid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_tmid()); + } + + // int32 ssid = 2; + if (this->ssid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_ssid()); + } + + // int32 ccnt = 3; + if (this->ccnt() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_ccnt()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void QueryKey::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.QueryKey) + GOOGLE_DCHECK_NE(&from, this); + const QueryKey* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.QueryKey) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.QueryKey) + MergeFrom(*source); + } +} + +void QueryKey::MergeFrom(const QueryKey& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.QueryKey) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.tmid() != 0) { + _internal_set_tmid(from._internal_tmid()); + } + if (from.ssid() != 0) { + _internal_set_ssid(from._internal_ssid()); + } + if (from.ccnt() != 0) { + _internal_set_ccnt(from._internal_ccnt()); + } +} + +void QueryKey::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.QueryKey) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void QueryKey::CopyFrom(const QueryKey& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.QueryKey) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool QueryKey::IsInitialized() const { + return true; +} + +void QueryKey::InternalSwap(QueryKey* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(QueryKey, ccnt_) + + sizeof(QueryKey::ccnt_) + - PROTOBUF_FIELD_OFFSET(QueryKey, tmid_)>( + reinterpret_cast(&tmid_), + reinterpret_cast(&other->tmid_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata QueryKey::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void SegmentKey::InitAsDefaultInstance() { +} +class SegmentKey::_Internal { + public: +}; + +SegmentKey::SegmentKey(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.SegmentKey) +} +SegmentKey::SegmentKey(const SegmentKey& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&dbid_, &from.dbid_, + static_cast(reinterpret_cast(&segindex_) - + reinterpret_cast(&dbid_)) + sizeof(segindex_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.SegmentKey) +} + +void SegmentKey::SharedCtor() { + ::memset(&dbid_, 0, static_cast( + reinterpret_cast(&segindex_) - + reinterpret_cast(&dbid_)) + sizeof(segindex_)); +} + +SegmentKey::~SegmentKey() { + // @@protoc_insertion_point(destructor:yagpcc.SegmentKey) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void SegmentKey::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void SegmentKey::ArenaDtor(void* object) { + SegmentKey* _this = reinterpret_cast< SegmentKey* >(object); + (void)_this; +} +void SegmentKey::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SegmentKey::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const SegmentKey& SegmentKey::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SegmentKey_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void SegmentKey::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.SegmentKey) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&dbid_, 0, static_cast( + reinterpret_cast(&segindex_) - + reinterpret_cast(&dbid_)) + sizeof(segindex_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SegmentKey::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // int32 dbid = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + dbid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 segindex = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + segindex_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* SegmentKey::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.SegmentKey) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 dbid = 1; + if (this->dbid() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_dbid(), target); + } + + // int32 segindex = 2; + if (this->segindex() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_segindex(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.SegmentKey) + return target; +} + +size_t SegmentKey::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.SegmentKey) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int32 dbid = 1; + if (this->dbid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_dbid()); + } + + // int32 segindex = 2; + if (this->segindex() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_segindex()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SegmentKey::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.SegmentKey) + GOOGLE_DCHECK_NE(&from, this); + const SegmentKey* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.SegmentKey) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.SegmentKey) + MergeFrom(*source); + } +} + +void SegmentKey::MergeFrom(const SegmentKey& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.SegmentKey) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.dbid() != 0) { + _internal_set_dbid(from._internal_dbid()); + } + if (from.segindex() != 0) { + _internal_set_segindex(from._internal_segindex()); + } +} + +void SegmentKey::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.SegmentKey) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SegmentKey::CopyFrom(const SegmentKey& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.SegmentKey) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SegmentKey::IsInitialized() const { + return true; +} + +void SegmentKey::InternalSwap(SegmentKey* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SegmentKey, segindex_) + + sizeof(SegmentKey::segindex_) + - PROTOBUF_FIELD_OFFSET(SegmentKey, dbid_)>( + reinterpret_cast(&dbid_), + reinterpret_cast(&other->dbid_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SegmentKey::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void SystemStat::InitAsDefaultInstance() { +} +class SystemStat::_Internal { + public: +}; + +SystemStat::SystemStat(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.SystemStat) +} +SystemStat::SystemStat(const SystemStat& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&runningtimeseconds_, &from.runningtimeseconds_, + static_cast(reinterpret_cast(&cancelled_write_bytes_) - + reinterpret_cast(&runningtimeseconds_)) + sizeof(cancelled_write_bytes_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.SystemStat) +} + +void SystemStat::SharedCtor() { + ::memset(&runningtimeseconds_, 0, static_cast( + reinterpret_cast(&cancelled_write_bytes_) - + reinterpret_cast(&runningtimeseconds_)) + sizeof(cancelled_write_bytes_)); +} + +SystemStat::~SystemStat() { + // @@protoc_insertion_point(destructor:yagpcc.SystemStat) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void SystemStat::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void SystemStat::ArenaDtor(void* object) { + SystemStat* _this = reinterpret_cast< SystemStat* >(object); + (void)_this; +} +void SystemStat::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SystemStat::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const SystemStat& SystemStat::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SystemStat_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void SystemStat::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.SystemStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&runningtimeseconds_, 0, static_cast( + reinterpret_cast(&cancelled_write_bytes_) - + reinterpret_cast(&runningtimeseconds_)) + sizeof(cancelled_write_bytes_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SystemStat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // double runningTimeSeconds = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 9)) { + runningtimeseconds_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // double userTimeSeconds = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 17)) { + usertimeseconds_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // double kernelTimeSeconds = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 25)) { + kerneltimeseconds_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // uint64 vsize = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + vsize_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 rss = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + rss_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 VmSizeKb = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + vmsizekb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 VmPeakKb = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + vmpeakkb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 rchar = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + rchar_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 wchar = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + wchar_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 syscr = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + syscr_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 syscw = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { + syscw_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 read_bytes = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { + read_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 write_bytes = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { + write_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 cancelled_write_bytes = 14; + case 14: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) { + cancelled_write_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* SystemStat::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.SystemStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // double runningTimeSeconds = 1; + if (!(this->runningtimeseconds() <= 0 && this->runningtimeseconds() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(1, this->_internal_runningtimeseconds(), target); + } + + // double userTimeSeconds = 2; + if (!(this->usertimeseconds() <= 0 && this->usertimeseconds() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(2, this->_internal_usertimeseconds(), target); + } + + // double kernelTimeSeconds = 3; + if (!(this->kerneltimeseconds() <= 0 && this->kerneltimeseconds() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(3, this->_internal_kerneltimeseconds(), target); + } + + // uint64 vsize = 4; + if (this->vsize() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(4, this->_internal_vsize(), target); + } + + // uint64 rss = 5; + if (this->rss() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(5, this->_internal_rss(), target); + } + + // uint64 VmSizeKb = 6; + if (this->vmsizekb() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(6, this->_internal_vmsizekb(), target); + } + + // uint64 VmPeakKb = 7; + if (this->vmpeakkb() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(7, this->_internal_vmpeakkb(), target); + } + + // uint64 rchar = 8; + if (this->rchar() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(8, this->_internal_rchar(), target); + } + + // uint64 wchar = 9; + if (this->wchar() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(9, this->_internal_wchar(), target); + } + + // uint64 syscr = 10; + if (this->syscr() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(10, this->_internal_syscr(), target); + } + + // uint64 syscw = 11; + if (this->syscw() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(11, this->_internal_syscw(), target); + } + + // uint64 read_bytes = 12; + if (this->read_bytes() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(12, this->_internal_read_bytes(), target); + } + + // uint64 write_bytes = 13; + if (this->write_bytes() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(13, this->_internal_write_bytes(), target); + } + + // uint64 cancelled_write_bytes = 14; + if (this->cancelled_write_bytes() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(14, this->_internal_cancelled_write_bytes(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.SystemStat) + return target; +} + +size_t SystemStat::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.SystemStat) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // double runningTimeSeconds = 1; + if (!(this->runningtimeseconds() <= 0 && this->runningtimeseconds() >= 0)) { + total_size += 1 + 8; + } + + // double userTimeSeconds = 2; + if (!(this->usertimeseconds() <= 0 && this->usertimeseconds() >= 0)) { + total_size += 1 + 8; + } + + // double kernelTimeSeconds = 3; + if (!(this->kerneltimeseconds() <= 0 && this->kerneltimeseconds() >= 0)) { + total_size += 1 + 8; + } + + // uint64 vsize = 4; + if (this->vsize() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_vsize()); + } + + // uint64 rss = 5; + if (this->rss() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_rss()); + } + + // uint64 VmSizeKb = 6; + if (this->vmsizekb() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_vmsizekb()); + } + + // uint64 VmPeakKb = 7; + if (this->vmpeakkb() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_vmpeakkb()); + } + + // uint64 rchar = 8; + if (this->rchar() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_rchar()); + } + + // uint64 wchar = 9; + if (this->wchar() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_wchar()); + } + + // uint64 syscr = 10; + if (this->syscr() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_syscr()); + } + + // uint64 syscw = 11; + if (this->syscw() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_syscw()); + } + + // uint64 read_bytes = 12; + if (this->read_bytes() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_read_bytes()); + } + + // uint64 write_bytes = 13; + if (this->write_bytes() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_write_bytes()); + } + + // uint64 cancelled_write_bytes = 14; + if (this->cancelled_write_bytes() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_cancelled_write_bytes()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SystemStat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.SystemStat) + GOOGLE_DCHECK_NE(&from, this); + const SystemStat* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.SystemStat) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.SystemStat) + MergeFrom(*source); + } +} + +void SystemStat::MergeFrom(const SystemStat& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.SystemStat) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (!(from.runningtimeseconds() <= 0 && from.runningtimeseconds() >= 0)) { + _internal_set_runningtimeseconds(from._internal_runningtimeseconds()); + } + if (!(from.usertimeseconds() <= 0 && from.usertimeseconds() >= 0)) { + _internal_set_usertimeseconds(from._internal_usertimeseconds()); + } + if (!(from.kerneltimeseconds() <= 0 && from.kerneltimeseconds() >= 0)) { + _internal_set_kerneltimeseconds(from._internal_kerneltimeseconds()); + } + if (from.vsize() != 0) { + _internal_set_vsize(from._internal_vsize()); + } + if (from.rss() != 0) { + _internal_set_rss(from._internal_rss()); + } + if (from.vmsizekb() != 0) { + _internal_set_vmsizekb(from._internal_vmsizekb()); + } + if (from.vmpeakkb() != 0) { + _internal_set_vmpeakkb(from._internal_vmpeakkb()); + } + if (from.rchar() != 0) { + _internal_set_rchar(from._internal_rchar()); + } + if (from.wchar() != 0) { + _internal_set_wchar(from._internal_wchar()); + } + if (from.syscr() != 0) { + _internal_set_syscr(from._internal_syscr()); + } + if (from.syscw() != 0) { + _internal_set_syscw(from._internal_syscw()); + } + if (from.read_bytes() != 0) { + _internal_set_read_bytes(from._internal_read_bytes()); + } + if (from.write_bytes() != 0) { + _internal_set_write_bytes(from._internal_write_bytes()); + } + if (from.cancelled_write_bytes() != 0) { + _internal_set_cancelled_write_bytes(from._internal_cancelled_write_bytes()); + } +} + +void SystemStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.SystemStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SystemStat::CopyFrom(const SystemStat& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.SystemStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SystemStat::IsInitialized() const { + return true; +} + +void SystemStat::InternalSwap(SystemStat* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SystemStat, cancelled_write_bytes_) + + sizeof(SystemStat::cancelled_write_bytes_) + - PROTOBUF_FIELD_OFFSET(SystemStat, runningtimeseconds_)>( + reinterpret_cast(&runningtimeseconds_), + reinterpret_cast(&other->runningtimeseconds_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SystemStat::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void NetworkStat::InitAsDefaultInstance() { +} +class NetworkStat::_Internal { + public: +}; + +NetworkStat::NetworkStat(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.NetworkStat) +} +NetworkStat::NetworkStat(const NetworkStat& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&total_bytes_, &from.total_bytes_, + static_cast(reinterpret_cast(&chunks_) - + reinterpret_cast(&total_bytes_)) + sizeof(chunks_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.NetworkStat) +} + +void NetworkStat::SharedCtor() { + ::memset(&total_bytes_, 0, static_cast( + reinterpret_cast(&chunks_) - + reinterpret_cast(&total_bytes_)) + sizeof(chunks_)); +} + +NetworkStat::~NetworkStat() { + // @@protoc_insertion_point(destructor:yagpcc.NetworkStat) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void NetworkStat::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void NetworkStat::ArenaDtor(void* object) { + NetworkStat* _this = reinterpret_cast< NetworkStat* >(object); + (void)_this; +} +void NetworkStat::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void NetworkStat::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const NetworkStat& NetworkStat::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_NetworkStat_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void NetworkStat::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.NetworkStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&total_bytes_, 0, static_cast( + reinterpret_cast(&chunks_) - + reinterpret_cast(&total_bytes_)) + sizeof(chunks_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* NetworkStat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // uint32 total_bytes = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + total_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint32 tuple_bytes = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + tuple_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint32 chunks = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + chunks_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* NetworkStat::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.NetworkStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint32 total_bytes = 1; + if (this->total_bytes() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(1, this->_internal_total_bytes(), target); + } + + // uint32 tuple_bytes = 2; + if (this->tuple_bytes() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(2, this->_internal_tuple_bytes(), target); + } + + // uint32 chunks = 3; + if (this->chunks() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt32ToArray(3, this->_internal_chunks(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.NetworkStat) + return target; +} + +size_t NetworkStat::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.NetworkStat) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint32 total_bytes = 1; + if (this->total_bytes() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->_internal_total_bytes()); + } + + // uint32 tuple_bytes = 2; + if (this->tuple_bytes() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->_internal_tuple_bytes()); + } + + // uint32 chunks = 3; + if (this->chunks() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt32Size( + this->_internal_chunks()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void NetworkStat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.NetworkStat) + GOOGLE_DCHECK_NE(&from, this); + const NetworkStat* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.NetworkStat) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.NetworkStat) + MergeFrom(*source); + } +} + +void NetworkStat::MergeFrom(const NetworkStat& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.NetworkStat) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.total_bytes() != 0) { + _internal_set_total_bytes(from._internal_total_bytes()); + } + if (from.tuple_bytes() != 0) { + _internal_set_tuple_bytes(from._internal_tuple_bytes()); + } + if (from.chunks() != 0) { + _internal_set_chunks(from._internal_chunks()); + } +} + +void NetworkStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.NetworkStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void NetworkStat::CopyFrom(const NetworkStat& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.NetworkStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool NetworkStat::IsInitialized() const { + return true; +} + +void NetworkStat::InternalSwap(NetworkStat* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(NetworkStat, chunks_) + + sizeof(NetworkStat::chunks_) + - PROTOBUF_FIELD_OFFSET(NetworkStat, total_bytes_)>( + reinterpret_cast(&total_bytes_), + reinterpret_cast(&other->total_bytes_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata NetworkStat::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void InterconnectStat::InitAsDefaultInstance() { +} +class InterconnectStat::_Internal { + public: +}; + +InterconnectStat::InterconnectStat(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.InterconnectStat) +} +InterconnectStat::InterconnectStat(const InterconnectStat& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&total_recv_queue_size_, &from.total_recv_queue_size_, + static_cast(reinterpret_cast(&status_query_msg_num_) - + reinterpret_cast(&total_recv_queue_size_)) + sizeof(status_query_msg_num_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.InterconnectStat) +} + +void InterconnectStat::SharedCtor() { + ::memset(&total_recv_queue_size_, 0, static_cast( + reinterpret_cast(&status_query_msg_num_) - + reinterpret_cast(&total_recv_queue_size_)) + sizeof(status_query_msg_num_)); +} + +InterconnectStat::~InterconnectStat() { + // @@protoc_insertion_point(destructor:yagpcc.InterconnectStat) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void InterconnectStat::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void InterconnectStat::ArenaDtor(void* object) { + InterconnectStat* _this = reinterpret_cast< InterconnectStat* >(object); + (void)_this; +} +void InterconnectStat::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void InterconnectStat::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const InterconnectStat& InterconnectStat::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_InterconnectStat_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void InterconnectStat::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.InterconnectStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&total_recv_queue_size_, 0, static_cast( + reinterpret_cast(&status_query_msg_num_) - + reinterpret_cast(&total_recv_queue_size_)) + sizeof(status_query_msg_num_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* InterconnectStat::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // uint64 total_recv_queue_size = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + total_recv_queue_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 recv_queue_size_counting_time = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + recv_queue_size_counting_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 total_capacity = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + total_capacity_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 capacity_counting_time = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + capacity_counting_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 total_buffers = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + total_buffers_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 buffer_counting_time = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 48)) { + buffer_counting_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 active_connections_num = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + active_connections_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 retransmits = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + retransmits_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 startup_cached_pkt_num = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + startup_cached_pkt_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 mismatch_num = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + mismatch_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 crc_errors = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { + crc_errors_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 snd_pkt_num = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { + snd_pkt_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 recv_pkt_num = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { + recv_pkt_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 disordered_pkt_num = 14; + case 14: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) { + disordered_pkt_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 duplicated_pkt_num = 15; + case 15: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 120)) { + duplicated_pkt_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 recv_ack_num = 16; + case 16: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128)) { + recv_ack_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 status_query_msg_num = 17; + case 17: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 136)) { + status_query_msg_num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* InterconnectStat::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.InterconnectStat) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 total_recv_queue_size = 1; + if (this->total_recv_queue_size() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_total_recv_queue_size(), target); + } + + // uint64 recv_queue_size_counting_time = 2; + if (this->recv_queue_size_counting_time() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_recv_queue_size_counting_time(), target); + } + + // uint64 total_capacity = 3; + if (this->total_capacity() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(3, this->_internal_total_capacity(), target); + } + + // uint64 capacity_counting_time = 4; + if (this->capacity_counting_time() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(4, this->_internal_capacity_counting_time(), target); + } + + // uint64 total_buffers = 5; + if (this->total_buffers() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(5, this->_internal_total_buffers(), target); + } + + // uint64 buffer_counting_time = 6; + if (this->buffer_counting_time() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(6, this->_internal_buffer_counting_time(), target); + } + + // uint64 active_connections_num = 7; + if (this->active_connections_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(7, this->_internal_active_connections_num(), target); + } + + // int64 retransmits = 8; + if (this->retransmits() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(8, this->_internal_retransmits(), target); + } + + // int64 startup_cached_pkt_num = 9; + if (this->startup_cached_pkt_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(9, this->_internal_startup_cached_pkt_num(), target); + } + + // int64 mismatch_num = 10; + if (this->mismatch_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(10, this->_internal_mismatch_num(), target); + } + + // int64 crc_errors = 11; + if (this->crc_errors() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(11, this->_internal_crc_errors(), target); + } + + // int64 snd_pkt_num = 12; + if (this->snd_pkt_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(12, this->_internal_snd_pkt_num(), target); + } + + // int64 recv_pkt_num = 13; + if (this->recv_pkt_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(13, this->_internal_recv_pkt_num(), target); + } + + // int64 disordered_pkt_num = 14; + if (this->disordered_pkt_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(14, this->_internal_disordered_pkt_num(), target); + } + + // int64 duplicated_pkt_num = 15; + if (this->duplicated_pkt_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(15, this->_internal_duplicated_pkt_num(), target); + } + + // int64 recv_ack_num = 16; + if (this->recv_ack_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(16, this->_internal_recv_ack_num(), target); + } + + // int64 status_query_msg_num = 17; + if (this->status_query_msg_num() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(17, this->_internal_status_query_msg_num(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.InterconnectStat) + return target; +} + +size_t InterconnectStat::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.InterconnectStat) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // uint64 total_recv_queue_size = 1; + if (this->total_recv_queue_size() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_total_recv_queue_size()); + } + + // uint64 recv_queue_size_counting_time = 2; + if (this->recv_queue_size_counting_time() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_recv_queue_size_counting_time()); + } + + // uint64 total_capacity = 3; + if (this->total_capacity() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_total_capacity()); + } + + // uint64 capacity_counting_time = 4; + if (this->capacity_counting_time() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_capacity_counting_time()); + } + + // uint64 total_buffers = 5; + if (this->total_buffers() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_total_buffers()); + } + + // uint64 buffer_counting_time = 6; + if (this->buffer_counting_time() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_buffer_counting_time()); + } + + // uint64 active_connections_num = 7; + if (this->active_connections_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_active_connections_num()); + } + + // int64 retransmits = 8; + if (this->retransmits() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_retransmits()); + } + + // int64 startup_cached_pkt_num = 9; + if (this->startup_cached_pkt_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_startup_cached_pkt_num()); + } + + // int64 mismatch_num = 10; + if (this->mismatch_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_mismatch_num()); + } + + // int64 crc_errors = 11; + if (this->crc_errors() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_crc_errors()); + } + + // int64 snd_pkt_num = 12; + if (this->snd_pkt_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_snd_pkt_num()); + } + + // int64 recv_pkt_num = 13; + if (this->recv_pkt_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_recv_pkt_num()); + } + + // int64 disordered_pkt_num = 14; + if (this->disordered_pkt_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_disordered_pkt_num()); + } + + // int64 duplicated_pkt_num = 15; + if (this->duplicated_pkt_num() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_duplicated_pkt_num()); + } + + // int64 recv_ack_num = 16; + if (this->recv_ack_num() != 0) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_recv_ack_num()); + } + + // int64 status_query_msg_num = 17; + if (this->status_query_msg_num() != 0) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_status_query_msg_num()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void InterconnectStat::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.InterconnectStat) + GOOGLE_DCHECK_NE(&from, this); + const InterconnectStat* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.InterconnectStat) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.InterconnectStat) + MergeFrom(*source); + } +} + +void InterconnectStat::MergeFrom(const InterconnectStat& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.InterconnectStat) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.total_recv_queue_size() != 0) { + _internal_set_total_recv_queue_size(from._internal_total_recv_queue_size()); + } + if (from.recv_queue_size_counting_time() != 0) { + _internal_set_recv_queue_size_counting_time(from._internal_recv_queue_size_counting_time()); + } + if (from.total_capacity() != 0) { + _internal_set_total_capacity(from._internal_total_capacity()); + } + if (from.capacity_counting_time() != 0) { + _internal_set_capacity_counting_time(from._internal_capacity_counting_time()); + } + if (from.total_buffers() != 0) { + _internal_set_total_buffers(from._internal_total_buffers()); + } + if (from.buffer_counting_time() != 0) { + _internal_set_buffer_counting_time(from._internal_buffer_counting_time()); + } + if (from.active_connections_num() != 0) { + _internal_set_active_connections_num(from._internal_active_connections_num()); + } + if (from.retransmits() != 0) { + _internal_set_retransmits(from._internal_retransmits()); + } + if (from.startup_cached_pkt_num() != 0) { + _internal_set_startup_cached_pkt_num(from._internal_startup_cached_pkt_num()); + } + if (from.mismatch_num() != 0) { + _internal_set_mismatch_num(from._internal_mismatch_num()); + } + if (from.crc_errors() != 0) { + _internal_set_crc_errors(from._internal_crc_errors()); + } + if (from.snd_pkt_num() != 0) { + _internal_set_snd_pkt_num(from._internal_snd_pkt_num()); + } + if (from.recv_pkt_num() != 0) { + _internal_set_recv_pkt_num(from._internal_recv_pkt_num()); + } + if (from.disordered_pkt_num() != 0) { + _internal_set_disordered_pkt_num(from._internal_disordered_pkt_num()); + } + if (from.duplicated_pkt_num() != 0) { + _internal_set_duplicated_pkt_num(from._internal_duplicated_pkt_num()); + } + if (from.recv_ack_num() != 0) { + _internal_set_recv_ack_num(from._internal_recv_ack_num()); + } + if (from.status_query_msg_num() != 0) { + _internal_set_status_query_msg_num(from._internal_status_query_msg_num()); + } +} + +void InterconnectStat::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.InterconnectStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void InterconnectStat::CopyFrom(const InterconnectStat& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.InterconnectStat) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool InterconnectStat::IsInitialized() const { + return true; +} + +void InterconnectStat::InternalSwap(InterconnectStat* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(InterconnectStat, status_query_msg_num_) + + sizeof(InterconnectStat::status_query_msg_num_) + - PROTOBUF_FIELD_OFFSET(InterconnectStat, total_recv_queue_size_)>( + reinterpret_cast(&total_recv_queue_size_), + reinterpret_cast(&other->total_recv_queue_size_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata InterconnectStat::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void MetricInstrumentation::InitAsDefaultInstance() { + ::yagpcc::_MetricInstrumentation_default_instance_._instance.get_mutable()->sent_ = const_cast< ::yagpcc::NetworkStat*>( + ::yagpcc::NetworkStat::internal_default_instance()); + ::yagpcc::_MetricInstrumentation_default_instance_._instance.get_mutable()->received_ = const_cast< ::yagpcc::NetworkStat*>( + ::yagpcc::NetworkStat::internal_default_instance()); + ::yagpcc::_MetricInstrumentation_default_instance_._instance.get_mutable()->interconnect_ = const_cast< ::yagpcc::InterconnectStat*>( + ::yagpcc::InterconnectStat::internal_default_instance()); +} +class MetricInstrumentation::_Internal { + public: + static const ::yagpcc::NetworkStat& sent(const MetricInstrumentation* msg); + static const ::yagpcc::NetworkStat& received(const MetricInstrumentation* msg); + static const ::yagpcc::InterconnectStat& interconnect(const MetricInstrumentation* msg); +}; + +const ::yagpcc::NetworkStat& +MetricInstrumentation::_Internal::sent(const MetricInstrumentation* msg) { + return *msg->sent_; +} +const ::yagpcc::NetworkStat& +MetricInstrumentation::_Internal::received(const MetricInstrumentation* msg) { + return *msg->received_; +} +const ::yagpcc::InterconnectStat& +MetricInstrumentation::_Internal::interconnect(const MetricInstrumentation* msg) { + return *msg->interconnect_; +} +MetricInstrumentation::MetricInstrumentation(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.MetricInstrumentation) +} +MetricInstrumentation::MetricInstrumentation(const MetricInstrumentation& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_sent()) { + sent_ = new ::yagpcc::NetworkStat(*from.sent_); + } else { + sent_ = nullptr; + } + if (from._internal_has_received()) { + received_ = new ::yagpcc::NetworkStat(*from.received_); + } else { + received_ = nullptr; + } + if (from._internal_has_interconnect()) { + interconnect_ = new ::yagpcc::InterconnectStat(*from.interconnect_); + } else { + interconnect_ = nullptr; + } + ::memcpy(&ntuples_, &from.ntuples_, + static_cast(reinterpret_cast(&inherited_time_) - + reinterpret_cast(&ntuples_)) + sizeof(inherited_time_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.MetricInstrumentation) +} + +void MetricInstrumentation::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MetricInstrumentation_protos_2fyagpcc_5fmetrics_2eproto.base); + ::memset(&sent_, 0, static_cast( + reinterpret_cast(&inherited_time_) - + reinterpret_cast(&sent_)) + sizeof(inherited_time_)); +} + +MetricInstrumentation::~MetricInstrumentation() { + // @@protoc_insertion_point(destructor:yagpcc.MetricInstrumentation) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void MetricInstrumentation::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete sent_; + if (this != internal_default_instance()) delete received_; + if (this != internal_default_instance()) delete interconnect_; +} + +void MetricInstrumentation::ArenaDtor(void* object) { + MetricInstrumentation* _this = reinterpret_cast< MetricInstrumentation* >(object); + (void)_this; +} +void MetricInstrumentation::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void MetricInstrumentation::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const MetricInstrumentation& MetricInstrumentation::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MetricInstrumentation_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void MetricInstrumentation::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.MetricInstrumentation) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArena() == nullptr && sent_ != nullptr) { + delete sent_; + } + sent_ = nullptr; + if (GetArena() == nullptr && received_ != nullptr) { + delete received_; + } + received_ = nullptr; + if (GetArena() == nullptr && interconnect_ != nullptr) { + delete interconnect_; + } + interconnect_ = nullptr; + ::memset(&ntuples_, 0, static_cast( + reinterpret_cast(&inherited_time_) - + reinterpret_cast(&ntuples_)) + sizeof(inherited_time_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MetricInstrumentation::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // uint64 ntuples = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ntuples_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 nloops = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + nloops_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 tuplecount = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + tuplecount_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // double firsttuple = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 33)) { + firsttuple_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // double startup = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 41)) { + startup_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // double total = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 49)) { + total_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // uint64 shared_blks_hit = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + shared_blks_hit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 shared_blks_read = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + shared_blks_read_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 shared_blks_dirtied = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + shared_blks_dirtied_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 shared_blks_written = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 80)) { + shared_blks_written_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 local_blks_hit = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 88)) { + local_blks_hit_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 local_blks_read = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 96)) { + local_blks_read_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 local_blks_dirtied = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { + local_blks_dirtied_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 local_blks_written = 14; + case 14: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 112)) { + local_blks_written_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 temp_blks_read = 15; + case 15: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 120)) { + temp_blks_read_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // uint64 temp_blks_written = 16; + case 16: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 128)) { + temp_blks_written_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // double blk_read_time = 17; + case 17: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 137)) { + blk_read_time_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // double blk_write_time = 18; + case 18: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 145)) { + blk_write_time_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // .yagpcc.NetworkStat sent = 19; + case 19: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 154)) { + ptr = ctx->ParseMessage(_internal_mutable_sent(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.NetworkStat received = 20; + case 20: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 162)) { + ptr = ctx->ParseMessage(_internal_mutable_received(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // double startup_time = 21; + case 21: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 169)) { + startup_time_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // uint64 inherited_calls = 22; + case 22: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 176)) { + inherited_calls_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // double inherited_time = 23; + case 23: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 185)) { + inherited_time_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // .yagpcc.InterconnectStat interconnect = 24; + case 24: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 194)) { + ptr = ctx->ParseMessage(_internal_mutable_interconnect(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* MetricInstrumentation::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.MetricInstrumentation) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // uint64 ntuples = 1; + if (this->ntuples() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(1, this->_internal_ntuples(), target); + } + + // uint64 nloops = 2; + if (this->nloops() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(2, this->_internal_nloops(), target); + } + + // uint64 tuplecount = 3; + if (this->tuplecount() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(3, this->_internal_tuplecount(), target); + } + + // double firsttuple = 4; + if (!(this->firsttuple() <= 0 && this->firsttuple() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(4, this->_internal_firsttuple(), target); + } + + // double startup = 5; + if (!(this->startup() <= 0 && this->startup() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(5, this->_internal_startup(), target); + } + + // double total = 6; + if (!(this->total() <= 0 && this->total() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(6, this->_internal_total(), target); + } + + // uint64 shared_blks_hit = 7; + if (this->shared_blks_hit() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(7, this->_internal_shared_blks_hit(), target); + } + + // uint64 shared_blks_read = 8; + if (this->shared_blks_read() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(8, this->_internal_shared_blks_read(), target); + } + + // uint64 shared_blks_dirtied = 9; + if (this->shared_blks_dirtied() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(9, this->_internal_shared_blks_dirtied(), target); + } + + // uint64 shared_blks_written = 10; + if (this->shared_blks_written() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(10, this->_internal_shared_blks_written(), target); + } + + // uint64 local_blks_hit = 11; + if (this->local_blks_hit() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(11, this->_internal_local_blks_hit(), target); + } + + // uint64 local_blks_read = 12; + if (this->local_blks_read() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(12, this->_internal_local_blks_read(), target); + } + + // uint64 local_blks_dirtied = 13; + if (this->local_blks_dirtied() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(13, this->_internal_local_blks_dirtied(), target); + } + + // uint64 local_blks_written = 14; + if (this->local_blks_written() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(14, this->_internal_local_blks_written(), target); + } + + // uint64 temp_blks_read = 15; + if (this->temp_blks_read() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(15, this->_internal_temp_blks_read(), target); + } + + // uint64 temp_blks_written = 16; + if (this->temp_blks_written() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(16, this->_internal_temp_blks_written(), target); + } + + // double blk_read_time = 17; + if (!(this->blk_read_time() <= 0 && this->blk_read_time() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(17, this->_internal_blk_read_time(), target); + } + + // double blk_write_time = 18; + if (!(this->blk_write_time() <= 0 && this->blk_write_time() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(18, this->_internal_blk_write_time(), target); + } + + // .yagpcc.NetworkStat sent = 19; + if (this->has_sent()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 19, _Internal::sent(this), target, stream); + } + + // .yagpcc.NetworkStat received = 20; + if (this->has_received()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 20, _Internal::received(this), target, stream); + } + + // double startup_time = 21; + if (!(this->startup_time() <= 0 && this->startup_time() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(21, this->_internal_startup_time(), target); + } + + // uint64 inherited_calls = 22; + if (this->inherited_calls() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteUInt64ToArray(22, this->_internal_inherited_calls(), target); + } + + // double inherited_time = 23; + if (!(this->inherited_time() <= 0 && this->inherited_time() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(23, this->_internal_inherited_time(), target); + } + + // .yagpcc.InterconnectStat interconnect = 24; + if (this->has_interconnect()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 24, _Internal::interconnect(this), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.MetricInstrumentation) + return target; +} + +size_t MetricInstrumentation::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.MetricInstrumentation) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .yagpcc.NetworkStat sent = 19; + if (this->has_sent()) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *sent_); + } + + // .yagpcc.NetworkStat received = 20; + if (this->has_received()) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *received_); + } + + // .yagpcc.InterconnectStat interconnect = 24; + if (this->has_interconnect()) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *interconnect_); + } + + // uint64 ntuples = 1; + if (this->ntuples() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_ntuples()); + } + + // uint64 nloops = 2; + if (this->nloops() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_nloops()); + } + + // uint64 tuplecount = 3; + if (this->tuplecount() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_tuplecount()); + } + + // double firsttuple = 4; + if (!(this->firsttuple() <= 0 && this->firsttuple() >= 0)) { + total_size += 1 + 8; + } + + // double startup = 5; + if (!(this->startup() <= 0 && this->startup() >= 0)) { + total_size += 1 + 8; + } + + // double total = 6; + if (!(this->total() <= 0 && this->total() >= 0)) { + total_size += 1 + 8; + } + + // uint64 shared_blks_hit = 7; + if (this->shared_blks_hit() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_shared_blks_hit()); + } + + // uint64 shared_blks_read = 8; + if (this->shared_blks_read() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_shared_blks_read()); + } + + // uint64 shared_blks_dirtied = 9; + if (this->shared_blks_dirtied() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_shared_blks_dirtied()); + } + + // uint64 shared_blks_written = 10; + if (this->shared_blks_written() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_shared_blks_written()); + } + + // uint64 local_blks_hit = 11; + if (this->local_blks_hit() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_local_blks_hit()); + } + + // uint64 local_blks_read = 12; + if (this->local_blks_read() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_local_blks_read()); + } + + // uint64 local_blks_dirtied = 13; + if (this->local_blks_dirtied() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_local_blks_dirtied()); + } + + // uint64 local_blks_written = 14; + if (this->local_blks_written() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_local_blks_written()); + } + + // uint64 temp_blks_read = 15; + if (this->temp_blks_read() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_temp_blks_read()); + } + + // uint64 temp_blks_written = 16; + if (this->temp_blks_written() != 0) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_temp_blks_written()); + } + + // double blk_read_time = 17; + if (!(this->blk_read_time() <= 0 && this->blk_read_time() >= 0)) { + total_size += 2 + 8; + } + + // double blk_write_time = 18; + if (!(this->blk_write_time() <= 0 && this->blk_write_time() >= 0)) { + total_size += 2 + 8; + } + + // double startup_time = 21; + if (!(this->startup_time() <= 0 && this->startup_time() >= 0)) { + total_size += 2 + 8; + } + + // uint64 inherited_calls = 22; + if (this->inherited_calls() != 0) { + total_size += 2 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::UInt64Size( + this->_internal_inherited_calls()); + } + + // double inherited_time = 23; + if (!(this->inherited_time() <= 0 && this->inherited_time() >= 0)) { + total_size += 2 + 8; + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MetricInstrumentation::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.MetricInstrumentation) + GOOGLE_DCHECK_NE(&from, this); + const MetricInstrumentation* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.MetricInstrumentation) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.MetricInstrumentation) + MergeFrom(*source); + } +} + +void MetricInstrumentation::MergeFrom(const MetricInstrumentation& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.MetricInstrumentation) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_sent()) { + _internal_mutable_sent()->::yagpcc::NetworkStat::MergeFrom(from._internal_sent()); + } + if (from.has_received()) { + _internal_mutable_received()->::yagpcc::NetworkStat::MergeFrom(from._internal_received()); + } + if (from.has_interconnect()) { + _internal_mutable_interconnect()->::yagpcc::InterconnectStat::MergeFrom(from._internal_interconnect()); + } + if (from.ntuples() != 0) { + _internal_set_ntuples(from._internal_ntuples()); + } + if (from.nloops() != 0) { + _internal_set_nloops(from._internal_nloops()); + } + if (from.tuplecount() != 0) { + _internal_set_tuplecount(from._internal_tuplecount()); + } + if (!(from.firsttuple() <= 0 && from.firsttuple() >= 0)) { + _internal_set_firsttuple(from._internal_firsttuple()); + } + if (!(from.startup() <= 0 && from.startup() >= 0)) { + _internal_set_startup(from._internal_startup()); + } + if (!(from.total() <= 0 && from.total() >= 0)) { + _internal_set_total(from._internal_total()); + } + if (from.shared_blks_hit() != 0) { + _internal_set_shared_blks_hit(from._internal_shared_blks_hit()); + } + if (from.shared_blks_read() != 0) { + _internal_set_shared_blks_read(from._internal_shared_blks_read()); + } + if (from.shared_blks_dirtied() != 0) { + _internal_set_shared_blks_dirtied(from._internal_shared_blks_dirtied()); + } + if (from.shared_blks_written() != 0) { + _internal_set_shared_blks_written(from._internal_shared_blks_written()); + } + if (from.local_blks_hit() != 0) { + _internal_set_local_blks_hit(from._internal_local_blks_hit()); + } + if (from.local_blks_read() != 0) { + _internal_set_local_blks_read(from._internal_local_blks_read()); + } + if (from.local_blks_dirtied() != 0) { + _internal_set_local_blks_dirtied(from._internal_local_blks_dirtied()); + } + if (from.local_blks_written() != 0) { + _internal_set_local_blks_written(from._internal_local_blks_written()); + } + if (from.temp_blks_read() != 0) { + _internal_set_temp_blks_read(from._internal_temp_blks_read()); + } + if (from.temp_blks_written() != 0) { + _internal_set_temp_blks_written(from._internal_temp_blks_written()); + } + if (!(from.blk_read_time() <= 0 && from.blk_read_time() >= 0)) { + _internal_set_blk_read_time(from._internal_blk_read_time()); + } + if (!(from.blk_write_time() <= 0 && from.blk_write_time() >= 0)) { + _internal_set_blk_write_time(from._internal_blk_write_time()); + } + if (!(from.startup_time() <= 0 && from.startup_time() >= 0)) { + _internal_set_startup_time(from._internal_startup_time()); + } + if (from.inherited_calls() != 0) { + _internal_set_inherited_calls(from._internal_inherited_calls()); + } + if (!(from.inherited_time() <= 0 && from.inherited_time() >= 0)) { + _internal_set_inherited_time(from._internal_inherited_time()); + } +} + +void MetricInstrumentation::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.MetricInstrumentation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MetricInstrumentation::CopyFrom(const MetricInstrumentation& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.MetricInstrumentation) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MetricInstrumentation::IsInitialized() const { + return true; +} + +void MetricInstrumentation::InternalSwap(MetricInstrumentation* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(MetricInstrumentation, inherited_time_) + + sizeof(MetricInstrumentation::inherited_time_) + - PROTOBUF_FIELD_OFFSET(MetricInstrumentation, sent_)>( + reinterpret_cast(&sent_), + reinterpret_cast(&other->sent_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MetricInstrumentation::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void SpillInfo::InitAsDefaultInstance() { +} +class SpillInfo::_Internal { + public: +}; + +SpillInfo::SpillInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.SpillInfo) +} +SpillInfo::SpillInfo(const SpillInfo& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&totalbytes_, &from.totalbytes_, + static_cast(reinterpret_cast(&filecount_) - + reinterpret_cast(&totalbytes_)) + sizeof(filecount_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.SpillInfo) +} + +void SpillInfo::SharedCtor() { + ::memset(&totalbytes_, 0, static_cast( + reinterpret_cast(&filecount_) - + reinterpret_cast(&totalbytes_)) + sizeof(filecount_)); +} + +SpillInfo::~SpillInfo() { + // @@protoc_insertion_point(destructor:yagpcc.SpillInfo) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void SpillInfo::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void SpillInfo::ArenaDtor(void* object) { + SpillInfo* _this = reinterpret_cast< SpillInfo* >(object); + (void)_this; +} +void SpillInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SpillInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const SpillInfo& SpillInfo::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SpillInfo_protos_2fyagpcc_5fmetrics_2eproto.base); + return *internal_default_instance(); +} + + +void SpillInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.SpillInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&totalbytes_, 0, static_cast( + reinterpret_cast(&filecount_) - + reinterpret_cast(&totalbytes_)) + sizeof(filecount_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SpillInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // int32 fileCount = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + filecount_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int64 totalBytes = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + totalbytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* SpillInfo::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.SpillInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 fileCount = 1; + if (this->filecount() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_filecount(), target); + } + + // int64 totalBytes = 2; + if (this->totalbytes() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt64ToArray(2, this->_internal_totalbytes(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.SpillInfo) + return target; +} + +size_t SpillInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.SpillInfo) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int64 totalBytes = 2; + if (this->totalbytes() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int64Size( + this->_internal_totalbytes()); + } + + // int32 fileCount = 1; + if (this->filecount() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_filecount()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SpillInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.SpillInfo) + GOOGLE_DCHECK_NE(&from, this); + const SpillInfo* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.SpillInfo) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.SpillInfo) + MergeFrom(*source); + } +} + +void SpillInfo::MergeFrom(const SpillInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.SpillInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.totalbytes() != 0) { + _internal_set_totalbytes(from._internal_totalbytes()); + } + if (from.filecount() != 0) { + _internal_set_filecount(from._internal_filecount()); + } +} + +void SpillInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.SpillInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SpillInfo::CopyFrom(const SpillInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.SpillInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SpillInfo::IsInitialized() const { + return true; +} + +void SpillInfo::InternalSwap(SpillInfo* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SpillInfo, filecount_) + + sizeof(SpillInfo::filecount_) + - PROTOBUF_FIELD_OFFSET(SpillInfo, totalbytes_)>( + reinterpret_cast(&totalbytes_), + reinterpret_cast(&other->totalbytes_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SpillInfo::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace yagpcc +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::yagpcc::QueryInfo* Arena::CreateMaybeMessage< ::yagpcc::QueryInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::QueryInfo >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::AdditionalQueryInfo* Arena::CreateMaybeMessage< ::yagpcc::AdditionalQueryInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::AdditionalQueryInfo >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::AdditionalQueryStat* Arena::CreateMaybeMessage< ::yagpcc::AdditionalQueryStat >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::AdditionalQueryStat >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::GPMetrics* Arena::CreateMaybeMessage< ::yagpcc::GPMetrics >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::GPMetrics >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::QueryKey* Arena::CreateMaybeMessage< ::yagpcc::QueryKey >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::QueryKey >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::SegmentKey* Arena::CreateMaybeMessage< ::yagpcc::SegmentKey >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::SegmentKey >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::SystemStat* Arena::CreateMaybeMessage< ::yagpcc::SystemStat >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::SystemStat >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::NetworkStat* Arena::CreateMaybeMessage< ::yagpcc::NetworkStat >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::NetworkStat >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::InterconnectStat* Arena::CreateMaybeMessage< ::yagpcc::InterconnectStat >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::InterconnectStat >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::MetricInstrumentation* Arena::CreateMaybeMessage< ::yagpcc::MetricInstrumentation >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::MetricInstrumentation >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::SpillInfo* Arena::CreateMaybeMessage< ::yagpcc::SpillInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::SpillInfo >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_metrics.pb.h b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_metrics.pb.h new file mode 100644 index 00000000000..3619a25ff5b --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_metrics.pb.h @@ -0,0 +1,5516 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/yagpcc_metrics.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fmetrics_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fmetrics_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3012000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_protos_2fyagpcc_5fmetrics_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[11] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_protos_2fyagpcc_5fmetrics_2eproto; +namespace yagpcc { +class AdditionalQueryInfo; +class AdditionalQueryInfoDefaultTypeInternal; +extern AdditionalQueryInfoDefaultTypeInternal _AdditionalQueryInfo_default_instance_; +class AdditionalQueryStat; +class AdditionalQueryStatDefaultTypeInternal; +extern AdditionalQueryStatDefaultTypeInternal _AdditionalQueryStat_default_instance_; +class GPMetrics; +class GPMetricsDefaultTypeInternal; +extern GPMetricsDefaultTypeInternal _GPMetrics_default_instance_; +class InterconnectStat; +class InterconnectStatDefaultTypeInternal; +extern InterconnectStatDefaultTypeInternal _InterconnectStat_default_instance_; +class MetricInstrumentation; +class MetricInstrumentationDefaultTypeInternal; +extern MetricInstrumentationDefaultTypeInternal _MetricInstrumentation_default_instance_; +class NetworkStat; +class NetworkStatDefaultTypeInternal; +extern NetworkStatDefaultTypeInternal _NetworkStat_default_instance_; +class QueryInfo; +class QueryInfoDefaultTypeInternal; +extern QueryInfoDefaultTypeInternal _QueryInfo_default_instance_; +class QueryKey; +class QueryKeyDefaultTypeInternal; +extern QueryKeyDefaultTypeInternal _QueryKey_default_instance_; +class SegmentKey; +class SegmentKeyDefaultTypeInternal; +extern SegmentKeyDefaultTypeInternal _SegmentKey_default_instance_; +class SpillInfo; +class SpillInfoDefaultTypeInternal; +extern SpillInfoDefaultTypeInternal _SpillInfo_default_instance_; +class SystemStat; +class SystemStatDefaultTypeInternal; +extern SystemStatDefaultTypeInternal _SystemStat_default_instance_; +} // namespace yagpcc +PROTOBUF_NAMESPACE_OPEN +template<> ::yagpcc::AdditionalQueryInfo* Arena::CreateMaybeMessage<::yagpcc::AdditionalQueryInfo>(Arena*); +template<> ::yagpcc::AdditionalQueryStat* Arena::CreateMaybeMessage<::yagpcc::AdditionalQueryStat>(Arena*); +template<> ::yagpcc::GPMetrics* Arena::CreateMaybeMessage<::yagpcc::GPMetrics>(Arena*); +template<> ::yagpcc::InterconnectStat* Arena::CreateMaybeMessage<::yagpcc::InterconnectStat>(Arena*); +template<> ::yagpcc::MetricInstrumentation* Arena::CreateMaybeMessage<::yagpcc::MetricInstrumentation>(Arena*); +template<> ::yagpcc::NetworkStat* Arena::CreateMaybeMessage<::yagpcc::NetworkStat>(Arena*); +template<> ::yagpcc::QueryInfo* Arena::CreateMaybeMessage<::yagpcc::QueryInfo>(Arena*); +template<> ::yagpcc::QueryKey* Arena::CreateMaybeMessage<::yagpcc::QueryKey>(Arena*); +template<> ::yagpcc::SegmentKey* Arena::CreateMaybeMessage<::yagpcc::SegmentKey>(Arena*); +template<> ::yagpcc::SpillInfo* Arena::CreateMaybeMessage<::yagpcc::SpillInfo>(Arena*); +template<> ::yagpcc::SystemStat* Arena::CreateMaybeMessage<::yagpcc::SystemStat>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace yagpcc { + +enum QueryStatus : int { + QUERY_STATUS_UNSPECIFIED = 0, + QUERY_STATUS_SUBMIT = 1, + QUERY_STATUS_START = 2, + QUERY_STATUS_DONE = 3, + QUERY_STATUS_QUERY_DONE = 4, + QUERY_STATUS_ERROR = 5, + QUERY_STATUS_CANCELLING = 6, + QUERY_STATUS_CANCELED = 7, + QUERY_STATUS_END = 8, + QueryStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + QueryStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool QueryStatus_IsValid(int value); +constexpr QueryStatus QueryStatus_MIN = QUERY_STATUS_UNSPECIFIED; +constexpr QueryStatus QueryStatus_MAX = QUERY_STATUS_END; +constexpr int QueryStatus_ARRAYSIZE = QueryStatus_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* QueryStatus_descriptor(); +template +inline const std::string& QueryStatus_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function QueryStatus_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + QueryStatus_descriptor(), enum_t_value); +} +inline bool QueryStatus_Parse( + const std::string& name, QueryStatus* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + QueryStatus_descriptor(), name, value); +} +enum PlanNodeStatus : int { + PLAN_NODE_STATUS_UNSPECIFIED = 0, + PLAN_NODE_STATUS_INITIALIZED = 1, + PLAN_NODE_STATUS_EXECUTING = 2, + PLAN_NODE_STATUS_FINISHED = 3, + PlanNodeStatus_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + PlanNodeStatus_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool PlanNodeStatus_IsValid(int value); +constexpr PlanNodeStatus PlanNodeStatus_MIN = PLAN_NODE_STATUS_UNSPECIFIED; +constexpr PlanNodeStatus PlanNodeStatus_MAX = PLAN_NODE_STATUS_FINISHED; +constexpr int PlanNodeStatus_ARRAYSIZE = PlanNodeStatus_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PlanNodeStatus_descriptor(); +template +inline const std::string& PlanNodeStatus_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function PlanNodeStatus_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + PlanNodeStatus_descriptor(), enum_t_value); +} +inline bool PlanNodeStatus_Parse( + const std::string& name, PlanNodeStatus* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + PlanNodeStatus_descriptor(), name, value); +} +enum PlanGenerator : int { + PLAN_GENERATOR_UNSPECIFIED = 0, + PLAN_GENERATOR_PLANNER = 1, + PLAN_GENERATOR_OPTIMIZER = 2, + PlanGenerator_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + PlanGenerator_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool PlanGenerator_IsValid(int value); +constexpr PlanGenerator PlanGenerator_MIN = PLAN_GENERATOR_UNSPECIFIED; +constexpr PlanGenerator PlanGenerator_MAX = PLAN_GENERATOR_OPTIMIZER; +constexpr int PlanGenerator_ARRAYSIZE = PlanGenerator_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* PlanGenerator_descriptor(); +template +inline const std::string& PlanGenerator_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function PlanGenerator_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + PlanGenerator_descriptor(), enum_t_value); +} +inline bool PlanGenerator_Parse( + const std::string& name, PlanGenerator* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + PlanGenerator_descriptor(), name, value); +} +// =================================================================== + +class QueryInfo PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.QueryInfo) */ { + public: + inline QueryInfo() : QueryInfo(nullptr) {}; + virtual ~QueryInfo(); + + QueryInfo(const QueryInfo& from); + QueryInfo(QueryInfo&& from) noexcept + : QueryInfo() { + *this = ::std::move(from); + } + + inline QueryInfo& operator=(const QueryInfo& from) { + CopyFrom(from); + return *this; + } + inline QueryInfo& operator=(QueryInfo&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const QueryInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const QueryInfo* internal_default_instance() { + return reinterpret_cast( + &_QueryInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(QueryInfo& a, QueryInfo& b) { + a.Swap(&b); + } + inline void Swap(QueryInfo* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(QueryInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline QueryInfo* New() const final { + return CreateMaybeMessage(nullptr); + } + + QueryInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const QueryInfo& from); + void MergeFrom(const QueryInfo& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(QueryInfo* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.QueryInfo"; + } + protected: + explicit QueryInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kQueryTextFieldNumber = 4, + kPlanTextFieldNumber = 5, + kTemplateQueryTextFieldNumber = 6, + kTemplatePlanTextFieldNumber = 7, + kUserNameFieldNumber = 8, + kDatabaseNameFieldNumber = 9, + kRsgnameFieldNumber = 10, + kAnalyzeTextFieldNumber = 11, + kQueryIdFieldNumber = 2, + kPlanIdFieldNumber = 3, + kGeneratorFieldNumber = 1, + }; + // string query_text = 4; + void clear_query_text(); + const std::string& query_text() const; + void set_query_text(const std::string& value); + void set_query_text(std::string&& value); + void set_query_text(const char* value); + void set_query_text(const char* value, size_t size); + std::string* mutable_query_text(); + std::string* release_query_text(); + void set_allocated_query_text(std::string* query_text); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_query_text(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_query_text( + std::string* query_text); + private: + const std::string& _internal_query_text() const; + void _internal_set_query_text(const std::string& value); + std::string* _internal_mutable_query_text(); + public: + + // string plan_text = 5; + void clear_plan_text(); + const std::string& plan_text() const; + void set_plan_text(const std::string& value); + void set_plan_text(std::string&& value); + void set_plan_text(const char* value); + void set_plan_text(const char* value, size_t size); + std::string* mutable_plan_text(); + std::string* release_plan_text(); + void set_allocated_plan_text(std::string* plan_text); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_plan_text(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_plan_text( + std::string* plan_text); + private: + const std::string& _internal_plan_text() const; + void _internal_set_plan_text(const std::string& value); + std::string* _internal_mutable_plan_text(); + public: + + // string template_query_text = 6; + void clear_template_query_text(); + const std::string& template_query_text() const; + void set_template_query_text(const std::string& value); + void set_template_query_text(std::string&& value); + void set_template_query_text(const char* value); + void set_template_query_text(const char* value, size_t size); + std::string* mutable_template_query_text(); + std::string* release_template_query_text(); + void set_allocated_template_query_text(std::string* template_query_text); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_template_query_text(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_template_query_text( + std::string* template_query_text); + private: + const std::string& _internal_template_query_text() const; + void _internal_set_template_query_text(const std::string& value); + std::string* _internal_mutable_template_query_text(); + public: + + // string template_plan_text = 7; + void clear_template_plan_text(); + const std::string& template_plan_text() const; + void set_template_plan_text(const std::string& value); + void set_template_plan_text(std::string&& value); + void set_template_plan_text(const char* value); + void set_template_plan_text(const char* value, size_t size); + std::string* mutable_template_plan_text(); + std::string* release_template_plan_text(); + void set_allocated_template_plan_text(std::string* template_plan_text); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_template_plan_text(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_template_plan_text( + std::string* template_plan_text); + private: + const std::string& _internal_template_plan_text() const; + void _internal_set_template_plan_text(const std::string& value); + std::string* _internal_mutable_template_plan_text(); + public: + + // string userName = 8; + void clear_username(); + const std::string& username() const; + void set_username(const std::string& value); + void set_username(std::string&& value); + void set_username(const char* value); + void set_username(const char* value, size_t size); + std::string* mutable_username(); + std::string* release_username(); + void set_allocated_username(std::string* username); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_username(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_username( + std::string* username); + private: + const std::string& _internal_username() const; + void _internal_set_username(const std::string& value); + std::string* _internal_mutable_username(); + public: + + // string databaseName = 9; + void clear_databasename(); + const std::string& databasename() const; + void set_databasename(const std::string& value); + void set_databasename(std::string&& value); + void set_databasename(const char* value); + void set_databasename(const char* value, size_t size); + std::string* mutable_databasename(); + std::string* release_databasename(); + void set_allocated_databasename(std::string* databasename); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_databasename(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_databasename( + std::string* databasename); + private: + const std::string& _internal_databasename() const; + void _internal_set_databasename(const std::string& value); + std::string* _internal_mutable_databasename(); + public: + + // string rsgname = 10; + void clear_rsgname(); + const std::string& rsgname() const; + void set_rsgname(const std::string& value); + void set_rsgname(std::string&& value); + void set_rsgname(const char* value); + void set_rsgname(const char* value, size_t size); + std::string* mutable_rsgname(); + std::string* release_rsgname(); + void set_allocated_rsgname(std::string* rsgname); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_rsgname(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_rsgname( + std::string* rsgname); + private: + const std::string& _internal_rsgname() const; + void _internal_set_rsgname(const std::string& value); + std::string* _internal_mutable_rsgname(); + public: + + // string analyze_text = 11; + void clear_analyze_text(); + const std::string& analyze_text() const; + void set_analyze_text(const std::string& value); + void set_analyze_text(std::string&& value); + void set_analyze_text(const char* value); + void set_analyze_text(const char* value, size_t size); + std::string* mutable_analyze_text(); + std::string* release_analyze_text(); + void set_allocated_analyze_text(std::string* analyze_text); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_analyze_text(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_analyze_text( + std::string* analyze_text); + private: + const std::string& _internal_analyze_text() const; + void _internal_set_analyze_text(const std::string& value); + std::string* _internal_mutable_analyze_text(); + public: + + // uint64 query_id = 2; + void clear_query_id(); + ::PROTOBUF_NAMESPACE_ID::uint64 query_id() const; + void set_query_id(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_query_id() const; + void _internal_set_query_id(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 plan_id = 3; + void clear_plan_id(); + ::PROTOBUF_NAMESPACE_ID::uint64 plan_id() const; + void set_plan_id(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_plan_id() const; + void _internal_set_plan_id(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // .yagpcc.PlanGenerator generator = 1; + void clear_generator(); + ::yagpcc::PlanGenerator generator() const; + void set_generator(::yagpcc::PlanGenerator value); + private: + ::yagpcc::PlanGenerator _internal_generator() const; + void _internal_set_generator(::yagpcc::PlanGenerator value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.QueryInfo) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr query_text_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr plan_text_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr template_query_text_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr template_plan_text_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr username_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr databasename_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr rsgname_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr analyze_text_; + ::PROTOBUF_NAMESPACE_ID::uint64 query_id_; + ::PROTOBUF_NAMESPACE_ID::uint64 plan_id_; + int generator_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class AdditionalQueryInfo PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.AdditionalQueryInfo) */ { + public: + inline AdditionalQueryInfo() : AdditionalQueryInfo(nullptr) {}; + virtual ~AdditionalQueryInfo(); + + AdditionalQueryInfo(const AdditionalQueryInfo& from); + AdditionalQueryInfo(AdditionalQueryInfo&& from) noexcept + : AdditionalQueryInfo() { + *this = ::std::move(from); + } + + inline AdditionalQueryInfo& operator=(const AdditionalQueryInfo& from) { + CopyFrom(from); + return *this; + } + inline AdditionalQueryInfo& operator=(AdditionalQueryInfo&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const AdditionalQueryInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AdditionalQueryInfo* internal_default_instance() { + return reinterpret_cast( + &_AdditionalQueryInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(AdditionalQueryInfo& a, AdditionalQueryInfo& b) { + a.Swap(&b); + } + inline void Swap(AdditionalQueryInfo* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(AdditionalQueryInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline AdditionalQueryInfo* New() const final { + return CreateMaybeMessage(nullptr); + } + + AdditionalQueryInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const AdditionalQueryInfo& from); + void MergeFrom(const AdditionalQueryInfo& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AdditionalQueryInfo* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.AdditionalQueryInfo"; + } + protected: + explicit AdditionalQueryInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kErrorMessageFieldNumber = 2, + kNestedLevelFieldNumber = 1, + kSliceIdFieldNumber = 3, + }; + // string error_message = 2; + void clear_error_message(); + const std::string& error_message() const; + void set_error_message(const std::string& value); + void set_error_message(std::string&& value); + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + std::string* mutable_error_message(); + std::string* release_error_message(); + void set_allocated_error_message(std::string* error_message); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_error_message(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_error_message( + std::string* error_message); + private: + const std::string& _internal_error_message() const; + void _internal_set_error_message(const std::string& value); + std::string* _internal_mutable_error_message(); + public: + + // int64 nested_level = 1; + void clear_nested_level(); + ::PROTOBUF_NAMESPACE_ID::int64 nested_level() const; + void set_nested_level(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_nested_level() const; + void _internal_set_nested_level(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 slice_id = 3; + void clear_slice_id(); + ::PROTOBUF_NAMESPACE_ID::int64 slice_id() const; + void set_slice_id(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_slice_id() const; + void _internal_set_slice_id(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.AdditionalQueryInfo) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_message_; + ::PROTOBUF_NAMESPACE_ID::int64 nested_level_; + ::PROTOBUF_NAMESPACE_ID::int64 slice_id_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class AdditionalQueryStat PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.AdditionalQueryStat) */ { + public: + inline AdditionalQueryStat() : AdditionalQueryStat(nullptr) {}; + virtual ~AdditionalQueryStat(); + + AdditionalQueryStat(const AdditionalQueryStat& from); + AdditionalQueryStat(AdditionalQueryStat&& from) noexcept + : AdditionalQueryStat() { + *this = ::std::move(from); + } + + inline AdditionalQueryStat& operator=(const AdditionalQueryStat& from) { + CopyFrom(from); + return *this; + } + inline AdditionalQueryStat& operator=(AdditionalQueryStat&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const AdditionalQueryStat& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const AdditionalQueryStat* internal_default_instance() { + return reinterpret_cast( + &_AdditionalQueryStat_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(AdditionalQueryStat& a, AdditionalQueryStat& b) { + a.Swap(&b); + } + inline void Swap(AdditionalQueryStat* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(AdditionalQueryStat* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline AdditionalQueryStat* New() const final { + return CreateMaybeMessage(nullptr); + } + + AdditionalQueryStat* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const AdditionalQueryStat& from); + void MergeFrom(const AdditionalQueryStat& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(AdditionalQueryStat* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.AdditionalQueryStat"; + } + protected: + explicit AdditionalQueryStat(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kSlicesFieldNumber = 2, + kErrorMessageFieldNumber = 1, + }; + // repeated int64 slices = 2; + int slices_size() const; + private: + int _internal_slices_size() const; + public: + void clear_slices(); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_slices(int index) const; + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& + _internal_slices() const; + void _internal_add_slices(::PROTOBUF_NAMESPACE_ID::int64 value); + ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* + _internal_mutable_slices(); + public: + ::PROTOBUF_NAMESPACE_ID::int64 slices(int index) const; + void set_slices(int index, ::PROTOBUF_NAMESPACE_ID::int64 value); + void add_slices(::PROTOBUF_NAMESPACE_ID::int64 value); + const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& + slices() const; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* + mutable_slices(); + + // string error_message = 1; + void clear_error_message(); + const std::string& error_message() const; + void set_error_message(const std::string& value); + void set_error_message(std::string&& value); + void set_error_message(const char* value); + void set_error_message(const char* value, size_t size); + std::string* mutable_error_message(); + std::string* release_error_message(); + void set_allocated_error_message(std::string* error_message); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_error_message(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_error_message( + std::string* error_message); + private: + const std::string& _internal_error_message() const; + void _internal_set_error_message(const std::string& value); + std::string* _internal_mutable_error_message(); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.AdditionalQueryStat) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 > slices_; + mutable std::atomic _slices_cached_byte_size_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_message_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class GPMetrics PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.GPMetrics) */ { + public: + inline GPMetrics() : GPMetrics(nullptr) {}; + virtual ~GPMetrics(); + + GPMetrics(const GPMetrics& from); + GPMetrics(GPMetrics&& from) noexcept + : GPMetrics() { + *this = ::std::move(from); + } + + inline GPMetrics& operator=(const GPMetrics& from) { + CopyFrom(from); + return *this; + } + inline GPMetrics& operator=(GPMetrics&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const GPMetrics& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const GPMetrics* internal_default_instance() { + return reinterpret_cast( + &_GPMetrics_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(GPMetrics& a, GPMetrics& b) { + a.Swap(&b); + } + inline void Swap(GPMetrics* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(GPMetrics* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline GPMetrics* New() const final { + return CreateMaybeMessage(nullptr); + } + + GPMetrics* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const GPMetrics& from); + void MergeFrom(const GPMetrics& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(GPMetrics* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.GPMetrics"; + } + protected: + explicit GPMetrics(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kSystemStatFieldNumber = 1, + kInstrumentationFieldNumber = 2, + kSpillFieldNumber = 3, + }; + // .yagpcc.SystemStat systemStat = 1; + bool has_systemstat() const; + private: + bool _internal_has_systemstat() const; + public: + void clear_systemstat(); + const ::yagpcc::SystemStat& systemstat() const; + ::yagpcc::SystemStat* release_systemstat(); + ::yagpcc::SystemStat* mutable_systemstat(); + void set_allocated_systemstat(::yagpcc::SystemStat* systemstat); + private: + const ::yagpcc::SystemStat& _internal_systemstat() const; + ::yagpcc::SystemStat* _internal_mutable_systemstat(); + public: + void unsafe_arena_set_allocated_systemstat( + ::yagpcc::SystemStat* systemstat); + ::yagpcc::SystemStat* unsafe_arena_release_systemstat(); + + // .yagpcc.MetricInstrumentation instrumentation = 2; + bool has_instrumentation() const; + private: + bool _internal_has_instrumentation() const; + public: + void clear_instrumentation(); + const ::yagpcc::MetricInstrumentation& instrumentation() const; + ::yagpcc::MetricInstrumentation* release_instrumentation(); + ::yagpcc::MetricInstrumentation* mutable_instrumentation(); + void set_allocated_instrumentation(::yagpcc::MetricInstrumentation* instrumentation); + private: + const ::yagpcc::MetricInstrumentation& _internal_instrumentation() const; + ::yagpcc::MetricInstrumentation* _internal_mutable_instrumentation(); + public: + void unsafe_arena_set_allocated_instrumentation( + ::yagpcc::MetricInstrumentation* instrumentation); + ::yagpcc::MetricInstrumentation* unsafe_arena_release_instrumentation(); + + // .yagpcc.SpillInfo spill = 3; + bool has_spill() const; + private: + bool _internal_has_spill() const; + public: + void clear_spill(); + const ::yagpcc::SpillInfo& spill() const; + ::yagpcc::SpillInfo* release_spill(); + ::yagpcc::SpillInfo* mutable_spill(); + void set_allocated_spill(::yagpcc::SpillInfo* spill); + private: + const ::yagpcc::SpillInfo& _internal_spill() const; + ::yagpcc::SpillInfo* _internal_mutable_spill(); + public: + void unsafe_arena_set_allocated_spill( + ::yagpcc::SpillInfo* spill); + ::yagpcc::SpillInfo* unsafe_arena_release_spill(); + + // @@protoc_insertion_point(class_scope:yagpcc.GPMetrics) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::yagpcc::SystemStat* systemstat_; + ::yagpcc::MetricInstrumentation* instrumentation_; + ::yagpcc::SpillInfo* spill_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class QueryKey PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.QueryKey) */ { + public: + inline QueryKey() : QueryKey(nullptr) {}; + virtual ~QueryKey(); + + QueryKey(const QueryKey& from); + QueryKey(QueryKey&& from) noexcept + : QueryKey() { + *this = ::std::move(from); + } + + inline QueryKey& operator=(const QueryKey& from) { + CopyFrom(from); + return *this; + } + inline QueryKey& operator=(QueryKey&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const QueryKey& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const QueryKey* internal_default_instance() { + return reinterpret_cast( + &_QueryKey_default_instance_); + } + static constexpr int kIndexInFileMessages = + 4; + + friend void swap(QueryKey& a, QueryKey& b) { + a.Swap(&b); + } + inline void Swap(QueryKey* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(QueryKey* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline QueryKey* New() const final { + return CreateMaybeMessage(nullptr); + } + + QueryKey* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const QueryKey& from); + void MergeFrom(const QueryKey& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(QueryKey* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.QueryKey"; + } + protected: + explicit QueryKey(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTmidFieldNumber = 1, + kSsidFieldNumber = 2, + kCcntFieldNumber = 3, + }; + // int32 tmid = 1; + void clear_tmid(); + ::PROTOBUF_NAMESPACE_ID::int32 tmid() const; + void set_tmid(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_tmid() const; + void _internal_set_tmid(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 ssid = 2; + void clear_ssid(); + ::PROTOBUF_NAMESPACE_ID::int32 ssid() const; + void set_ssid(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_ssid() const; + void _internal_set_ssid(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 ccnt = 3; + void clear_ccnt(); + ::PROTOBUF_NAMESPACE_ID::int32 ccnt() const; + void set_ccnt(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_ccnt() const; + void _internal_set_ccnt(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.QueryKey) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::int32 tmid_; + ::PROTOBUF_NAMESPACE_ID::int32 ssid_; + ::PROTOBUF_NAMESPACE_ID::int32 ccnt_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class SegmentKey PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.SegmentKey) */ { + public: + inline SegmentKey() : SegmentKey(nullptr) {}; + virtual ~SegmentKey(); + + SegmentKey(const SegmentKey& from); + SegmentKey(SegmentKey&& from) noexcept + : SegmentKey() { + *this = ::std::move(from); + } + + inline SegmentKey& operator=(const SegmentKey& from) { + CopyFrom(from); + return *this; + } + inline SegmentKey& operator=(SegmentKey&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const SegmentKey& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SegmentKey* internal_default_instance() { + return reinterpret_cast( + &_SegmentKey_default_instance_); + } + static constexpr int kIndexInFileMessages = + 5; + + friend void swap(SegmentKey& a, SegmentKey& b) { + a.Swap(&b); + } + inline void Swap(SegmentKey* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SegmentKey* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline SegmentKey* New() const final { + return CreateMaybeMessage(nullptr); + } + + SegmentKey* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const SegmentKey& from); + void MergeFrom(const SegmentKey& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SegmentKey* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.SegmentKey"; + } + protected: + explicit SegmentKey(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kDbidFieldNumber = 1, + kSegindexFieldNumber = 2, + }; + // int32 dbid = 1; + void clear_dbid(); + ::PROTOBUF_NAMESPACE_ID::int32 dbid() const; + void set_dbid(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_dbid() const; + void _internal_set_dbid(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 segindex = 2; + void clear_segindex(); + ::PROTOBUF_NAMESPACE_ID::int32 segindex() const; + void set_segindex(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_segindex() const; + void _internal_set_segindex(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.SegmentKey) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::int32 dbid_; + ::PROTOBUF_NAMESPACE_ID::int32 segindex_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class SystemStat PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.SystemStat) */ { + public: + inline SystemStat() : SystemStat(nullptr) {}; + virtual ~SystemStat(); + + SystemStat(const SystemStat& from); + SystemStat(SystemStat&& from) noexcept + : SystemStat() { + *this = ::std::move(from); + } + + inline SystemStat& operator=(const SystemStat& from) { + CopyFrom(from); + return *this; + } + inline SystemStat& operator=(SystemStat&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const SystemStat& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SystemStat* internal_default_instance() { + return reinterpret_cast( + &_SystemStat_default_instance_); + } + static constexpr int kIndexInFileMessages = + 6; + + friend void swap(SystemStat& a, SystemStat& b) { + a.Swap(&b); + } + inline void Swap(SystemStat* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SystemStat* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline SystemStat* New() const final { + return CreateMaybeMessage(nullptr); + } + + SystemStat* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const SystemStat& from); + void MergeFrom(const SystemStat& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SystemStat* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.SystemStat"; + } + protected: + explicit SystemStat(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kRunningTimeSecondsFieldNumber = 1, + kUserTimeSecondsFieldNumber = 2, + kKernelTimeSecondsFieldNumber = 3, + kVsizeFieldNumber = 4, + kRssFieldNumber = 5, + kVmSizeKbFieldNumber = 6, + kVmPeakKbFieldNumber = 7, + kRcharFieldNumber = 8, + kWcharFieldNumber = 9, + kSyscrFieldNumber = 10, + kSyscwFieldNumber = 11, + kReadBytesFieldNumber = 12, + kWriteBytesFieldNumber = 13, + kCancelledWriteBytesFieldNumber = 14, + }; + // double runningTimeSeconds = 1; + void clear_runningtimeseconds(); + double runningtimeseconds() const; + void set_runningtimeseconds(double value); + private: + double _internal_runningtimeseconds() const; + void _internal_set_runningtimeseconds(double value); + public: + + // double userTimeSeconds = 2; + void clear_usertimeseconds(); + double usertimeseconds() const; + void set_usertimeseconds(double value); + private: + double _internal_usertimeseconds() const; + void _internal_set_usertimeseconds(double value); + public: + + // double kernelTimeSeconds = 3; + void clear_kerneltimeseconds(); + double kerneltimeseconds() const; + void set_kerneltimeseconds(double value); + private: + double _internal_kerneltimeseconds() const; + void _internal_set_kerneltimeseconds(double value); + public: + + // uint64 vsize = 4; + void clear_vsize(); + ::PROTOBUF_NAMESPACE_ID::uint64 vsize() const; + void set_vsize(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_vsize() const; + void _internal_set_vsize(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 rss = 5; + void clear_rss(); + ::PROTOBUF_NAMESPACE_ID::uint64 rss() const; + void set_rss(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_rss() const; + void _internal_set_rss(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 VmSizeKb = 6; + void clear_vmsizekb(); + ::PROTOBUF_NAMESPACE_ID::uint64 vmsizekb() const; + void set_vmsizekb(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_vmsizekb() const; + void _internal_set_vmsizekb(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 VmPeakKb = 7; + void clear_vmpeakkb(); + ::PROTOBUF_NAMESPACE_ID::uint64 vmpeakkb() const; + void set_vmpeakkb(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_vmpeakkb() const; + void _internal_set_vmpeakkb(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 rchar = 8; + void clear_rchar(); + ::PROTOBUF_NAMESPACE_ID::uint64 rchar() const; + void set_rchar(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_rchar() const; + void _internal_set_rchar(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 wchar = 9; + void clear_wchar(); + ::PROTOBUF_NAMESPACE_ID::uint64 wchar() const; + void set_wchar(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_wchar() const; + void _internal_set_wchar(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 syscr = 10; + void clear_syscr(); + ::PROTOBUF_NAMESPACE_ID::uint64 syscr() const; + void set_syscr(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_syscr() const; + void _internal_set_syscr(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 syscw = 11; + void clear_syscw(); + ::PROTOBUF_NAMESPACE_ID::uint64 syscw() const; + void set_syscw(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_syscw() const; + void _internal_set_syscw(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 read_bytes = 12; + void clear_read_bytes(); + ::PROTOBUF_NAMESPACE_ID::uint64 read_bytes() const; + void set_read_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_read_bytes() const; + void _internal_set_read_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 write_bytes = 13; + void clear_write_bytes(); + ::PROTOBUF_NAMESPACE_ID::uint64 write_bytes() const; + void set_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_write_bytes() const; + void _internal_set_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 cancelled_write_bytes = 14; + void clear_cancelled_write_bytes(); + ::PROTOBUF_NAMESPACE_ID::uint64 cancelled_write_bytes() const; + void set_cancelled_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_cancelled_write_bytes() const; + void _internal_set_cancelled_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.SystemStat) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + double runningtimeseconds_; + double usertimeseconds_; + double kerneltimeseconds_; + ::PROTOBUF_NAMESPACE_ID::uint64 vsize_; + ::PROTOBUF_NAMESPACE_ID::uint64 rss_; + ::PROTOBUF_NAMESPACE_ID::uint64 vmsizekb_; + ::PROTOBUF_NAMESPACE_ID::uint64 vmpeakkb_; + ::PROTOBUF_NAMESPACE_ID::uint64 rchar_; + ::PROTOBUF_NAMESPACE_ID::uint64 wchar_; + ::PROTOBUF_NAMESPACE_ID::uint64 syscr_; + ::PROTOBUF_NAMESPACE_ID::uint64 syscw_; + ::PROTOBUF_NAMESPACE_ID::uint64 read_bytes_; + ::PROTOBUF_NAMESPACE_ID::uint64 write_bytes_; + ::PROTOBUF_NAMESPACE_ID::uint64 cancelled_write_bytes_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class NetworkStat PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.NetworkStat) */ { + public: + inline NetworkStat() : NetworkStat(nullptr) {}; + virtual ~NetworkStat(); + + NetworkStat(const NetworkStat& from); + NetworkStat(NetworkStat&& from) noexcept + : NetworkStat() { + *this = ::std::move(from); + } + + inline NetworkStat& operator=(const NetworkStat& from) { + CopyFrom(from); + return *this; + } + inline NetworkStat& operator=(NetworkStat&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const NetworkStat& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const NetworkStat* internal_default_instance() { + return reinterpret_cast( + &_NetworkStat_default_instance_); + } + static constexpr int kIndexInFileMessages = + 7; + + friend void swap(NetworkStat& a, NetworkStat& b) { + a.Swap(&b); + } + inline void Swap(NetworkStat* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(NetworkStat* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline NetworkStat* New() const final { + return CreateMaybeMessage(nullptr); + } + + NetworkStat* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const NetworkStat& from); + void MergeFrom(const NetworkStat& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(NetworkStat* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.NetworkStat"; + } + protected: + explicit NetworkStat(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTotalBytesFieldNumber = 1, + kTupleBytesFieldNumber = 2, + kChunksFieldNumber = 3, + }; + // uint32 total_bytes = 1; + void clear_total_bytes(); + ::PROTOBUF_NAMESPACE_ID::uint32 total_bytes() const; + void set_total_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint32 _internal_total_bytes() const; + void _internal_set_total_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value); + public: + + // uint32 tuple_bytes = 2; + void clear_tuple_bytes(); + ::PROTOBUF_NAMESPACE_ID::uint32 tuple_bytes() const; + void set_tuple_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint32 _internal_tuple_bytes() const; + void _internal_set_tuple_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value); + public: + + // uint32 chunks = 3; + void clear_chunks(); + ::PROTOBUF_NAMESPACE_ID::uint32 chunks() const; + void set_chunks(::PROTOBUF_NAMESPACE_ID::uint32 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint32 _internal_chunks() const; + void _internal_set_chunks(::PROTOBUF_NAMESPACE_ID::uint32 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.NetworkStat) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::uint32 total_bytes_; + ::PROTOBUF_NAMESPACE_ID::uint32 tuple_bytes_; + ::PROTOBUF_NAMESPACE_ID::uint32 chunks_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class InterconnectStat PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.InterconnectStat) */ { + public: + inline InterconnectStat() : InterconnectStat(nullptr) {}; + virtual ~InterconnectStat(); + + InterconnectStat(const InterconnectStat& from); + InterconnectStat(InterconnectStat&& from) noexcept + : InterconnectStat() { + *this = ::std::move(from); + } + + inline InterconnectStat& operator=(const InterconnectStat& from) { + CopyFrom(from); + return *this; + } + inline InterconnectStat& operator=(InterconnectStat&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const InterconnectStat& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const InterconnectStat* internal_default_instance() { + return reinterpret_cast( + &_InterconnectStat_default_instance_); + } + static constexpr int kIndexInFileMessages = + 8; + + friend void swap(InterconnectStat& a, InterconnectStat& b) { + a.Swap(&b); + } + inline void Swap(InterconnectStat* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(InterconnectStat* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline InterconnectStat* New() const final { + return CreateMaybeMessage(nullptr); + } + + InterconnectStat* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const InterconnectStat& from); + void MergeFrom(const InterconnectStat& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(InterconnectStat* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.InterconnectStat"; + } + protected: + explicit InterconnectStat(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTotalRecvQueueSizeFieldNumber = 1, + kRecvQueueSizeCountingTimeFieldNumber = 2, + kTotalCapacityFieldNumber = 3, + kCapacityCountingTimeFieldNumber = 4, + kTotalBuffersFieldNumber = 5, + kBufferCountingTimeFieldNumber = 6, + kActiveConnectionsNumFieldNumber = 7, + kRetransmitsFieldNumber = 8, + kStartupCachedPktNumFieldNumber = 9, + kMismatchNumFieldNumber = 10, + kCrcErrorsFieldNumber = 11, + kSndPktNumFieldNumber = 12, + kRecvPktNumFieldNumber = 13, + kDisorderedPktNumFieldNumber = 14, + kDuplicatedPktNumFieldNumber = 15, + kRecvAckNumFieldNumber = 16, + kStatusQueryMsgNumFieldNumber = 17, + }; + // uint64 total_recv_queue_size = 1; + void clear_total_recv_queue_size(); + ::PROTOBUF_NAMESPACE_ID::uint64 total_recv_queue_size() const; + void set_total_recv_queue_size(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_total_recv_queue_size() const; + void _internal_set_total_recv_queue_size(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 recv_queue_size_counting_time = 2; + void clear_recv_queue_size_counting_time(); + ::PROTOBUF_NAMESPACE_ID::uint64 recv_queue_size_counting_time() const; + void set_recv_queue_size_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_recv_queue_size_counting_time() const; + void _internal_set_recv_queue_size_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 total_capacity = 3; + void clear_total_capacity(); + ::PROTOBUF_NAMESPACE_ID::uint64 total_capacity() const; + void set_total_capacity(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_total_capacity() const; + void _internal_set_total_capacity(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 capacity_counting_time = 4; + void clear_capacity_counting_time(); + ::PROTOBUF_NAMESPACE_ID::uint64 capacity_counting_time() const; + void set_capacity_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_capacity_counting_time() const; + void _internal_set_capacity_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 total_buffers = 5; + void clear_total_buffers(); + ::PROTOBUF_NAMESPACE_ID::uint64 total_buffers() const; + void set_total_buffers(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_total_buffers() const; + void _internal_set_total_buffers(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 buffer_counting_time = 6; + void clear_buffer_counting_time(); + ::PROTOBUF_NAMESPACE_ID::uint64 buffer_counting_time() const; + void set_buffer_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_buffer_counting_time() const; + void _internal_set_buffer_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 active_connections_num = 7; + void clear_active_connections_num(); + ::PROTOBUF_NAMESPACE_ID::uint64 active_connections_num() const; + void set_active_connections_num(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_active_connections_num() const; + void _internal_set_active_connections_num(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // int64 retransmits = 8; + void clear_retransmits(); + ::PROTOBUF_NAMESPACE_ID::int64 retransmits() const; + void set_retransmits(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_retransmits() const; + void _internal_set_retransmits(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 startup_cached_pkt_num = 9; + void clear_startup_cached_pkt_num(); + ::PROTOBUF_NAMESPACE_ID::int64 startup_cached_pkt_num() const; + void set_startup_cached_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_startup_cached_pkt_num() const; + void _internal_set_startup_cached_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 mismatch_num = 10; + void clear_mismatch_num(); + ::PROTOBUF_NAMESPACE_ID::int64 mismatch_num() const; + void set_mismatch_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_mismatch_num() const; + void _internal_set_mismatch_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 crc_errors = 11; + void clear_crc_errors(); + ::PROTOBUF_NAMESPACE_ID::int64 crc_errors() const; + void set_crc_errors(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_crc_errors() const; + void _internal_set_crc_errors(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 snd_pkt_num = 12; + void clear_snd_pkt_num(); + ::PROTOBUF_NAMESPACE_ID::int64 snd_pkt_num() const; + void set_snd_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_snd_pkt_num() const; + void _internal_set_snd_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 recv_pkt_num = 13; + void clear_recv_pkt_num(); + ::PROTOBUF_NAMESPACE_ID::int64 recv_pkt_num() const; + void set_recv_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_recv_pkt_num() const; + void _internal_set_recv_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 disordered_pkt_num = 14; + void clear_disordered_pkt_num(); + ::PROTOBUF_NAMESPACE_ID::int64 disordered_pkt_num() const; + void set_disordered_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_disordered_pkt_num() const; + void _internal_set_disordered_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 duplicated_pkt_num = 15; + void clear_duplicated_pkt_num(); + ::PROTOBUF_NAMESPACE_ID::int64 duplicated_pkt_num() const; + void set_duplicated_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_duplicated_pkt_num() const; + void _internal_set_duplicated_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 recv_ack_num = 16; + void clear_recv_ack_num(); + ::PROTOBUF_NAMESPACE_ID::int64 recv_ack_num() const; + void set_recv_ack_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_recv_ack_num() const; + void _internal_set_recv_ack_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int64 status_query_msg_num = 17; + void clear_status_query_msg_num(); + ::PROTOBUF_NAMESPACE_ID::int64 status_query_msg_num() const; + void set_status_query_msg_num(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_status_query_msg_num() const; + void _internal_set_status_query_msg_num(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.InterconnectStat) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::uint64 total_recv_queue_size_; + ::PROTOBUF_NAMESPACE_ID::uint64 recv_queue_size_counting_time_; + ::PROTOBUF_NAMESPACE_ID::uint64 total_capacity_; + ::PROTOBUF_NAMESPACE_ID::uint64 capacity_counting_time_; + ::PROTOBUF_NAMESPACE_ID::uint64 total_buffers_; + ::PROTOBUF_NAMESPACE_ID::uint64 buffer_counting_time_; + ::PROTOBUF_NAMESPACE_ID::uint64 active_connections_num_; + ::PROTOBUF_NAMESPACE_ID::int64 retransmits_; + ::PROTOBUF_NAMESPACE_ID::int64 startup_cached_pkt_num_; + ::PROTOBUF_NAMESPACE_ID::int64 mismatch_num_; + ::PROTOBUF_NAMESPACE_ID::int64 crc_errors_; + ::PROTOBUF_NAMESPACE_ID::int64 snd_pkt_num_; + ::PROTOBUF_NAMESPACE_ID::int64 recv_pkt_num_; + ::PROTOBUF_NAMESPACE_ID::int64 disordered_pkt_num_; + ::PROTOBUF_NAMESPACE_ID::int64 duplicated_pkt_num_; + ::PROTOBUF_NAMESPACE_ID::int64 recv_ack_num_; + ::PROTOBUF_NAMESPACE_ID::int64 status_query_msg_num_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class MetricInstrumentation PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.MetricInstrumentation) */ { + public: + inline MetricInstrumentation() : MetricInstrumentation(nullptr) {}; + virtual ~MetricInstrumentation(); + + MetricInstrumentation(const MetricInstrumentation& from); + MetricInstrumentation(MetricInstrumentation&& from) noexcept + : MetricInstrumentation() { + *this = ::std::move(from); + } + + inline MetricInstrumentation& operator=(const MetricInstrumentation& from) { + CopyFrom(from); + return *this; + } + inline MetricInstrumentation& operator=(MetricInstrumentation&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const MetricInstrumentation& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MetricInstrumentation* internal_default_instance() { + return reinterpret_cast( + &_MetricInstrumentation_default_instance_); + } + static constexpr int kIndexInFileMessages = + 9; + + friend void swap(MetricInstrumentation& a, MetricInstrumentation& b) { + a.Swap(&b); + } + inline void Swap(MetricInstrumentation* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MetricInstrumentation* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline MetricInstrumentation* New() const final { + return CreateMaybeMessage(nullptr); + } + + MetricInstrumentation* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const MetricInstrumentation& from); + void MergeFrom(const MetricInstrumentation& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MetricInstrumentation* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.MetricInstrumentation"; + } + protected: + explicit MetricInstrumentation(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kSentFieldNumber = 19, + kReceivedFieldNumber = 20, + kInterconnectFieldNumber = 24, + kNtuplesFieldNumber = 1, + kNloopsFieldNumber = 2, + kTuplecountFieldNumber = 3, + kFirsttupleFieldNumber = 4, + kStartupFieldNumber = 5, + kTotalFieldNumber = 6, + kSharedBlksHitFieldNumber = 7, + kSharedBlksReadFieldNumber = 8, + kSharedBlksDirtiedFieldNumber = 9, + kSharedBlksWrittenFieldNumber = 10, + kLocalBlksHitFieldNumber = 11, + kLocalBlksReadFieldNumber = 12, + kLocalBlksDirtiedFieldNumber = 13, + kLocalBlksWrittenFieldNumber = 14, + kTempBlksReadFieldNumber = 15, + kTempBlksWrittenFieldNumber = 16, + kBlkReadTimeFieldNumber = 17, + kBlkWriteTimeFieldNumber = 18, + kStartupTimeFieldNumber = 21, + kInheritedCallsFieldNumber = 22, + kInheritedTimeFieldNumber = 23, + }; + // .yagpcc.NetworkStat sent = 19; + bool has_sent() const; + private: + bool _internal_has_sent() const; + public: + void clear_sent(); + const ::yagpcc::NetworkStat& sent() const; + ::yagpcc::NetworkStat* release_sent(); + ::yagpcc::NetworkStat* mutable_sent(); + void set_allocated_sent(::yagpcc::NetworkStat* sent); + private: + const ::yagpcc::NetworkStat& _internal_sent() const; + ::yagpcc::NetworkStat* _internal_mutable_sent(); + public: + void unsafe_arena_set_allocated_sent( + ::yagpcc::NetworkStat* sent); + ::yagpcc::NetworkStat* unsafe_arena_release_sent(); + + // .yagpcc.NetworkStat received = 20; + bool has_received() const; + private: + bool _internal_has_received() const; + public: + void clear_received(); + const ::yagpcc::NetworkStat& received() const; + ::yagpcc::NetworkStat* release_received(); + ::yagpcc::NetworkStat* mutable_received(); + void set_allocated_received(::yagpcc::NetworkStat* received); + private: + const ::yagpcc::NetworkStat& _internal_received() const; + ::yagpcc::NetworkStat* _internal_mutable_received(); + public: + void unsafe_arena_set_allocated_received( + ::yagpcc::NetworkStat* received); + ::yagpcc::NetworkStat* unsafe_arena_release_received(); + + // .yagpcc.InterconnectStat interconnect = 24; + bool has_interconnect() const; + private: + bool _internal_has_interconnect() const; + public: + void clear_interconnect(); + const ::yagpcc::InterconnectStat& interconnect() const; + ::yagpcc::InterconnectStat* release_interconnect(); + ::yagpcc::InterconnectStat* mutable_interconnect(); + void set_allocated_interconnect(::yagpcc::InterconnectStat* interconnect); + private: + const ::yagpcc::InterconnectStat& _internal_interconnect() const; + ::yagpcc::InterconnectStat* _internal_mutable_interconnect(); + public: + void unsafe_arena_set_allocated_interconnect( + ::yagpcc::InterconnectStat* interconnect); + ::yagpcc::InterconnectStat* unsafe_arena_release_interconnect(); + + // uint64 ntuples = 1; + void clear_ntuples(); + ::PROTOBUF_NAMESPACE_ID::uint64 ntuples() const; + void set_ntuples(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_ntuples() const; + void _internal_set_ntuples(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 nloops = 2; + void clear_nloops(); + ::PROTOBUF_NAMESPACE_ID::uint64 nloops() const; + void set_nloops(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_nloops() const; + void _internal_set_nloops(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 tuplecount = 3; + void clear_tuplecount(); + ::PROTOBUF_NAMESPACE_ID::uint64 tuplecount() const; + void set_tuplecount(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_tuplecount() const; + void _internal_set_tuplecount(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // double firsttuple = 4; + void clear_firsttuple(); + double firsttuple() const; + void set_firsttuple(double value); + private: + double _internal_firsttuple() const; + void _internal_set_firsttuple(double value); + public: + + // double startup = 5; + void clear_startup(); + double startup() const; + void set_startup(double value); + private: + double _internal_startup() const; + void _internal_set_startup(double value); + public: + + // double total = 6; + void clear_total(); + double total() const; + void set_total(double value); + private: + double _internal_total() const; + void _internal_set_total(double value); + public: + + // uint64 shared_blks_hit = 7; + void clear_shared_blks_hit(); + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_hit() const; + void set_shared_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_shared_blks_hit() const; + void _internal_set_shared_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 shared_blks_read = 8; + void clear_shared_blks_read(); + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_read() const; + void set_shared_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_shared_blks_read() const; + void _internal_set_shared_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 shared_blks_dirtied = 9; + void clear_shared_blks_dirtied(); + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_dirtied() const; + void set_shared_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_shared_blks_dirtied() const; + void _internal_set_shared_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 shared_blks_written = 10; + void clear_shared_blks_written(); + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_written() const; + void set_shared_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_shared_blks_written() const; + void _internal_set_shared_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 local_blks_hit = 11; + void clear_local_blks_hit(); + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_hit() const; + void set_local_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_local_blks_hit() const; + void _internal_set_local_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 local_blks_read = 12; + void clear_local_blks_read(); + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_read() const; + void set_local_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_local_blks_read() const; + void _internal_set_local_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 local_blks_dirtied = 13; + void clear_local_blks_dirtied(); + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_dirtied() const; + void set_local_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_local_blks_dirtied() const; + void _internal_set_local_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 local_blks_written = 14; + void clear_local_blks_written(); + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_written() const; + void set_local_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_local_blks_written() const; + void _internal_set_local_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 temp_blks_read = 15; + void clear_temp_blks_read(); + ::PROTOBUF_NAMESPACE_ID::uint64 temp_blks_read() const; + void set_temp_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_temp_blks_read() const; + void _internal_set_temp_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // uint64 temp_blks_written = 16; + void clear_temp_blks_written(); + ::PROTOBUF_NAMESPACE_ID::uint64 temp_blks_written() const; + void set_temp_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_temp_blks_written() const; + void _internal_set_temp_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // double blk_read_time = 17; + void clear_blk_read_time(); + double blk_read_time() const; + void set_blk_read_time(double value); + private: + double _internal_blk_read_time() const; + void _internal_set_blk_read_time(double value); + public: + + // double blk_write_time = 18; + void clear_blk_write_time(); + double blk_write_time() const; + void set_blk_write_time(double value); + private: + double _internal_blk_write_time() const; + void _internal_set_blk_write_time(double value); + public: + + // double startup_time = 21; + void clear_startup_time(); + double startup_time() const; + void set_startup_time(double value); + private: + double _internal_startup_time() const; + void _internal_set_startup_time(double value); + public: + + // uint64 inherited_calls = 22; + void clear_inherited_calls(); + ::PROTOBUF_NAMESPACE_ID::uint64 inherited_calls() const; + void set_inherited_calls(::PROTOBUF_NAMESPACE_ID::uint64 value); + private: + ::PROTOBUF_NAMESPACE_ID::uint64 _internal_inherited_calls() const; + void _internal_set_inherited_calls(::PROTOBUF_NAMESPACE_ID::uint64 value); + public: + + // double inherited_time = 23; + void clear_inherited_time(); + double inherited_time() const; + void set_inherited_time(double value); + private: + double _internal_inherited_time() const; + void _internal_set_inherited_time(double value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.MetricInstrumentation) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::yagpcc::NetworkStat* sent_; + ::yagpcc::NetworkStat* received_; + ::yagpcc::InterconnectStat* interconnect_; + ::PROTOBUF_NAMESPACE_ID::uint64 ntuples_; + ::PROTOBUF_NAMESPACE_ID::uint64 nloops_; + ::PROTOBUF_NAMESPACE_ID::uint64 tuplecount_; + double firsttuple_; + double startup_; + double total_; + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_hit_; + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_read_; + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_dirtied_; + ::PROTOBUF_NAMESPACE_ID::uint64 shared_blks_written_; + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_hit_; + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_read_; + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_dirtied_; + ::PROTOBUF_NAMESPACE_ID::uint64 local_blks_written_; + ::PROTOBUF_NAMESPACE_ID::uint64 temp_blks_read_; + ::PROTOBUF_NAMESPACE_ID::uint64 temp_blks_written_; + double blk_read_time_; + double blk_write_time_; + double startup_time_; + ::PROTOBUF_NAMESPACE_ID::uint64 inherited_calls_; + double inherited_time_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// ------------------------------------------------------------------- + +class SpillInfo PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.SpillInfo) */ { + public: + inline SpillInfo() : SpillInfo(nullptr) {}; + virtual ~SpillInfo(); + + SpillInfo(const SpillInfo& from); + SpillInfo(SpillInfo&& from) noexcept + : SpillInfo() { + *this = ::std::move(from); + } + + inline SpillInfo& operator=(const SpillInfo& from) { + CopyFrom(from); + return *this; + } + inline SpillInfo& operator=(SpillInfo&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const SpillInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SpillInfo* internal_default_instance() { + return reinterpret_cast( + &_SpillInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 10; + + friend void swap(SpillInfo& a, SpillInfo& b) { + a.Swap(&b); + } + inline void Swap(SpillInfo* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SpillInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline SpillInfo* New() const final { + return CreateMaybeMessage(nullptr); + } + + SpillInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const SpillInfo& from); + void MergeFrom(const SpillInfo& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SpillInfo* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.SpillInfo"; + } + protected: + explicit SpillInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTotalBytesFieldNumber = 2, + kFileCountFieldNumber = 1, + }; + // int64 totalBytes = 2; + void clear_totalbytes(); + ::PROTOBUF_NAMESPACE_ID::int64 totalbytes() const; + void set_totalbytes(::PROTOBUF_NAMESPACE_ID::int64 value); + private: + ::PROTOBUF_NAMESPACE_ID::int64 _internal_totalbytes() const; + void _internal_set_totalbytes(::PROTOBUF_NAMESPACE_ID::int64 value); + public: + + // int32 fileCount = 1; + void clear_filecount(); + ::PROTOBUF_NAMESPACE_ID::int32 filecount() const; + void set_filecount(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_filecount() const; + void _internal_set_filecount(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.SpillInfo) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::int64 totalbytes_; + ::PROTOBUF_NAMESPACE_ID::int32 filecount_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fmetrics_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// QueryInfo + +// .yagpcc.PlanGenerator generator = 1; +inline void QueryInfo::clear_generator() { + generator_ = 0; +} +inline ::yagpcc::PlanGenerator QueryInfo::_internal_generator() const { + return static_cast< ::yagpcc::PlanGenerator >(generator_); +} +inline ::yagpcc::PlanGenerator QueryInfo::generator() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.generator) + return _internal_generator(); +} +inline void QueryInfo::_internal_set_generator(::yagpcc::PlanGenerator value) { + + generator_ = value; +} +inline void QueryInfo::set_generator(::yagpcc::PlanGenerator value) { + _internal_set_generator(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.generator) +} + +// uint64 query_id = 2; +inline void QueryInfo::clear_query_id() { + query_id_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 QueryInfo::_internal_query_id() const { + return query_id_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 QueryInfo::query_id() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.query_id) + return _internal_query_id(); +} +inline void QueryInfo::_internal_set_query_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + query_id_ = value; +} +inline void QueryInfo::set_query_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_query_id(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.query_id) +} + +// uint64 plan_id = 3; +inline void QueryInfo::clear_plan_id() { + plan_id_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 QueryInfo::_internal_plan_id() const { + return plan_id_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 QueryInfo::plan_id() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.plan_id) + return _internal_plan_id(); +} +inline void QueryInfo::_internal_set_plan_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + plan_id_ = value; +} +inline void QueryInfo::set_plan_id(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_plan_id(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.plan_id) +} + +// string query_text = 4; +inline void QueryInfo::clear_query_text() { + query_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::query_text() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.query_text) + return _internal_query_text(); +} +inline void QueryInfo::set_query_text(const std::string& value) { + _internal_set_query_text(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.query_text) +} +inline std::string* QueryInfo::mutable_query_text() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.query_text) + return _internal_mutable_query_text(); +} +inline const std::string& QueryInfo::_internal_query_text() const { + return query_text_.Get(); +} +inline void QueryInfo::_internal_set_query_text(const std::string& value) { + + query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_query_text(std::string&& value) { + + query_text_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.query_text) +} +inline void QueryInfo::set_query_text(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.query_text) +} +inline void QueryInfo::set_query_text(const char* value, + size_t size) { + + query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.query_text) +} +inline std::string* QueryInfo::_internal_mutable_query_text() { + + return query_text_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_query_text() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.query_text) + return query_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_query_text(std::string* query_text) { + if (query_text != nullptr) { + + } else { + + } + query_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), query_text, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.query_text) +} +inline std::string* QueryInfo::unsafe_arena_release_query_text() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.query_text) + GOOGLE_DCHECK(GetArena() != nullptr); + + return query_text_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_query_text( + std::string* query_text) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (query_text != nullptr) { + + } else { + + } + query_text_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + query_text, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.query_text) +} + +// string plan_text = 5; +inline void QueryInfo::clear_plan_text() { + plan_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::plan_text() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.plan_text) + return _internal_plan_text(); +} +inline void QueryInfo::set_plan_text(const std::string& value) { + _internal_set_plan_text(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.plan_text) +} +inline std::string* QueryInfo::mutable_plan_text() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.plan_text) + return _internal_mutable_plan_text(); +} +inline const std::string& QueryInfo::_internal_plan_text() const { + return plan_text_.Get(); +} +inline void QueryInfo::_internal_set_plan_text(const std::string& value) { + + plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_plan_text(std::string&& value) { + + plan_text_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.plan_text) +} +inline void QueryInfo::set_plan_text(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.plan_text) +} +inline void QueryInfo::set_plan_text(const char* value, + size_t size) { + + plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.plan_text) +} +inline std::string* QueryInfo::_internal_mutable_plan_text() { + + return plan_text_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_plan_text() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.plan_text) + return plan_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_plan_text(std::string* plan_text) { + if (plan_text != nullptr) { + + } else { + + } + plan_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), plan_text, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.plan_text) +} +inline std::string* QueryInfo::unsafe_arena_release_plan_text() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.plan_text) + GOOGLE_DCHECK(GetArena() != nullptr); + + return plan_text_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_plan_text( + std::string* plan_text) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (plan_text != nullptr) { + + } else { + + } + plan_text_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + plan_text, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.plan_text) +} + +// string template_query_text = 6; +inline void QueryInfo::clear_template_query_text() { + template_query_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::template_query_text() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.template_query_text) + return _internal_template_query_text(); +} +inline void QueryInfo::set_template_query_text(const std::string& value) { + _internal_set_template_query_text(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.template_query_text) +} +inline std::string* QueryInfo::mutable_template_query_text() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.template_query_text) + return _internal_mutable_template_query_text(); +} +inline const std::string& QueryInfo::_internal_template_query_text() const { + return template_query_text_.Get(); +} +inline void QueryInfo::_internal_set_template_query_text(const std::string& value) { + + template_query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_template_query_text(std::string&& value) { + + template_query_text_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.template_query_text) +} +inline void QueryInfo::set_template_query_text(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + template_query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.template_query_text) +} +inline void QueryInfo::set_template_query_text(const char* value, + size_t size) { + + template_query_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.template_query_text) +} +inline std::string* QueryInfo::_internal_mutable_template_query_text() { + + return template_query_text_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_template_query_text() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.template_query_text) + return template_query_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_template_query_text(std::string* template_query_text) { + if (template_query_text != nullptr) { + + } else { + + } + template_query_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), template_query_text, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.template_query_text) +} +inline std::string* QueryInfo::unsafe_arena_release_template_query_text() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.template_query_text) + GOOGLE_DCHECK(GetArena() != nullptr); + + return template_query_text_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_template_query_text( + std::string* template_query_text) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (template_query_text != nullptr) { + + } else { + + } + template_query_text_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + template_query_text, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.template_query_text) +} + +// string template_plan_text = 7; +inline void QueryInfo::clear_template_plan_text() { + template_plan_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::template_plan_text() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.template_plan_text) + return _internal_template_plan_text(); +} +inline void QueryInfo::set_template_plan_text(const std::string& value) { + _internal_set_template_plan_text(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.template_plan_text) +} +inline std::string* QueryInfo::mutable_template_plan_text() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.template_plan_text) + return _internal_mutable_template_plan_text(); +} +inline const std::string& QueryInfo::_internal_template_plan_text() const { + return template_plan_text_.Get(); +} +inline void QueryInfo::_internal_set_template_plan_text(const std::string& value) { + + template_plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_template_plan_text(std::string&& value) { + + template_plan_text_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.template_plan_text) +} +inline void QueryInfo::set_template_plan_text(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + template_plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.template_plan_text) +} +inline void QueryInfo::set_template_plan_text(const char* value, + size_t size) { + + template_plan_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.template_plan_text) +} +inline std::string* QueryInfo::_internal_mutable_template_plan_text() { + + return template_plan_text_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_template_plan_text() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.template_plan_text) + return template_plan_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_template_plan_text(std::string* template_plan_text) { + if (template_plan_text != nullptr) { + + } else { + + } + template_plan_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), template_plan_text, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.template_plan_text) +} +inline std::string* QueryInfo::unsafe_arena_release_template_plan_text() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.template_plan_text) + GOOGLE_DCHECK(GetArena() != nullptr); + + return template_plan_text_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_template_plan_text( + std::string* template_plan_text) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (template_plan_text != nullptr) { + + } else { + + } + template_plan_text_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + template_plan_text, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.template_plan_text) +} + +// string userName = 8; +inline void QueryInfo::clear_username() { + username_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::username() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.userName) + return _internal_username(); +} +inline void QueryInfo::set_username(const std::string& value) { + _internal_set_username(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.userName) +} +inline std::string* QueryInfo::mutable_username() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.userName) + return _internal_mutable_username(); +} +inline const std::string& QueryInfo::_internal_username() const { + return username_.Get(); +} +inline void QueryInfo::_internal_set_username(const std::string& value) { + + username_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_username(std::string&& value) { + + username_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.userName) +} +inline void QueryInfo::set_username(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + username_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.userName) +} +inline void QueryInfo::set_username(const char* value, + size_t size) { + + username_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.userName) +} +inline std::string* QueryInfo::_internal_mutable_username() { + + return username_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_username() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.userName) + return username_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_username(std::string* username) { + if (username != nullptr) { + + } else { + + } + username_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), username, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.userName) +} +inline std::string* QueryInfo::unsafe_arena_release_username() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.userName) + GOOGLE_DCHECK(GetArena() != nullptr); + + return username_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_username( + std::string* username) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (username != nullptr) { + + } else { + + } + username_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + username, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.userName) +} + +// string databaseName = 9; +inline void QueryInfo::clear_databasename() { + databasename_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::databasename() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.databaseName) + return _internal_databasename(); +} +inline void QueryInfo::set_databasename(const std::string& value) { + _internal_set_databasename(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.databaseName) +} +inline std::string* QueryInfo::mutable_databasename() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.databaseName) + return _internal_mutable_databasename(); +} +inline const std::string& QueryInfo::_internal_databasename() const { + return databasename_.Get(); +} +inline void QueryInfo::_internal_set_databasename(const std::string& value) { + + databasename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_databasename(std::string&& value) { + + databasename_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.databaseName) +} +inline void QueryInfo::set_databasename(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + databasename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.databaseName) +} +inline void QueryInfo::set_databasename(const char* value, + size_t size) { + + databasename_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.databaseName) +} +inline std::string* QueryInfo::_internal_mutable_databasename() { + + return databasename_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_databasename() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.databaseName) + return databasename_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_databasename(std::string* databasename) { + if (databasename != nullptr) { + + } else { + + } + databasename_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), databasename, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.databaseName) +} +inline std::string* QueryInfo::unsafe_arena_release_databasename() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.databaseName) + GOOGLE_DCHECK(GetArena() != nullptr); + + return databasename_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_databasename( + std::string* databasename) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (databasename != nullptr) { + + } else { + + } + databasename_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + databasename, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.databaseName) +} + +// string rsgname = 10; +inline void QueryInfo::clear_rsgname() { + rsgname_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::rsgname() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.rsgname) + return _internal_rsgname(); +} +inline void QueryInfo::set_rsgname(const std::string& value) { + _internal_set_rsgname(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.rsgname) +} +inline std::string* QueryInfo::mutable_rsgname() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.rsgname) + return _internal_mutable_rsgname(); +} +inline const std::string& QueryInfo::_internal_rsgname() const { + return rsgname_.Get(); +} +inline void QueryInfo::_internal_set_rsgname(const std::string& value) { + + rsgname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_rsgname(std::string&& value) { + + rsgname_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.rsgname) +} +inline void QueryInfo::set_rsgname(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + rsgname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.rsgname) +} +inline void QueryInfo::set_rsgname(const char* value, + size_t size) { + + rsgname_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.rsgname) +} +inline std::string* QueryInfo::_internal_mutable_rsgname() { + + return rsgname_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_rsgname() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.rsgname) + return rsgname_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_rsgname(std::string* rsgname) { + if (rsgname != nullptr) { + + } else { + + } + rsgname_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), rsgname, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.rsgname) +} +inline std::string* QueryInfo::unsafe_arena_release_rsgname() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.rsgname) + GOOGLE_DCHECK(GetArena() != nullptr); + + return rsgname_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_rsgname( + std::string* rsgname) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (rsgname != nullptr) { + + } else { + + } + rsgname_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + rsgname, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.rsgname) +} + +// string analyze_text = 11; +inline void QueryInfo::clear_analyze_text() { + analyze_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& QueryInfo::analyze_text() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryInfo.analyze_text) + return _internal_analyze_text(); +} +inline void QueryInfo::set_analyze_text(const std::string& value) { + _internal_set_analyze_text(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryInfo.analyze_text) +} +inline std::string* QueryInfo::mutable_analyze_text() { + // @@protoc_insertion_point(field_mutable:yagpcc.QueryInfo.analyze_text) + return _internal_mutable_analyze_text(); +} +inline const std::string& QueryInfo::_internal_analyze_text() const { + return analyze_text_.Get(); +} +inline void QueryInfo::_internal_set_analyze_text(const std::string& value) { + + analyze_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void QueryInfo::set_analyze_text(std::string&& value) { + + analyze_text_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.QueryInfo.analyze_text) +} +inline void QueryInfo::set_analyze_text(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + analyze_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.QueryInfo.analyze_text) +} +inline void QueryInfo::set_analyze_text(const char* value, + size_t size) { + + analyze_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.QueryInfo.analyze_text) +} +inline std::string* QueryInfo::_internal_mutable_analyze_text() { + + return analyze_text_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* QueryInfo::release_analyze_text() { + // @@protoc_insertion_point(field_release:yagpcc.QueryInfo.analyze_text) + return analyze_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void QueryInfo::set_allocated_analyze_text(std::string* analyze_text) { + if (analyze_text != nullptr) { + + } else { + + } + analyze_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), analyze_text, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.QueryInfo.analyze_text) +} +inline std::string* QueryInfo::unsafe_arena_release_analyze_text() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.QueryInfo.analyze_text) + GOOGLE_DCHECK(GetArena() != nullptr); + + return analyze_text_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void QueryInfo::unsafe_arena_set_allocated_analyze_text( + std::string* analyze_text) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (analyze_text != nullptr) { + + } else { + + } + analyze_text_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + analyze_text, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.QueryInfo.analyze_text) +} + +// ------------------------------------------------------------------- + +// AdditionalQueryInfo + +// int64 nested_level = 1; +inline void AdditionalQueryInfo::clear_nested_level() { + nested_level_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 AdditionalQueryInfo::_internal_nested_level() const { + return nested_level_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 AdditionalQueryInfo::nested_level() const { + // @@protoc_insertion_point(field_get:yagpcc.AdditionalQueryInfo.nested_level) + return _internal_nested_level(); +} +inline void AdditionalQueryInfo::_internal_set_nested_level(::PROTOBUF_NAMESPACE_ID::int64 value) { + + nested_level_ = value; +} +inline void AdditionalQueryInfo::set_nested_level(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_nested_level(value); + // @@protoc_insertion_point(field_set:yagpcc.AdditionalQueryInfo.nested_level) +} + +// string error_message = 2; +inline void AdditionalQueryInfo::clear_error_message() { + error_message_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& AdditionalQueryInfo::error_message() const { + // @@protoc_insertion_point(field_get:yagpcc.AdditionalQueryInfo.error_message) + return _internal_error_message(); +} +inline void AdditionalQueryInfo::set_error_message(const std::string& value) { + _internal_set_error_message(value); + // @@protoc_insertion_point(field_set:yagpcc.AdditionalQueryInfo.error_message) +} +inline std::string* AdditionalQueryInfo::mutable_error_message() { + // @@protoc_insertion_point(field_mutable:yagpcc.AdditionalQueryInfo.error_message) + return _internal_mutable_error_message(); +} +inline const std::string& AdditionalQueryInfo::_internal_error_message() const { + return error_message_.Get(); +} +inline void AdditionalQueryInfo::_internal_set_error_message(const std::string& value) { + + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void AdditionalQueryInfo::set_error_message(std::string&& value) { + + error_message_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.AdditionalQueryInfo.error_message) +} +inline void AdditionalQueryInfo::set_error_message(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.AdditionalQueryInfo.error_message) +} +inline void AdditionalQueryInfo::set_error_message(const char* value, + size_t size) { + + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.AdditionalQueryInfo.error_message) +} +inline std::string* AdditionalQueryInfo::_internal_mutable_error_message() { + + return error_message_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* AdditionalQueryInfo::release_error_message() { + // @@protoc_insertion_point(field_release:yagpcc.AdditionalQueryInfo.error_message) + return error_message_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void AdditionalQueryInfo::set_allocated_error_message(std::string* error_message) { + if (error_message != nullptr) { + + } else { + + } + error_message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error_message, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.AdditionalQueryInfo.error_message) +} +inline std::string* AdditionalQueryInfo::unsafe_arena_release_error_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.AdditionalQueryInfo.error_message) + GOOGLE_DCHECK(GetArena() != nullptr); + + return error_message_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void AdditionalQueryInfo::unsafe_arena_set_allocated_error_message( + std::string* error_message) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (error_message != nullptr) { + + } else { + + } + error_message_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + error_message, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.AdditionalQueryInfo.error_message) +} + +// int64 slice_id = 3; +inline void AdditionalQueryInfo::clear_slice_id() { + slice_id_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 AdditionalQueryInfo::_internal_slice_id() const { + return slice_id_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 AdditionalQueryInfo::slice_id() const { + // @@protoc_insertion_point(field_get:yagpcc.AdditionalQueryInfo.slice_id) + return _internal_slice_id(); +} +inline void AdditionalQueryInfo::_internal_set_slice_id(::PROTOBUF_NAMESPACE_ID::int64 value) { + + slice_id_ = value; +} +inline void AdditionalQueryInfo::set_slice_id(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_slice_id(value); + // @@protoc_insertion_point(field_set:yagpcc.AdditionalQueryInfo.slice_id) +} + +// ------------------------------------------------------------------- + +// AdditionalQueryStat + +// string error_message = 1; +inline void AdditionalQueryStat::clear_error_message() { + error_message_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& AdditionalQueryStat::error_message() const { + // @@protoc_insertion_point(field_get:yagpcc.AdditionalQueryStat.error_message) + return _internal_error_message(); +} +inline void AdditionalQueryStat::set_error_message(const std::string& value) { + _internal_set_error_message(value); + // @@protoc_insertion_point(field_set:yagpcc.AdditionalQueryStat.error_message) +} +inline std::string* AdditionalQueryStat::mutable_error_message() { + // @@protoc_insertion_point(field_mutable:yagpcc.AdditionalQueryStat.error_message) + return _internal_mutable_error_message(); +} +inline const std::string& AdditionalQueryStat::_internal_error_message() const { + return error_message_.Get(); +} +inline void AdditionalQueryStat::_internal_set_error_message(const std::string& value) { + + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void AdditionalQueryStat::set_error_message(std::string&& value) { + + error_message_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.AdditionalQueryStat.error_message) +} +inline void AdditionalQueryStat::set_error_message(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.AdditionalQueryStat.error_message) +} +inline void AdditionalQueryStat::set_error_message(const char* value, + size_t size) { + + error_message_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.AdditionalQueryStat.error_message) +} +inline std::string* AdditionalQueryStat::_internal_mutable_error_message() { + + return error_message_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* AdditionalQueryStat::release_error_message() { + // @@protoc_insertion_point(field_release:yagpcc.AdditionalQueryStat.error_message) + return error_message_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void AdditionalQueryStat::set_allocated_error_message(std::string* error_message) { + if (error_message != nullptr) { + + } else { + + } + error_message_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error_message, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.AdditionalQueryStat.error_message) +} +inline std::string* AdditionalQueryStat::unsafe_arena_release_error_message() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.AdditionalQueryStat.error_message) + GOOGLE_DCHECK(GetArena() != nullptr); + + return error_message_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void AdditionalQueryStat::unsafe_arena_set_allocated_error_message( + std::string* error_message) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (error_message != nullptr) { + + } else { + + } + error_message_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + error_message, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.AdditionalQueryStat.error_message) +} + +// repeated int64 slices = 2; +inline int AdditionalQueryStat::_internal_slices_size() const { + return slices_.size(); +} +inline int AdditionalQueryStat::slices_size() const { + return _internal_slices_size(); +} +inline void AdditionalQueryStat::clear_slices() { + slices_.Clear(); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 AdditionalQueryStat::_internal_slices(int index) const { + return slices_.Get(index); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 AdditionalQueryStat::slices(int index) const { + // @@protoc_insertion_point(field_get:yagpcc.AdditionalQueryStat.slices) + return _internal_slices(index); +} +inline void AdditionalQueryStat::set_slices(int index, ::PROTOBUF_NAMESPACE_ID::int64 value) { + slices_.Set(index, value); + // @@protoc_insertion_point(field_set:yagpcc.AdditionalQueryStat.slices) +} +inline void AdditionalQueryStat::_internal_add_slices(::PROTOBUF_NAMESPACE_ID::int64 value) { + slices_.Add(value); +} +inline void AdditionalQueryStat::add_slices(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_add_slices(value); + // @@protoc_insertion_point(field_add:yagpcc.AdditionalQueryStat.slices) +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& +AdditionalQueryStat::_internal_slices() const { + return slices_; +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >& +AdditionalQueryStat::slices() const { + // @@protoc_insertion_point(field_list:yagpcc.AdditionalQueryStat.slices) + return _internal_slices(); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* +AdditionalQueryStat::_internal_mutable_slices() { + return &slices_; +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedField< ::PROTOBUF_NAMESPACE_ID::int64 >* +AdditionalQueryStat::mutable_slices() { + // @@protoc_insertion_point(field_mutable_list:yagpcc.AdditionalQueryStat.slices) + return _internal_mutable_slices(); +} + +// ------------------------------------------------------------------- + +// GPMetrics + +// .yagpcc.SystemStat systemStat = 1; +inline bool GPMetrics::_internal_has_systemstat() const { + return this != internal_default_instance() && systemstat_ != nullptr; +} +inline bool GPMetrics::has_systemstat() const { + return _internal_has_systemstat(); +} +inline void GPMetrics::clear_systemstat() { + if (GetArena() == nullptr && systemstat_ != nullptr) { + delete systemstat_; + } + systemstat_ = nullptr; +} +inline const ::yagpcc::SystemStat& GPMetrics::_internal_systemstat() const { + const ::yagpcc::SystemStat* p = systemstat_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_SystemStat_default_instance_); +} +inline const ::yagpcc::SystemStat& GPMetrics::systemstat() const { + // @@protoc_insertion_point(field_get:yagpcc.GPMetrics.systemStat) + return _internal_systemstat(); +} +inline void GPMetrics::unsafe_arena_set_allocated_systemstat( + ::yagpcc::SystemStat* systemstat) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(systemstat_); + } + systemstat_ = systemstat; + if (systemstat) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.GPMetrics.systemStat) +} +inline ::yagpcc::SystemStat* GPMetrics::release_systemstat() { + auto temp = unsafe_arena_release_systemstat(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::SystemStat* GPMetrics::unsafe_arena_release_systemstat() { + // @@protoc_insertion_point(field_release:yagpcc.GPMetrics.systemStat) + + ::yagpcc::SystemStat* temp = systemstat_; + systemstat_ = nullptr; + return temp; +} +inline ::yagpcc::SystemStat* GPMetrics::_internal_mutable_systemstat() { + + if (systemstat_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::SystemStat>(GetArena()); + systemstat_ = p; + } + return systemstat_; +} +inline ::yagpcc::SystemStat* GPMetrics::mutable_systemstat() { + // @@protoc_insertion_point(field_mutable:yagpcc.GPMetrics.systemStat) + return _internal_mutable_systemstat(); +} +inline void GPMetrics::set_allocated_systemstat(::yagpcc::SystemStat* systemstat) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete systemstat_; + } + if (systemstat) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(systemstat); + if (message_arena != submessage_arena) { + systemstat = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, systemstat, submessage_arena); + } + + } else { + + } + systemstat_ = systemstat; + // @@protoc_insertion_point(field_set_allocated:yagpcc.GPMetrics.systemStat) +} + +// .yagpcc.MetricInstrumentation instrumentation = 2; +inline bool GPMetrics::_internal_has_instrumentation() const { + return this != internal_default_instance() && instrumentation_ != nullptr; +} +inline bool GPMetrics::has_instrumentation() const { + return _internal_has_instrumentation(); +} +inline void GPMetrics::clear_instrumentation() { + if (GetArena() == nullptr && instrumentation_ != nullptr) { + delete instrumentation_; + } + instrumentation_ = nullptr; +} +inline const ::yagpcc::MetricInstrumentation& GPMetrics::_internal_instrumentation() const { + const ::yagpcc::MetricInstrumentation* p = instrumentation_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_MetricInstrumentation_default_instance_); +} +inline const ::yagpcc::MetricInstrumentation& GPMetrics::instrumentation() const { + // @@protoc_insertion_point(field_get:yagpcc.GPMetrics.instrumentation) + return _internal_instrumentation(); +} +inline void GPMetrics::unsafe_arena_set_allocated_instrumentation( + ::yagpcc::MetricInstrumentation* instrumentation) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(instrumentation_); + } + instrumentation_ = instrumentation; + if (instrumentation) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.GPMetrics.instrumentation) +} +inline ::yagpcc::MetricInstrumentation* GPMetrics::release_instrumentation() { + auto temp = unsafe_arena_release_instrumentation(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::MetricInstrumentation* GPMetrics::unsafe_arena_release_instrumentation() { + // @@protoc_insertion_point(field_release:yagpcc.GPMetrics.instrumentation) + + ::yagpcc::MetricInstrumentation* temp = instrumentation_; + instrumentation_ = nullptr; + return temp; +} +inline ::yagpcc::MetricInstrumentation* GPMetrics::_internal_mutable_instrumentation() { + + if (instrumentation_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::MetricInstrumentation>(GetArena()); + instrumentation_ = p; + } + return instrumentation_; +} +inline ::yagpcc::MetricInstrumentation* GPMetrics::mutable_instrumentation() { + // @@protoc_insertion_point(field_mutable:yagpcc.GPMetrics.instrumentation) + return _internal_mutable_instrumentation(); +} +inline void GPMetrics::set_allocated_instrumentation(::yagpcc::MetricInstrumentation* instrumentation) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete instrumentation_; + } + if (instrumentation) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(instrumentation); + if (message_arena != submessage_arena) { + instrumentation = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, instrumentation, submessage_arena); + } + + } else { + + } + instrumentation_ = instrumentation; + // @@protoc_insertion_point(field_set_allocated:yagpcc.GPMetrics.instrumentation) +} + +// .yagpcc.SpillInfo spill = 3; +inline bool GPMetrics::_internal_has_spill() const { + return this != internal_default_instance() && spill_ != nullptr; +} +inline bool GPMetrics::has_spill() const { + return _internal_has_spill(); +} +inline void GPMetrics::clear_spill() { + if (GetArena() == nullptr && spill_ != nullptr) { + delete spill_; + } + spill_ = nullptr; +} +inline const ::yagpcc::SpillInfo& GPMetrics::_internal_spill() const { + const ::yagpcc::SpillInfo* p = spill_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_SpillInfo_default_instance_); +} +inline const ::yagpcc::SpillInfo& GPMetrics::spill() const { + // @@protoc_insertion_point(field_get:yagpcc.GPMetrics.spill) + return _internal_spill(); +} +inline void GPMetrics::unsafe_arena_set_allocated_spill( + ::yagpcc::SpillInfo* spill) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(spill_); + } + spill_ = spill; + if (spill) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.GPMetrics.spill) +} +inline ::yagpcc::SpillInfo* GPMetrics::release_spill() { + auto temp = unsafe_arena_release_spill(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::SpillInfo* GPMetrics::unsafe_arena_release_spill() { + // @@protoc_insertion_point(field_release:yagpcc.GPMetrics.spill) + + ::yagpcc::SpillInfo* temp = spill_; + spill_ = nullptr; + return temp; +} +inline ::yagpcc::SpillInfo* GPMetrics::_internal_mutable_spill() { + + if (spill_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::SpillInfo>(GetArena()); + spill_ = p; + } + return spill_; +} +inline ::yagpcc::SpillInfo* GPMetrics::mutable_spill() { + // @@protoc_insertion_point(field_mutable:yagpcc.GPMetrics.spill) + return _internal_mutable_spill(); +} +inline void GPMetrics::set_allocated_spill(::yagpcc::SpillInfo* spill) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete spill_; + } + if (spill) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(spill); + if (message_arena != submessage_arena) { + spill = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, spill, submessage_arena); + } + + } else { + + } + spill_ = spill; + // @@protoc_insertion_point(field_set_allocated:yagpcc.GPMetrics.spill) +} + +// ------------------------------------------------------------------- + +// QueryKey + +// int32 tmid = 1; +inline void QueryKey::clear_tmid() { + tmid_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 QueryKey::_internal_tmid() const { + return tmid_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 QueryKey::tmid() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryKey.tmid) + return _internal_tmid(); +} +inline void QueryKey::_internal_set_tmid(::PROTOBUF_NAMESPACE_ID::int32 value) { + + tmid_ = value; +} +inline void QueryKey::set_tmid(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_tmid(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryKey.tmid) +} + +// int32 ssid = 2; +inline void QueryKey::clear_ssid() { + ssid_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 QueryKey::_internal_ssid() const { + return ssid_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 QueryKey::ssid() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryKey.ssid) + return _internal_ssid(); +} +inline void QueryKey::_internal_set_ssid(::PROTOBUF_NAMESPACE_ID::int32 value) { + + ssid_ = value; +} +inline void QueryKey::set_ssid(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_ssid(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryKey.ssid) +} + +// int32 ccnt = 3; +inline void QueryKey::clear_ccnt() { + ccnt_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 QueryKey::_internal_ccnt() const { + return ccnt_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 QueryKey::ccnt() const { + // @@protoc_insertion_point(field_get:yagpcc.QueryKey.ccnt) + return _internal_ccnt(); +} +inline void QueryKey::_internal_set_ccnt(::PROTOBUF_NAMESPACE_ID::int32 value) { + + ccnt_ = value; +} +inline void QueryKey::set_ccnt(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_ccnt(value); + // @@protoc_insertion_point(field_set:yagpcc.QueryKey.ccnt) +} + +// ------------------------------------------------------------------- + +// SegmentKey + +// int32 dbid = 1; +inline void SegmentKey::clear_dbid() { + dbid_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 SegmentKey::_internal_dbid() const { + return dbid_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 SegmentKey::dbid() const { + // @@protoc_insertion_point(field_get:yagpcc.SegmentKey.dbid) + return _internal_dbid(); +} +inline void SegmentKey::_internal_set_dbid(::PROTOBUF_NAMESPACE_ID::int32 value) { + + dbid_ = value; +} +inline void SegmentKey::set_dbid(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_dbid(value); + // @@protoc_insertion_point(field_set:yagpcc.SegmentKey.dbid) +} + +// int32 segindex = 2; +inline void SegmentKey::clear_segindex() { + segindex_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 SegmentKey::_internal_segindex() const { + return segindex_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 SegmentKey::segindex() const { + // @@protoc_insertion_point(field_get:yagpcc.SegmentKey.segindex) + return _internal_segindex(); +} +inline void SegmentKey::_internal_set_segindex(::PROTOBUF_NAMESPACE_ID::int32 value) { + + segindex_ = value; +} +inline void SegmentKey::set_segindex(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_segindex(value); + // @@protoc_insertion_point(field_set:yagpcc.SegmentKey.segindex) +} + +// ------------------------------------------------------------------- + +// SystemStat + +// double runningTimeSeconds = 1; +inline void SystemStat::clear_runningtimeseconds() { + runningtimeseconds_ = 0; +} +inline double SystemStat::_internal_runningtimeseconds() const { + return runningtimeseconds_; +} +inline double SystemStat::runningtimeseconds() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.runningTimeSeconds) + return _internal_runningtimeseconds(); +} +inline void SystemStat::_internal_set_runningtimeseconds(double value) { + + runningtimeseconds_ = value; +} +inline void SystemStat::set_runningtimeseconds(double value) { + _internal_set_runningtimeseconds(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.runningTimeSeconds) +} + +// double userTimeSeconds = 2; +inline void SystemStat::clear_usertimeseconds() { + usertimeseconds_ = 0; +} +inline double SystemStat::_internal_usertimeseconds() const { + return usertimeseconds_; +} +inline double SystemStat::usertimeseconds() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.userTimeSeconds) + return _internal_usertimeseconds(); +} +inline void SystemStat::_internal_set_usertimeseconds(double value) { + + usertimeseconds_ = value; +} +inline void SystemStat::set_usertimeseconds(double value) { + _internal_set_usertimeseconds(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.userTimeSeconds) +} + +// double kernelTimeSeconds = 3; +inline void SystemStat::clear_kerneltimeseconds() { + kerneltimeseconds_ = 0; +} +inline double SystemStat::_internal_kerneltimeseconds() const { + return kerneltimeseconds_; +} +inline double SystemStat::kerneltimeseconds() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.kernelTimeSeconds) + return _internal_kerneltimeseconds(); +} +inline void SystemStat::_internal_set_kerneltimeseconds(double value) { + + kerneltimeseconds_ = value; +} +inline void SystemStat::set_kerneltimeseconds(double value) { + _internal_set_kerneltimeseconds(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.kernelTimeSeconds) +} + +// uint64 vsize = 4; +inline void SystemStat::clear_vsize() { + vsize_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_vsize() const { + return vsize_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::vsize() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.vsize) + return _internal_vsize(); +} +inline void SystemStat::_internal_set_vsize(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + vsize_ = value; +} +inline void SystemStat::set_vsize(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_vsize(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.vsize) +} + +// uint64 rss = 5; +inline void SystemStat::clear_rss() { + rss_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_rss() const { + return rss_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::rss() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.rss) + return _internal_rss(); +} +inline void SystemStat::_internal_set_rss(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + rss_ = value; +} +inline void SystemStat::set_rss(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_rss(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.rss) +} + +// uint64 VmSizeKb = 6; +inline void SystemStat::clear_vmsizekb() { + vmsizekb_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_vmsizekb() const { + return vmsizekb_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::vmsizekb() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.VmSizeKb) + return _internal_vmsizekb(); +} +inline void SystemStat::_internal_set_vmsizekb(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + vmsizekb_ = value; +} +inline void SystemStat::set_vmsizekb(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_vmsizekb(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.VmSizeKb) +} + +// uint64 VmPeakKb = 7; +inline void SystemStat::clear_vmpeakkb() { + vmpeakkb_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_vmpeakkb() const { + return vmpeakkb_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::vmpeakkb() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.VmPeakKb) + return _internal_vmpeakkb(); +} +inline void SystemStat::_internal_set_vmpeakkb(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + vmpeakkb_ = value; +} +inline void SystemStat::set_vmpeakkb(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_vmpeakkb(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.VmPeakKb) +} + +// uint64 rchar = 8; +inline void SystemStat::clear_rchar() { + rchar_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_rchar() const { + return rchar_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::rchar() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.rchar) + return _internal_rchar(); +} +inline void SystemStat::_internal_set_rchar(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + rchar_ = value; +} +inline void SystemStat::set_rchar(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_rchar(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.rchar) +} + +// uint64 wchar = 9; +inline void SystemStat::clear_wchar() { + wchar_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_wchar() const { + return wchar_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::wchar() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.wchar) + return _internal_wchar(); +} +inline void SystemStat::_internal_set_wchar(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + wchar_ = value; +} +inline void SystemStat::set_wchar(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_wchar(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.wchar) +} + +// uint64 syscr = 10; +inline void SystemStat::clear_syscr() { + syscr_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_syscr() const { + return syscr_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::syscr() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.syscr) + return _internal_syscr(); +} +inline void SystemStat::_internal_set_syscr(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + syscr_ = value; +} +inline void SystemStat::set_syscr(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_syscr(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.syscr) +} + +// uint64 syscw = 11; +inline void SystemStat::clear_syscw() { + syscw_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_syscw() const { + return syscw_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::syscw() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.syscw) + return _internal_syscw(); +} +inline void SystemStat::_internal_set_syscw(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + syscw_ = value; +} +inline void SystemStat::set_syscw(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_syscw(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.syscw) +} + +// uint64 read_bytes = 12; +inline void SystemStat::clear_read_bytes() { + read_bytes_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_read_bytes() const { + return read_bytes_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::read_bytes() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.read_bytes) + return _internal_read_bytes(); +} +inline void SystemStat::_internal_set_read_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + read_bytes_ = value; +} +inline void SystemStat::set_read_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_read_bytes(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.read_bytes) +} + +// uint64 write_bytes = 13; +inline void SystemStat::clear_write_bytes() { + write_bytes_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_write_bytes() const { + return write_bytes_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::write_bytes() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.write_bytes) + return _internal_write_bytes(); +} +inline void SystemStat::_internal_set_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + write_bytes_ = value; +} +inline void SystemStat::set_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_write_bytes(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.write_bytes) +} + +// uint64 cancelled_write_bytes = 14; +inline void SystemStat::clear_cancelled_write_bytes() { + cancelled_write_bytes_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::_internal_cancelled_write_bytes() const { + return cancelled_write_bytes_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 SystemStat::cancelled_write_bytes() const { + // @@protoc_insertion_point(field_get:yagpcc.SystemStat.cancelled_write_bytes) + return _internal_cancelled_write_bytes(); +} +inline void SystemStat::_internal_set_cancelled_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + cancelled_write_bytes_ = value; +} +inline void SystemStat::set_cancelled_write_bytes(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_cancelled_write_bytes(value); + // @@protoc_insertion_point(field_set:yagpcc.SystemStat.cancelled_write_bytes) +} + +// ------------------------------------------------------------------- + +// NetworkStat + +// uint32 total_bytes = 1; +inline void NetworkStat::clear_total_bytes() { + total_bytes_ = 0u; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 NetworkStat::_internal_total_bytes() const { + return total_bytes_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 NetworkStat::total_bytes() const { + // @@protoc_insertion_point(field_get:yagpcc.NetworkStat.total_bytes) + return _internal_total_bytes(); +} +inline void NetworkStat::_internal_set_total_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value) { + + total_bytes_ = value; +} +inline void NetworkStat::set_total_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value) { + _internal_set_total_bytes(value); + // @@protoc_insertion_point(field_set:yagpcc.NetworkStat.total_bytes) +} + +// uint32 tuple_bytes = 2; +inline void NetworkStat::clear_tuple_bytes() { + tuple_bytes_ = 0u; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 NetworkStat::_internal_tuple_bytes() const { + return tuple_bytes_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 NetworkStat::tuple_bytes() const { + // @@protoc_insertion_point(field_get:yagpcc.NetworkStat.tuple_bytes) + return _internal_tuple_bytes(); +} +inline void NetworkStat::_internal_set_tuple_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value) { + + tuple_bytes_ = value; +} +inline void NetworkStat::set_tuple_bytes(::PROTOBUF_NAMESPACE_ID::uint32 value) { + _internal_set_tuple_bytes(value); + // @@protoc_insertion_point(field_set:yagpcc.NetworkStat.tuple_bytes) +} + +// uint32 chunks = 3; +inline void NetworkStat::clear_chunks() { + chunks_ = 0u; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 NetworkStat::_internal_chunks() const { + return chunks_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint32 NetworkStat::chunks() const { + // @@protoc_insertion_point(field_get:yagpcc.NetworkStat.chunks) + return _internal_chunks(); +} +inline void NetworkStat::_internal_set_chunks(::PROTOBUF_NAMESPACE_ID::uint32 value) { + + chunks_ = value; +} +inline void NetworkStat::set_chunks(::PROTOBUF_NAMESPACE_ID::uint32 value) { + _internal_set_chunks(value); + // @@protoc_insertion_point(field_set:yagpcc.NetworkStat.chunks) +} + +// ------------------------------------------------------------------- + +// InterconnectStat + +// uint64 total_recv_queue_size = 1; +inline void InterconnectStat::clear_total_recv_queue_size() { + total_recv_queue_size_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::_internal_total_recv_queue_size() const { + return total_recv_queue_size_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::total_recv_queue_size() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.total_recv_queue_size) + return _internal_total_recv_queue_size(); +} +inline void InterconnectStat::_internal_set_total_recv_queue_size(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + total_recv_queue_size_ = value; +} +inline void InterconnectStat::set_total_recv_queue_size(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_total_recv_queue_size(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.total_recv_queue_size) +} + +// uint64 recv_queue_size_counting_time = 2; +inline void InterconnectStat::clear_recv_queue_size_counting_time() { + recv_queue_size_counting_time_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::_internal_recv_queue_size_counting_time() const { + return recv_queue_size_counting_time_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::recv_queue_size_counting_time() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.recv_queue_size_counting_time) + return _internal_recv_queue_size_counting_time(); +} +inline void InterconnectStat::_internal_set_recv_queue_size_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + recv_queue_size_counting_time_ = value; +} +inline void InterconnectStat::set_recv_queue_size_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_recv_queue_size_counting_time(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.recv_queue_size_counting_time) +} + +// uint64 total_capacity = 3; +inline void InterconnectStat::clear_total_capacity() { + total_capacity_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::_internal_total_capacity() const { + return total_capacity_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::total_capacity() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.total_capacity) + return _internal_total_capacity(); +} +inline void InterconnectStat::_internal_set_total_capacity(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + total_capacity_ = value; +} +inline void InterconnectStat::set_total_capacity(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_total_capacity(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.total_capacity) +} + +// uint64 capacity_counting_time = 4; +inline void InterconnectStat::clear_capacity_counting_time() { + capacity_counting_time_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::_internal_capacity_counting_time() const { + return capacity_counting_time_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::capacity_counting_time() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.capacity_counting_time) + return _internal_capacity_counting_time(); +} +inline void InterconnectStat::_internal_set_capacity_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + capacity_counting_time_ = value; +} +inline void InterconnectStat::set_capacity_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_capacity_counting_time(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.capacity_counting_time) +} + +// uint64 total_buffers = 5; +inline void InterconnectStat::clear_total_buffers() { + total_buffers_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::_internal_total_buffers() const { + return total_buffers_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::total_buffers() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.total_buffers) + return _internal_total_buffers(); +} +inline void InterconnectStat::_internal_set_total_buffers(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + total_buffers_ = value; +} +inline void InterconnectStat::set_total_buffers(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_total_buffers(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.total_buffers) +} + +// uint64 buffer_counting_time = 6; +inline void InterconnectStat::clear_buffer_counting_time() { + buffer_counting_time_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::_internal_buffer_counting_time() const { + return buffer_counting_time_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::buffer_counting_time() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.buffer_counting_time) + return _internal_buffer_counting_time(); +} +inline void InterconnectStat::_internal_set_buffer_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + buffer_counting_time_ = value; +} +inline void InterconnectStat::set_buffer_counting_time(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_buffer_counting_time(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.buffer_counting_time) +} + +// uint64 active_connections_num = 7; +inline void InterconnectStat::clear_active_connections_num() { + active_connections_num_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::_internal_active_connections_num() const { + return active_connections_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 InterconnectStat::active_connections_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.active_connections_num) + return _internal_active_connections_num(); +} +inline void InterconnectStat::_internal_set_active_connections_num(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + active_connections_num_ = value; +} +inline void InterconnectStat::set_active_connections_num(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_active_connections_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.active_connections_num) +} + +// int64 retransmits = 8; +inline void InterconnectStat::clear_retransmits() { + retransmits_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_retransmits() const { + return retransmits_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::retransmits() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.retransmits) + return _internal_retransmits(); +} +inline void InterconnectStat::_internal_set_retransmits(::PROTOBUF_NAMESPACE_ID::int64 value) { + + retransmits_ = value; +} +inline void InterconnectStat::set_retransmits(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_retransmits(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.retransmits) +} + +// int64 startup_cached_pkt_num = 9; +inline void InterconnectStat::clear_startup_cached_pkt_num() { + startup_cached_pkt_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_startup_cached_pkt_num() const { + return startup_cached_pkt_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::startup_cached_pkt_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.startup_cached_pkt_num) + return _internal_startup_cached_pkt_num(); +} +inline void InterconnectStat::_internal_set_startup_cached_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + startup_cached_pkt_num_ = value; +} +inline void InterconnectStat::set_startup_cached_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_startup_cached_pkt_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.startup_cached_pkt_num) +} + +// int64 mismatch_num = 10; +inline void InterconnectStat::clear_mismatch_num() { + mismatch_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_mismatch_num() const { + return mismatch_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::mismatch_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.mismatch_num) + return _internal_mismatch_num(); +} +inline void InterconnectStat::_internal_set_mismatch_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + mismatch_num_ = value; +} +inline void InterconnectStat::set_mismatch_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_mismatch_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.mismatch_num) +} + +// int64 crc_errors = 11; +inline void InterconnectStat::clear_crc_errors() { + crc_errors_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_crc_errors() const { + return crc_errors_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::crc_errors() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.crc_errors) + return _internal_crc_errors(); +} +inline void InterconnectStat::_internal_set_crc_errors(::PROTOBUF_NAMESPACE_ID::int64 value) { + + crc_errors_ = value; +} +inline void InterconnectStat::set_crc_errors(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_crc_errors(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.crc_errors) +} + +// int64 snd_pkt_num = 12; +inline void InterconnectStat::clear_snd_pkt_num() { + snd_pkt_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_snd_pkt_num() const { + return snd_pkt_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::snd_pkt_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.snd_pkt_num) + return _internal_snd_pkt_num(); +} +inline void InterconnectStat::_internal_set_snd_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + snd_pkt_num_ = value; +} +inline void InterconnectStat::set_snd_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_snd_pkt_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.snd_pkt_num) +} + +// int64 recv_pkt_num = 13; +inline void InterconnectStat::clear_recv_pkt_num() { + recv_pkt_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_recv_pkt_num() const { + return recv_pkt_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::recv_pkt_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.recv_pkt_num) + return _internal_recv_pkt_num(); +} +inline void InterconnectStat::_internal_set_recv_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + recv_pkt_num_ = value; +} +inline void InterconnectStat::set_recv_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_recv_pkt_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.recv_pkt_num) +} + +// int64 disordered_pkt_num = 14; +inline void InterconnectStat::clear_disordered_pkt_num() { + disordered_pkt_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_disordered_pkt_num() const { + return disordered_pkt_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::disordered_pkt_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.disordered_pkt_num) + return _internal_disordered_pkt_num(); +} +inline void InterconnectStat::_internal_set_disordered_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + disordered_pkt_num_ = value; +} +inline void InterconnectStat::set_disordered_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_disordered_pkt_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.disordered_pkt_num) +} + +// int64 duplicated_pkt_num = 15; +inline void InterconnectStat::clear_duplicated_pkt_num() { + duplicated_pkt_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_duplicated_pkt_num() const { + return duplicated_pkt_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::duplicated_pkt_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.duplicated_pkt_num) + return _internal_duplicated_pkt_num(); +} +inline void InterconnectStat::_internal_set_duplicated_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + duplicated_pkt_num_ = value; +} +inline void InterconnectStat::set_duplicated_pkt_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_duplicated_pkt_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.duplicated_pkt_num) +} + +// int64 recv_ack_num = 16; +inline void InterconnectStat::clear_recv_ack_num() { + recv_ack_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_recv_ack_num() const { + return recv_ack_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::recv_ack_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.recv_ack_num) + return _internal_recv_ack_num(); +} +inline void InterconnectStat::_internal_set_recv_ack_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + recv_ack_num_ = value; +} +inline void InterconnectStat::set_recv_ack_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_recv_ack_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.recv_ack_num) +} + +// int64 status_query_msg_num = 17; +inline void InterconnectStat::clear_status_query_msg_num() { + status_query_msg_num_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::_internal_status_query_msg_num() const { + return status_query_msg_num_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 InterconnectStat::status_query_msg_num() const { + // @@protoc_insertion_point(field_get:yagpcc.InterconnectStat.status_query_msg_num) + return _internal_status_query_msg_num(); +} +inline void InterconnectStat::_internal_set_status_query_msg_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + + status_query_msg_num_ = value; +} +inline void InterconnectStat::set_status_query_msg_num(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_status_query_msg_num(value); + // @@protoc_insertion_point(field_set:yagpcc.InterconnectStat.status_query_msg_num) +} + +// ------------------------------------------------------------------- + +// MetricInstrumentation + +// uint64 ntuples = 1; +inline void MetricInstrumentation::clear_ntuples() { + ntuples_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_ntuples() const { + return ntuples_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::ntuples() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.ntuples) + return _internal_ntuples(); +} +inline void MetricInstrumentation::_internal_set_ntuples(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + ntuples_ = value; +} +inline void MetricInstrumentation::set_ntuples(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_ntuples(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.ntuples) +} + +// uint64 nloops = 2; +inline void MetricInstrumentation::clear_nloops() { + nloops_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_nloops() const { + return nloops_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::nloops() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.nloops) + return _internal_nloops(); +} +inline void MetricInstrumentation::_internal_set_nloops(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + nloops_ = value; +} +inline void MetricInstrumentation::set_nloops(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_nloops(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.nloops) +} + +// uint64 tuplecount = 3; +inline void MetricInstrumentation::clear_tuplecount() { + tuplecount_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_tuplecount() const { + return tuplecount_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::tuplecount() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.tuplecount) + return _internal_tuplecount(); +} +inline void MetricInstrumentation::_internal_set_tuplecount(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + tuplecount_ = value; +} +inline void MetricInstrumentation::set_tuplecount(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_tuplecount(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.tuplecount) +} + +// double firsttuple = 4; +inline void MetricInstrumentation::clear_firsttuple() { + firsttuple_ = 0; +} +inline double MetricInstrumentation::_internal_firsttuple() const { + return firsttuple_; +} +inline double MetricInstrumentation::firsttuple() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.firsttuple) + return _internal_firsttuple(); +} +inline void MetricInstrumentation::_internal_set_firsttuple(double value) { + + firsttuple_ = value; +} +inline void MetricInstrumentation::set_firsttuple(double value) { + _internal_set_firsttuple(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.firsttuple) +} + +// double startup = 5; +inline void MetricInstrumentation::clear_startup() { + startup_ = 0; +} +inline double MetricInstrumentation::_internal_startup() const { + return startup_; +} +inline double MetricInstrumentation::startup() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.startup) + return _internal_startup(); +} +inline void MetricInstrumentation::_internal_set_startup(double value) { + + startup_ = value; +} +inline void MetricInstrumentation::set_startup(double value) { + _internal_set_startup(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.startup) +} + +// double total = 6; +inline void MetricInstrumentation::clear_total() { + total_ = 0; +} +inline double MetricInstrumentation::_internal_total() const { + return total_; +} +inline double MetricInstrumentation::total() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.total) + return _internal_total(); +} +inline void MetricInstrumentation::_internal_set_total(double value) { + + total_ = value; +} +inline void MetricInstrumentation::set_total(double value) { + _internal_set_total(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.total) +} + +// uint64 shared_blks_hit = 7; +inline void MetricInstrumentation::clear_shared_blks_hit() { + shared_blks_hit_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_shared_blks_hit() const { + return shared_blks_hit_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::shared_blks_hit() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.shared_blks_hit) + return _internal_shared_blks_hit(); +} +inline void MetricInstrumentation::_internal_set_shared_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + shared_blks_hit_ = value; +} +inline void MetricInstrumentation::set_shared_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_shared_blks_hit(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.shared_blks_hit) +} + +// uint64 shared_blks_read = 8; +inline void MetricInstrumentation::clear_shared_blks_read() { + shared_blks_read_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_shared_blks_read() const { + return shared_blks_read_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::shared_blks_read() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.shared_blks_read) + return _internal_shared_blks_read(); +} +inline void MetricInstrumentation::_internal_set_shared_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + shared_blks_read_ = value; +} +inline void MetricInstrumentation::set_shared_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_shared_blks_read(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.shared_blks_read) +} + +// uint64 shared_blks_dirtied = 9; +inline void MetricInstrumentation::clear_shared_blks_dirtied() { + shared_blks_dirtied_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_shared_blks_dirtied() const { + return shared_blks_dirtied_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::shared_blks_dirtied() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.shared_blks_dirtied) + return _internal_shared_blks_dirtied(); +} +inline void MetricInstrumentation::_internal_set_shared_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + shared_blks_dirtied_ = value; +} +inline void MetricInstrumentation::set_shared_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_shared_blks_dirtied(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.shared_blks_dirtied) +} + +// uint64 shared_blks_written = 10; +inline void MetricInstrumentation::clear_shared_blks_written() { + shared_blks_written_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_shared_blks_written() const { + return shared_blks_written_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::shared_blks_written() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.shared_blks_written) + return _internal_shared_blks_written(); +} +inline void MetricInstrumentation::_internal_set_shared_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + shared_blks_written_ = value; +} +inline void MetricInstrumentation::set_shared_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_shared_blks_written(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.shared_blks_written) +} + +// uint64 local_blks_hit = 11; +inline void MetricInstrumentation::clear_local_blks_hit() { + local_blks_hit_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_local_blks_hit() const { + return local_blks_hit_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::local_blks_hit() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.local_blks_hit) + return _internal_local_blks_hit(); +} +inline void MetricInstrumentation::_internal_set_local_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + local_blks_hit_ = value; +} +inline void MetricInstrumentation::set_local_blks_hit(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_local_blks_hit(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.local_blks_hit) +} + +// uint64 local_blks_read = 12; +inline void MetricInstrumentation::clear_local_blks_read() { + local_blks_read_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_local_blks_read() const { + return local_blks_read_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::local_blks_read() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.local_blks_read) + return _internal_local_blks_read(); +} +inline void MetricInstrumentation::_internal_set_local_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + local_blks_read_ = value; +} +inline void MetricInstrumentation::set_local_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_local_blks_read(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.local_blks_read) +} + +// uint64 local_blks_dirtied = 13; +inline void MetricInstrumentation::clear_local_blks_dirtied() { + local_blks_dirtied_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_local_blks_dirtied() const { + return local_blks_dirtied_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::local_blks_dirtied() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.local_blks_dirtied) + return _internal_local_blks_dirtied(); +} +inline void MetricInstrumentation::_internal_set_local_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + local_blks_dirtied_ = value; +} +inline void MetricInstrumentation::set_local_blks_dirtied(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_local_blks_dirtied(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.local_blks_dirtied) +} + +// uint64 local_blks_written = 14; +inline void MetricInstrumentation::clear_local_blks_written() { + local_blks_written_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_local_blks_written() const { + return local_blks_written_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::local_blks_written() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.local_blks_written) + return _internal_local_blks_written(); +} +inline void MetricInstrumentation::_internal_set_local_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + local_blks_written_ = value; +} +inline void MetricInstrumentation::set_local_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_local_blks_written(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.local_blks_written) +} + +// uint64 temp_blks_read = 15; +inline void MetricInstrumentation::clear_temp_blks_read() { + temp_blks_read_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_temp_blks_read() const { + return temp_blks_read_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::temp_blks_read() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.temp_blks_read) + return _internal_temp_blks_read(); +} +inline void MetricInstrumentation::_internal_set_temp_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + temp_blks_read_ = value; +} +inline void MetricInstrumentation::set_temp_blks_read(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_temp_blks_read(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.temp_blks_read) +} + +// uint64 temp_blks_written = 16; +inline void MetricInstrumentation::clear_temp_blks_written() { + temp_blks_written_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_temp_blks_written() const { + return temp_blks_written_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::temp_blks_written() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.temp_blks_written) + return _internal_temp_blks_written(); +} +inline void MetricInstrumentation::_internal_set_temp_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + temp_blks_written_ = value; +} +inline void MetricInstrumentation::set_temp_blks_written(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_temp_blks_written(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.temp_blks_written) +} + +// double blk_read_time = 17; +inline void MetricInstrumentation::clear_blk_read_time() { + blk_read_time_ = 0; +} +inline double MetricInstrumentation::_internal_blk_read_time() const { + return blk_read_time_; +} +inline double MetricInstrumentation::blk_read_time() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.blk_read_time) + return _internal_blk_read_time(); +} +inline void MetricInstrumentation::_internal_set_blk_read_time(double value) { + + blk_read_time_ = value; +} +inline void MetricInstrumentation::set_blk_read_time(double value) { + _internal_set_blk_read_time(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.blk_read_time) +} + +// double blk_write_time = 18; +inline void MetricInstrumentation::clear_blk_write_time() { + blk_write_time_ = 0; +} +inline double MetricInstrumentation::_internal_blk_write_time() const { + return blk_write_time_; +} +inline double MetricInstrumentation::blk_write_time() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.blk_write_time) + return _internal_blk_write_time(); +} +inline void MetricInstrumentation::_internal_set_blk_write_time(double value) { + + blk_write_time_ = value; +} +inline void MetricInstrumentation::set_blk_write_time(double value) { + _internal_set_blk_write_time(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.blk_write_time) +} + +// .yagpcc.NetworkStat sent = 19; +inline bool MetricInstrumentation::_internal_has_sent() const { + return this != internal_default_instance() && sent_ != nullptr; +} +inline bool MetricInstrumentation::has_sent() const { + return _internal_has_sent(); +} +inline void MetricInstrumentation::clear_sent() { + if (GetArena() == nullptr && sent_ != nullptr) { + delete sent_; + } + sent_ = nullptr; +} +inline const ::yagpcc::NetworkStat& MetricInstrumentation::_internal_sent() const { + const ::yagpcc::NetworkStat* p = sent_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_NetworkStat_default_instance_); +} +inline const ::yagpcc::NetworkStat& MetricInstrumentation::sent() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.sent) + return _internal_sent(); +} +inline void MetricInstrumentation::unsafe_arena_set_allocated_sent( + ::yagpcc::NetworkStat* sent) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(sent_); + } + sent_ = sent; + if (sent) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricInstrumentation.sent) +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::release_sent() { + auto temp = unsafe_arena_release_sent(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::unsafe_arena_release_sent() { + // @@protoc_insertion_point(field_release:yagpcc.MetricInstrumentation.sent) + + ::yagpcc::NetworkStat* temp = sent_; + sent_ = nullptr; + return temp; +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::_internal_mutable_sent() { + + if (sent_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::NetworkStat>(GetArena()); + sent_ = p; + } + return sent_; +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::mutable_sent() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricInstrumentation.sent) + return _internal_mutable_sent(); +} +inline void MetricInstrumentation::set_allocated_sent(::yagpcc::NetworkStat* sent) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete sent_; + } + if (sent) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(sent); + if (message_arena != submessage_arena) { + sent = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, sent, submessage_arena); + } + + } else { + + } + sent_ = sent; + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricInstrumentation.sent) +} + +// .yagpcc.NetworkStat received = 20; +inline bool MetricInstrumentation::_internal_has_received() const { + return this != internal_default_instance() && received_ != nullptr; +} +inline bool MetricInstrumentation::has_received() const { + return _internal_has_received(); +} +inline void MetricInstrumentation::clear_received() { + if (GetArena() == nullptr && received_ != nullptr) { + delete received_; + } + received_ = nullptr; +} +inline const ::yagpcc::NetworkStat& MetricInstrumentation::_internal_received() const { + const ::yagpcc::NetworkStat* p = received_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_NetworkStat_default_instance_); +} +inline const ::yagpcc::NetworkStat& MetricInstrumentation::received() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.received) + return _internal_received(); +} +inline void MetricInstrumentation::unsafe_arena_set_allocated_received( + ::yagpcc::NetworkStat* received) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(received_); + } + received_ = received; + if (received) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricInstrumentation.received) +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::release_received() { + auto temp = unsafe_arena_release_received(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::unsafe_arena_release_received() { + // @@protoc_insertion_point(field_release:yagpcc.MetricInstrumentation.received) + + ::yagpcc::NetworkStat* temp = received_; + received_ = nullptr; + return temp; +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::_internal_mutable_received() { + + if (received_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::NetworkStat>(GetArena()); + received_ = p; + } + return received_; +} +inline ::yagpcc::NetworkStat* MetricInstrumentation::mutable_received() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricInstrumentation.received) + return _internal_mutable_received(); +} +inline void MetricInstrumentation::set_allocated_received(::yagpcc::NetworkStat* received) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete received_; + } + if (received) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(received); + if (message_arena != submessage_arena) { + received = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, received, submessage_arena); + } + + } else { + + } + received_ = received; + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricInstrumentation.received) +} + +// double startup_time = 21; +inline void MetricInstrumentation::clear_startup_time() { + startup_time_ = 0; +} +inline double MetricInstrumentation::_internal_startup_time() const { + return startup_time_; +} +inline double MetricInstrumentation::startup_time() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.startup_time) + return _internal_startup_time(); +} +inline void MetricInstrumentation::_internal_set_startup_time(double value) { + + startup_time_ = value; +} +inline void MetricInstrumentation::set_startup_time(double value) { + _internal_set_startup_time(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.startup_time) +} + +// uint64 inherited_calls = 22; +inline void MetricInstrumentation::clear_inherited_calls() { + inherited_calls_ = PROTOBUF_ULONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::_internal_inherited_calls() const { + return inherited_calls_; +} +inline ::PROTOBUF_NAMESPACE_ID::uint64 MetricInstrumentation::inherited_calls() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.inherited_calls) + return _internal_inherited_calls(); +} +inline void MetricInstrumentation::_internal_set_inherited_calls(::PROTOBUF_NAMESPACE_ID::uint64 value) { + + inherited_calls_ = value; +} +inline void MetricInstrumentation::set_inherited_calls(::PROTOBUF_NAMESPACE_ID::uint64 value) { + _internal_set_inherited_calls(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.inherited_calls) +} + +// double inherited_time = 23; +inline void MetricInstrumentation::clear_inherited_time() { + inherited_time_ = 0; +} +inline double MetricInstrumentation::_internal_inherited_time() const { + return inherited_time_; +} +inline double MetricInstrumentation::inherited_time() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.inherited_time) + return _internal_inherited_time(); +} +inline void MetricInstrumentation::_internal_set_inherited_time(double value) { + + inherited_time_ = value; +} +inline void MetricInstrumentation::set_inherited_time(double value) { + _internal_set_inherited_time(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricInstrumentation.inherited_time) +} + +// .yagpcc.InterconnectStat interconnect = 24; +inline bool MetricInstrumentation::_internal_has_interconnect() const { + return this != internal_default_instance() && interconnect_ != nullptr; +} +inline bool MetricInstrumentation::has_interconnect() const { + return _internal_has_interconnect(); +} +inline void MetricInstrumentation::clear_interconnect() { + if (GetArena() == nullptr && interconnect_ != nullptr) { + delete interconnect_; + } + interconnect_ = nullptr; +} +inline const ::yagpcc::InterconnectStat& MetricInstrumentation::_internal_interconnect() const { + const ::yagpcc::InterconnectStat* p = interconnect_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_InterconnectStat_default_instance_); +} +inline const ::yagpcc::InterconnectStat& MetricInstrumentation::interconnect() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricInstrumentation.interconnect) + return _internal_interconnect(); +} +inline void MetricInstrumentation::unsafe_arena_set_allocated_interconnect( + ::yagpcc::InterconnectStat* interconnect) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(interconnect_); + } + interconnect_ = interconnect; + if (interconnect) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricInstrumentation.interconnect) +} +inline ::yagpcc::InterconnectStat* MetricInstrumentation::release_interconnect() { + auto temp = unsafe_arena_release_interconnect(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::InterconnectStat* MetricInstrumentation::unsafe_arena_release_interconnect() { + // @@protoc_insertion_point(field_release:yagpcc.MetricInstrumentation.interconnect) + + ::yagpcc::InterconnectStat* temp = interconnect_; + interconnect_ = nullptr; + return temp; +} +inline ::yagpcc::InterconnectStat* MetricInstrumentation::_internal_mutable_interconnect() { + + if (interconnect_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::InterconnectStat>(GetArena()); + interconnect_ = p; + } + return interconnect_; +} +inline ::yagpcc::InterconnectStat* MetricInstrumentation::mutable_interconnect() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricInstrumentation.interconnect) + return _internal_mutable_interconnect(); +} +inline void MetricInstrumentation::set_allocated_interconnect(::yagpcc::InterconnectStat* interconnect) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete interconnect_; + } + if (interconnect) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(interconnect); + if (message_arena != submessage_arena) { + interconnect = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, interconnect, submessage_arena); + } + + } else { + + } + interconnect_ = interconnect; + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricInstrumentation.interconnect) +} + +// ------------------------------------------------------------------- + +// SpillInfo + +// int32 fileCount = 1; +inline void SpillInfo::clear_filecount() { + filecount_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 SpillInfo::_internal_filecount() const { + return filecount_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 SpillInfo::filecount() const { + // @@protoc_insertion_point(field_get:yagpcc.SpillInfo.fileCount) + return _internal_filecount(); +} +inline void SpillInfo::_internal_set_filecount(::PROTOBUF_NAMESPACE_ID::int32 value) { + + filecount_ = value; +} +inline void SpillInfo::set_filecount(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_filecount(value); + // @@protoc_insertion_point(field_set:yagpcc.SpillInfo.fileCount) +} + +// int64 totalBytes = 2; +inline void SpillInfo::clear_totalbytes() { + totalbytes_ = PROTOBUF_LONGLONG(0); +} +inline ::PROTOBUF_NAMESPACE_ID::int64 SpillInfo::_internal_totalbytes() const { + return totalbytes_; +} +inline ::PROTOBUF_NAMESPACE_ID::int64 SpillInfo::totalbytes() const { + // @@protoc_insertion_point(field_get:yagpcc.SpillInfo.totalBytes) + return _internal_totalbytes(); +} +inline void SpillInfo::_internal_set_totalbytes(::PROTOBUF_NAMESPACE_ID::int64 value) { + + totalbytes_ = value; +} +inline void SpillInfo::set_totalbytes(::PROTOBUF_NAMESPACE_ID::int64 value) { + _internal_set_totalbytes(value); + // @@protoc_insertion_point(field_set:yagpcc.SpillInfo.totalBytes) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace yagpcc + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::yagpcc::QueryStatus> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::QueryStatus>() { + return ::yagpcc::QueryStatus_descriptor(); +} +template <> struct is_proto_enum< ::yagpcc::PlanNodeStatus> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::PlanNodeStatus>() { + return ::yagpcc::PlanNodeStatus_descriptor(); +} +template <> struct is_proto_enum< ::yagpcc::PlanGenerator> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::PlanGenerator>() { + return ::yagpcc::PlanGenerator_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fmetrics_2eproto diff --git a/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_plan.pb.cpp b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_plan.pb.cpp new file mode 100644 index 00000000000..08af1e2cec7 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_plan.pb.cpp @@ -0,0 +1,2575 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/yagpcc_plan.proto + +#include "protos/yagpcc_plan.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fplan_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MetricMotionInfo_protos_2fyagpcc_5fplan_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fplan_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MetricRelationInfo_protos_2fyagpcc_5fplan_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fplan_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MetricSliceInfo_protos_2fyagpcc_5fplan_2eproto; +namespace yagpcc { +class MetricPlanDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _MetricPlan_default_instance_; +class MetricMotionInfoDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _MetricMotionInfo_default_instance_; +class MetricRelationInfoDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _MetricRelationInfo_default_instance_; +class MetricSliceInfoDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _MetricSliceInfo_default_instance_; +} // namespace yagpcc +static void InitDefaultsscc_info_MetricMotionInfo_protos_2fyagpcc_5fplan_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_MetricMotionInfo_default_instance_; + new (ptr) ::yagpcc::MetricMotionInfo(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::MetricMotionInfo::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MetricMotionInfo_protos_2fyagpcc_5fplan_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MetricMotionInfo_protos_2fyagpcc_5fplan_2eproto}, {}}; + +static void InitDefaultsscc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_MetricPlan_default_instance_; + new (ptr) ::yagpcc::MetricPlan(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::MetricPlan::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 3, 0, InitDefaultsscc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto}, { + &scc_info_MetricMotionInfo_protos_2fyagpcc_5fplan_2eproto.base, + &scc_info_MetricRelationInfo_protos_2fyagpcc_5fplan_2eproto.base, + &scc_info_MetricSliceInfo_protos_2fyagpcc_5fplan_2eproto.base,}}; + +static void InitDefaultsscc_info_MetricRelationInfo_protos_2fyagpcc_5fplan_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_MetricRelationInfo_default_instance_; + new (ptr) ::yagpcc::MetricRelationInfo(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::MetricRelationInfo::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MetricRelationInfo_protos_2fyagpcc_5fplan_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MetricRelationInfo_protos_2fyagpcc_5fplan_2eproto}, {}}; + +static void InitDefaultsscc_info_MetricSliceInfo_protos_2fyagpcc_5fplan_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_MetricSliceInfo_default_instance_; + new (ptr) ::yagpcc::MetricSliceInfo(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::MetricSliceInfo::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MetricSliceInfo_protos_2fyagpcc_5fplan_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MetricSliceInfo_protos_2fyagpcc_5fplan_2eproto}, {}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_protos_2fyagpcc_5fplan_2eproto[4]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_protos_2fyagpcc_5fplan_2eproto[5]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_protos_2fyagpcc_5fplan_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_protos_2fyagpcc_5fplan_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, type_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, plan_node_id_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, parent_plan_node_id_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, startup_cost_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, total_cost_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, plan_rows_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, plan_width_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, arg1_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, arg2_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, motion_info_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, relation_info_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, scan_index_name_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, scan_direction_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, slice_info_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricPlan, statement_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricMotionInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricMotionInfo, type_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricMotionInfo, isbroadcast_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricMotionInfo, locustype_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricMotionInfo, sliceid_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricMotionInfo, parentsliceid_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricRelationInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricRelationInfo, oid_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricRelationInfo, name_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricRelationInfo, schema_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricRelationInfo, alias_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricRelationInfo, dynamicscanid_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricSliceInfo, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricSliceInfo, slice_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricSliceInfo, segments_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricSliceInfo, gangtype_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricSliceInfo, gang_), +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::yagpcc::MetricPlan)}, + { 20, -1, sizeof(::yagpcc::MetricMotionInfo)}, + { 30, -1, sizeof(::yagpcc::MetricRelationInfo)}, + { 40, -1, sizeof(::yagpcc::MetricSliceInfo)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::yagpcc::_MetricPlan_default_instance_), + reinterpret_cast(&::yagpcc::_MetricMotionInfo_default_instance_), + reinterpret_cast(&::yagpcc::_MetricRelationInfo_default_instance_), + reinterpret_cast(&::yagpcc::_MetricSliceInfo_default_instance_), +}; + +const char descriptor_table_protodef_protos_2fyagpcc_5fplan_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\030protos/yagpcc_plan.proto\022\006yagpcc\"\272\003\n\nM" + "etricPlan\022\"\n\004type\030\001 \001(\0162\024.yagpcc.GpdbNod" + "eType\022\024\n\014plan_node_id\030\002 \001(\005\022\033\n\023parent_pl" + "an_node_id\030\003 \001(\005\022\024\n\014startup_cost\030\004 \001(\001\022\022" + "\n\ntotal_cost\030\005 \001(\001\022\021\n\tplan_rows\030\006 \001(\001\022\022\n" + "\nplan_width\030\007 \001(\005\022\014\n\004arg1\030\010 \001(\005\022\014\n\004arg2\030" + "\t \001(\005\022-\n\013motion_info\030\n \001(\0132\030.yagpcc.Metr" + "icMotionInfo\0221\n\rrelation_info\030\013 \001(\0132\032.ya" + "gpcc.MetricRelationInfo\022\027\n\017scan_index_na" + "me\030\014 \001(\t\022-\n\016scan_direction\030\r \001(\0162\025.yagpc" + "c.ScanDirection\022+\n\nslice_info\030\016 \001(\0132\027.ya" + "gpcc.MetricSliceInfo\022\021\n\tstatement\030\017 \001(\t\"" + "\232\001\n\020MetricMotionInfo\022 \n\004type\030\001 \001(\0162\022.yag" + "pcc.MotionType\022\023\n\013isBroadcast\030\002 \001(\010\022\'\n\tl" + "ocusType\030\003 \001(\0162\024.yagpcc.CdbLocusType\022\017\n\007" + "sliceId\030\004 \001(\005\022\025\n\rparentSliceId\030\005 \001(\005\"e\n\022" + "MetricRelationInfo\022\013\n\003oid\030\001 \001(\005\022\014\n\004name\030" + "\002 \001(\t\022\016\n\006schema\030\003 \001(\t\022\r\n\005alias\030\004 \001(\t\022\025\n\r" + "dynamicScanId\030\005 \001(\005\"d\n\017MetricSliceInfo\022\r" + "\n\005slice\030\001 \001(\005\022\020\n\010segments\030\002 \001(\005\022\"\n\010gangT" + "ype\030\003 \001(\0162\020.yagpcc.GangType\022\014\n\004gang\030\004 \001(" + "\005*h\n\rScanDirection\022\036\n\032SCAN_DIRECTION_UNS" + "PECIFIED\020\000\022\033\n\027SCAN_DIRECTION_BACKWARD\020\001\022" + "\032\n\026SCAN_DIRECTION_FORWARD\020\002*\272\001\n\010GangType" + "\022\031\n\025GANG_TYPE_UNSPECIFIED\020\000\022\031\n\025GANG_TYPE" + "_UNALLOCATED\020\001\022\034\n\030GANG_TYPE_ENTRYDB_READ" + "ER\020\002\022\036\n\032GANG_TYPE_SINGLETON_READER\020\003\022\034\n\030" + "GANG_TYPE_PRIMARY_READER\020\004\022\034\n\030GANG_TYPE_" + "PRIMARY_WRITER\020\005*\261\002\n\014CdbLocusType\022\036\n\032CDB" + "_LOCUS_TYPE_UNSPECIFIED\020\000\022\030\n\024CDB_LOCUS_T" + "YPE_ENTRY\020\001\022\034\n\030CDB_LOCUS_TYPE_SINGLE_QE\020" + "\002\022\032\n\026CDB_LOCUS_TYPE_GENERAL\020\003\022\"\n\036CDB_LOC" + "US_TYPE_SEGMENT_GENERAL\020\004\022\035\n\031CDB_LOCUS_T" + "YPE_REPLICATED\020\005\022\031\n\025CDB_LOCUS_TYPE_HASHE" + "D\020\006\022\034\n\030CDB_LOCUS_TYPE_HASHED_OJ\020\007\022\031\n\025CDB" + "_LOCUS_TYPE_STREWN\020\010\022\026\n\022CDB_LOCUS_TYPE_E" + "ND\020\t*p\n\nMotionType\022\033\n\027MOTION_TYPE_UNSPEC" + "IFIED\020\000\022\024\n\020MOTION_TYPE_HASH\020\001\022\025\n\021MOTION_" + "TYPE_FIXED\020\002\022\030\n\024MOTION_TYPE_EXPLICIT\020\003*\244" + "M\n\014GpdbNodeType\022\036\n\032GPDB_NODE_TYPE_UNSPEC" + "IFIED\020\000\022\016\n\nINDEX_INFO\020\001\022\020\n\014EXPR_CONTEXT\020" + "\002\022\023\n\017PROJECTION_INFO\020\003\022\017\n\013JUNK_FILTER\020\004\022" + "\023\n\017RESULT_REL_INFO\020\005\022\013\n\007E_STATE\020\006\022\024\n\020TUP" + "LE_TABLE_SLOT\020\007\022\017\n\013CDB_PROCESS\020\010\022\t\n\005SLIC" + "E\020\t\022\017\n\013SLICE_TABLE\020\n\022\023\n\017CURSOR_POS_INFO\020" + "\013\022\024\n\020SHARE_NODE_ENTRY\020\014\022\023\n\017PARTITION_STA" + "TE\020\r\022\027\n\023QUERY_DISPATCH_DESC\020\016\022\022\n\016OID_ASS" + "IGNMENT\020\017\022\010\n\004PLAN\020\020\022\010\n\004SCAN\020\021\022\010\n\004JOIN\020\022\022" + "\n\n\006RESULT\020\023\022\020\n\014MODIFY_TABLE\020\024\022\n\n\006APPEND\020" + "\025\022\020\n\014MERGE_APPEND\020\026\022\023\n\017RECURSIVE_UNION\020\027" + "\022\014\n\010SEQUENCE\020\030\022\016\n\nBITMAP_AND\020\031\022\r\n\tBITMAP" + "_OR\020\032\022\014\n\010SEQ_SCAN\020\033\022\024\n\020DYNAMIC_SEQ_SCAN\020" + "\034\022\021\n\rEXTERNAL_SCAN\020\035\022\016\n\nINDEX_SCAN\020\036\022\026\n\022" + "DYNAMIC_INDEX_SCAN\020\037\022\023\n\017INDEX_ONLY_SCAN\020" + " \022\025\n\021BITMAP_INDEX_SCAN\020!\022\035\n\031DYNAMIC_BITM" + "AP_INDEX_SCAN\020\"\022\024\n\020BITMAP_HEAP_SCAN\020#\022\034\n" + "\030DYNAMIC_BITMAP_HEAP_SCAN\020$\022\014\n\010TID_SCAN\020" + "%\022\021\n\rSUBQUERY_SCAN\020&\022\021\n\rFUNCTION_SCAN\020\'\022" + "\027\n\023TABLE_FUNCTION_SCAN\020(\022\017\n\013VALUES_SCAN\020" + ")\022\014\n\010CTE_SCAN\020*\022\023\n\017WORK_TABLE_SCAN\020+\022\020\n\014" + "FOREIGN_SCAN\020,\022\r\n\tNEST_LOOP\020-\022\016\n\nMERGE_J" + "OIN\020.\022\r\n\tHASH_JOIN\020/\022\014\n\010MATERIAL\0200\022\010\n\004SO" + "RT\0201\022\007\n\003AGG\0202\022\016\n\nWINDOW_AGG\0203\022\n\n\006UNIQUE\020" + "4\022\010\n\004HASH\0205\022\n\n\006SET_OP\0206\022\r\n\tLOCK_ROWS\0207\022\t" + "\n\005LIMIT\0208\022\n\n\006MOTION\0209\022\024\n\020SHARE_INPUT_SCA" + "N\020:\022\n\n\006REPEAT\020;\022\007\n\003DML\020<\022\020\n\014SPLIT_UPDATE" + "\020=\022\017\n\013ROW_TRIGGER\020>\022\r\n\tASSERT_OP\020\?\022\026\n\022PA" + "RTITION_SELECTOR\020@\022\014\n\010PLAN_END\020A\022\023\n\017NEST" + "_LOOP_PARAM\020B\022\021\n\rPLAN_ROW_MARK\020C\022\023\n\017PLAN" + "_INVAL_ITEM\020D\022\016\n\nPLAN_STATE\020E\022\016\n\nSCAN_ST" + "ATE\020F\022\016\n\nJOIN_STATE\020G\022\020\n\014RESULT_STATE\020H\022" + "\026\n\022MODIFY_TABLE_STATE\020I\022\020\n\014APPEND_STATE\020" + "J\022\026\n\022MERGE_APPEND_STATE\020K\022\031\n\025RECURSIVE_U" + "NION_STATE\020L\022\022\n\016SEQUENCE_STATE\020M\022\024\n\020BITM" + "AP_AND_STATE\020N\022\023\n\017BITMAP_OR_STATE\020O\022\022\n\016S" + "EQ_SCAN_STATE\020P\022\032\n\026DYNAMIC_SEQ_SCAN_STAT" + "E\020Q\022\027\n\023EXTERNAL_SCAN_STATE\020R\022\024\n\020INDEX_SC" + "AN_STATE\020S\022\034\n\030DYNAMIC_INDEX_SCAN_STATE\020T" + "\022\031\n\025INDEX_ONLY_SCAN_STATE\020U\022\033\n\027BITMAP_IN" + "DEX_SCAN_STATE\020V\022#\n\037DYNAMIC_BITMAP_INDEX" + "_SCAN_STATE\020W\022\032\n\026BITMAP_HEAP_SCAN_STATE\020" + "X\022\"\n\036DYNAMIC_BITMAP_HEAP_SCAN_STATE\020Y\022\022\n" + "\016TID_SCAN_STATE\020Z\022\027\n\023SUBQUERY_SCAN_STATE" + "\020[\022\027\n\023FUNCTION_SCAN_STATE\020\\\022\030\n\024TABLE_FUN" + "CTION_STATE\020]\022\025\n\021VALUES_SCAN_STATE\020^\022\022\n\016" + "CTE_SCAN_STATE\020_\022\031\n\025WORK_TABLE_SCAN_STAT" + "E\020`\022\026\n\022FOREIGN_SCAN_STATE\020a\022\023\n\017NEST_LOOP" + "_STATE\020b\022\024\n\020MERGE_JOIN_STATE\020c\022\023\n\017HASH_J" + "OIN_STATE\020d\022\022\n\016MATERIAL_STATE\020e\022\016\n\nSORT_" + "STATE\020f\022\r\n\tAGG_STATE\020g\022\024\n\020WINDOW_AGG_STA" + "TE\020h\022\020\n\014UNIQUE_STATE\020i\022\016\n\nHASH_STATE\020j\022\020" + "\n\014SET_OP_STATE\020k\022\023\n\017LOCK_ROWS_STATE\020l\022\017\n" + "\013LIMIT_STATE\020m\022\020\n\014MOTION_STATE\020n\022\032\n\026SHAR" + "E_INPUT_SCAN_STATE\020o\022\020\n\014REPEAT_STATE\020p\022\r" + "\n\tDML_STATE\020q\022\026\n\022SPLIT_UPDATE_STATE\020r\022\025\n" + "\021ROW_TRIGGER_STATE\020s\022\023\n\017ASSERT_OP_STATE\020" + "t\022\034\n\030PARTITION_SELECTOR_STATE\020u\022\023\n\017TUPLE" + "_DESC_NODE\020v\022 \n\034SERIALIZED_PARAM_EXTERN_" + "DATA\020w\022\t\n\005ALIAS\020x\022\r\n\tRANGE_VAR\020y\022\010\n\004EXPR" + "\020z\022\007\n\003VAR\020{\022\t\n\005CONST\020|\022\t\n\005PARAM\020}\022\n\n\006AGG" + "REF\020~\022\017\n\013WINDOW_FUNC\020\177\022\016\n\tARRAY_REF\020\200\001\022\016" + "\n\tFUNC_EXPR\020\201\001\022\023\n\016NAMED_ARG_EXPR\020\202\001\022\014\n\007O" + "P_EXPR\020\203\001\022\022\n\rDISTINCT_EXPR\020\204\001\022\021\n\014NULL_IF" + "_EXPR\020\205\001\022\031\n\024SCALAR_ARRAY_OP_EXPR\020\206\001\022\016\n\tB" + "OOL_EXPR\020\207\001\022\r\n\010SUB_LINK\020\210\001\022\r\n\010SUB_PLAN\020\211" + "\001\022\031\n\024ALTERNATIVE_SUB_PLAN\020\212\001\022\021\n\014FIELD_SE" + "LECT\020\213\001\022\020\n\013FIELD_STORE\020\214\001\022\021\n\014RELABEL_TYP" + "E\020\215\001\022\022\n\rCOERCE_VIA_IO\020\216\001\022\026\n\021ARRAY_COERCE" + "_EXPR\020\217\001\022\031\n\024CONVERT_ROWTYPE_EXPR\020\220\001\022\021\n\014C" + "OLLATE_EXPR\020\221\001\022\016\n\tCASE_EXPR\020\222\001\022\016\n\tCASE_W" + "HEN\020\223\001\022\023\n\016CASE_TEST_EXPR\020\224\001\022\017\n\nARRAY_EXP" + "R\020\225\001\022\r\n\010ROW_EXPR\020\226\001\022\025\n\020ROW_COMPARE_EXPR\020" + "\227\001\022\022\n\rCOALESCE_EXPR\020\230\001\022\021\n\014MIN_MAX_EXPR\020\231" + "\001\022\r\n\010XML_EXPR\020\232\001\022\016\n\tNULL_TEST\020\233\001\022\021\n\014BOOL" + "EAN_TEST\020\234\001\022\025\n\020COERCE_TO_DOMAIN\020\235\001\022\034\n\027CO" + "ERCE_TO_DOMAIN_VALUES\020\236\001\022\023\n\016SET_TO_DEFAU" + "LT\020\237\001\022\024\n\017CURRENT_OF_EXPR\020\240\001\022\021\n\014TARGET_EN" + "TRY\020\241\001\022\022\n\rRANGE_TBL_REF\020\242\001\022\016\n\tJOIN_EXPR\020" + "\243\001\022\016\n\tFROM_EXPR\020\244\001\022\020\n\013INTO_CLAUSE\020\245\001\022\025\n\020" + "COPY_INTO_CLAUSE\020\246\001\022\023\n\016REFRESH_CLAUSE\020\247\001" + "\022\t\n\004FLOW\020\250\001\022\r\n\010GROUPING\020\251\001\022\r\n\010GROUP_ID\020\252" + "\001\022\023\n\016DISTRIBUTED_BY\020\253\001\022\024\n\017DML_ACTION_EXP" + "R\020\254\001\022\027\n\022PART_SELECTED_EXPR\020\255\001\022\026\n\021PART_DE" + "FAULT_EXPR\020\256\001\022\024\n\017PART_BOUND_EXPR\020\257\001\022\036\n\031P" + "ART_BOUND_INCLUSION_EXPR\020\260\001\022\031\n\024PART_BOUN" + "D_OPEN_EXPR\020\261\001\022\030\n\023PART_LIST_RULE_EXPR\020\262\001" + "\022\035\n\030PART_LIST_NULL_TEST_EXPR\020\263\001\022\023\n\016TABLE" + "_OID_INFO\020\264\001\022\017\n\nEXPR_STATE\020\265\001\022\027\n\022GENERIC" + "_EXPR_STATE\020\266\001\022\035\n\030WHOLE_ROW_VAR_EXPR_STA" + "TE\020\267\001\022\026\n\021AGGREF_EXPR_STATE\020\270\001\022\033\n\026WINDOW_" + "FUNC_EXPR_STATE\020\271\001\022\031\n\024ARRAY_REF_EXPR_STA" + "TE\020\272\001\022\024\n\017FUNC_EXPR_STATE\020\273\001\022\037\n\032SCALAR_AR" + "RAY_OP_EXPR_STATE\020\274\001\022\024\n\017BOOL_EXPR_STATE\020" + "\275\001\022\023\n\016SUB_PLAN_STATE\020\276\001\022\037\n\032ALTERNATIVE_S" + "UB_PLAN_STATE\020\277\001\022\027\n\022FIELD_SELECT_STATE\020\300" + "\001\022\026\n\021FIELD_STORE_STATE\020\301\001\022\030\n\023COERCE_VIA_" + "IO_STATE\020\302\001\022\034\n\027ARRAY_COERCE_EXPR_STATE\020\303" + "\001\022\037\n\032CONVERT_ROWTYPE_EXPR_STATE\020\304\001\022\024\n\017CA" + "SE_EXPR_STATE\020\305\001\022\024\n\017CASE_WHEN_STATE\020\306\001\022\025" + "\n\020ARRAY_EXPR_STATE\020\307\001\022\023\n\016ROW_EXPR_STATE\020" + "\310\001\022\033\n\026ROW_COMPARE_EXPR_STATE\020\311\001\022\030\n\023COALE" + "SCE_EXPR_STATE\020\312\001\022\027\n\022MIN_MAX_EXPR_STATE\020" + "\313\001\022\023\n\016XML_EXPR_STATE\020\314\001\022\024\n\017NULL_TEST_STA" + "TE\020\315\001\022\033\n\026COERCE_TO_DOMAIN_STATE\020\316\001\022\034\n\027DO" + "MAIN_CONSTRAINT_STATE\020\317\001\022\035\n\030GROUPING_FUN" + "C_EXPR_STATE\020\320\001\022\035\n\030PART_SELECTED_EXPR_ST" + "ATE\020\321\001\022\034\n\027PART_DEFAULT_EXPR_STATE\020\322\001\022\032\n\025" + "PART_BOUND_EXPR_STATE\020\323\001\022$\n\037PART_BOUND_I" + "NCLUSION_EXPR_STATE\020\324\001\022\037\n\032PART_BOUND_OPE" + "N_EXPR_STATE\020\325\001\022\036\n\031PART_LIST_RULE_EXPR_S" + "TATE\020\326\001\022#\n\036PART_LIST_NULL_TEST_EXPR_STAT" + "E\020\327\001\022\021\n\014PLANNER_INFO\020\330\001\022\023\n\016PLANNER_GLOBA" + "L\020\331\001\022\021\n\014REL_OPT_INFO\020\332\001\022\023\n\016INDEX_OPT_INF" + "O\020\333\001\022\024\n\017PARAM_PATH_INFO\020\334\001\022\t\n\004PATH\020\335\001\022\025\n" + "\020APPEND_ONLY_PATH\020\336\001\022\016\n\tAOCS_PATH\020\337\001\022\022\n\r" + "EXTERNAL_PATH\020\340\001\022\017\n\nINDEX_PATH\020\341\001\022\025\n\020BIT" + "MAP_HEAP_PATH\020\342\001\022\024\n\017BITMAP_AND_PATH\020\343\001\022\023" + "\n\016BITMAP_OR_PATH\020\344\001\022\016\n\tNEST_PATH\020\345\001\022\017\n\nM" + "ERGE_PATH\020\346\001\022\016\n\tHASH_PATH\020\347\001\022\r\n\010TID_PATH" + "\020\350\001\022\021\n\014FOREIGN_PATH\020\351\001\022\020\n\013APPEND_PATH\020\352\001" + "\022\026\n\021MERGE_APPEND_PATH\020\353\001\022\020\n\013RESULT_PATH\020" + "\354\001\022\022\n\rMATERIAL_PATH\020\355\001\022\020\n\013UNIQUE_PATH\020\356\001" + "\022\024\n\017PROJECTION_PATH\020\357\001\022\026\n\021EQUIVALENCE_CL" + "ASS\020\360\001\022\027\n\022EQUIVALENCE_MEMBER\020\361\001\022\r\n\010PATH_" + "KEY\020\362\001\022\022\n\rRESTRICT_INFO\020\363\001\022\025\n\020PLACE_HOLD" + "ER_VAR\020\364\001\022\026\n\021SPECIAL_JOIN_INFO\020\365\001\022\026\n\021LAT" + "ERAL_JOIN_INFO\020\366\001\022\024\n\017APPEND_REL_INFO\020\367\001\022" + "\026\n\021PLACE_HOLDER_INFO\020\370\001\022\025\n\020MIN_MAX_AGG_I" + "NFO\020\371\001\022\016\n\tPARTITION\020\372\001\022\023\n\016PARTITION_RULE" + "\020\373\001\022\023\n\016PARTITION_NODE\020\374\001\022\021\n\014PG_PART_RULE" + "\020\375\001\022\025\n\020SEGFILE_MAP_NODE\020\376\001\022\027\n\022PLANNER_PA" + "RAM_ITEM\020\377\001\022\024\n\017CDB_MOTION_PATH\020\200\002\022\034\n\027PAR" + "TITION_SELECTOR_PATH\020\201\002\022\030\n\023CDB_REL_COLUM" + "N_INFO\020\202\002\022\025\n\020DISTRIBUTION_KEY\020\203\002\022\023\n\016MEMO" + "RY_CONTEXT\020\204\002\022\026\n\021ALLOC_SET_CONTEXT\020\205\002\022\023\n" + "\016MEMORY_ACCOUNT\020\206\002\022\n\n\005VALUE\020\207\002\022\014\n\007INTEGE" + "R\020\210\002\022\n\n\005FLOAT\020\211\002\022\013\n\006STRING\020\212\002\022\017\n\nBIT_STR" + "ING\020\213\002\022\017\n\nNULL_VALUE\020\214\002\022\t\n\004LIST\020\215\002\022\r\n\010IN" + "T_LIST\020\216\002\022\r\n\010OID_LIST\020\217\002\022\n\n\005QUERY\020\220\002\022\021\n\014" + "PLANNED_STMT\020\221\002\022\020\n\013INSERT_STMT\020\222\002\022\020\n\013DEL" + "ETE_STMT\020\223\002\022\020\n\013UPDATE_STMT\020\224\002\022\020\n\013SELECT_" + "STMT\020\225\002\022\025\n\020ALTER_TABLE_STMT\020\226\002\022\024\n\017ALTER_" + "TABLE_CMD\020\227\002\022\026\n\021ALTER_DOMAIN_STMT\020\230\002\022\027\n\022" + "SET_OPERATION_STMT\020\231\002\022\017\n\nGRANT_STMT\020\232\002\022\024" + "\n\017GRANT_ROLE_STMT\020\233\002\022\"\n\035ALTER_DEFAULT_PR" + "IVILEGES_STMT\020\234\002\022\026\n\021CLOSE_PORTAL_STMT\020\235\002" + "\022\021\n\014CLUSTER_STMT\020\236\002\022\016\n\tCOPY_STMT\020\237\002\022\020\n\013C" + "REATE_STMT\020\240\002\022\032\n\025SINGLE_ROW_ERROR_DESC\020\241" + "\002\022\030\n\023EXT_TABLE_TYPE_DESC\020\242\002\022\031\n\024CREATE_EX" + "TERNAL_STMT\020\243\002\022\020\n\013DEFINE_STMT\020\244\002\022\016\n\tDROP" + "_STMT\020\245\002\022\022\n\rTRUNCATE_STMT\020\246\002\022\021\n\014COMMENT_" + "STMT\020\247\002\022\017\n\nFETCH_STMT\020\250\002\022\017\n\nINDEX_STMT\020\251" + "\002\022\031\n\024CREATE_FUNCTION_STMT\020\252\002\022\030\n\023ALTER_FU" + "NCTION_STMT\020\253\002\022\014\n\007DO_STMT\020\254\002\022\020\n\013RENAME_S" + "TMT\020\255\002\022\016\n\tRULE_STMT\020\256\002\022\020\n\013NOTIFY_STMT\020\257\002" + "\022\020\n\013LISTEN_STMT\020\260\002\022\022\n\rUNLISTEN_STMT\020\261\002\022\025" + "\n\020TRANSACTION_STMT\020\262\002\022\016\n\tVIEW_STMT\020\263\002\022\016\n" + "\tLOAD_STMT\020\264\002\022\027\n\022CREATE_DOMAIN_STMT\020\265\002\022\022" + "\n\rCREATEDB_STMT\020\266\002\022\020\n\013DROPDB_STMT\020\267\002\022\020\n\013" + "VACUUM_STMT\020\270\002\022\021\n\014EXPLAIN_STMT\020\271\002\022\031\n\024CRE" + "ATE_TABLE_AS_STMT\020\272\002\022\024\n\017CREATE_SEQ_STMT\020" + "\273\002\022\023\n\016ALTER_SEQ_STMT\020\274\002\022\026\n\021VARIABLE_SET_" + "STMT\020\275\002\022\027\n\022VARIABLE_SHOW_STMT\020\276\002\022\021\n\014DISC" + "ARD_STMT\020\277\002\022\025\n\020CREATE_TRIG_STMT\020\300\002\022\027\n\022CR" + "EATE_P_LANG_STMT\020\301\002\022\025\n\020CREATE_ROLE_STMT\020" + "\302\002\022\024\n\017ALTER_ROLE_STMT\020\303\002\022\023\n\016DROP_ROLE_ST" + "MT\020\304\002\022\026\n\021CREATE_QUEUE_STMT\020\305\002\022\025\n\020ALTER_Q" + "UEUE_STMT\020\306\002\022\024\n\017DROP_QUEUE_STMT\020\307\002\022\037\n\032CR" + "EATE_RESOURCE_GROUP_STMT\020\310\002\022\035\n\030DROP_RESO" + "URCE_GROUP_STMT\020\311\002\022\036\n\031ALTER_RESOURCE_GRO" + "UP_STMT\020\312\002\022\016\n\tLOCK_STMT\020\313\002\022\031\n\024CONSTRAINT" + "S_SET_STMT\020\314\002\022\021\n\014REINDEX_STMT\020\315\002\022\025\n\020CHEC" + "K_POINT_STMT\020\316\002\022\027\n\022CREATE_SCHEMA_STMT\020\317\002" + "\022\030\n\023ALTER_DATABASE_STMT\020\320\002\022\034\n\027ALTER_DATA" + "BASE_SET_STMT\020\321\002\022\030\n\023ALTER_ROLE_SET_STMT\020" + "\322\002\022\033\n\026CREATE_CONVERSION_STMT\020\323\002\022\025\n\020CREAT" + "E_CAST_STMT\020\324\002\022\031\n\024CREATE_OP_CLASS_STMT\020\325" + "\002\022\032\n\025CREATE_OP_FAMILY_STMT\020\326\002\022\031\n\024ALTER_O" + "P_FAMILY_STMT\020\327\002\022\021\n\014PREPARE_STMT\020\330\002\022\021\n\014E" + "XECUTE_STMT\020\331\002\022\024\n\017DEALLOCATE_STMT\020\332\002\022\030\n\023" + "DECLARE_CURSOR_STMT\020\333\002\022\034\n\027CREATE_TABLE_S" + "PACE_STMT\020\334\002\022\032\n\025DROP_TABLE_SPACE_STMT\020\335\002" + "\022\035\n\030ALTER_OBJECT_SCHEMA_STMT\020\336\002\022\025\n\020ALTER" + "_OWNER_STMT\020\337\002\022\024\n\017DROP_OWNED_STMT\020\340\002\022\030\n\023" + "REASSIGN_OWNED_STMT\020\341\002\022\030\n\023COMPOSITE_TYPE" + "_STMT\020\342\002\022\025\n\020CREATE_ENUM_STMT\020\343\002\022\026\n\021CREAT" + "E_RANGE_STMT\020\344\002\022\024\n\017ALTER_ENUM_STMT\020\345\002\022\035\n" + "\030ALTER_TS_DICTIONARY_STMT\020\346\002\022 \n\033ALTER_TS" + "_CONFIGURATION_STMT\020\347\002\022\024\n\017CREATE_FDW_STM" + "T\020\350\002\022\023\n\016ALTER_FDW_STMT\020\351\002\022\037\n\032CREATE_FORE" + "IGN_SERVER_STMT\020\352\002\022\036\n\031ALTER_FOREIGN_SERV" + "ER_STMT\020\353\002\022\035\n\030CREATE_USER_MAPPING_STMT\020\354" + "\002\022\034\n\027ALTER_USER_MAPPING_STMT\020\355\002\022\033\n\026DROP_" + "USER_MAPPING_STMT\020\356\002\022#\n\036ALTER_TABLE_SPAC" + "E_OPTIONS_STMT\020\357\002\022\036\n\031ALTER_TABLE_MOVE_AL" + "L_STMT\020\360\002\022\023\n\016SEC_LABEL_STMT\020\361\002\022\036\n\031CREATE" + "_FOREIGN_TABLE_STMT\020\362\002\022\032\n\025CREATE_EXTENSI" + "ON_STMT\020\363\002\022\031\n\024ALTER_EXTENSION_STMT\020\364\002\022\"\n" + "\035ALTER_EXTENSION_CONTENTS_STMT\020\365\002\022\033\n\026CRE" + "ATE_EVENT_TRIG_STMT\020\366\002\022\032\n\025ALTER_EVENT_TR" + "IG_STMT\020\367\002\022\032\n\025REFRESH_MAT_VIEW_STMT\020\370\002\022\032" + "\n\025REPLICA_IDENTITY_STMT\020\371\002\022\026\n\021ALTER_SYST" + "EM_STMT\020\372\002\022\021\n\014PARTITION_BY\020\373\002\022\023\n\016PARTITI" + "ON_ELEM\020\374\002\022\031\n\024PARTITION_RANGE_ITEM\020\375\002\022\031\n" + "\024PARTITION_BOUND_SPEC\020\376\002\022\023\n\016PARTITION_SP" + "EC\020\377\002\022\032\n\025PARTITION_VALUES_SPEC\020\200\003\022\027\n\022ALT" + "ER_PARTITION_ID\020\201\003\022\030\n\023ALTER_PARTITION_CM" + "D\020\202\003\022\032\n\025INHERIT_PARTITION_CMD\020\203\003\022\033\n\026CREA" + "TE_FILE_SPACE_STMT\020\204\003\022\025\n\020FILE_SPACE_ENTR" + "Y\020\205\003\022\031\n\024DROP_FILE_SPACE_STMT\020\206\003\022\025\n\020TABLE" + "_VALUE_EXPR\020\207\003\022\030\n\023DENY_LOGIN_INTERVAL\020\210\003" + "\022\025\n\020DENY_LOGIN_POINT\020\211\003\022\024\n\017ALTER_TYPE_ST" + "MT\020\212\003\022\031\n\024SET_DISTRIBUTION_CMD\020\213\003\022\025\n\020EXPA" + "ND_STMT_SPEC\020\214\003\022\013\n\006A_EXPR\020\215\003\022\017\n\nCOLUMN_R" + "EF\020\216\003\022\016\n\tPARAM_REF\020\217\003\022\014\n\007A_CONST\020\220\003\022\016\n\tF" + "UNC_CALL\020\221\003\022\013\n\006A_STAR\020\222\003\022\016\n\tA_INDICES\020\223\003" + "\022\022\n\rA_INDIRECTION\020\224\003\022\021\n\014A_ARRAY_EXPR\020\225\003\022" + "\017\n\nRES_TARGET\020\226\003\022\016\n\tTYPE_CAST\020\227\003\022\023\n\016COLL" + "ATE_CLAUSE\020\230\003\022\014\n\007SORT_BY\020\231\003\022\017\n\nWINDOW_DE" + "F\020\232\003\022\024\n\017RANGE_SUBSELECT\020\233\003\022\023\n\016RANGE_FUNC" + "TION\020\234\003\022\016\n\tTYPE_NAME\020\235\003\022\017\n\nCOLUMN_DEF\020\236\003" + "\022\017\n\nINDEX_ELEM\020\237\003\022\017\n\nCONSTRAINT\020\240\003\022\r\n\010DE" + "F_ELEM\020\241\003\022\024\n\017RANGE_TBL_ENTRY\020\242\003\022\027\n\022RANGE" + "_TBL_FUNCTION\020\243\003\022\026\n\021WITH_CHECK_OPTION\020\244\003" + "\022\024\n\017GROUPING_CLAUSE\020\245\003\022\022\n\rGROUPING_FUNC\020" + "\246\003\022\026\n\021SORT_GROUP_CLAUSE\020\247\003\022\022\n\rWINDOW_CLA" + "USE\020\250\003\022\021\n\014PRIV_GRANTEE\020\251\003\022\023\n\016FUNC_WITH_A" + "RGS\020\252\003\022\020\n\013ACCESS_PRIV\020\253\003\022\031\n\024CREATE_OP_CL" + "ASS_ITEM\020\254\003\022\026\n\021TABLE_LIKE_CLAUSE\020\255\003\022\027\n\022F" + "UNCTION_PARAMETER\020\256\003\022\023\n\016LOCKING_CLAUSE\020\257" + "\003\022\024\n\017ROW_MARK_CLAUSE\020\260\003\022\022\n\rXML_SERIALIZE" + "\020\261\003\022\020\n\013WITH_CLAUSE\020\262\003\022\026\n\021COMMON_TABLE_EX" + "PR\020\263\003\022\'\n\"COLUMN_REFERENCE_STORAGE_DIRECT" + "IVE\020\264\003\022\030\n\023IDENTIFY_SYSTEM_CMD\020\265\003\022\024\n\017BASE" + "_BACKUP_CMD\020\266\003\022 \n\033CREATE_REPLICATION_SLO" + "T_CMD\020\267\003\022\036\n\031DROP_REPLICATION_SLOT_CMD\020\270\003" + "\022\032\n\025START_REPLICATION_CMD\020\271\003\022\032\n\025TIME_LIN" + "E_HISTORY_CMD\020\272\003\022\021\n\014TRIGGER_DATA\020\273\003\022\027\n\022E" + "VENT_TRIGGER_DATA\020\274\003\022\024\n\017RETURN_SET_INFO\020" + "\275\003\022\027\n\022WINDOW_OBJECT_DATA\020\276\003\022\017\n\nTID_BITMA" + "P\020\277\003\022\026\n\021INLINE_CODE_BLOCK\020\300\003\022\020\n\013FDW_ROUT" + "INE\020\301\003\022\022\n\rSTREAM_BITMAP\020\302\003\022\023\n\016FORMATTER_" + "DATA\020\303\003\022\026\n\021EXT_PROTOCOL_DATA\020\304\003\022 \n\033EXT_P" + "ROTOCOL_VALIDATOR_DATA\020\305\003\022\023\n\016SELECTED_PA" + "RTS\020\306\003\022\026\n\021COOKED_CONSTRAINT\020\307\003\022\031\n\024CDB_EX" + "PLAIN_STAT_HDR\020\310\003\022\016\n\tGP_POLICY\020\311\003\022\022\n\rRET" + "RIEVE_STMT\020\312\003BNB\016SegmentYAGPCCPZ(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_protos_2fyagpcc_5fplan_2eproto)), true); +namespace yagpcc { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ScanDirection_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fplan_2eproto[0]; +} +bool ScanDirection_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GangType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fplan_2eproto[1]; +} +bool GangType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CdbLocusType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fplan_2eproto[2]; +} +bool CdbLocusType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MotionType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fplan_2eproto[3]; +} +bool MotionType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + return true; + default: + return false; + } +} + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GpdbNodeType_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fplan_2eproto[4]; +} +bool GpdbNodeType_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + case 19: + case 20: + case 21: + case 22: + case 23: + case 24: + case 25: + case 26: + case 27: + case 28: + case 29: + case 30: + case 31: + case 32: + case 33: + case 34: + case 35: + case 36: + case 37: + case 38: + case 39: + case 40: + case 41: + case 42: + case 43: + case 44: + case 45: + case 46: + case 47: + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + case 58: + case 59: + case 60: + case 61: + case 62: + case 63: + case 64: + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + case 91: + case 92: + case 93: + case 94: + case 95: + case 96: + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + case 123: + case 124: + case 125: + case 126: + case 127: + case 128: + case 129: + case 130: + case 131: + case 132: + case 133: + case 134: + case 135: + case 136: + case 137: + case 138: + case 139: + case 140: + case 141: + case 142: + case 143: + case 144: + case 145: + case 146: + case 147: + case 148: + case 149: + case 150: + case 151: + case 152: + case 153: + case 154: + case 155: + case 156: + case 157: + case 158: + case 159: + case 160: + case 161: + case 162: + case 163: + case 164: + case 165: + case 166: + case 167: + case 168: + case 169: + case 170: + case 171: + case 172: + case 173: + case 174: + case 175: + case 176: + case 177: + case 178: + case 179: + case 180: + case 181: + case 182: + case 183: + case 184: + case 185: + case 186: + case 187: + case 188: + case 189: + case 190: + case 191: + case 192: + case 193: + case 194: + case 195: + case 196: + case 197: + case 198: + case 199: + case 200: + case 201: + case 202: + case 203: + case 204: + case 205: + case 206: + case 207: + case 208: + case 209: + case 210: + case 211: + case 212: + case 213: + case 214: + case 215: + case 216: + case 217: + case 218: + case 219: + case 220: + case 221: + case 222: + case 223: + case 224: + case 225: + case 226: + case 227: + case 228: + case 229: + case 230: + case 231: + case 232: + case 233: + case 234: + case 235: + case 236: + case 237: + case 238: + case 239: + case 240: + case 241: + case 242: + case 243: + case 244: + case 245: + case 246: + case 247: + case 248: + case 249: + case 250: + case 251: + case 252: + case 253: + case 254: + case 255: + case 256: + case 257: + case 258: + case 259: + case 260: + case 261: + case 262: + case 263: + case 264: + case 265: + case 266: + case 267: + case 268: + case 269: + case 270: + case 271: + case 272: + case 273: + case 274: + case 275: + case 276: + case 277: + case 278: + case 279: + case 280: + case 281: + case 282: + case 283: + case 284: + case 285: + case 286: + case 287: + case 288: + case 289: + case 290: + case 291: + case 292: + case 293: + case 294: + case 295: + case 296: + case 297: + case 298: + case 299: + case 300: + case 301: + case 302: + case 303: + case 304: + case 305: + case 306: + case 307: + case 308: + case 309: + case 310: + case 311: + case 312: + case 313: + case 314: + case 315: + case 316: + case 317: + case 318: + case 319: + case 320: + case 321: + case 322: + case 323: + case 324: + case 325: + case 326: + case 327: + case 328: + case 329: + case 330: + case 331: + case 332: + case 333: + case 334: + case 335: + case 336: + case 337: + case 338: + case 339: + case 340: + case 341: + case 342: + case 343: + case 344: + case 345: + case 346: + case 347: + case 348: + case 349: + case 350: + case 351: + case 352: + case 353: + case 354: + case 355: + case 356: + case 357: + case 358: + case 359: + case 360: + case 361: + case 362: + case 363: + case 364: + case 365: + case 366: + case 367: + case 368: + case 369: + case 370: + case 371: + case 372: + case 373: + case 374: + case 375: + case 376: + case 377: + case 378: + case 379: + case 380: + case 381: + case 382: + case 383: + case 384: + case 385: + case 386: + case 387: + case 388: + case 389: + case 390: + case 391: + case 392: + case 393: + case 394: + case 395: + case 396: + case 397: + case 398: + case 399: + case 400: + case 401: + case 402: + case 403: + case 404: + case 405: + case 406: + case 407: + case 408: + case 409: + case 410: + case 411: + case 412: + case 413: + case 414: + case 415: + case 416: + case 417: + case 418: + case 419: + case 420: + case 421: + case 422: + case 423: + case 424: + case 425: + case 426: + case 427: + case 428: + case 429: + case 430: + case 431: + case 432: + case 433: + case 434: + case 435: + case 436: + case 437: + case 438: + case 439: + case 440: + case 441: + case 442: + case 443: + case 444: + case 445: + case 446: + case 447: + case 448: + case 449: + case 450: + case 451: + case 452: + case 453: + case 454: + case 455: + case 456: + case 457: + case 458: + return true; + default: + return false; + } +} + + +// =================================================================== + +void MetricPlan::InitAsDefaultInstance() { + ::yagpcc::_MetricPlan_default_instance_._instance.get_mutable()->motion_info_ = const_cast< ::yagpcc::MetricMotionInfo*>( + ::yagpcc::MetricMotionInfo::internal_default_instance()); + ::yagpcc::_MetricPlan_default_instance_._instance.get_mutable()->relation_info_ = const_cast< ::yagpcc::MetricRelationInfo*>( + ::yagpcc::MetricRelationInfo::internal_default_instance()); + ::yagpcc::_MetricPlan_default_instance_._instance.get_mutable()->slice_info_ = const_cast< ::yagpcc::MetricSliceInfo*>( + ::yagpcc::MetricSliceInfo::internal_default_instance()); +} +class MetricPlan::_Internal { + public: + static const ::yagpcc::MetricMotionInfo& motion_info(const MetricPlan* msg); + static const ::yagpcc::MetricRelationInfo& relation_info(const MetricPlan* msg); + static const ::yagpcc::MetricSliceInfo& slice_info(const MetricPlan* msg); +}; + +const ::yagpcc::MetricMotionInfo& +MetricPlan::_Internal::motion_info(const MetricPlan* msg) { + return *msg->motion_info_; +} +const ::yagpcc::MetricRelationInfo& +MetricPlan::_Internal::relation_info(const MetricPlan* msg) { + return *msg->relation_info_; +} +const ::yagpcc::MetricSliceInfo& +MetricPlan::_Internal::slice_info(const MetricPlan* msg) { + return *msg->slice_info_; +} +MetricPlan::MetricPlan(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.MetricPlan) +} +MetricPlan::MetricPlan(const MetricPlan& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + scan_index_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_scan_index_name().empty()) { + scan_index_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_scan_index_name(), + GetArena()); + } + statement_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_statement().empty()) { + statement_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_statement(), + GetArena()); + } + if (from._internal_has_motion_info()) { + motion_info_ = new ::yagpcc::MetricMotionInfo(*from.motion_info_); + } else { + motion_info_ = nullptr; + } + if (from._internal_has_relation_info()) { + relation_info_ = new ::yagpcc::MetricRelationInfo(*from.relation_info_); + } else { + relation_info_ = nullptr; + } + if (from._internal_has_slice_info()) { + slice_info_ = new ::yagpcc::MetricSliceInfo(*from.slice_info_); + } else { + slice_info_ = nullptr; + } + ::memcpy(&type_, &from.type_, + static_cast(reinterpret_cast(&scan_direction_) - + reinterpret_cast(&type_)) + sizeof(scan_direction_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.MetricPlan) +} + +void MetricPlan::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto.base); + scan_index_name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + statement_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&motion_info_, 0, static_cast( + reinterpret_cast(&scan_direction_) - + reinterpret_cast(&motion_info_)) + sizeof(scan_direction_)); +} + +MetricPlan::~MetricPlan() { + // @@protoc_insertion_point(destructor:yagpcc.MetricPlan) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void MetricPlan::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + scan_index_name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + statement_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (this != internal_default_instance()) delete motion_info_; + if (this != internal_default_instance()) delete relation_info_; + if (this != internal_default_instance()) delete slice_info_; +} + +void MetricPlan::ArenaDtor(void* object) { + MetricPlan* _this = reinterpret_cast< MetricPlan* >(object); + (void)_this; +} +void MetricPlan::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void MetricPlan::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const MetricPlan& MetricPlan::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto.base); + return *internal_default_instance(); +} + + +void MetricPlan::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.MetricPlan) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + scan_index_name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + statement_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + if (GetArena() == nullptr && motion_info_ != nullptr) { + delete motion_info_; + } + motion_info_ = nullptr; + if (GetArena() == nullptr && relation_info_ != nullptr) { + delete relation_info_; + } + relation_info_ = nullptr; + if (GetArena() == nullptr && slice_info_ != nullptr) { + delete slice_info_; + } + slice_info_ = nullptr; + ::memset(&type_, 0, static_cast( + reinterpret_cast(&scan_direction_) - + reinterpret_cast(&type_)) + sizeof(scan_direction_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MetricPlan::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .yagpcc.GpdbNodeType type = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_type(static_cast<::yagpcc::GpdbNodeType>(val)); + } else goto handle_unusual; + continue; + // int32 plan_node_id = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + plan_node_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 parent_plan_node_id = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + parent_plan_node_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // double startup_cost = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 33)) { + startup_cost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // double total_cost = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 41)) { + total_cost_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // double plan_rows = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 49)) { + plan_rows_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad(ptr); + ptr += sizeof(double); + } else goto handle_unusual; + continue; + // int32 plan_width = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 56)) { + plan_width_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 arg1 = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 64)) { + arg1_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 arg2 = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 72)) { + arg2_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.MetricMotionInfo motion_info = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + ptr = ctx->ParseMessage(_internal_mutable_motion_info(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.MetricRelationInfo relation_info = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + ptr = ctx->ParseMessage(_internal_mutable_relation_info(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string scan_index_name = 12; + case 12: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 98)) { + auto str = _internal_mutable_scan_index_name(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.MetricPlan.scan_index_name")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.ScanDirection scan_direction = 13; + case 13: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 104)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_scan_direction(static_cast<::yagpcc::ScanDirection>(val)); + } else goto handle_unusual; + continue; + // .yagpcc.MetricSliceInfo slice_info = 14; + case 14: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 114)) { + ptr = ctx->ParseMessage(_internal_mutable_slice_info(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string statement = 15; + case 15: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 122)) { + auto str = _internal_mutable_statement(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.MetricPlan.statement")); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* MetricPlan::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.MetricPlan) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .yagpcc.GpdbNodeType type = 1; + if (this->type() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); + } + + // int32 plan_node_id = 2; + if (this->plan_node_id() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_plan_node_id(), target); + } + + // int32 parent_plan_node_id = 3; + if (this->parent_plan_node_id() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(3, this->_internal_parent_plan_node_id(), target); + } + + // double startup_cost = 4; + if (!(this->startup_cost() <= 0 && this->startup_cost() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(4, this->_internal_startup_cost(), target); + } + + // double total_cost = 5; + if (!(this->total_cost() <= 0 && this->total_cost() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(5, this->_internal_total_cost(), target); + } + + // double plan_rows = 6; + if (!(this->plan_rows() <= 0 && this->plan_rows() >= 0)) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteDoubleToArray(6, this->_internal_plan_rows(), target); + } + + // int32 plan_width = 7; + if (this->plan_width() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(7, this->_internal_plan_width(), target); + } + + // int32 arg1 = 8; + if (this->arg1() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(8, this->_internal_arg1(), target); + } + + // int32 arg2 = 9; + if (this->arg2() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(9, this->_internal_arg2(), target); + } + + // .yagpcc.MetricMotionInfo motion_info = 10; + if (this->has_motion_info()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 10, _Internal::motion_info(this), target, stream); + } + + // .yagpcc.MetricRelationInfo relation_info = 11; + if (this->has_relation_info()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 11, _Internal::relation_info(this), target, stream); + } + + // string scan_index_name = 12; + if (this->scan_index_name().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_scan_index_name().data(), static_cast(this->_internal_scan_index_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.MetricPlan.scan_index_name"); + target = stream->WriteStringMaybeAliased( + 12, this->_internal_scan_index_name(), target); + } + + // .yagpcc.ScanDirection scan_direction = 13; + if (this->scan_direction() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 13, this->_internal_scan_direction(), target); + } + + // .yagpcc.MetricSliceInfo slice_info = 14; + if (this->has_slice_info()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 14, _Internal::slice_info(this), target, stream); + } + + // string statement = 15; + if (this->statement().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_statement().data(), static_cast(this->_internal_statement().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.MetricPlan.statement"); + target = stream->WriteStringMaybeAliased( + 15, this->_internal_statement(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.MetricPlan) + return target; +} + +size_t MetricPlan::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.MetricPlan) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string scan_index_name = 12; + if (this->scan_index_name().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_scan_index_name()); + } + + // string statement = 15; + if (this->statement().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_statement()); + } + + // .yagpcc.MetricMotionInfo motion_info = 10; + if (this->has_motion_info()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *motion_info_); + } + + // .yagpcc.MetricRelationInfo relation_info = 11; + if (this->has_relation_info()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *relation_info_); + } + + // .yagpcc.MetricSliceInfo slice_info = 14; + if (this->has_slice_info()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *slice_info_); + } + + // .yagpcc.GpdbNodeType type = 1; + if (this->type() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); + } + + // int32 plan_node_id = 2; + if (this->plan_node_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_plan_node_id()); + } + + // double startup_cost = 4; + if (!(this->startup_cost() <= 0 && this->startup_cost() >= 0)) { + total_size += 1 + 8; + } + + // double total_cost = 5; + if (!(this->total_cost() <= 0 && this->total_cost() >= 0)) { + total_size += 1 + 8; + } + + // int32 parent_plan_node_id = 3; + if (this->parent_plan_node_id() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_parent_plan_node_id()); + } + + // int32 plan_width = 7; + if (this->plan_width() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_plan_width()); + } + + // double plan_rows = 6; + if (!(this->plan_rows() <= 0 && this->plan_rows() >= 0)) { + total_size += 1 + 8; + } + + // int32 arg1 = 8; + if (this->arg1() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_arg1()); + } + + // int32 arg2 = 9; + if (this->arg2() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_arg2()); + } + + // .yagpcc.ScanDirection scan_direction = 13; + if (this->scan_direction() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_scan_direction()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MetricPlan::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.MetricPlan) + GOOGLE_DCHECK_NE(&from, this); + const MetricPlan* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.MetricPlan) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.MetricPlan) + MergeFrom(*source); + } +} + +void MetricPlan::MergeFrom(const MetricPlan& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.MetricPlan) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.scan_index_name().size() > 0) { + _internal_set_scan_index_name(from._internal_scan_index_name()); + } + if (from.statement().size() > 0) { + _internal_set_statement(from._internal_statement()); + } + if (from.has_motion_info()) { + _internal_mutable_motion_info()->::yagpcc::MetricMotionInfo::MergeFrom(from._internal_motion_info()); + } + if (from.has_relation_info()) { + _internal_mutable_relation_info()->::yagpcc::MetricRelationInfo::MergeFrom(from._internal_relation_info()); + } + if (from.has_slice_info()) { + _internal_mutable_slice_info()->::yagpcc::MetricSliceInfo::MergeFrom(from._internal_slice_info()); + } + if (from.type() != 0) { + _internal_set_type(from._internal_type()); + } + if (from.plan_node_id() != 0) { + _internal_set_plan_node_id(from._internal_plan_node_id()); + } + if (!(from.startup_cost() <= 0 && from.startup_cost() >= 0)) { + _internal_set_startup_cost(from._internal_startup_cost()); + } + if (!(from.total_cost() <= 0 && from.total_cost() >= 0)) { + _internal_set_total_cost(from._internal_total_cost()); + } + if (from.parent_plan_node_id() != 0) { + _internal_set_parent_plan_node_id(from._internal_parent_plan_node_id()); + } + if (from.plan_width() != 0) { + _internal_set_plan_width(from._internal_plan_width()); + } + if (!(from.plan_rows() <= 0 && from.plan_rows() >= 0)) { + _internal_set_plan_rows(from._internal_plan_rows()); + } + if (from.arg1() != 0) { + _internal_set_arg1(from._internal_arg1()); + } + if (from.arg2() != 0) { + _internal_set_arg2(from._internal_arg2()); + } + if (from.scan_direction() != 0) { + _internal_set_scan_direction(from._internal_scan_direction()); + } +} + +void MetricPlan::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.MetricPlan) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MetricPlan::CopyFrom(const MetricPlan& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.MetricPlan) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MetricPlan::IsInitialized() const { + return true; +} + +void MetricPlan::InternalSwap(MetricPlan* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + scan_index_name_.Swap(&other->scan_index_name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + statement_.Swap(&other->statement_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(MetricPlan, scan_direction_) + + sizeof(MetricPlan::scan_direction_) + - PROTOBUF_FIELD_OFFSET(MetricPlan, motion_info_)>( + reinterpret_cast(&motion_info_), + reinterpret_cast(&other->motion_info_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MetricPlan::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void MetricMotionInfo::InitAsDefaultInstance() { +} +class MetricMotionInfo::_Internal { + public: +}; + +MetricMotionInfo::MetricMotionInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.MetricMotionInfo) +} +MetricMotionInfo::MetricMotionInfo(const MetricMotionInfo& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&type_, &from.type_, + static_cast(reinterpret_cast(&parentsliceid_) - + reinterpret_cast(&type_)) + sizeof(parentsliceid_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.MetricMotionInfo) +} + +void MetricMotionInfo::SharedCtor() { + ::memset(&type_, 0, static_cast( + reinterpret_cast(&parentsliceid_) - + reinterpret_cast(&type_)) + sizeof(parentsliceid_)); +} + +MetricMotionInfo::~MetricMotionInfo() { + // @@protoc_insertion_point(destructor:yagpcc.MetricMotionInfo) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void MetricMotionInfo::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void MetricMotionInfo::ArenaDtor(void* object) { + MetricMotionInfo* _this = reinterpret_cast< MetricMotionInfo* >(object); + (void)_this; +} +void MetricMotionInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void MetricMotionInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const MetricMotionInfo& MetricMotionInfo::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MetricMotionInfo_protos_2fyagpcc_5fplan_2eproto.base); + return *internal_default_instance(); +} + + +void MetricMotionInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.MetricMotionInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&type_, 0, static_cast( + reinterpret_cast(&parentsliceid_) - + reinterpret_cast(&type_)) + sizeof(parentsliceid_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MetricMotionInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .yagpcc.MotionType type = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_type(static_cast<::yagpcc::MotionType>(val)); + } else goto handle_unusual; + continue; + // bool isBroadcast = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + isbroadcast_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.CdbLocusType locusType = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_locustype(static_cast<::yagpcc::CdbLocusType>(val)); + } else goto handle_unusual; + continue; + // int32 sliceId = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + sliceid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 parentSliceId = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + parentsliceid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* MetricMotionInfo::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.MetricMotionInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .yagpcc.MotionType type = 1; + if (this->type() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_type(), target); + } + + // bool isBroadcast = 2; + if (this->isbroadcast() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteBoolToArray(2, this->_internal_isbroadcast(), target); + } + + // .yagpcc.CdbLocusType locusType = 3; + if (this->locustype() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 3, this->_internal_locustype(), target); + } + + // int32 sliceId = 4; + if (this->sliceid() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_sliceid(), target); + } + + // int32 parentSliceId = 5; + if (this->parentsliceid() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_parentsliceid(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.MetricMotionInfo) + return target; +} + +size_t MetricMotionInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.MetricMotionInfo) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .yagpcc.MotionType type = 1; + if (this->type() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_type()); + } + + // bool isBroadcast = 2; + if (this->isbroadcast() != 0) { + total_size += 1 + 1; + } + + // .yagpcc.CdbLocusType locusType = 3; + if (this->locustype() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_locustype()); + } + + // int32 sliceId = 4; + if (this->sliceid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_sliceid()); + } + + // int32 parentSliceId = 5; + if (this->parentsliceid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_parentsliceid()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MetricMotionInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.MetricMotionInfo) + GOOGLE_DCHECK_NE(&from, this); + const MetricMotionInfo* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.MetricMotionInfo) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.MetricMotionInfo) + MergeFrom(*source); + } +} + +void MetricMotionInfo::MergeFrom(const MetricMotionInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.MetricMotionInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.type() != 0) { + _internal_set_type(from._internal_type()); + } + if (from.isbroadcast() != 0) { + _internal_set_isbroadcast(from._internal_isbroadcast()); + } + if (from.locustype() != 0) { + _internal_set_locustype(from._internal_locustype()); + } + if (from.sliceid() != 0) { + _internal_set_sliceid(from._internal_sliceid()); + } + if (from.parentsliceid() != 0) { + _internal_set_parentsliceid(from._internal_parentsliceid()); + } +} + +void MetricMotionInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.MetricMotionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MetricMotionInfo::CopyFrom(const MetricMotionInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.MetricMotionInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MetricMotionInfo::IsInitialized() const { + return true; +} + +void MetricMotionInfo::InternalSwap(MetricMotionInfo* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(MetricMotionInfo, parentsliceid_) + + sizeof(MetricMotionInfo::parentsliceid_) + - PROTOBUF_FIELD_OFFSET(MetricMotionInfo, type_)>( + reinterpret_cast(&type_), + reinterpret_cast(&other->type_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MetricMotionInfo::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void MetricRelationInfo::InitAsDefaultInstance() { +} +class MetricRelationInfo::_Internal { + public: +}; + +MetricRelationInfo::MetricRelationInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.MetricRelationInfo) +} +MetricRelationInfo::MetricRelationInfo(const MetricRelationInfo& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_name().empty()) { + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_name(), + GetArena()); + } + schema_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_schema().empty()) { + schema_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_schema(), + GetArena()); + } + alias_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_alias().empty()) { + alias_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_alias(), + GetArena()); + } + ::memcpy(&oid_, &from.oid_, + static_cast(reinterpret_cast(&dynamicscanid_) - + reinterpret_cast(&oid_)) + sizeof(dynamicscanid_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.MetricRelationInfo) +} + +void MetricRelationInfo::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MetricRelationInfo_protos_2fyagpcc_5fplan_2eproto.base); + name_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + schema_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + alias_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + ::memset(&oid_, 0, static_cast( + reinterpret_cast(&dynamicscanid_) - + reinterpret_cast(&oid_)) + sizeof(dynamicscanid_)); +} + +MetricRelationInfo::~MetricRelationInfo() { + // @@protoc_insertion_point(destructor:yagpcc.MetricRelationInfo) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void MetricRelationInfo::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + name_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + schema_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + alias_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void MetricRelationInfo::ArenaDtor(void* object) { + MetricRelationInfo* _this = reinterpret_cast< MetricRelationInfo* >(object); + (void)_this; +} +void MetricRelationInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void MetricRelationInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const MetricRelationInfo& MetricRelationInfo::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MetricRelationInfo_protos_2fyagpcc_5fplan_2eproto.base); + return *internal_default_instance(); +} + + +void MetricRelationInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.MetricRelationInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + schema_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + alias_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::memset(&oid_, 0, static_cast( + reinterpret_cast(&dynamicscanid_) - + reinterpret_cast(&oid_)) + sizeof(dynamicscanid_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MetricRelationInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // int32 oid = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + oid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string name = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + auto str = _internal_mutable_name(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.MetricRelationInfo.name")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string schema = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + auto str = _internal_mutable_schema(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.MetricRelationInfo.schema")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // string alias = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + auto str = _internal_mutable_alias(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.MetricRelationInfo.alias")); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 dynamicScanId = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 40)) { + dynamicscanid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* MetricRelationInfo::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.MetricRelationInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 oid = 1; + if (this->oid() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_oid(), target); + } + + // string name = 2; + if (this->name().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_name().data(), static_cast(this->_internal_name().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.MetricRelationInfo.name"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_name(), target); + } + + // string schema = 3; + if (this->schema().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_schema().data(), static_cast(this->_internal_schema().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.MetricRelationInfo.schema"); + target = stream->WriteStringMaybeAliased( + 3, this->_internal_schema(), target); + } + + // string alias = 4; + if (this->alias().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_alias().data(), static_cast(this->_internal_alias().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.MetricRelationInfo.alias"); + target = stream->WriteStringMaybeAliased( + 4, this->_internal_alias(), target); + } + + // int32 dynamicScanId = 5; + if (this->dynamicscanid() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(5, this->_internal_dynamicscanid(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.MetricRelationInfo) + return target; +} + +size_t MetricRelationInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.MetricRelationInfo) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string name = 2; + if (this->name().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_name()); + } + + // string schema = 3; + if (this->schema().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_schema()); + } + + // string alias = 4; + if (this->alias().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_alias()); + } + + // int32 oid = 1; + if (this->oid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_oid()); + } + + // int32 dynamicScanId = 5; + if (this->dynamicscanid() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_dynamicscanid()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MetricRelationInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.MetricRelationInfo) + GOOGLE_DCHECK_NE(&from, this); + const MetricRelationInfo* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.MetricRelationInfo) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.MetricRelationInfo) + MergeFrom(*source); + } +} + +void MetricRelationInfo::MergeFrom(const MetricRelationInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.MetricRelationInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.name().size() > 0) { + _internal_set_name(from._internal_name()); + } + if (from.schema().size() > 0) { + _internal_set_schema(from._internal_schema()); + } + if (from.alias().size() > 0) { + _internal_set_alias(from._internal_alias()); + } + if (from.oid() != 0) { + _internal_set_oid(from._internal_oid()); + } + if (from.dynamicscanid() != 0) { + _internal_set_dynamicscanid(from._internal_dynamicscanid()); + } +} + +void MetricRelationInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.MetricRelationInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MetricRelationInfo::CopyFrom(const MetricRelationInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.MetricRelationInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MetricRelationInfo::IsInitialized() const { + return true; +} + +void MetricRelationInfo::InternalSwap(MetricRelationInfo* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + name_.Swap(&other->name_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + schema_.Swap(&other->schema_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + alias_.Swap(&other->alias_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(MetricRelationInfo, dynamicscanid_) + + sizeof(MetricRelationInfo::dynamicscanid_) + - PROTOBUF_FIELD_OFFSET(MetricRelationInfo, oid_)>( + reinterpret_cast(&oid_), + reinterpret_cast(&other->oid_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MetricRelationInfo::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void MetricSliceInfo::InitAsDefaultInstance() { +} +class MetricSliceInfo::_Internal { + public: +}; + +MetricSliceInfo::MetricSliceInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.MetricSliceInfo) +} +MetricSliceInfo::MetricSliceInfo(const MetricSliceInfo& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::memcpy(&slice_, &from.slice_, + static_cast(reinterpret_cast(&gang_) - + reinterpret_cast(&slice_)) + sizeof(gang_)); + // @@protoc_insertion_point(copy_constructor:yagpcc.MetricSliceInfo) +} + +void MetricSliceInfo::SharedCtor() { + ::memset(&slice_, 0, static_cast( + reinterpret_cast(&gang_) - + reinterpret_cast(&slice_)) + sizeof(gang_)); +} + +MetricSliceInfo::~MetricSliceInfo() { + // @@protoc_insertion_point(destructor:yagpcc.MetricSliceInfo) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void MetricSliceInfo::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); +} + +void MetricSliceInfo::ArenaDtor(void* object) { + MetricSliceInfo* _this = reinterpret_cast< MetricSliceInfo* >(object); + (void)_this; +} +void MetricSliceInfo::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void MetricSliceInfo::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const MetricSliceInfo& MetricSliceInfo::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MetricSliceInfo_protos_2fyagpcc_5fplan_2eproto.base); + return *internal_default_instance(); +} + + +void MetricSliceInfo::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.MetricSliceInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + ::memset(&slice_, 0, static_cast( + reinterpret_cast(&gang_) - + reinterpret_cast(&slice_)) + sizeof(gang_)); + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MetricSliceInfo::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // int32 slice = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + slice_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // int32 segments = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 16)) { + segments_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.GangType gangType = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 24)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_gangtype(static_cast<::yagpcc::GangType>(val)); + } else goto handle_unusual; + continue; + // int32 gang = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 32)) { + gang_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* MetricSliceInfo::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.MetricSliceInfo) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // int32 slice = 1; + if (this->slice() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(1, this->_internal_slice(), target); + } + + // int32 segments = 2; + if (this->segments() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(2, this->_internal_segments(), target); + } + + // .yagpcc.GangType gangType = 3; + if (this->gangtype() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 3, this->_internal_gangtype(), target); + } + + // int32 gang = 4; + if (this->gang() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteInt32ToArray(4, this->_internal_gang(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.MetricSliceInfo) + return target; +} + +size_t MetricSliceInfo::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.MetricSliceInfo) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // int32 slice = 1; + if (this->slice() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_slice()); + } + + // int32 segments = 2; + if (this->segments() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_segments()); + } + + // .yagpcc.GangType gangType = 3; + if (this->gangtype() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_gangtype()); + } + + // int32 gang = 4; + if (this->gang() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::Int32Size( + this->_internal_gang()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MetricSliceInfo::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.MetricSliceInfo) + GOOGLE_DCHECK_NE(&from, this); + const MetricSliceInfo* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.MetricSliceInfo) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.MetricSliceInfo) + MergeFrom(*source); + } +} + +void MetricSliceInfo::MergeFrom(const MetricSliceInfo& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.MetricSliceInfo) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.slice() != 0) { + _internal_set_slice(from._internal_slice()); + } + if (from.segments() != 0) { + _internal_set_segments(from._internal_segments()); + } + if (from.gangtype() != 0) { + _internal_set_gangtype(from._internal_gangtype()); + } + if (from.gang() != 0) { + _internal_set_gang(from._internal_gang()); + } +} + +void MetricSliceInfo::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.MetricSliceInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MetricSliceInfo::CopyFrom(const MetricSliceInfo& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.MetricSliceInfo) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MetricSliceInfo::IsInitialized() const { + return true; +} + +void MetricSliceInfo::InternalSwap(MetricSliceInfo* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(MetricSliceInfo, gang_) + + sizeof(MetricSliceInfo::gang_) + - PROTOBUF_FIELD_OFFSET(MetricSliceInfo, slice_)>( + reinterpret_cast(&slice_), + reinterpret_cast(&other->slice_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MetricSliceInfo::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace yagpcc +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::yagpcc::MetricPlan* Arena::CreateMaybeMessage< ::yagpcc::MetricPlan >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::MetricPlan >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::MetricMotionInfo* Arena::CreateMaybeMessage< ::yagpcc::MetricMotionInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::MetricMotionInfo >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::MetricRelationInfo* Arena::CreateMaybeMessage< ::yagpcc::MetricRelationInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::MetricRelationInfo >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::MetricSliceInfo* Arena::CreateMaybeMessage< ::yagpcc::MetricSliceInfo >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::MetricSliceInfo >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_plan.pb.h b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_plan.pb.h new file mode 100644 index 00000000000..bf93e43140c --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_plan.pb.h @@ -0,0 +1,2745 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/yagpcc_plan.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fplan_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fplan_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3012000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fplan_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_protos_2fyagpcc_5fplan_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_protos_2fyagpcc_5fplan_2eproto; +namespace yagpcc { +class MetricMotionInfo; +class MetricMotionInfoDefaultTypeInternal; +extern MetricMotionInfoDefaultTypeInternal _MetricMotionInfo_default_instance_; +class MetricPlan; +class MetricPlanDefaultTypeInternal; +extern MetricPlanDefaultTypeInternal _MetricPlan_default_instance_; +class MetricRelationInfo; +class MetricRelationInfoDefaultTypeInternal; +extern MetricRelationInfoDefaultTypeInternal _MetricRelationInfo_default_instance_; +class MetricSliceInfo; +class MetricSliceInfoDefaultTypeInternal; +extern MetricSliceInfoDefaultTypeInternal _MetricSliceInfo_default_instance_; +} // namespace yagpcc +PROTOBUF_NAMESPACE_OPEN +template<> ::yagpcc::MetricMotionInfo* Arena::CreateMaybeMessage<::yagpcc::MetricMotionInfo>(Arena*); +template<> ::yagpcc::MetricPlan* Arena::CreateMaybeMessage<::yagpcc::MetricPlan>(Arena*); +template<> ::yagpcc::MetricRelationInfo* Arena::CreateMaybeMessage<::yagpcc::MetricRelationInfo>(Arena*); +template<> ::yagpcc::MetricSliceInfo* Arena::CreateMaybeMessage<::yagpcc::MetricSliceInfo>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace yagpcc { + +enum ScanDirection : int { + SCAN_DIRECTION_UNSPECIFIED = 0, + SCAN_DIRECTION_BACKWARD = 1, + SCAN_DIRECTION_FORWARD = 2, + ScanDirection_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + ScanDirection_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool ScanDirection_IsValid(int value); +constexpr ScanDirection ScanDirection_MIN = SCAN_DIRECTION_UNSPECIFIED; +constexpr ScanDirection ScanDirection_MAX = SCAN_DIRECTION_FORWARD; +constexpr int ScanDirection_ARRAYSIZE = ScanDirection_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* ScanDirection_descriptor(); +template +inline const std::string& ScanDirection_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function ScanDirection_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + ScanDirection_descriptor(), enum_t_value); +} +inline bool ScanDirection_Parse( + const std::string& name, ScanDirection* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + ScanDirection_descriptor(), name, value); +} +enum GangType : int { + GANG_TYPE_UNSPECIFIED = 0, + GANG_TYPE_UNALLOCATED = 1, + GANG_TYPE_ENTRYDB_READER = 2, + GANG_TYPE_SINGLETON_READER = 3, + GANG_TYPE_PRIMARY_READER = 4, + GANG_TYPE_PRIMARY_WRITER = 5, + GangType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + GangType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool GangType_IsValid(int value); +constexpr GangType GangType_MIN = GANG_TYPE_UNSPECIFIED; +constexpr GangType GangType_MAX = GANG_TYPE_PRIMARY_WRITER; +constexpr int GangType_ARRAYSIZE = GangType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GangType_descriptor(); +template +inline const std::string& GangType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function GangType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + GangType_descriptor(), enum_t_value); +} +inline bool GangType_Parse( + const std::string& name, GangType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + GangType_descriptor(), name, value); +} +enum CdbLocusType : int { + CDB_LOCUS_TYPE_UNSPECIFIED = 0, + CDB_LOCUS_TYPE_ENTRY = 1, + CDB_LOCUS_TYPE_SINGLE_QE = 2, + CDB_LOCUS_TYPE_GENERAL = 3, + CDB_LOCUS_TYPE_SEGMENT_GENERAL = 4, + CDB_LOCUS_TYPE_REPLICATED = 5, + CDB_LOCUS_TYPE_HASHED = 6, + CDB_LOCUS_TYPE_HASHED_OJ = 7, + CDB_LOCUS_TYPE_STREWN = 8, + CDB_LOCUS_TYPE_END = 9, + CdbLocusType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + CdbLocusType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool CdbLocusType_IsValid(int value); +constexpr CdbLocusType CdbLocusType_MIN = CDB_LOCUS_TYPE_UNSPECIFIED; +constexpr CdbLocusType CdbLocusType_MAX = CDB_LOCUS_TYPE_END; +constexpr int CdbLocusType_ARRAYSIZE = CdbLocusType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* CdbLocusType_descriptor(); +template +inline const std::string& CdbLocusType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function CdbLocusType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + CdbLocusType_descriptor(), enum_t_value); +} +inline bool CdbLocusType_Parse( + const std::string& name, CdbLocusType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + CdbLocusType_descriptor(), name, value); +} +enum MotionType : int { + MOTION_TYPE_UNSPECIFIED = 0, + MOTION_TYPE_HASH = 1, + MOTION_TYPE_FIXED = 2, + MOTION_TYPE_EXPLICIT = 3, + MotionType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + MotionType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool MotionType_IsValid(int value); +constexpr MotionType MotionType_MIN = MOTION_TYPE_UNSPECIFIED; +constexpr MotionType MotionType_MAX = MOTION_TYPE_EXPLICIT; +constexpr int MotionType_ARRAYSIZE = MotionType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MotionType_descriptor(); +template +inline const std::string& MotionType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function MotionType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + MotionType_descriptor(), enum_t_value); +} +inline bool MotionType_Parse( + const std::string& name, MotionType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + MotionType_descriptor(), name, value); +} +enum GpdbNodeType : int { + GPDB_NODE_TYPE_UNSPECIFIED = 0, + INDEX_INFO = 1, + EXPR_CONTEXT = 2, + PROJECTION_INFO = 3, + JUNK_FILTER = 4, + RESULT_REL_INFO = 5, + E_STATE = 6, + TUPLE_TABLE_SLOT = 7, + CDB_PROCESS = 8, + SLICE = 9, + SLICE_TABLE = 10, + CURSOR_POS_INFO = 11, + SHARE_NODE_ENTRY = 12, + PARTITION_STATE = 13, + QUERY_DISPATCH_DESC = 14, + OID_ASSIGNMENT = 15, + PLAN = 16, + SCAN = 17, + JOIN = 18, + RESULT = 19, + MODIFY_TABLE = 20, + APPEND = 21, + MERGE_APPEND = 22, + RECURSIVE_UNION = 23, + SEQUENCE = 24, + BITMAP_AND = 25, + BITMAP_OR = 26, + SEQ_SCAN = 27, + DYNAMIC_SEQ_SCAN = 28, + EXTERNAL_SCAN = 29, + INDEX_SCAN = 30, + DYNAMIC_INDEX_SCAN = 31, + INDEX_ONLY_SCAN = 32, + BITMAP_INDEX_SCAN = 33, + DYNAMIC_BITMAP_INDEX_SCAN = 34, + BITMAP_HEAP_SCAN = 35, + DYNAMIC_BITMAP_HEAP_SCAN = 36, + TID_SCAN = 37, + SUBQUERY_SCAN = 38, + FUNCTION_SCAN = 39, + TABLE_FUNCTION_SCAN = 40, + VALUES_SCAN = 41, + CTE_SCAN = 42, + WORK_TABLE_SCAN = 43, + FOREIGN_SCAN = 44, + NEST_LOOP = 45, + MERGE_JOIN = 46, + HASH_JOIN = 47, + MATERIAL = 48, + SORT = 49, + AGG = 50, + WINDOW_AGG = 51, + UNIQUE = 52, + HASH = 53, + SET_OP = 54, + LOCK_ROWS = 55, + LIMIT = 56, + MOTION = 57, + SHARE_INPUT_SCAN = 58, + REPEAT = 59, + DML = 60, + SPLIT_UPDATE = 61, + ROW_TRIGGER = 62, + ASSERT_OP = 63, + PARTITION_SELECTOR = 64, + PLAN_END = 65, + NEST_LOOP_PARAM = 66, + PLAN_ROW_MARK = 67, + PLAN_INVAL_ITEM = 68, + PLAN_STATE = 69, + SCAN_STATE = 70, + JOIN_STATE = 71, + RESULT_STATE = 72, + MODIFY_TABLE_STATE = 73, + APPEND_STATE = 74, + MERGE_APPEND_STATE = 75, + RECURSIVE_UNION_STATE = 76, + SEQUENCE_STATE = 77, + BITMAP_AND_STATE = 78, + BITMAP_OR_STATE = 79, + SEQ_SCAN_STATE = 80, + DYNAMIC_SEQ_SCAN_STATE = 81, + EXTERNAL_SCAN_STATE = 82, + INDEX_SCAN_STATE = 83, + DYNAMIC_INDEX_SCAN_STATE = 84, + INDEX_ONLY_SCAN_STATE = 85, + BITMAP_INDEX_SCAN_STATE = 86, + DYNAMIC_BITMAP_INDEX_SCAN_STATE = 87, + BITMAP_HEAP_SCAN_STATE = 88, + DYNAMIC_BITMAP_HEAP_SCAN_STATE = 89, + TID_SCAN_STATE = 90, + SUBQUERY_SCAN_STATE = 91, + FUNCTION_SCAN_STATE = 92, + TABLE_FUNCTION_STATE = 93, + VALUES_SCAN_STATE = 94, + CTE_SCAN_STATE = 95, + WORK_TABLE_SCAN_STATE = 96, + FOREIGN_SCAN_STATE = 97, + NEST_LOOP_STATE = 98, + MERGE_JOIN_STATE = 99, + HASH_JOIN_STATE = 100, + MATERIAL_STATE = 101, + SORT_STATE = 102, + AGG_STATE = 103, + WINDOW_AGG_STATE = 104, + UNIQUE_STATE = 105, + HASH_STATE = 106, + SET_OP_STATE = 107, + LOCK_ROWS_STATE = 108, + LIMIT_STATE = 109, + MOTION_STATE = 110, + SHARE_INPUT_SCAN_STATE = 111, + REPEAT_STATE = 112, + DML_STATE = 113, + SPLIT_UPDATE_STATE = 114, + ROW_TRIGGER_STATE = 115, + ASSERT_OP_STATE = 116, + PARTITION_SELECTOR_STATE = 117, + TUPLE_DESC_NODE = 118, + SERIALIZED_PARAM_EXTERN_DATA = 119, + ALIAS = 120, + RANGE_VAR = 121, + EXPR = 122, + VAR = 123, + CONST = 124, + PARAM = 125, + AGGREF = 126, + WINDOW_FUNC = 127, + ARRAY_REF = 128, + FUNC_EXPR = 129, + NAMED_ARG_EXPR = 130, + OP_EXPR = 131, + DISTINCT_EXPR = 132, + NULL_IF_EXPR = 133, + SCALAR_ARRAY_OP_EXPR = 134, + BOOL_EXPR = 135, + SUB_LINK = 136, + SUB_PLAN = 137, + ALTERNATIVE_SUB_PLAN = 138, + FIELD_SELECT = 139, + FIELD_STORE = 140, + RELABEL_TYPE = 141, + COERCE_VIA_IO = 142, + ARRAY_COERCE_EXPR = 143, + CONVERT_ROWTYPE_EXPR = 144, + COLLATE_EXPR = 145, + CASE_EXPR = 146, + CASE_WHEN = 147, + CASE_TEST_EXPR = 148, + ARRAY_EXPR = 149, + ROW_EXPR = 150, + ROW_COMPARE_EXPR = 151, + COALESCE_EXPR = 152, + MIN_MAX_EXPR = 153, + XML_EXPR = 154, + NULL_TEST = 155, + BOOLEAN_TEST = 156, + COERCE_TO_DOMAIN = 157, + COERCE_TO_DOMAIN_VALUES = 158, + SET_TO_DEFAULT = 159, + CURRENT_OF_EXPR = 160, + TARGET_ENTRY = 161, + RANGE_TBL_REF = 162, + JOIN_EXPR = 163, + FROM_EXPR = 164, + INTO_CLAUSE = 165, + COPY_INTO_CLAUSE = 166, + REFRESH_CLAUSE = 167, + FLOW = 168, + GROUPING = 169, + GROUP_ID = 170, + DISTRIBUTED_BY = 171, + DML_ACTION_EXPR = 172, + PART_SELECTED_EXPR = 173, + PART_DEFAULT_EXPR = 174, + PART_BOUND_EXPR = 175, + PART_BOUND_INCLUSION_EXPR = 176, + PART_BOUND_OPEN_EXPR = 177, + PART_LIST_RULE_EXPR = 178, + PART_LIST_NULL_TEST_EXPR = 179, + TABLE_OID_INFO = 180, + EXPR_STATE = 181, + GENERIC_EXPR_STATE = 182, + WHOLE_ROW_VAR_EXPR_STATE = 183, + AGGREF_EXPR_STATE = 184, + WINDOW_FUNC_EXPR_STATE = 185, + ARRAY_REF_EXPR_STATE = 186, + FUNC_EXPR_STATE = 187, + SCALAR_ARRAY_OP_EXPR_STATE = 188, + BOOL_EXPR_STATE = 189, + SUB_PLAN_STATE = 190, + ALTERNATIVE_SUB_PLAN_STATE = 191, + FIELD_SELECT_STATE = 192, + FIELD_STORE_STATE = 193, + COERCE_VIA_IO_STATE = 194, + ARRAY_COERCE_EXPR_STATE = 195, + CONVERT_ROWTYPE_EXPR_STATE = 196, + CASE_EXPR_STATE = 197, + CASE_WHEN_STATE = 198, + ARRAY_EXPR_STATE = 199, + ROW_EXPR_STATE = 200, + ROW_COMPARE_EXPR_STATE = 201, + COALESCE_EXPR_STATE = 202, + MIN_MAX_EXPR_STATE = 203, + XML_EXPR_STATE = 204, + NULL_TEST_STATE = 205, + COERCE_TO_DOMAIN_STATE = 206, + DOMAIN_CONSTRAINT_STATE = 207, + GROUPING_FUNC_EXPR_STATE = 208, + PART_SELECTED_EXPR_STATE = 209, + PART_DEFAULT_EXPR_STATE = 210, + PART_BOUND_EXPR_STATE = 211, + PART_BOUND_INCLUSION_EXPR_STATE = 212, + PART_BOUND_OPEN_EXPR_STATE = 213, + PART_LIST_RULE_EXPR_STATE = 214, + PART_LIST_NULL_TEST_EXPR_STATE = 215, + PLANNER_INFO = 216, + PLANNER_GLOBAL = 217, + REL_OPT_INFO = 218, + INDEX_OPT_INFO = 219, + PARAM_PATH_INFO = 220, + PATH = 221, + APPEND_ONLY_PATH = 222, + AOCS_PATH = 223, + EXTERNAL_PATH = 224, + INDEX_PATH = 225, + BITMAP_HEAP_PATH = 226, + BITMAP_AND_PATH = 227, + BITMAP_OR_PATH = 228, + NEST_PATH = 229, + MERGE_PATH = 230, + HASH_PATH = 231, + TID_PATH = 232, + FOREIGN_PATH = 233, + APPEND_PATH = 234, + MERGE_APPEND_PATH = 235, + RESULT_PATH = 236, + MATERIAL_PATH = 237, + UNIQUE_PATH = 238, + PROJECTION_PATH = 239, + EQUIVALENCE_CLASS = 240, + EQUIVALENCE_MEMBER = 241, + PATH_KEY = 242, + RESTRICT_INFO = 243, + PLACE_HOLDER_VAR = 244, + SPECIAL_JOIN_INFO = 245, + LATERAL_JOIN_INFO = 246, + APPEND_REL_INFO = 247, + PLACE_HOLDER_INFO = 248, + MIN_MAX_AGG_INFO = 249, + PARTITION = 250, + PARTITION_RULE = 251, + PARTITION_NODE = 252, + PG_PART_RULE = 253, + SEGFILE_MAP_NODE = 254, + PLANNER_PARAM_ITEM = 255, + CDB_MOTION_PATH = 256, + PARTITION_SELECTOR_PATH = 257, + CDB_REL_COLUMN_INFO = 258, + DISTRIBUTION_KEY = 259, + MEMORY_CONTEXT = 260, + ALLOC_SET_CONTEXT = 261, + MEMORY_ACCOUNT = 262, + VALUE = 263, + INTEGER = 264, + FLOAT = 265, + STRING = 266, + BIT_STRING = 267, + NULL_VALUE = 268, + LIST = 269, + INT_LIST = 270, + OID_LIST = 271, + QUERY = 272, + PLANNED_STMT = 273, + INSERT_STMT = 274, + DELETE_STMT = 275, + UPDATE_STMT = 276, + SELECT_STMT = 277, + ALTER_TABLE_STMT = 278, + ALTER_TABLE_CMD = 279, + ALTER_DOMAIN_STMT = 280, + SET_OPERATION_STMT = 281, + GRANT_STMT = 282, + GRANT_ROLE_STMT = 283, + ALTER_DEFAULT_PRIVILEGES_STMT = 284, + CLOSE_PORTAL_STMT = 285, + CLUSTER_STMT = 286, + COPY_STMT = 287, + CREATE_STMT = 288, + SINGLE_ROW_ERROR_DESC = 289, + EXT_TABLE_TYPE_DESC = 290, + CREATE_EXTERNAL_STMT = 291, + DEFINE_STMT = 292, + DROP_STMT = 293, + TRUNCATE_STMT = 294, + COMMENT_STMT = 295, + FETCH_STMT = 296, + INDEX_STMT = 297, + CREATE_FUNCTION_STMT = 298, + ALTER_FUNCTION_STMT = 299, + DO_STMT = 300, + RENAME_STMT = 301, + RULE_STMT = 302, + NOTIFY_STMT = 303, + LISTEN_STMT = 304, + UNLISTEN_STMT = 305, + TRANSACTION_STMT = 306, + VIEW_STMT = 307, + LOAD_STMT = 308, + CREATE_DOMAIN_STMT = 309, + CREATEDB_STMT = 310, + DROPDB_STMT = 311, + VACUUM_STMT = 312, + EXPLAIN_STMT = 313, + CREATE_TABLE_AS_STMT = 314, + CREATE_SEQ_STMT = 315, + ALTER_SEQ_STMT = 316, + VARIABLE_SET_STMT = 317, + VARIABLE_SHOW_STMT = 318, + DISCARD_STMT = 319, + CREATE_TRIG_STMT = 320, + CREATE_P_LANG_STMT = 321, + CREATE_ROLE_STMT = 322, + ALTER_ROLE_STMT = 323, + DROP_ROLE_STMT = 324, + CREATE_QUEUE_STMT = 325, + ALTER_QUEUE_STMT = 326, + DROP_QUEUE_STMT = 327, + CREATE_RESOURCE_GROUP_STMT = 328, + DROP_RESOURCE_GROUP_STMT = 329, + ALTER_RESOURCE_GROUP_STMT = 330, + LOCK_STMT = 331, + CONSTRAINTS_SET_STMT = 332, + REINDEX_STMT = 333, + CHECK_POINT_STMT = 334, + CREATE_SCHEMA_STMT = 335, + ALTER_DATABASE_STMT = 336, + ALTER_DATABASE_SET_STMT = 337, + ALTER_ROLE_SET_STMT = 338, + CREATE_CONVERSION_STMT = 339, + CREATE_CAST_STMT = 340, + CREATE_OP_CLASS_STMT = 341, + CREATE_OP_FAMILY_STMT = 342, + ALTER_OP_FAMILY_STMT = 343, + PREPARE_STMT = 344, + EXECUTE_STMT = 345, + DEALLOCATE_STMT = 346, + DECLARE_CURSOR_STMT = 347, + CREATE_TABLE_SPACE_STMT = 348, + DROP_TABLE_SPACE_STMT = 349, + ALTER_OBJECT_SCHEMA_STMT = 350, + ALTER_OWNER_STMT = 351, + DROP_OWNED_STMT = 352, + REASSIGN_OWNED_STMT = 353, + COMPOSITE_TYPE_STMT = 354, + CREATE_ENUM_STMT = 355, + CREATE_RANGE_STMT = 356, + ALTER_ENUM_STMT = 357, + ALTER_TS_DICTIONARY_STMT = 358, + ALTER_TS_CONFIGURATION_STMT = 359, + CREATE_FDW_STMT = 360, + ALTER_FDW_STMT = 361, + CREATE_FOREIGN_SERVER_STMT = 362, + ALTER_FOREIGN_SERVER_STMT = 363, + CREATE_USER_MAPPING_STMT = 364, + ALTER_USER_MAPPING_STMT = 365, + DROP_USER_MAPPING_STMT = 366, + ALTER_TABLE_SPACE_OPTIONS_STMT = 367, + ALTER_TABLE_MOVE_ALL_STMT = 368, + SEC_LABEL_STMT = 369, + CREATE_FOREIGN_TABLE_STMT = 370, + CREATE_EXTENSION_STMT = 371, + ALTER_EXTENSION_STMT = 372, + ALTER_EXTENSION_CONTENTS_STMT = 373, + CREATE_EVENT_TRIG_STMT = 374, + ALTER_EVENT_TRIG_STMT = 375, + REFRESH_MAT_VIEW_STMT = 376, + REPLICA_IDENTITY_STMT = 377, + ALTER_SYSTEM_STMT = 378, + PARTITION_BY = 379, + PARTITION_ELEM = 380, + PARTITION_RANGE_ITEM = 381, + PARTITION_BOUND_SPEC = 382, + PARTITION_SPEC = 383, + PARTITION_VALUES_SPEC = 384, + ALTER_PARTITION_ID = 385, + ALTER_PARTITION_CMD = 386, + INHERIT_PARTITION_CMD = 387, + CREATE_FILE_SPACE_STMT = 388, + FILE_SPACE_ENTRY = 389, + DROP_FILE_SPACE_STMT = 390, + TABLE_VALUE_EXPR = 391, + DENY_LOGIN_INTERVAL = 392, + DENY_LOGIN_POINT = 393, + ALTER_TYPE_STMT = 394, + SET_DISTRIBUTION_CMD = 395, + EXPAND_STMT_SPEC = 396, + A_EXPR = 397, + COLUMN_REF = 398, + PARAM_REF = 399, + A_CONST = 400, + FUNC_CALL = 401, + A_STAR = 402, + A_INDICES = 403, + A_INDIRECTION = 404, + A_ARRAY_EXPR = 405, + RES_TARGET = 406, + TYPE_CAST = 407, + COLLATE_CLAUSE = 408, + SORT_BY = 409, + WINDOW_DEF = 410, + RANGE_SUBSELECT = 411, + RANGE_FUNCTION = 412, + TYPE_NAME = 413, + COLUMN_DEF = 414, + INDEX_ELEM = 415, + CONSTRAINT = 416, + DEF_ELEM = 417, + RANGE_TBL_ENTRY = 418, + RANGE_TBL_FUNCTION = 419, + WITH_CHECK_OPTION = 420, + GROUPING_CLAUSE = 421, + GROUPING_FUNC = 422, + SORT_GROUP_CLAUSE = 423, + WINDOW_CLAUSE = 424, + PRIV_GRANTEE = 425, + FUNC_WITH_ARGS = 426, + ACCESS_PRIV = 427, + CREATE_OP_CLASS_ITEM = 428, + TABLE_LIKE_CLAUSE = 429, + FUNCTION_PARAMETER = 430, + LOCKING_CLAUSE = 431, + ROW_MARK_CLAUSE = 432, + XML_SERIALIZE = 433, + WITH_CLAUSE = 434, + COMMON_TABLE_EXPR = 435, + COLUMN_REFERENCE_STORAGE_DIRECTIVE = 436, + IDENTIFY_SYSTEM_CMD = 437, + BASE_BACKUP_CMD = 438, + CREATE_REPLICATION_SLOT_CMD = 439, + DROP_REPLICATION_SLOT_CMD = 440, + START_REPLICATION_CMD = 441, + TIME_LINE_HISTORY_CMD = 442, + TRIGGER_DATA = 443, + EVENT_TRIGGER_DATA = 444, + RETURN_SET_INFO = 445, + WINDOW_OBJECT_DATA = 446, + TID_BITMAP = 447, + INLINE_CODE_BLOCK = 448, + FDW_ROUTINE = 449, + STREAM_BITMAP = 450, + FORMATTER_DATA = 451, + EXT_PROTOCOL_DATA = 452, + EXT_PROTOCOL_VALIDATOR_DATA = 453, + SELECTED_PARTS = 454, + COOKED_CONSTRAINT = 455, + CDB_EXPLAIN_STAT_HDR = 456, + GP_POLICY = 457, + RETRIEVE_STMT = 458, + GpdbNodeType_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + GpdbNodeType_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool GpdbNodeType_IsValid(int value); +constexpr GpdbNodeType GpdbNodeType_MIN = GPDB_NODE_TYPE_UNSPECIFIED; +constexpr GpdbNodeType GpdbNodeType_MAX = RETRIEVE_STMT; +constexpr int GpdbNodeType_ARRAYSIZE = GpdbNodeType_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* GpdbNodeType_descriptor(); +template +inline const std::string& GpdbNodeType_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function GpdbNodeType_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + GpdbNodeType_descriptor(), enum_t_value); +} +inline bool GpdbNodeType_Parse( + const std::string& name, GpdbNodeType* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + GpdbNodeType_descriptor(), name, value); +} +// =================================================================== + +class MetricPlan PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.MetricPlan) */ { + public: + inline MetricPlan() : MetricPlan(nullptr) {}; + virtual ~MetricPlan(); + + MetricPlan(const MetricPlan& from); + MetricPlan(MetricPlan&& from) noexcept + : MetricPlan() { + *this = ::std::move(from); + } + + inline MetricPlan& operator=(const MetricPlan& from) { + CopyFrom(from); + return *this; + } + inline MetricPlan& operator=(MetricPlan&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const MetricPlan& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MetricPlan* internal_default_instance() { + return reinterpret_cast( + &_MetricPlan_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(MetricPlan& a, MetricPlan& b) { + a.Swap(&b); + } + inline void Swap(MetricPlan* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MetricPlan* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline MetricPlan* New() const final { + return CreateMaybeMessage(nullptr); + } + + MetricPlan* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const MetricPlan& from); + void MergeFrom(const MetricPlan& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MetricPlan* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.MetricPlan"; + } + protected: + explicit MetricPlan(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fplan_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kScanIndexNameFieldNumber = 12, + kStatementFieldNumber = 15, + kMotionInfoFieldNumber = 10, + kRelationInfoFieldNumber = 11, + kSliceInfoFieldNumber = 14, + kTypeFieldNumber = 1, + kPlanNodeIdFieldNumber = 2, + kStartupCostFieldNumber = 4, + kTotalCostFieldNumber = 5, + kParentPlanNodeIdFieldNumber = 3, + kPlanWidthFieldNumber = 7, + kPlanRowsFieldNumber = 6, + kArg1FieldNumber = 8, + kArg2FieldNumber = 9, + kScanDirectionFieldNumber = 13, + }; + // string scan_index_name = 12; + void clear_scan_index_name(); + const std::string& scan_index_name() const; + void set_scan_index_name(const std::string& value); + void set_scan_index_name(std::string&& value); + void set_scan_index_name(const char* value); + void set_scan_index_name(const char* value, size_t size); + std::string* mutable_scan_index_name(); + std::string* release_scan_index_name(); + void set_allocated_scan_index_name(std::string* scan_index_name); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_scan_index_name(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_scan_index_name( + std::string* scan_index_name); + private: + const std::string& _internal_scan_index_name() const; + void _internal_set_scan_index_name(const std::string& value); + std::string* _internal_mutable_scan_index_name(); + public: + + // string statement = 15; + void clear_statement(); + const std::string& statement() const; + void set_statement(const std::string& value); + void set_statement(std::string&& value); + void set_statement(const char* value); + void set_statement(const char* value, size_t size); + std::string* mutable_statement(); + std::string* release_statement(); + void set_allocated_statement(std::string* statement); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_statement(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_statement( + std::string* statement); + private: + const std::string& _internal_statement() const; + void _internal_set_statement(const std::string& value); + std::string* _internal_mutable_statement(); + public: + + // .yagpcc.MetricMotionInfo motion_info = 10; + bool has_motion_info() const; + private: + bool _internal_has_motion_info() const; + public: + void clear_motion_info(); + const ::yagpcc::MetricMotionInfo& motion_info() const; + ::yagpcc::MetricMotionInfo* release_motion_info(); + ::yagpcc::MetricMotionInfo* mutable_motion_info(); + void set_allocated_motion_info(::yagpcc::MetricMotionInfo* motion_info); + private: + const ::yagpcc::MetricMotionInfo& _internal_motion_info() const; + ::yagpcc::MetricMotionInfo* _internal_mutable_motion_info(); + public: + void unsafe_arena_set_allocated_motion_info( + ::yagpcc::MetricMotionInfo* motion_info); + ::yagpcc::MetricMotionInfo* unsafe_arena_release_motion_info(); + + // .yagpcc.MetricRelationInfo relation_info = 11; + bool has_relation_info() const; + private: + bool _internal_has_relation_info() const; + public: + void clear_relation_info(); + const ::yagpcc::MetricRelationInfo& relation_info() const; + ::yagpcc::MetricRelationInfo* release_relation_info(); + ::yagpcc::MetricRelationInfo* mutable_relation_info(); + void set_allocated_relation_info(::yagpcc::MetricRelationInfo* relation_info); + private: + const ::yagpcc::MetricRelationInfo& _internal_relation_info() const; + ::yagpcc::MetricRelationInfo* _internal_mutable_relation_info(); + public: + void unsafe_arena_set_allocated_relation_info( + ::yagpcc::MetricRelationInfo* relation_info); + ::yagpcc::MetricRelationInfo* unsafe_arena_release_relation_info(); + + // .yagpcc.MetricSliceInfo slice_info = 14; + bool has_slice_info() const; + private: + bool _internal_has_slice_info() const; + public: + void clear_slice_info(); + const ::yagpcc::MetricSliceInfo& slice_info() const; + ::yagpcc::MetricSliceInfo* release_slice_info(); + ::yagpcc::MetricSliceInfo* mutable_slice_info(); + void set_allocated_slice_info(::yagpcc::MetricSliceInfo* slice_info); + private: + const ::yagpcc::MetricSliceInfo& _internal_slice_info() const; + ::yagpcc::MetricSliceInfo* _internal_mutable_slice_info(); + public: + void unsafe_arena_set_allocated_slice_info( + ::yagpcc::MetricSliceInfo* slice_info); + ::yagpcc::MetricSliceInfo* unsafe_arena_release_slice_info(); + + // .yagpcc.GpdbNodeType type = 1; + void clear_type(); + ::yagpcc::GpdbNodeType type() const; + void set_type(::yagpcc::GpdbNodeType value); + private: + ::yagpcc::GpdbNodeType _internal_type() const; + void _internal_set_type(::yagpcc::GpdbNodeType value); + public: + + // int32 plan_node_id = 2; + void clear_plan_node_id(); + ::PROTOBUF_NAMESPACE_ID::int32 plan_node_id() const; + void set_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_plan_node_id() const; + void _internal_set_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // double startup_cost = 4; + void clear_startup_cost(); + double startup_cost() const; + void set_startup_cost(double value); + private: + double _internal_startup_cost() const; + void _internal_set_startup_cost(double value); + public: + + // double total_cost = 5; + void clear_total_cost(); + double total_cost() const; + void set_total_cost(double value); + private: + double _internal_total_cost() const; + void _internal_set_total_cost(double value); + public: + + // int32 parent_plan_node_id = 3; + void clear_parent_plan_node_id(); + ::PROTOBUF_NAMESPACE_ID::int32 parent_plan_node_id() const; + void set_parent_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_parent_plan_node_id() const; + void _internal_set_parent_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 plan_width = 7; + void clear_plan_width(); + ::PROTOBUF_NAMESPACE_ID::int32 plan_width() const; + void set_plan_width(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_plan_width() const; + void _internal_set_plan_width(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // double plan_rows = 6; + void clear_plan_rows(); + double plan_rows() const; + void set_plan_rows(double value); + private: + double _internal_plan_rows() const; + void _internal_set_plan_rows(double value); + public: + + // int32 arg1 = 8; + void clear_arg1(); + ::PROTOBUF_NAMESPACE_ID::int32 arg1() const; + void set_arg1(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_arg1() const; + void _internal_set_arg1(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 arg2 = 9; + void clear_arg2(); + ::PROTOBUF_NAMESPACE_ID::int32 arg2() const; + void set_arg2(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_arg2() const; + void _internal_set_arg2(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // .yagpcc.ScanDirection scan_direction = 13; + void clear_scan_direction(); + ::yagpcc::ScanDirection scan_direction() const; + void set_scan_direction(::yagpcc::ScanDirection value); + private: + ::yagpcc::ScanDirection _internal_scan_direction() const; + void _internal_set_scan_direction(::yagpcc::ScanDirection value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.MetricPlan) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr scan_index_name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr statement_; + ::yagpcc::MetricMotionInfo* motion_info_; + ::yagpcc::MetricRelationInfo* relation_info_; + ::yagpcc::MetricSliceInfo* slice_info_; + int type_; + ::PROTOBUF_NAMESPACE_ID::int32 plan_node_id_; + double startup_cost_; + double total_cost_; + ::PROTOBUF_NAMESPACE_ID::int32 parent_plan_node_id_; + ::PROTOBUF_NAMESPACE_ID::int32 plan_width_; + double plan_rows_; + ::PROTOBUF_NAMESPACE_ID::int32 arg1_; + ::PROTOBUF_NAMESPACE_ID::int32 arg2_; + int scan_direction_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fplan_2eproto; +}; +// ------------------------------------------------------------------- + +class MetricMotionInfo PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.MetricMotionInfo) */ { + public: + inline MetricMotionInfo() : MetricMotionInfo(nullptr) {}; + virtual ~MetricMotionInfo(); + + MetricMotionInfo(const MetricMotionInfo& from); + MetricMotionInfo(MetricMotionInfo&& from) noexcept + : MetricMotionInfo() { + *this = ::std::move(from); + } + + inline MetricMotionInfo& operator=(const MetricMotionInfo& from) { + CopyFrom(from); + return *this; + } + inline MetricMotionInfo& operator=(MetricMotionInfo&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const MetricMotionInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MetricMotionInfo* internal_default_instance() { + return reinterpret_cast( + &_MetricMotionInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(MetricMotionInfo& a, MetricMotionInfo& b) { + a.Swap(&b); + } + inline void Swap(MetricMotionInfo* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MetricMotionInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline MetricMotionInfo* New() const final { + return CreateMaybeMessage(nullptr); + } + + MetricMotionInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const MetricMotionInfo& from); + void MergeFrom(const MetricMotionInfo& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MetricMotionInfo* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.MetricMotionInfo"; + } + protected: + explicit MetricMotionInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fplan_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kTypeFieldNumber = 1, + kIsBroadcastFieldNumber = 2, + kLocusTypeFieldNumber = 3, + kSliceIdFieldNumber = 4, + kParentSliceIdFieldNumber = 5, + }; + // .yagpcc.MotionType type = 1; + void clear_type(); + ::yagpcc::MotionType type() const; + void set_type(::yagpcc::MotionType value); + private: + ::yagpcc::MotionType _internal_type() const; + void _internal_set_type(::yagpcc::MotionType value); + public: + + // bool isBroadcast = 2; + void clear_isbroadcast(); + bool isbroadcast() const; + void set_isbroadcast(bool value); + private: + bool _internal_isbroadcast() const; + void _internal_set_isbroadcast(bool value); + public: + + // .yagpcc.CdbLocusType locusType = 3; + void clear_locustype(); + ::yagpcc::CdbLocusType locustype() const; + void set_locustype(::yagpcc::CdbLocusType value); + private: + ::yagpcc::CdbLocusType _internal_locustype() const; + void _internal_set_locustype(::yagpcc::CdbLocusType value); + public: + + // int32 sliceId = 4; + void clear_sliceid(); + ::PROTOBUF_NAMESPACE_ID::int32 sliceid() const; + void set_sliceid(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_sliceid() const; + void _internal_set_sliceid(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 parentSliceId = 5; + void clear_parentsliceid(); + ::PROTOBUF_NAMESPACE_ID::int32 parentsliceid() const; + void set_parentsliceid(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_parentsliceid() const; + void _internal_set_parentsliceid(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.MetricMotionInfo) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + int type_; + bool isbroadcast_; + int locustype_; + ::PROTOBUF_NAMESPACE_ID::int32 sliceid_; + ::PROTOBUF_NAMESPACE_ID::int32 parentsliceid_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fplan_2eproto; +}; +// ------------------------------------------------------------------- + +class MetricRelationInfo PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.MetricRelationInfo) */ { + public: + inline MetricRelationInfo() : MetricRelationInfo(nullptr) {}; + virtual ~MetricRelationInfo(); + + MetricRelationInfo(const MetricRelationInfo& from); + MetricRelationInfo(MetricRelationInfo&& from) noexcept + : MetricRelationInfo() { + *this = ::std::move(from); + } + + inline MetricRelationInfo& operator=(const MetricRelationInfo& from) { + CopyFrom(from); + return *this; + } + inline MetricRelationInfo& operator=(MetricRelationInfo&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const MetricRelationInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MetricRelationInfo* internal_default_instance() { + return reinterpret_cast( + &_MetricRelationInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(MetricRelationInfo& a, MetricRelationInfo& b) { + a.Swap(&b); + } + inline void Swap(MetricRelationInfo* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MetricRelationInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline MetricRelationInfo* New() const final { + return CreateMaybeMessage(nullptr); + } + + MetricRelationInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const MetricRelationInfo& from); + void MergeFrom(const MetricRelationInfo& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MetricRelationInfo* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.MetricRelationInfo"; + } + protected: + explicit MetricRelationInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fplan_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kNameFieldNumber = 2, + kSchemaFieldNumber = 3, + kAliasFieldNumber = 4, + kOidFieldNumber = 1, + kDynamicScanIdFieldNumber = 5, + }; + // string name = 2; + void clear_name(); + const std::string& name() const; + void set_name(const std::string& value); + void set_name(std::string&& value); + void set_name(const char* value); + void set_name(const char* value, size_t size); + std::string* mutable_name(); + std::string* release_name(); + void set_allocated_name(std::string* name); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_name(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_name( + std::string* name); + private: + const std::string& _internal_name() const; + void _internal_set_name(const std::string& value); + std::string* _internal_mutable_name(); + public: + + // string schema = 3; + void clear_schema(); + const std::string& schema() const; + void set_schema(const std::string& value); + void set_schema(std::string&& value); + void set_schema(const char* value); + void set_schema(const char* value, size_t size); + std::string* mutable_schema(); + std::string* release_schema(); + void set_allocated_schema(std::string* schema); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_schema(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_schema( + std::string* schema); + private: + const std::string& _internal_schema() const; + void _internal_set_schema(const std::string& value); + std::string* _internal_mutable_schema(); + public: + + // string alias = 4; + void clear_alias(); + const std::string& alias() const; + void set_alias(const std::string& value); + void set_alias(std::string&& value); + void set_alias(const char* value); + void set_alias(const char* value, size_t size); + std::string* mutable_alias(); + std::string* release_alias(); + void set_allocated_alias(std::string* alias); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_alias(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_alias( + std::string* alias); + private: + const std::string& _internal_alias() const; + void _internal_set_alias(const std::string& value); + std::string* _internal_mutable_alias(); + public: + + // int32 oid = 1; + void clear_oid(); + ::PROTOBUF_NAMESPACE_ID::int32 oid() const; + void set_oid(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_oid() const; + void _internal_set_oid(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 dynamicScanId = 5; + void clear_dynamicscanid(); + ::PROTOBUF_NAMESPACE_ID::int32 dynamicscanid() const; + void set_dynamicscanid(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_dynamicscanid() const; + void _internal_set_dynamicscanid(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.MetricRelationInfo) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr name_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr schema_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr alias_; + ::PROTOBUF_NAMESPACE_ID::int32 oid_; + ::PROTOBUF_NAMESPACE_ID::int32 dynamicscanid_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fplan_2eproto; +}; +// ------------------------------------------------------------------- + +class MetricSliceInfo PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.MetricSliceInfo) */ { + public: + inline MetricSliceInfo() : MetricSliceInfo(nullptr) {}; + virtual ~MetricSliceInfo(); + + MetricSliceInfo(const MetricSliceInfo& from); + MetricSliceInfo(MetricSliceInfo&& from) noexcept + : MetricSliceInfo() { + *this = ::std::move(from); + } + + inline MetricSliceInfo& operator=(const MetricSliceInfo& from) { + CopyFrom(from); + return *this; + } + inline MetricSliceInfo& operator=(MetricSliceInfo&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const MetricSliceInfo& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MetricSliceInfo* internal_default_instance() { + return reinterpret_cast( + &_MetricSliceInfo_default_instance_); + } + static constexpr int kIndexInFileMessages = + 3; + + friend void swap(MetricSliceInfo& a, MetricSliceInfo& b) { + a.Swap(&b); + } + inline void Swap(MetricSliceInfo* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MetricSliceInfo* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline MetricSliceInfo* New() const final { + return CreateMaybeMessage(nullptr); + } + + MetricSliceInfo* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const MetricSliceInfo& from); + void MergeFrom(const MetricSliceInfo& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MetricSliceInfo* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.MetricSliceInfo"; + } + protected: + explicit MetricSliceInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fplan_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fplan_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kSliceFieldNumber = 1, + kSegmentsFieldNumber = 2, + kGangTypeFieldNumber = 3, + kGangFieldNumber = 4, + }; + // int32 slice = 1; + void clear_slice(); + ::PROTOBUF_NAMESPACE_ID::int32 slice() const; + void set_slice(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_slice() const; + void _internal_set_slice(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // int32 segments = 2; + void clear_segments(); + ::PROTOBUF_NAMESPACE_ID::int32 segments() const; + void set_segments(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_segments() const; + void _internal_set_segments(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // .yagpcc.GangType gangType = 3; + void clear_gangtype(); + ::yagpcc::GangType gangtype() const; + void set_gangtype(::yagpcc::GangType value); + private: + ::yagpcc::GangType _internal_gangtype() const; + void _internal_set_gangtype(::yagpcc::GangType value); + public: + + // int32 gang = 4; + void clear_gang(); + ::PROTOBUF_NAMESPACE_ID::int32 gang() const; + void set_gang(::PROTOBUF_NAMESPACE_ID::int32 value); + private: + ::PROTOBUF_NAMESPACE_ID::int32 _internal_gang() const; + void _internal_set_gang(::PROTOBUF_NAMESPACE_ID::int32 value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.MetricSliceInfo) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::int32 slice_; + ::PROTOBUF_NAMESPACE_ID::int32 segments_; + int gangtype_; + ::PROTOBUF_NAMESPACE_ID::int32 gang_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fplan_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// MetricPlan + +// .yagpcc.GpdbNodeType type = 1; +inline void MetricPlan::clear_type() { + type_ = 0; +} +inline ::yagpcc::GpdbNodeType MetricPlan::_internal_type() const { + return static_cast< ::yagpcc::GpdbNodeType >(type_); +} +inline ::yagpcc::GpdbNodeType MetricPlan::type() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.type) + return _internal_type(); +} +inline void MetricPlan::_internal_set_type(::yagpcc::GpdbNodeType value) { + + type_ = value; +} +inline void MetricPlan::set_type(::yagpcc::GpdbNodeType value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.type) +} + +// int32 plan_node_id = 2; +inline void MetricPlan::clear_plan_node_id() { + plan_node_id_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::_internal_plan_node_id() const { + return plan_node_id_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::plan_node_id() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.plan_node_id) + return _internal_plan_node_id(); +} +inline void MetricPlan::_internal_set_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value) { + + plan_node_id_ = value; +} +inline void MetricPlan::set_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_plan_node_id(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.plan_node_id) +} + +// int32 parent_plan_node_id = 3; +inline void MetricPlan::clear_parent_plan_node_id() { + parent_plan_node_id_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::_internal_parent_plan_node_id() const { + return parent_plan_node_id_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::parent_plan_node_id() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.parent_plan_node_id) + return _internal_parent_plan_node_id(); +} +inline void MetricPlan::_internal_set_parent_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value) { + + parent_plan_node_id_ = value; +} +inline void MetricPlan::set_parent_plan_node_id(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_parent_plan_node_id(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.parent_plan_node_id) +} + +// double startup_cost = 4; +inline void MetricPlan::clear_startup_cost() { + startup_cost_ = 0; +} +inline double MetricPlan::_internal_startup_cost() const { + return startup_cost_; +} +inline double MetricPlan::startup_cost() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.startup_cost) + return _internal_startup_cost(); +} +inline void MetricPlan::_internal_set_startup_cost(double value) { + + startup_cost_ = value; +} +inline void MetricPlan::set_startup_cost(double value) { + _internal_set_startup_cost(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.startup_cost) +} + +// double total_cost = 5; +inline void MetricPlan::clear_total_cost() { + total_cost_ = 0; +} +inline double MetricPlan::_internal_total_cost() const { + return total_cost_; +} +inline double MetricPlan::total_cost() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.total_cost) + return _internal_total_cost(); +} +inline void MetricPlan::_internal_set_total_cost(double value) { + + total_cost_ = value; +} +inline void MetricPlan::set_total_cost(double value) { + _internal_set_total_cost(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.total_cost) +} + +// double plan_rows = 6; +inline void MetricPlan::clear_plan_rows() { + plan_rows_ = 0; +} +inline double MetricPlan::_internal_plan_rows() const { + return plan_rows_; +} +inline double MetricPlan::plan_rows() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.plan_rows) + return _internal_plan_rows(); +} +inline void MetricPlan::_internal_set_plan_rows(double value) { + + plan_rows_ = value; +} +inline void MetricPlan::set_plan_rows(double value) { + _internal_set_plan_rows(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.plan_rows) +} + +// int32 plan_width = 7; +inline void MetricPlan::clear_plan_width() { + plan_width_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::_internal_plan_width() const { + return plan_width_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::plan_width() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.plan_width) + return _internal_plan_width(); +} +inline void MetricPlan::_internal_set_plan_width(::PROTOBUF_NAMESPACE_ID::int32 value) { + + plan_width_ = value; +} +inline void MetricPlan::set_plan_width(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_plan_width(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.plan_width) +} + +// int32 arg1 = 8; +inline void MetricPlan::clear_arg1() { + arg1_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::_internal_arg1() const { + return arg1_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::arg1() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.arg1) + return _internal_arg1(); +} +inline void MetricPlan::_internal_set_arg1(::PROTOBUF_NAMESPACE_ID::int32 value) { + + arg1_ = value; +} +inline void MetricPlan::set_arg1(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_arg1(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.arg1) +} + +// int32 arg2 = 9; +inline void MetricPlan::clear_arg2() { + arg2_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::_internal_arg2() const { + return arg2_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricPlan::arg2() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.arg2) + return _internal_arg2(); +} +inline void MetricPlan::_internal_set_arg2(::PROTOBUF_NAMESPACE_ID::int32 value) { + + arg2_ = value; +} +inline void MetricPlan::set_arg2(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_arg2(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.arg2) +} + +// .yagpcc.MetricMotionInfo motion_info = 10; +inline bool MetricPlan::_internal_has_motion_info() const { + return this != internal_default_instance() && motion_info_ != nullptr; +} +inline bool MetricPlan::has_motion_info() const { + return _internal_has_motion_info(); +} +inline void MetricPlan::clear_motion_info() { + if (GetArena() == nullptr && motion_info_ != nullptr) { + delete motion_info_; + } + motion_info_ = nullptr; +} +inline const ::yagpcc::MetricMotionInfo& MetricPlan::_internal_motion_info() const { + const ::yagpcc::MetricMotionInfo* p = motion_info_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_MetricMotionInfo_default_instance_); +} +inline const ::yagpcc::MetricMotionInfo& MetricPlan::motion_info() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.motion_info) + return _internal_motion_info(); +} +inline void MetricPlan::unsafe_arena_set_allocated_motion_info( + ::yagpcc::MetricMotionInfo* motion_info) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(motion_info_); + } + motion_info_ = motion_info; + if (motion_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricPlan.motion_info) +} +inline ::yagpcc::MetricMotionInfo* MetricPlan::release_motion_info() { + auto temp = unsafe_arena_release_motion_info(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::MetricMotionInfo* MetricPlan::unsafe_arena_release_motion_info() { + // @@protoc_insertion_point(field_release:yagpcc.MetricPlan.motion_info) + + ::yagpcc::MetricMotionInfo* temp = motion_info_; + motion_info_ = nullptr; + return temp; +} +inline ::yagpcc::MetricMotionInfo* MetricPlan::_internal_mutable_motion_info() { + + if (motion_info_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::MetricMotionInfo>(GetArena()); + motion_info_ = p; + } + return motion_info_; +} +inline ::yagpcc::MetricMotionInfo* MetricPlan::mutable_motion_info() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricPlan.motion_info) + return _internal_mutable_motion_info(); +} +inline void MetricPlan::set_allocated_motion_info(::yagpcc::MetricMotionInfo* motion_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete motion_info_; + } + if (motion_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(motion_info); + if (message_arena != submessage_arena) { + motion_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, motion_info, submessage_arena); + } + + } else { + + } + motion_info_ = motion_info; + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricPlan.motion_info) +} + +// .yagpcc.MetricRelationInfo relation_info = 11; +inline bool MetricPlan::_internal_has_relation_info() const { + return this != internal_default_instance() && relation_info_ != nullptr; +} +inline bool MetricPlan::has_relation_info() const { + return _internal_has_relation_info(); +} +inline void MetricPlan::clear_relation_info() { + if (GetArena() == nullptr && relation_info_ != nullptr) { + delete relation_info_; + } + relation_info_ = nullptr; +} +inline const ::yagpcc::MetricRelationInfo& MetricPlan::_internal_relation_info() const { + const ::yagpcc::MetricRelationInfo* p = relation_info_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_MetricRelationInfo_default_instance_); +} +inline const ::yagpcc::MetricRelationInfo& MetricPlan::relation_info() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.relation_info) + return _internal_relation_info(); +} +inline void MetricPlan::unsafe_arena_set_allocated_relation_info( + ::yagpcc::MetricRelationInfo* relation_info) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(relation_info_); + } + relation_info_ = relation_info; + if (relation_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricPlan.relation_info) +} +inline ::yagpcc::MetricRelationInfo* MetricPlan::release_relation_info() { + auto temp = unsafe_arena_release_relation_info(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::MetricRelationInfo* MetricPlan::unsafe_arena_release_relation_info() { + // @@protoc_insertion_point(field_release:yagpcc.MetricPlan.relation_info) + + ::yagpcc::MetricRelationInfo* temp = relation_info_; + relation_info_ = nullptr; + return temp; +} +inline ::yagpcc::MetricRelationInfo* MetricPlan::_internal_mutable_relation_info() { + + if (relation_info_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::MetricRelationInfo>(GetArena()); + relation_info_ = p; + } + return relation_info_; +} +inline ::yagpcc::MetricRelationInfo* MetricPlan::mutable_relation_info() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricPlan.relation_info) + return _internal_mutable_relation_info(); +} +inline void MetricPlan::set_allocated_relation_info(::yagpcc::MetricRelationInfo* relation_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete relation_info_; + } + if (relation_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(relation_info); + if (message_arena != submessage_arena) { + relation_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, relation_info, submessage_arena); + } + + } else { + + } + relation_info_ = relation_info; + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricPlan.relation_info) +} + +// string scan_index_name = 12; +inline void MetricPlan::clear_scan_index_name() { + scan_index_name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& MetricPlan::scan_index_name() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.scan_index_name) + return _internal_scan_index_name(); +} +inline void MetricPlan::set_scan_index_name(const std::string& value) { + _internal_set_scan_index_name(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.scan_index_name) +} +inline std::string* MetricPlan::mutable_scan_index_name() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricPlan.scan_index_name) + return _internal_mutable_scan_index_name(); +} +inline const std::string& MetricPlan::_internal_scan_index_name() const { + return scan_index_name_.Get(); +} +inline void MetricPlan::_internal_set_scan_index_name(const std::string& value) { + + scan_index_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void MetricPlan::set_scan_index_name(std::string&& value) { + + scan_index_name_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.MetricPlan.scan_index_name) +} +inline void MetricPlan::set_scan_index_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + scan_index_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.MetricPlan.scan_index_name) +} +inline void MetricPlan::set_scan_index_name(const char* value, + size_t size) { + + scan_index_name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.MetricPlan.scan_index_name) +} +inline std::string* MetricPlan::_internal_mutable_scan_index_name() { + + return scan_index_name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* MetricPlan::release_scan_index_name() { + // @@protoc_insertion_point(field_release:yagpcc.MetricPlan.scan_index_name) + return scan_index_name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void MetricPlan::set_allocated_scan_index_name(std::string* scan_index_name) { + if (scan_index_name != nullptr) { + + } else { + + } + scan_index_name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), scan_index_name, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricPlan.scan_index_name) +} +inline std::string* MetricPlan::unsafe_arena_release_scan_index_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.MetricPlan.scan_index_name) + GOOGLE_DCHECK(GetArena() != nullptr); + + return scan_index_name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void MetricPlan::unsafe_arena_set_allocated_scan_index_name( + std::string* scan_index_name) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (scan_index_name != nullptr) { + + } else { + + } + scan_index_name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + scan_index_name, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricPlan.scan_index_name) +} + +// .yagpcc.ScanDirection scan_direction = 13; +inline void MetricPlan::clear_scan_direction() { + scan_direction_ = 0; +} +inline ::yagpcc::ScanDirection MetricPlan::_internal_scan_direction() const { + return static_cast< ::yagpcc::ScanDirection >(scan_direction_); +} +inline ::yagpcc::ScanDirection MetricPlan::scan_direction() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.scan_direction) + return _internal_scan_direction(); +} +inline void MetricPlan::_internal_set_scan_direction(::yagpcc::ScanDirection value) { + + scan_direction_ = value; +} +inline void MetricPlan::set_scan_direction(::yagpcc::ScanDirection value) { + _internal_set_scan_direction(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.scan_direction) +} + +// .yagpcc.MetricSliceInfo slice_info = 14; +inline bool MetricPlan::_internal_has_slice_info() const { + return this != internal_default_instance() && slice_info_ != nullptr; +} +inline bool MetricPlan::has_slice_info() const { + return _internal_has_slice_info(); +} +inline void MetricPlan::clear_slice_info() { + if (GetArena() == nullptr && slice_info_ != nullptr) { + delete slice_info_; + } + slice_info_ = nullptr; +} +inline const ::yagpcc::MetricSliceInfo& MetricPlan::_internal_slice_info() const { + const ::yagpcc::MetricSliceInfo* p = slice_info_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_MetricSliceInfo_default_instance_); +} +inline const ::yagpcc::MetricSliceInfo& MetricPlan::slice_info() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.slice_info) + return _internal_slice_info(); +} +inline void MetricPlan::unsafe_arena_set_allocated_slice_info( + ::yagpcc::MetricSliceInfo* slice_info) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(slice_info_); + } + slice_info_ = slice_info; + if (slice_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricPlan.slice_info) +} +inline ::yagpcc::MetricSliceInfo* MetricPlan::release_slice_info() { + auto temp = unsafe_arena_release_slice_info(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::MetricSliceInfo* MetricPlan::unsafe_arena_release_slice_info() { + // @@protoc_insertion_point(field_release:yagpcc.MetricPlan.slice_info) + + ::yagpcc::MetricSliceInfo* temp = slice_info_; + slice_info_ = nullptr; + return temp; +} +inline ::yagpcc::MetricSliceInfo* MetricPlan::_internal_mutable_slice_info() { + + if (slice_info_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::MetricSliceInfo>(GetArena()); + slice_info_ = p; + } + return slice_info_; +} +inline ::yagpcc::MetricSliceInfo* MetricPlan::mutable_slice_info() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricPlan.slice_info) + return _internal_mutable_slice_info(); +} +inline void MetricPlan::set_allocated_slice_info(::yagpcc::MetricSliceInfo* slice_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete slice_info_; + } + if (slice_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + ::PROTOBUF_NAMESPACE_ID::Arena::GetArena(slice_info); + if (message_arena != submessage_arena) { + slice_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, slice_info, submessage_arena); + } + + } else { + + } + slice_info_ = slice_info; + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricPlan.slice_info) +} + +// string statement = 15; +inline void MetricPlan::clear_statement() { + statement_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& MetricPlan::statement() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricPlan.statement) + return _internal_statement(); +} +inline void MetricPlan::set_statement(const std::string& value) { + _internal_set_statement(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricPlan.statement) +} +inline std::string* MetricPlan::mutable_statement() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricPlan.statement) + return _internal_mutable_statement(); +} +inline const std::string& MetricPlan::_internal_statement() const { + return statement_.Get(); +} +inline void MetricPlan::_internal_set_statement(const std::string& value) { + + statement_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void MetricPlan::set_statement(std::string&& value) { + + statement_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.MetricPlan.statement) +} +inline void MetricPlan::set_statement(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + statement_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.MetricPlan.statement) +} +inline void MetricPlan::set_statement(const char* value, + size_t size) { + + statement_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.MetricPlan.statement) +} +inline std::string* MetricPlan::_internal_mutable_statement() { + + return statement_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* MetricPlan::release_statement() { + // @@protoc_insertion_point(field_release:yagpcc.MetricPlan.statement) + return statement_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void MetricPlan::set_allocated_statement(std::string* statement) { + if (statement != nullptr) { + + } else { + + } + statement_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), statement, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricPlan.statement) +} +inline std::string* MetricPlan::unsafe_arena_release_statement() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.MetricPlan.statement) + GOOGLE_DCHECK(GetArena() != nullptr); + + return statement_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void MetricPlan::unsafe_arena_set_allocated_statement( + std::string* statement) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (statement != nullptr) { + + } else { + + } + statement_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + statement, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricPlan.statement) +} + +// ------------------------------------------------------------------- + +// MetricMotionInfo + +// .yagpcc.MotionType type = 1; +inline void MetricMotionInfo::clear_type() { + type_ = 0; +} +inline ::yagpcc::MotionType MetricMotionInfo::_internal_type() const { + return static_cast< ::yagpcc::MotionType >(type_); +} +inline ::yagpcc::MotionType MetricMotionInfo::type() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricMotionInfo.type) + return _internal_type(); +} +inline void MetricMotionInfo::_internal_set_type(::yagpcc::MotionType value) { + + type_ = value; +} +inline void MetricMotionInfo::set_type(::yagpcc::MotionType value) { + _internal_set_type(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricMotionInfo.type) +} + +// bool isBroadcast = 2; +inline void MetricMotionInfo::clear_isbroadcast() { + isbroadcast_ = false; +} +inline bool MetricMotionInfo::_internal_isbroadcast() const { + return isbroadcast_; +} +inline bool MetricMotionInfo::isbroadcast() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricMotionInfo.isBroadcast) + return _internal_isbroadcast(); +} +inline void MetricMotionInfo::_internal_set_isbroadcast(bool value) { + + isbroadcast_ = value; +} +inline void MetricMotionInfo::set_isbroadcast(bool value) { + _internal_set_isbroadcast(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricMotionInfo.isBroadcast) +} + +// .yagpcc.CdbLocusType locusType = 3; +inline void MetricMotionInfo::clear_locustype() { + locustype_ = 0; +} +inline ::yagpcc::CdbLocusType MetricMotionInfo::_internal_locustype() const { + return static_cast< ::yagpcc::CdbLocusType >(locustype_); +} +inline ::yagpcc::CdbLocusType MetricMotionInfo::locustype() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricMotionInfo.locusType) + return _internal_locustype(); +} +inline void MetricMotionInfo::_internal_set_locustype(::yagpcc::CdbLocusType value) { + + locustype_ = value; +} +inline void MetricMotionInfo::set_locustype(::yagpcc::CdbLocusType value) { + _internal_set_locustype(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricMotionInfo.locusType) +} + +// int32 sliceId = 4; +inline void MetricMotionInfo::clear_sliceid() { + sliceid_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricMotionInfo::_internal_sliceid() const { + return sliceid_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricMotionInfo::sliceid() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricMotionInfo.sliceId) + return _internal_sliceid(); +} +inline void MetricMotionInfo::_internal_set_sliceid(::PROTOBUF_NAMESPACE_ID::int32 value) { + + sliceid_ = value; +} +inline void MetricMotionInfo::set_sliceid(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_sliceid(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricMotionInfo.sliceId) +} + +// int32 parentSliceId = 5; +inline void MetricMotionInfo::clear_parentsliceid() { + parentsliceid_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricMotionInfo::_internal_parentsliceid() const { + return parentsliceid_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricMotionInfo::parentsliceid() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricMotionInfo.parentSliceId) + return _internal_parentsliceid(); +} +inline void MetricMotionInfo::_internal_set_parentsliceid(::PROTOBUF_NAMESPACE_ID::int32 value) { + + parentsliceid_ = value; +} +inline void MetricMotionInfo::set_parentsliceid(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_parentsliceid(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricMotionInfo.parentSliceId) +} + +// ------------------------------------------------------------------- + +// MetricRelationInfo + +// int32 oid = 1; +inline void MetricRelationInfo::clear_oid() { + oid_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricRelationInfo::_internal_oid() const { + return oid_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricRelationInfo::oid() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricRelationInfo.oid) + return _internal_oid(); +} +inline void MetricRelationInfo::_internal_set_oid(::PROTOBUF_NAMESPACE_ID::int32 value) { + + oid_ = value; +} +inline void MetricRelationInfo::set_oid(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_oid(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricRelationInfo.oid) +} + +// string name = 2; +inline void MetricRelationInfo::clear_name() { + name_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& MetricRelationInfo::name() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricRelationInfo.name) + return _internal_name(); +} +inline void MetricRelationInfo::set_name(const std::string& value) { + _internal_set_name(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricRelationInfo.name) +} +inline std::string* MetricRelationInfo::mutable_name() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricRelationInfo.name) + return _internal_mutable_name(); +} +inline const std::string& MetricRelationInfo::_internal_name() const { + return name_.Get(); +} +inline void MetricRelationInfo::_internal_set_name(const std::string& value) { + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void MetricRelationInfo::set_name(std::string&& value) { + + name_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.MetricRelationInfo.name) +} +inline void MetricRelationInfo::set_name(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.MetricRelationInfo.name) +} +inline void MetricRelationInfo::set_name(const char* value, + size_t size) { + + name_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.MetricRelationInfo.name) +} +inline std::string* MetricRelationInfo::_internal_mutable_name() { + + return name_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* MetricRelationInfo::release_name() { + // @@protoc_insertion_point(field_release:yagpcc.MetricRelationInfo.name) + return name_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void MetricRelationInfo::set_allocated_name(std::string* name) { + if (name != nullptr) { + + } else { + + } + name_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), name, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricRelationInfo.name) +} +inline std::string* MetricRelationInfo::unsafe_arena_release_name() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.MetricRelationInfo.name) + GOOGLE_DCHECK(GetArena() != nullptr); + + return name_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void MetricRelationInfo::unsafe_arena_set_allocated_name( + std::string* name) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (name != nullptr) { + + } else { + + } + name_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + name, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricRelationInfo.name) +} + +// string schema = 3; +inline void MetricRelationInfo::clear_schema() { + schema_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& MetricRelationInfo::schema() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricRelationInfo.schema) + return _internal_schema(); +} +inline void MetricRelationInfo::set_schema(const std::string& value) { + _internal_set_schema(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricRelationInfo.schema) +} +inline std::string* MetricRelationInfo::mutable_schema() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricRelationInfo.schema) + return _internal_mutable_schema(); +} +inline const std::string& MetricRelationInfo::_internal_schema() const { + return schema_.Get(); +} +inline void MetricRelationInfo::_internal_set_schema(const std::string& value) { + + schema_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void MetricRelationInfo::set_schema(std::string&& value) { + + schema_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.MetricRelationInfo.schema) +} +inline void MetricRelationInfo::set_schema(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + schema_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.MetricRelationInfo.schema) +} +inline void MetricRelationInfo::set_schema(const char* value, + size_t size) { + + schema_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.MetricRelationInfo.schema) +} +inline std::string* MetricRelationInfo::_internal_mutable_schema() { + + return schema_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* MetricRelationInfo::release_schema() { + // @@protoc_insertion_point(field_release:yagpcc.MetricRelationInfo.schema) + return schema_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void MetricRelationInfo::set_allocated_schema(std::string* schema) { + if (schema != nullptr) { + + } else { + + } + schema_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), schema, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricRelationInfo.schema) +} +inline std::string* MetricRelationInfo::unsafe_arena_release_schema() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.MetricRelationInfo.schema) + GOOGLE_DCHECK(GetArena() != nullptr); + + return schema_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void MetricRelationInfo::unsafe_arena_set_allocated_schema( + std::string* schema) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (schema != nullptr) { + + } else { + + } + schema_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + schema, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricRelationInfo.schema) +} + +// string alias = 4; +inline void MetricRelationInfo::clear_alias() { + alias_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& MetricRelationInfo::alias() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricRelationInfo.alias) + return _internal_alias(); +} +inline void MetricRelationInfo::set_alias(const std::string& value) { + _internal_set_alias(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricRelationInfo.alias) +} +inline std::string* MetricRelationInfo::mutable_alias() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricRelationInfo.alias) + return _internal_mutable_alias(); +} +inline const std::string& MetricRelationInfo::_internal_alias() const { + return alias_.Get(); +} +inline void MetricRelationInfo::_internal_set_alias(const std::string& value) { + + alias_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void MetricRelationInfo::set_alias(std::string&& value) { + + alias_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.MetricRelationInfo.alias) +} +inline void MetricRelationInfo::set_alias(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + alias_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.MetricRelationInfo.alias) +} +inline void MetricRelationInfo::set_alias(const char* value, + size_t size) { + + alias_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.MetricRelationInfo.alias) +} +inline std::string* MetricRelationInfo::_internal_mutable_alias() { + + return alias_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* MetricRelationInfo::release_alias() { + // @@protoc_insertion_point(field_release:yagpcc.MetricRelationInfo.alias) + return alias_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void MetricRelationInfo::set_allocated_alias(std::string* alias) { + if (alias != nullptr) { + + } else { + + } + alias_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), alias, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricRelationInfo.alias) +} +inline std::string* MetricRelationInfo::unsafe_arena_release_alias() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.MetricRelationInfo.alias) + GOOGLE_DCHECK(GetArena() != nullptr); + + return alias_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void MetricRelationInfo::unsafe_arena_set_allocated_alias( + std::string* alias) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (alias != nullptr) { + + } else { + + } + alias_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + alias, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricRelationInfo.alias) +} + +// int32 dynamicScanId = 5; +inline void MetricRelationInfo::clear_dynamicscanid() { + dynamicscanid_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricRelationInfo::_internal_dynamicscanid() const { + return dynamicscanid_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricRelationInfo::dynamicscanid() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricRelationInfo.dynamicScanId) + return _internal_dynamicscanid(); +} +inline void MetricRelationInfo::_internal_set_dynamicscanid(::PROTOBUF_NAMESPACE_ID::int32 value) { + + dynamicscanid_ = value; +} +inline void MetricRelationInfo::set_dynamicscanid(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_dynamicscanid(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricRelationInfo.dynamicScanId) +} + +// ------------------------------------------------------------------- + +// MetricSliceInfo + +// int32 slice = 1; +inline void MetricSliceInfo::clear_slice() { + slice_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricSliceInfo::_internal_slice() const { + return slice_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricSliceInfo::slice() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricSliceInfo.slice) + return _internal_slice(); +} +inline void MetricSliceInfo::_internal_set_slice(::PROTOBUF_NAMESPACE_ID::int32 value) { + + slice_ = value; +} +inline void MetricSliceInfo::set_slice(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_slice(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricSliceInfo.slice) +} + +// int32 segments = 2; +inline void MetricSliceInfo::clear_segments() { + segments_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricSliceInfo::_internal_segments() const { + return segments_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricSliceInfo::segments() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricSliceInfo.segments) + return _internal_segments(); +} +inline void MetricSliceInfo::_internal_set_segments(::PROTOBUF_NAMESPACE_ID::int32 value) { + + segments_ = value; +} +inline void MetricSliceInfo::set_segments(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_segments(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricSliceInfo.segments) +} + +// .yagpcc.GangType gangType = 3; +inline void MetricSliceInfo::clear_gangtype() { + gangtype_ = 0; +} +inline ::yagpcc::GangType MetricSliceInfo::_internal_gangtype() const { + return static_cast< ::yagpcc::GangType >(gangtype_); +} +inline ::yagpcc::GangType MetricSliceInfo::gangtype() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricSliceInfo.gangType) + return _internal_gangtype(); +} +inline void MetricSliceInfo::_internal_set_gangtype(::yagpcc::GangType value) { + + gangtype_ = value; +} +inline void MetricSliceInfo::set_gangtype(::yagpcc::GangType value) { + _internal_set_gangtype(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricSliceInfo.gangType) +} + +// int32 gang = 4; +inline void MetricSliceInfo::clear_gang() { + gang_ = 0; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricSliceInfo::_internal_gang() const { + return gang_; +} +inline ::PROTOBUF_NAMESPACE_ID::int32 MetricSliceInfo::gang() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricSliceInfo.gang) + return _internal_gang(); +} +inline void MetricSliceInfo::_internal_set_gang(::PROTOBUF_NAMESPACE_ID::int32 value) { + + gang_ = value; +} +inline void MetricSliceInfo::set_gang(::PROTOBUF_NAMESPACE_ID::int32 value) { + _internal_set_gang(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricSliceInfo.gang) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace yagpcc + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::yagpcc::ScanDirection> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::ScanDirection>() { + return ::yagpcc::ScanDirection_descriptor(); +} +template <> struct is_proto_enum< ::yagpcc::GangType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::GangType>() { + return ::yagpcc::GangType_descriptor(); +} +template <> struct is_proto_enum< ::yagpcc::CdbLocusType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::CdbLocusType>() { + return ::yagpcc::CdbLocusType_descriptor(); +} +template <> struct is_proto_enum< ::yagpcc::MotionType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::MotionType>() { + return ::yagpcc::MotionType_descriptor(); +} +template <> struct is_proto_enum< ::yagpcc::GpdbNodeType> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::GpdbNodeType>() { + return ::yagpcc::GpdbNodeType_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fplan_2eproto diff --git a/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_set_service.pb.cpp b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_set_service.pb.cpp new file mode 100644 index 00000000000..48ba67d6641 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_set_service.pb.cpp @@ -0,0 +1,1740 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/yagpcc_set_service.proto + +#include "protos/yagpcc_set_service.pb.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +// @@protoc_insertion_point(includes) +#include +extern PROTOBUF_INTERNAL_EXPORT_google_2fprotobuf_2ftimestamp_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_AdditionalQueryInfo_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fplan_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<3> scc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_QueryInfo_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_QueryKey_protos_2fyagpcc_5fmetrics_2eproto; +extern PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fmetrics_2eproto ::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_SegmentKey_protos_2fyagpcc_5fmetrics_2eproto; +namespace yagpcc { +class MetricResponseDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _MetricResponse_default_instance_; +class SetQueryReqDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _SetQueryReq_default_instance_; +class SetPlanNodeReqDefaultTypeInternal { + public: + ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed _instance; +} _SetPlanNodeReq_default_instance_; +} // namespace yagpcc +static void InitDefaultsscc_info_MetricResponse_protos_2fyagpcc_5fset_5fservice_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_MetricResponse_default_instance_; + new (ptr) ::yagpcc::MetricResponse(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::MetricResponse::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<0> scc_info_MetricResponse_protos_2fyagpcc_5fset_5fservice_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 0, 0, InitDefaultsscc_info_MetricResponse_protos_2fyagpcc_5fset_5fservice_2eproto}, {}}; + +static void InitDefaultsscc_info_SetPlanNodeReq_protos_2fyagpcc_5fset_5fservice_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_SetPlanNodeReq_default_instance_; + new (ptr) ::yagpcc::SetPlanNodeReq(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::SetPlanNodeReq::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<5> scc_info_SetPlanNodeReq_protos_2fyagpcc_5fset_5fservice_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 5, 0, InitDefaultsscc_info_SetPlanNodeReq_protos_2fyagpcc_5fset_5fservice_2eproto}, { + &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base, + &scc_info_QueryKey_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_SegmentKey_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto.base,}}; + +static void InitDefaultsscc_info_SetQueryReq_protos_2fyagpcc_5fset_5fservice_2eproto() { + GOOGLE_PROTOBUF_VERIFY_VERSION; + + { + void* ptr = &::yagpcc::_SetQueryReq_default_instance_; + new (ptr) ::yagpcc::SetQueryReq(); + ::PROTOBUF_NAMESPACE_ID::internal::OnShutdownDestroyMessage(ptr); + } + ::yagpcc::SetQueryReq::InitAsDefaultInstance(); +} + +::PROTOBUF_NAMESPACE_ID::internal::SCCInfo<7> scc_info_SetQueryReq_protos_2fyagpcc_5fset_5fservice_2eproto = + {{ATOMIC_VAR_INIT(::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase::kUninitialized), 7, 0, InitDefaultsscc_info_SetQueryReq_protos_2fyagpcc_5fset_5fservice_2eproto}, { + &scc_info_Timestamp_google_2fprotobuf_2ftimestamp_2eproto.base, + &scc_info_QueryKey_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_SegmentKey_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_QueryInfo_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_GPMetrics_protos_2fyagpcc_5fmetrics_2eproto.base, + &scc_info_MetricPlan_protos_2fyagpcc_5fplan_2eproto.base, + &scc_info_AdditionalQueryInfo_protos_2fyagpcc_5fmetrics_2eproto.base,}}; + +static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_protos_2fyagpcc_5fset_5fservice_2eproto[3]; +static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* file_level_enum_descriptors_protos_2fyagpcc_5fset_5fservice_2eproto[1]; +static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_protos_2fyagpcc_5fset_5fservice_2eproto = nullptr; + +const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_protos_2fyagpcc_5fset_5fservice_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricResponse, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricResponse, error_code_), + PROTOBUF_FIELD_OFFSET(::yagpcc::MetricResponse, error_text_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, query_status_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, datetime_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, query_key_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, segment_key_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, query_info_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, query_metrics_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, plan_tree_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, submit_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, start_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, end_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetQueryReq, add_info_), + ~0u, // no _has_bits_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, _internal_metadata_), + ~0u, // no _extensions_ + ~0u, // no _oneof_case_ + ~0u, // no _weak_field_map_ + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, node_status_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, datetime_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, query_key_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, segment_key_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, node_metrics_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, plan_node_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, submit_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, start_time_), + PROTOBUF_FIELD_OFFSET(::yagpcc::SetPlanNodeReq, end_time_), +}; +static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = { + { 0, -1, sizeof(::yagpcc::MetricResponse)}, + { 7, -1, sizeof(::yagpcc::SetQueryReq)}, + { 23, -1, sizeof(::yagpcc::SetPlanNodeReq)}, +}; + +static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = { + reinterpret_cast(&::yagpcc::_MetricResponse_default_instance_), + reinterpret_cast(&::yagpcc::_SetQueryReq_default_instance_), + reinterpret_cast(&::yagpcc::_SetPlanNodeReq_default_instance_), +}; + +const char descriptor_table_protodef_protos_2fyagpcc_5fset_5fservice_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = + "\n\037protos/yagpcc_set_service.proto\022\006yagpc" + "c\032\037google/protobuf/timestamp.proto\032\033prot" + "os/yagpcc_metrics.proto\032\030protos/yagpcc_p" + "lan.proto\"Z\n\016MetricResponse\0224\n\nerror_cod" + "e\030\001 \001(\0162 .yagpcc.MetricResponseStatusCod" + "e\022\022\n\nerror_text\030\002 \001(\t\"\352\003\n\013SetQueryReq\022)\n" + "\014query_status\030\001 \001(\0162\023.yagpcc.QueryStatus" + "\022,\n\010datetime\030\002 \001(\0132\032.google.protobuf.Tim" + "estamp\022#\n\tquery_key\030\003 \001(\0132\020.yagpcc.Query" + "Key\022\'\n\013segment_key\030\004 \001(\0132\022.yagpcc.Segmen" + "tKey\022%\n\nquery_info\030\005 \001(\0132\021.yagpcc.QueryI" + "nfo\022(\n\rquery_metrics\030\006 \001(\0132\021.yagpcc.GPMe" + "trics\022%\n\tplan_tree\030\007 \003(\0132\022.yagpcc.Metric" + "Plan\022/\n\013submit_time\030\010 \001(\0132\032.google.proto" + "buf.Timestamp\022.\n\nstart_time\030\t \001(\0132\032.goog" + "le.protobuf.Timestamp\022,\n\010end_time\030\n \001(\0132" + "\032.google.protobuf.Timestamp\022-\n\010add_info\030" + "\013 \001(\0132\033.yagpcc.AdditionalQueryInfo\"\230\003\n\016S" + "etPlanNodeReq\022+\n\013node_status\030\001 \001(\0162\026.yag" + "pcc.PlanNodeStatus\022,\n\010datetime\030\002 \001(\0132\032.g" + "oogle.protobuf.Timestamp\022#\n\tquery_key\030\003 " + "\001(\0132\020.yagpcc.QueryKey\022\'\n\013segment_key\030\004 \001" + "(\0132\022.yagpcc.SegmentKey\022\'\n\014node_metrics\030\005" + " \001(\0132\021.yagpcc.GPMetrics\022%\n\tplan_node\030\006 \001" + "(\0132\022.yagpcc.MetricPlan\022/\n\013submit_time\030\007 " + "\001(\0132\032.google.protobuf.Timestamp\022.\n\nstart" + "_time\030\010 \001(\0132\032.google.protobuf.Timestamp\022" + ",\n\010end_time\030\t \001(\0132\032.google.protobuf.Time" + "stamp*\227\001\n\030MetricResponseStatusCode\022+\n\'ME" + "TRIC_RESPONSE_STATUS_CODE_UNSPECIFIED\020\000\022" + "\'\n#METRIC_RESPONSE_STATUS_CODE_SUCCESS\020\001" + "\022%\n!METRIC_RESPONSE_STATUS_CODE_ERROR\020\0022" + "\226\001\n\014SetQueryInfo\022E\n\021SetMetricPlanNode\022\026." + "yagpcc.SetPlanNodeReq\032\026.yagpcc.MetricRes" + "ponse\"\000\022\?\n\016SetMetricQuery\022\023.yagpcc.SetQu" + "eryReq\032\026.yagpcc.MetricResponse\"\000BVB\017Segm" + "entYAGPCCASZCa.yandex-team.ru/cloud/mdb/" + "yagpcc/api/proto/agent_segment;greenplum" + "b\006proto3" + ; +static const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable*const descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto_deps[3] = { + &::descriptor_table_google_2fprotobuf_2ftimestamp_2eproto, + &::descriptor_table_protos_2fyagpcc_5fmetrics_2eproto, + &::descriptor_table_protos_2fyagpcc_5fplan_2eproto, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::SCCInfoBase*const descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto_sccs[3] = { + &scc_info_MetricResponse_protos_2fyagpcc_5fset_5fservice_2eproto.base, + &scc_info_SetPlanNodeReq_protos_2fyagpcc_5fset_5fservice_2eproto.base, + &scc_info_SetQueryReq_protos_2fyagpcc_5fset_5fservice_2eproto.base, +}; +static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto_once; +const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto = { + false, false, descriptor_table_protodef_protos_2fyagpcc_5fset_5fservice_2eproto, "protos/yagpcc_set_service.proto", 1528, + &descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto_once, descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto_sccs, descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto_deps, 3, 3, + schemas, file_default_instances, TableStruct_protos_2fyagpcc_5fset_5fservice_2eproto::offsets, + file_level_metadata_protos_2fyagpcc_5fset_5fservice_2eproto, 3, file_level_enum_descriptors_protos_2fyagpcc_5fset_5fservice_2eproto, file_level_service_descriptors_protos_2fyagpcc_5fset_5fservice_2eproto, +}; + +// Force running AddDescriptors() at dynamic initialization time. +static bool dynamic_init_dummy_protos_2fyagpcc_5fset_5fservice_2eproto = (static_cast(::PROTOBUF_NAMESPACE_ID::internal::AddDescriptors(&descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto)), true); +namespace yagpcc { +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MetricResponseStatusCode_descriptor() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto); + return file_level_enum_descriptors_protos_2fyagpcc_5fset_5fservice_2eproto[0]; +} +bool MetricResponseStatusCode_IsValid(int value) { + switch (value) { + case 0: + case 1: + case 2: + return true; + default: + return false; + } +} + + +// =================================================================== + +void MetricResponse::InitAsDefaultInstance() { +} +class MetricResponse::_Internal { + public: +}; + +MetricResponse::MetricResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.MetricResponse) +} +MetricResponse::MetricResponse(const MetricResponse& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + error_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + if (!from._internal_error_text().empty()) { + error_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), from._internal_error_text(), + GetArena()); + } + error_code_ = from.error_code_; + // @@protoc_insertion_point(copy_constructor:yagpcc.MetricResponse) +} + +void MetricResponse::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_MetricResponse_protos_2fyagpcc_5fset_5fservice_2eproto.base); + error_text_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); + error_code_ = 0; +} + +MetricResponse::~MetricResponse() { + // @@protoc_insertion_point(destructor:yagpcc.MetricResponse) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void MetricResponse::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + error_text_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited()); +} + +void MetricResponse::ArenaDtor(void* object) { + MetricResponse* _this = reinterpret_cast< MetricResponse* >(object); + (void)_this; +} +void MetricResponse::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void MetricResponse::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const MetricResponse& MetricResponse::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_MetricResponse_protos_2fyagpcc_5fset_5fservice_2eproto.base); + return *internal_default_instance(); +} + + +void MetricResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.MetricResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + error_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + error_code_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* MetricResponse::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .yagpcc.MetricResponseStatusCode error_code = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_error_code(static_cast<::yagpcc::MetricResponseStatusCode>(val)); + } else goto handle_unusual; + continue; + // string error_text = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + auto str = _internal_mutable_error_text(); + ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx); + CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "yagpcc.MetricResponse.error_text")); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* MetricResponse::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.MetricResponse) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .yagpcc.MetricResponseStatusCode error_code = 1; + if (this->error_code() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_error_code(), target); + } + + // string error_text = 2; + if (this->error_text().size() > 0) { + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String( + this->_internal_error_text().data(), static_cast(this->_internal_error_text().length()), + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE, + "yagpcc.MetricResponse.error_text"); + target = stream->WriteStringMaybeAliased( + 2, this->_internal_error_text(), target); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.MetricResponse) + return target; +} + +size_t MetricResponse::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.MetricResponse) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // string error_text = 2; + if (this->error_text().size() > 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize( + this->_internal_error_text()); + } + + // .yagpcc.MetricResponseStatusCode error_code = 1; + if (this->error_code() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_error_code()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void MetricResponse::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.MetricResponse) + GOOGLE_DCHECK_NE(&from, this); + const MetricResponse* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.MetricResponse) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.MetricResponse) + MergeFrom(*source); + } +} + +void MetricResponse::MergeFrom(const MetricResponse& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.MetricResponse) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.error_text().size() > 0) { + _internal_set_error_text(from._internal_error_text()); + } + if (from.error_code() != 0) { + _internal_set_error_code(from._internal_error_code()); + } +} + +void MetricResponse::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.MetricResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void MetricResponse::CopyFrom(const MetricResponse& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.MetricResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool MetricResponse::IsInitialized() const { + return true; +} + +void MetricResponse::InternalSwap(MetricResponse* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + error_text_.Swap(&other->error_text_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); + swap(error_code_, other->error_code_); +} + +::PROTOBUF_NAMESPACE_ID::Metadata MetricResponse::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void SetQueryReq::InitAsDefaultInstance() { + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->datetime_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->query_key_ = const_cast< ::yagpcc::QueryKey*>( + ::yagpcc::QueryKey::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->segment_key_ = const_cast< ::yagpcc::SegmentKey*>( + ::yagpcc::SegmentKey::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->query_info_ = const_cast< ::yagpcc::QueryInfo*>( + ::yagpcc::QueryInfo::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->query_metrics_ = const_cast< ::yagpcc::GPMetrics*>( + ::yagpcc::GPMetrics::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->submit_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->start_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->end_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); + ::yagpcc::_SetQueryReq_default_instance_._instance.get_mutable()->add_info_ = const_cast< ::yagpcc::AdditionalQueryInfo*>( + ::yagpcc::AdditionalQueryInfo::internal_default_instance()); +} +class SetQueryReq::_Internal { + public: + static const PROTOBUF_NAMESPACE_ID::Timestamp& datetime(const SetQueryReq* msg); + static const ::yagpcc::QueryKey& query_key(const SetQueryReq* msg); + static const ::yagpcc::SegmentKey& segment_key(const SetQueryReq* msg); + static const ::yagpcc::QueryInfo& query_info(const SetQueryReq* msg); + static const ::yagpcc::GPMetrics& query_metrics(const SetQueryReq* msg); + static const PROTOBUF_NAMESPACE_ID::Timestamp& submit_time(const SetQueryReq* msg); + static const PROTOBUF_NAMESPACE_ID::Timestamp& start_time(const SetQueryReq* msg); + static const PROTOBUF_NAMESPACE_ID::Timestamp& end_time(const SetQueryReq* msg); + static const ::yagpcc::AdditionalQueryInfo& add_info(const SetQueryReq* msg); +}; + +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetQueryReq::_Internal::datetime(const SetQueryReq* msg) { + return *msg->datetime_; +} +const ::yagpcc::QueryKey& +SetQueryReq::_Internal::query_key(const SetQueryReq* msg) { + return *msg->query_key_; +} +const ::yagpcc::SegmentKey& +SetQueryReq::_Internal::segment_key(const SetQueryReq* msg) { + return *msg->segment_key_; +} +const ::yagpcc::QueryInfo& +SetQueryReq::_Internal::query_info(const SetQueryReq* msg) { + return *msg->query_info_; +} +const ::yagpcc::GPMetrics& +SetQueryReq::_Internal::query_metrics(const SetQueryReq* msg) { + return *msg->query_metrics_; +} +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetQueryReq::_Internal::submit_time(const SetQueryReq* msg) { + return *msg->submit_time_; +} +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetQueryReq::_Internal::start_time(const SetQueryReq* msg) { + return *msg->start_time_; +} +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetQueryReq::_Internal::end_time(const SetQueryReq* msg) { + return *msg->end_time_; +} +const ::yagpcc::AdditionalQueryInfo& +SetQueryReq::_Internal::add_info(const SetQueryReq* msg) { + return *msg->add_info_; +} +void SetQueryReq::clear_datetime() { + if (GetArena() == nullptr && datetime_ != nullptr) { + delete datetime_; + } + datetime_ = nullptr; +} +void SetQueryReq::clear_query_key() { + if (GetArena() == nullptr && query_key_ != nullptr) { + delete query_key_; + } + query_key_ = nullptr; +} +void SetQueryReq::clear_segment_key() { + if (GetArena() == nullptr && segment_key_ != nullptr) { + delete segment_key_; + } + segment_key_ = nullptr; +} +void SetQueryReq::clear_query_info() { + if (GetArena() == nullptr && query_info_ != nullptr) { + delete query_info_; + } + query_info_ = nullptr; +} +void SetQueryReq::clear_query_metrics() { + if (GetArena() == nullptr && query_metrics_ != nullptr) { + delete query_metrics_; + } + query_metrics_ = nullptr; +} +void SetQueryReq::clear_plan_tree() { + plan_tree_.Clear(); +} +void SetQueryReq::clear_submit_time() { + if (GetArena() == nullptr && submit_time_ != nullptr) { + delete submit_time_; + } + submit_time_ = nullptr; +} +void SetQueryReq::clear_start_time() { + if (GetArena() == nullptr && start_time_ != nullptr) { + delete start_time_; + } + start_time_ = nullptr; +} +void SetQueryReq::clear_end_time() { + if (GetArena() == nullptr && end_time_ != nullptr) { + delete end_time_; + } + end_time_ = nullptr; +} +void SetQueryReq::clear_add_info() { + if (GetArena() == nullptr && add_info_ != nullptr) { + delete add_info_; + } + add_info_ = nullptr; +} +SetQueryReq::SetQueryReq(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena), + plan_tree_(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.SetQueryReq) +} +SetQueryReq::SetQueryReq(const SetQueryReq& from) + : ::PROTOBUF_NAMESPACE_ID::Message(), + plan_tree_(from.plan_tree_) { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_datetime()) { + datetime_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.datetime_); + } else { + datetime_ = nullptr; + } + if (from._internal_has_query_key()) { + query_key_ = new ::yagpcc::QueryKey(*from.query_key_); + } else { + query_key_ = nullptr; + } + if (from._internal_has_segment_key()) { + segment_key_ = new ::yagpcc::SegmentKey(*from.segment_key_); + } else { + segment_key_ = nullptr; + } + if (from._internal_has_query_info()) { + query_info_ = new ::yagpcc::QueryInfo(*from.query_info_); + } else { + query_info_ = nullptr; + } + if (from._internal_has_query_metrics()) { + query_metrics_ = new ::yagpcc::GPMetrics(*from.query_metrics_); + } else { + query_metrics_ = nullptr; + } + if (from._internal_has_submit_time()) { + submit_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.submit_time_); + } else { + submit_time_ = nullptr; + } + if (from._internal_has_start_time()) { + start_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.start_time_); + } else { + start_time_ = nullptr; + } + if (from._internal_has_end_time()) { + end_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.end_time_); + } else { + end_time_ = nullptr; + } + if (from._internal_has_add_info()) { + add_info_ = new ::yagpcc::AdditionalQueryInfo(*from.add_info_); + } else { + add_info_ = nullptr; + } + query_status_ = from.query_status_; + // @@protoc_insertion_point(copy_constructor:yagpcc.SetQueryReq) +} + +void SetQueryReq::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SetQueryReq_protos_2fyagpcc_5fset_5fservice_2eproto.base); + ::memset(&datetime_, 0, static_cast( + reinterpret_cast(&query_status_) - + reinterpret_cast(&datetime_)) + sizeof(query_status_)); +} + +SetQueryReq::~SetQueryReq() { + // @@protoc_insertion_point(destructor:yagpcc.SetQueryReq) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void SetQueryReq::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete datetime_; + if (this != internal_default_instance()) delete query_key_; + if (this != internal_default_instance()) delete segment_key_; + if (this != internal_default_instance()) delete query_info_; + if (this != internal_default_instance()) delete query_metrics_; + if (this != internal_default_instance()) delete submit_time_; + if (this != internal_default_instance()) delete start_time_; + if (this != internal_default_instance()) delete end_time_; + if (this != internal_default_instance()) delete add_info_; +} + +void SetQueryReq::ArenaDtor(void* object) { + SetQueryReq* _this = reinterpret_cast< SetQueryReq* >(object); + (void)_this; +} +void SetQueryReq::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SetQueryReq::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const SetQueryReq& SetQueryReq::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SetQueryReq_protos_2fyagpcc_5fset_5fservice_2eproto.base); + return *internal_default_instance(); +} + + +void SetQueryReq::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.SetQueryReq) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + plan_tree_.Clear(); + if (GetArena() == nullptr && datetime_ != nullptr) { + delete datetime_; + } + datetime_ = nullptr; + if (GetArena() == nullptr && query_key_ != nullptr) { + delete query_key_; + } + query_key_ = nullptr; + if (GetArena() == nullptr && segment_key_ != nullptr) { + delete segment_key_; + } + segment_key_ = nullptr; + if (GetArena() == nullptr && query_info_ != nullptr) { + delete query_info_; + } + query_info_ = nullptr; + if (GetArena() == nullptr && query_metrics_ != nullptr) { + delete query_metrics_; + } + query_metrics_ = nullptr; + if (GetArena() == nullptr && submit_time_ != nullptr) { + delete submit_time_; + } + submit_time_ = nullptr; + if (GetArena() == nullptr && start_time_ != nullptr) { + delete start_time_; + } + start_time_ = nullptr; + if (GetArena() == nullptr && end_time_ != nullptr) { + delete end_time_; + } + end_time_ = nullptr; + if (GetArena() == nullptr && add_info_ != nullptr) { + delete add_info_; + } + add_info_ = nullptr; + query_status_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SetQueryReq::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .yagpcc.QueryStatus query_status = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_query_status(static_cast<::yagpcc::QueryStatus>(val)); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp datetime = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_datetime(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.QueryKey query_key = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_query_key(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.SegmentKey segment_key = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_segment_key(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.QueryInfo query_info = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_query_info(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.GPMetrics query_metrics = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_query_metrics(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // repeated .yagpcc.MetricPlan plan_tree = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + ptr -= 1; + do { + ptr += 1; + ptr = ctx->ParseMessage(_internal_add_plan_tree(), ptr); + CHK_(ptr); + if (!ctx->DataAvailable(ptr)) break; + } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr)); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp submit_time = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_submit_time(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp start_time = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + ptr = ctx->ParseMessage(_internal_mutable_start_time(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp end_time = 10; + case 10: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 82)) { + ptr = ctx->ParseMessage(_internal_mutable_end_time(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.AdditionalQueryInfo add_info = 11; + case 11: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 90)) { + ptr = ctx->ParseMessage(_internal_mutable_add_info(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* SetQueryReq::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.SetQueryReq) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .yagpcc.QueryStatus query_status = 1; + if (this->query_status() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_query_status(), target); + } + + // .google.protobuf.Timestamp datetime = 2; + if (this->has_datetime()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 2, _Internal::datetime(this), target, stream); + } + + // .yagpcc.QueryKey query_key = 3; + if (this->has_query_key()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 3, _Internal::query_key(this), target, stream); + } + + // .yagpcc.SegmentKey segment_key = 4; + if (this->has_segment_key()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 4, _Internal::segment_key(this), target, stream); + } + + // .yagpcc.QueryInfo query_info = 5; + if (this->has_query_info()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 5, _Internal::query_info(this), target, stream); + } + + // .yagpcc.GPMetrics query_metrics = 6; + if (this->has_query_metrics()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 6, _Internal::query_metrics(this), target, stream); + } + + // repeated .yagpcc.MetricPlan plan_tree = 7; + for (unsigned int i = 0, + n = static_cast(this->_internal_plan_tree_size()); i < n; i++) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage(7, this->_internal_plan_tree(i), target, stream); + } + + // .google.protobuf.Timestamp submit_time = 8; + if (this->has_submit_time()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 8, _Internal::submit_time(this), target, stream); + } + + // .google.protobuf.Timestamp start_time = 9; + if (this->has_start_time()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 9, _Internal::start_time(this), target, stream); + } + + // .google.protobuf.Timestamp end_time = 10; + if (this->has_end_time()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 10, _Internal::end_time(this), target, stream); + } + + // .yagpcc.AdditionalQueryInfo add_info = 11; + if (this->has_add_info()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 11, _Internal::add_info(this), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.SetQueryReq) + return target; +} + +size_t SetQueryReq::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.SetQueryReq) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // repeated .yagpcc.MetricPlan plan_tree = 7; + total_size += 1UL * this->_internal_plan_tree_size(); + for (const auto& msg : this->plan_tree_) { + total_size += + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg); + } + + // .google.protobuf.Timestamp datetime = 2; + if (this->has_datetime()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *datetime_); + } + + // .yagpcc.QueryKey query_key = 3; + if (this->has_query_key()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *query_key_); + } + + // .yagpcc.SegmentKey segment_key = 4; + if (this->has_segment_key()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *segment_key_); + } + + // .yagpcc.QueryInfo query_info = 5; + if (this->has_query_info()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *query_info_); + } + + // .yagpcc.GPMetrics query_metrics = 6; + if (this->has_query_metrics()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *query_metrics_); + } + + // .google.protobuf.Timestamp submit_time = 8; + if (this->has_submit_time()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *submit_time_); + } + + // .google.protobuf.Timestamp start_time = 9; + if (this->has_start_time()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *start_time_); + } + + // .google.protobuf.Timestamp end_time = 10; + if (this->has_end_time()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *end_time_); + } + + // .yagpcc.AdditionalQueryInfo add_info = 11; + if (this->has_add_info()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *add_info_); + } + + // .yagpcc.QueryStatus query_status = 1; + if (this->query_status() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_query_status()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SetQueryReq::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.SetQueryReq) + GOOGLE_DCHECK_NE(&from, this); + const SetQueryReq* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.SetQueryReq) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.SetQueryReq) + MergeFrom(*source); + } +} + +void SetQueryReq::MergeFrom(const SetQueryReq& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.SetQueryReq) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + plan_tree_.MergeFrom(from.plan_tree_); + if (from.has_datetime()) { + _internal_mutable_datetime()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_datetime()); + } + if (from.has_query_key()) { + _internal_mutable_query_key()->::yagpcc::QueryKey::MergeFrom(from._internal_query_key()); + } + if (from.has_segment_key()) { + _internal_mutable_segment_key()->::yagpcc::SegmentKey::MergeFrom(from._internal_segment_key()); + } + if (from.has_query_info()) { + _internal_mutable_query_info()->::yagpcc::QueryInfo::MergeFrom(from._internal_query_info()); + } + if (from.has_query_metrics()) { + _internal_mutable_query_metrics()->::yagpcc::GPMetrics::MergeFrom(from._internal_query_metrics()); + } + if (from.has_submit_time()) { + _internal_mutable_submit_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_submit_time()); + } + if (from.has_start_time()) { + _internal_mutable_start_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_start_time()); + } + if (from.has_end_time()) { + _internal_mutable_end_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_end_time()); + } + if (from.has_add_info()) { + _internal_mutable_add_info()->::yagpcc::AdditionalQueryInfo::MergeFrom(from._internal_add_info()); + } + if (from.query_status() != 0) { + _internal_set_query_status(from._internal_query_status()); + } +} + +void SetQueryReq::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.SetQueryReq) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SetQueryReq::CopyFrom(const SetQueryReq& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.SetQueryReq) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SetQueryReq::IsInitialized() const { + return true; +} + +void SetQueryReq::InternalSwap(SetQueryReq* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + plan_tree_.InternalSwap(&other->plan_tree_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SetQueryReq, query_status_) + + sizeof(SetQueryReq::query_status_) + - PROTOBUF_FIELD_OFFSET(SetQueryReq, datetime_)>( + reinterpret_cast(&datetime_), + reinterpret_cast(&other->datetime_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SetQueryReq::GetMetadata() const { + return GetMetadataStatic(); +} + + +// =================================================================== + +void SetPlanNodeReq::InitAsDefaultInstance() { + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->datetime_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->query_key_ = const_cast< ::yagpcc::QueryKey*>( + ::yagpcc::QueryKey::internal_default_instance()); + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->segment_key_ = const_cast< ::yagpcc::SegmentKey*>( + ::yagpcc::SegmentKey::internal_default_instance()); + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->node_metrics_ = const_cast< ::yagpcc::GPMetrics*>( + ::yagpcc::GPMetrics::internal_default_instance()); + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->plan_node_ = const_cast< ::yagpcc::MetricPlan*>( + ::yagpcc::MetricPlan::internal_default_instance()); + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->submit_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->start_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); + ::yagpcc::_SetPlanNodeReq_default_instance_._instance.get_mutable()->end_time_ = const_cast< PROTOBUF_NAMESPACE_ID::Timestamp*>( + PROTOBUF_NAMESPACE_ID::Timestamp::internal_default_instance()); +} +class SetPlanNodeReq::_Internal { + public: + static const PROTOBUF_NAMESPACE_ID::Timestamp& datetime(const SetPlanNodeReq* msg); + static const ::yagpcc::QueryKey& query_key(const SetPlanNodeReq* msg); + static const ::yagpcc::SegmentKey& segment_key(const SetPlanNodeReq* msg); + static const ::yagpcc::GPMetrics& node_metrics(const SetPlanNodeReq* msg); + static const ::yagpcc::MetricPlan& plan_node(const SetPlanNodeReq* msg); + static const PROTOBUF_NAMESPACE_ID::Timestamp& submit_time(const SetPlanNodeReq* msg); + static const PROTOBUF_NAMESPACE_ID::Timestamp& start_time(const SetPlanNodeReq* msg); + static const PROTOBUF_NAMESPACE_ID::Timestamp& end_time(const SetPlanNodeReq* msg); +}; + +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetPlanNodeReq::_Internal::datetime(const SetPlanNodeReq* msg) { + return *msg->datetime_; +} +const ::yagpcc::QueryKey& +SetPlanNodeReq::_Internal::query_key(const SetPlanNodeReq* msg) { + return *msg->query_key_; +} +const ::yagpcc::SegmentKey& +SetPlanNodeReq::_Internal::segment_key(const SetPlanNodeReq* msg) { + return *msg->segment_key_; +} +const ::yagpcc::GPMetrics& +SetPlanNodeReq::_Internal::node_metrics(const SetPlanNodeReq* msg) { + return *msg->node_metrics_; +} +const ::yagpcc::MetricPlan& +SetPlanNodeReq::_Internal::plan_node(const SetPlanNodeReq* msg) { + return *msg->plan_node_; +} +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetPlanNodeReq::_Internal::submit_time(const SetPlanNodeReq* msg) { + return *msg->submit_time_; +} +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetPlanNodeReq::_Internal::start_time(const SetPlanNodeReq* msg) { + return *msg->start_time_; +} +const PROTOBUF_NAMESPACE_ID::Timestamp& +SetPlanNodeReq::_Internal::end_time(const SetPlanNodeReq* msg) { + return *msg->end_time_; +} +void SetPlanNodeReq::clear_datetime() { + if (GetArena() == nullptr && datetime_ != nullptr) { + delete datetime_; + } + datetime_ = nullptr; +} +void SetPlanNodeReq::clear_query_key() { + if (GetArena() == nullptr && query_key_ != nullptr) { + delete query_key_; + } + query_key_ = nullptr; +} +void SetPlanNodeReq::clear_segment_key() { + if (GetArena() == nullptr && segment_key_ != nullptr) { + delete segment_key_; + } + segment_key_ = nullptr; +} +void SetPlanNodeReq::clear_node_metrics() { + if (GetArena() == nullptr && node_metrics_ != nullptr) { + delete node_metrics_; + } + node_metrics_ = nullptr; +} +void SetPlanNodeReq::clear_plan_node() { + if (GetArena() == nullptr && plan_node_ != nullptr) { + delete plan_node_; + } + plan_node_ = nullptr; +} +void SetPlanNodeReq::clear_submit_time() { + if (GetArena() == nullptr && submit_time_ != nullptr) { + delete submit_time_; + } + submit_time_ = nullptr; +} +void SetPlanNodeReq::clear_start_time() { + if (GetArena() == nullptr && start_time_ != nullptr) { + delete start_time_; + } + start_time_ = nullptr; +} +void SetPlanNodeReq::clear_end_time() { + if (GetArena() == nullptr && end_time_ != nullptr) { + delete end_time_; + } + end_time_ = nullptr; +} +SetPlanNodeReq::SetPlanNodeReq(::PROTOBUF_NAMESPACE_ID::Arena* arena) + : ::PROTOBUF_NAMESPACE_ID::Message(arena) { + SharedCtor(); + RegisterArenaDtor(arena); + // @@protoc_insertion_point(arena_constructor:yagpcc.SetPlanNodeReq) +} +SetPlanNodeReq::SetPlanNodeReq(const SetPlanNodeReq& from) + : ::PROTOBUF_NAMESPACE_ID::Message() { + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + if (from._internal_has_datetime()) { + datetime_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.datetime_); + } else { + datetime_ = nullptr; + } + if (from._internal_has_query_key()) { + query_key_ = new ::yagpcc::QueryKey(*from.query_key_); + } else { + query_key_ = nullptr; + } + if (from._internal_has_segment_key()) { + segment_key_ = new ::yagpcc::SegmentKey(*from.segment_key_); + } else { + segment_key_ = nullptr; + } + if (from._internal_has_node_metrics()) { + node_metrics_ = new ::yagpcc::GPMetrics(*from.node_metrics_); + } else { + node_metrics_ = nullptr; + } + if (from._internal_has_plan_node()) { + plan_node_ = new ::yagpcc::MetricPlan(*from.plan_node_); + } else { + plan_node_ = nullptr; + } + if (from._internal_has_submit_time()) { + submit_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.submit_time_); + } else { + submit_time_ = nullptr; + } + if (from._internal_has_start_time()) { + start_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.start_time_); + } else { + start_time_ = nullptr; + } + if (from._internal_has_end_time()) { + end_time_ = new PROTOBUF_NAMESPACE_ID::Timestamp(*from.end_time_); + } else { + end_time_ = nullptr; + } + node_status_ = from.node_status_; + // @@protoc_insertion_point(copy_constructor:yagpcc.SetPlanNodeReq) +} + +void SetPlanNodeReq::SharedCtor() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&scc_info_SetPlanNodeReq_protos_2fyagpcc_5fset_5fservice_2eproto.base); + ::memset(&datetime_, 0, static_cast( + reinterpret_cast(&node_status_) - + reinterpret_cast(&datetime_)) + sizeof(node_status_)); +} + +SetPlanNodeReq::~SetPlanNodeReq() { + // @@protoc_insertion_point(destructor:yagpcc.SetPlanNodeReq) + SharedDtor(); + _internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +void SetPlanNodeReq::SharedDtor() { + GOOGLE_DCHECK(GetArena() == nullptr); + if (this != internal_default_instance()) delete datetime_; + if (this != internal_default_instance()) delete query_key_; + if (this != internal_default_instance()) delete segment_key_; + if (this != internal_default_instance()) delete node_metrics_; + if (this != internal_default_instance()) delete plan_node_; + if (this != internal_default_instance()) delete submit_time_; + if (this != internal_default_instance()) delete start_time_; + if (this != internal_default_instance()) delete end_time_; +} + +void SetPlanNodeReq::ArenaDtor(void* object) { + SetPlanNodeReq* _this = reinterpret_cast< SetPlanNodeReq* >(object); + (void)_this; +} +void SetPlanNodeReq::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) { +} +void SetPlanNodeReq::SetCachedSize(int size) const { + _cached_size_.Set(size); +} +const SetPlanNodeReq& SetPlanNodeReq::default_instance() { + ::PROTOBUF_NAMESPACE_ID::internal::InitSCC(&::scc_info_SetPlanNodeReq_protos_2fyagpcc_5fset_5fservice_2eproto.base); + return *internal_default_instance(); +} + + +void SetPlanNodeReq::Clear() { +// @@protoc_insertion_point(message_clear_start:yagpcc.SetPlanNodeReq) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + if (GetArena() == nullptr && datetime_ != nullptr) { + delete datetime_; + } + datetime_ = nullptr; + if (GetArena() == nullptr && query_key_ != nullptr) { + delete query_key_; + } + query_key_ = nullptr; + if (GetArena() == nullptr && segment_key_ != nullptr) { + delete segment_key_; + } + segment_key_ = nullptr; + if (GetArena() == nullptr && node_metrics_ != nullptr) { + delete node_metrics_; + } + node_metrics_ = nullptr; + if (GetArena() == nullptr && plan_node_ != nullptr) { + delete plan_node_; + } + plan_node_ = nullptr; + if (GetArena() == nullptr && submit_time_ != nullptr) { + delete submit_time_; + } + submit_time_ = nullptr; + if (GetArena() == nullptr && start_time_ != nullptr) { + delete start_time_; + } + start_time_ = nullptr; + if (GetArena() == nullptr && end_time_ != nullptr) { + delete end_time_; + } + end_time_ = nullptr; + node_status_ = 0; + _internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(); +} + +const char* SetPlanNodeReq::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) { +#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure + ::PROTOBUF_NAMESPACE_ID::Arena* arena = GetArena(); (void)arena; + while (!ctx->Done(&ptr)) { + ::PROTOBUF_NAMESPACE_ID::uint32 tag; + ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag); + CHK_(ptr); + switch (tag >> 3) { + // .yagpcc.PlanNodeStatus node_status = 1; + case 1: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 8)) { + ::PROTOBUF_NAMESPACE_ID::uint64 val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr); + CHK_(ptr); + _internal_set_node_status(static_cast<::yagpcc::PlanNodeStatus>(val)); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp datetime = 2; + case 2: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) { + ptr = ctx->ParseMessage(_internal_mutable_datetime(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.QueryKey query_key = 3; + case 3: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 26)) { + ptr = ctx->ParseMessage(_internal_mutable_query_key(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.SegmentKey segment_key = 4; + case 4: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 34)) { + ptr = ctx->ParseMessage(_internal_mutable_segment_key(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.GPMetrics node_metrics = 5; + case 5: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 42)) { + ptr = ctx->ParseMessage(_internal_mutable_node_metrics(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .yagpcc.MetricPlan plan_node = 6; + case 6: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 50)) { + ptr = ctx->ParseMessage(_internal_mutable_plan_node(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp submit_time = 7; + case 7: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 58)) { + ptr = ctx->ParseMessage(_internal_mutable_submit_time(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp start_time = 8; + case 8: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 66)) { + ptr = ctx->ParseMessage(_internal_mutable_start_time(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + // .google.protobuf.Timestamp end_time = 9; + case 9: + if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 74)) { + ptr = ctx->ParseMessage(_internal_mutable_end_time(), ptr); + CHK_(ptr); + } else goto handle_unusual; + continue; + default: { + handle_unusual: + if ((tag & 7) == 4 || tag == 0) { + ctx->SetLastTag(tag); + goto success; + } + ptr = UnknownFieldParse(tag, + _internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(), + ptr, ctx); + CHK_(ptr != nullptr); + continue; + } + } // switch + } // while +success: + return ptr; +failure: + ptr = nullptr; + goto success; +#undef CHK_ +} + +::PROTOBUF_NAMESPACE_ID::uint8* SetPlanNodeReq::_InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const { + // @@protoc_insertion_point(serialize_to_array_start:yagpcc.SetPlanNodeReq) + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + // .yagpcc.PlanNodeStatus node_status = 1; + if (this->node_status() != 0) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::WriteEnumToArray( + 1, this->_internal_node_status(), target); + } + + // .google.protobuf.Timestamp datetime = 2; + if (this->has_datetime()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 2, _Internal::datetime(this), target, stream); + } + + // .yagpcc.QueryKey query_key = 3; + if (this->has_query_key()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 3, _Internal::query_key(this), target, stream); + } + + // .yagpcc.SegmentKey segment_key = 4; + if (this->has_segment_key()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 4, _Internal::segment_key(this), target, stream); + } + + // .yagpcc.GPMetrics node_metrics = 5; + if (this->has_node_metrics()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 5, _Internal::node_metrics(this), target, stream); + } + + // .yagpcc.MetricPlan plan_node = 6; + if (this->has_plan_node()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 6, _Internal::plan_node(this), target, stream); + } + + // .google.protobuf.Timestamp submit_time = 7; + if (this->has_submit_time()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 7, _Internal::submit_time(this), target, stream); + } + + // .google.protobuf.Timestamp start_time = 8; + if (this->has_start_time()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 8, _Internal::start_time(this), target, stream); + } + + // .google.protobuf.Timestamp end_time = 9; + if (this->has_end_time()) { + target = stream->EnsureSpace(target); + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite:: + InternalWriteMessage( + 9, _Internal::end_time(this), target, stream); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray( + _internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:yagpcc.SetPlanNodeReq) + return target; +} + +size_t SetPlanNodeReq::ByteSizeLong() const { +// @@protoc_insertion_point(message_byte_size_start:yagpcc.SetPlanNodeReq) + size_t total_size = 0; + + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + // .google.protobuf.Timestamp datetime = 2; + if (this->has_datetime()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *datetime_); + } + + // .yagpcc.QueryKey query_key = 3; + if (this->has_query_key()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *query_key_); + } + + // .yagpcc.SegmentKey segment_key = 4; + if (this->has_segment_key()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *segment_key_); + } + + // .yagpcc.GPMetrics node_metrics = 5; + if (this->has_node_metrics()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *node_metrics_); + } + + // .yagpcc.MetricPlan plan_node = 6; + if (this->has_plan_node()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *plan_node_); + } + + // .google.protobuf.Timestamp submit_time = 7; + if (this->has_submit_time()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *submit_time_); + } + + // .google.protobuf.Timestamp start_time = 8; + if (this->has_start_time()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *start_time_); + } + + // .google.protobuf.Timestamp end_time = 9; + if (this->has_end_time()) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize( + *end_time_); + } + + // .yagpcc.PlanNodeStatus node_status = 1; + if (this->node_status() != 0) { + total_size += 1 + + ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::EnumSize(this->_internal_node_status()); + } + + if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) { + return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize( + _internal_metadata_, total_size, &_cached_size_); + } + int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size); + SetCachedSize(cached_size); + return total_size; +} + +void SetPlanNodeReq::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_merge_from_start:yagpcc.SetPlanNodeReq) + GOOGLE_DCHECK_NE(&from, this); + const SetPlanNodeReq* source = + ::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated( + &from); + if (source == nullptr) { + // @@protoc_insertion_point(generalized_merge_from_cast_fail:yagpcc.SetPlanNodeReq) + ::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this); + } else { + // @@protoc_insertion_point(generalized_merge_from_cast_success:yagpcc.SetPlanNodeReq) + MergeFrom(*source); + } +} + +void SetPlanNodeReq::MergeFrom(const SetPlanNodeReq& from) { +// @@protoc_insertion_point(class_specific_merge_from_start:yagpcc.SetPlanNodeReq) + GOOGLE_DCHECK_NE(&from, this); + _internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0; + (void) cached_has_bits; + + if (from.has_datetime()) { + _internal_mutable_datetime()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_datetime()); + } + if (from.has_query_key()) { + _internal_mutable_query_key()->::yagpcc::QueryKey::MergeFrom(from._internal_query_key()); + } + if (from.has_segment_key()) { + _internal_mutable_segment_key()->::yagpcc::SegmentKey::MergeFrom(from._internal_segment_key()); + } + if (from.has_node_metrics()) { + _internal_mutable_node_metrics()->::yagpcc::GPMetrics::MergeFrom(from._internal_node_metrics()); + } + if (from.has_plan_node()) { + _internal_mutable_plan_node()->::yagpcc::MetricPlan::MergeFrom(from._internal_plan_node()); + } + if (from.has_submit_time()) { + _internal_mutable_submit_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_submit_time()); + } + if (from.has_start_time()) { + _internal_mutable_start_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_start_time()); + } + if (from.has_end_time()) { + _internal_mutable_end_time()->PROTOBUF_NAMESPACE_ID::Timestamp::MergeFrom(from._internal_end_time()); + } + if (from.node_status() != 0) { + _internal_set_node_status(from._internal_node_status()); + } +} + +void SetPlanNodeReq::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) { +// @@protoc_insertion_point(generalized_copy_from_start:yagpcc.SetPlanNodeReq) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +void SetPlanNodeReq::CopyFrom(const SetPlanNodeReq& from) { +// @@protoc_insertion_point(class_specific_copy_from_start:yagpcc.SetPlanNodeReq) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + +bool SetPlanNodeReq::IsInitialized() const { + return true; +} + +void SetPlanNodeReq::InternalSwap(SetPlanNodeReq* other) { + using std::swap; + _internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_); + ::PROTOBUF_NAMESPACE_ID::internal::memswap< + PROTOBUF_FIELD_OFFSET(SetPlanNodeReq, node_status_) + + sizeof(SetPlanNodeReq::node_status_) + - PROTOBUF_FIELD_OFFSET(SetPlanNodeReq, datetime_)>( + reinterpret_cast(&datetime_), + reinterpret_cast(&other->datetime_)); +} + +::PROTOBUF_NAMESPACE_ID::Metadata SetPlanNodeReq::GetMetadata() const { + return GetMetadataStatic(); +} + + +// @@protoc_insertion_point(namespace_scope) +} // namespace yagpcc +PROTOBUF_NAMESPACE_OPEN +template<> PROTOBUF_NOINLINE ::yagpcc::MetricResponse* Arena::CreateMaybeMessage< ::yagpcc::MetricResponse >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::MetricResponse >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::SetQueryReq* Arena::CreateMaybeMessage< ::yagpcc::SetQueryReq >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::SetQueryReq >(arena); +} +template<> PROTOBUF_NOINLINE ::yagpcc::SetPlanNodeReq* Arena::CreateMaybeMessage< ::yagpcc::SetPlanNodeReq >(Arena* arena) { + return Arena::CreateMessageInternal< ::yagpcc::SetPlanNodeReq >(arena); +} +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) +#include diff --git a/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_set_service.pb.h b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_set_service.pb.h new file mode 100644 index 00000000000..9b93652487f --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/protos/yagpcc_set_service.pb.h @@ -0,0 +1,2399 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: protos/yagpcc_set_service.proto + +#ifndef GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fset_5fservice_2eproto +#define GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fset_5fservice_2eproto + +#include +#include + +#include +#if PROTOBUF_VERSION < 3012000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 3012004 < PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include +#include +#include +#include "protos/yagpcc_metrics.pb.h" +#include "protos/yagpcc_plan.pb.h" +// @@protoc_insertion_point(includes) +#include +#define PROTOBUF_INTERNAL_EXPORT_protos_2fyagpcc_5fset_5fservice_2eproto +PROTOBUF_NAMESPACE_OPEN +namespace internal { +class AnyMetadata; +} // namespace internal +PROTOBUF_NAMESPACE_CLOSE + +// Internal implementation detail -- do not use these members. +struct TableStruct_protos_2fyagpcc_5fset_5fservice_2eproto { + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::AuxillaryParseTableField aux[] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[3] + PROTOBUF_SECTION_VARIABLE(protodesc_cold); + static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[]; + static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[]; + static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[]; +}; +extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto; +namespace yagpcc { +class MetricResponse; +class MetricResponseDefaultTypeInternal; +extern MetricResponseDefaultTypeInternal _MetricResponse_default_instance_; +class SetPlanNodeReq; +class SetPlanNodeReqDefaultTypeInternal; +extern SetPlanNodeReqDefaultTypeInternal _SetPlanNodeReq_default_instance_; +class SetQueryReq; +class SetQueryReqDefaultTypeInternal; +extern SetQueryReqDefaultTypeInternal _SetQueryReq_default_instance_; +} // namespace yagpcc +PROTOBUF_NAMESPACE_OPEN +template<> ::yagpcc::MetricResponse* Arena::CreateMaybeMessage<::yagpcc::MetricResponse>(Arena*); +template<> ::yagpcc::SetPlanNodeReq* Arena::CreateMaybeMessage<::yagpcc::SetPlanNodeReq>(Arena*); +template<> ::yagpcc::SetQueryReq* Arena::CreateMaybeMessage<::yagpcc::SetQueryReq>(Arena*); +PROTOBUF_NAMESPACE_CLOSE +namespace yagpcc { + +enum MetricResponseStatusCode : int { + METRIC_RESPONSE_STATUS_CODE_UNSPECIFIED = 0, + METRIC_RESPONSE_STATUS_CODE_SUCCESS = 1, + METRIC_RESPONSE_STATUS_CODE_ERROR = 2, + MetricResponseStatusCode_INT_MIN_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::min(), + MetricResponseStatusCode_INT_MAX_SENTINEL_DO_NOT_USE_ = std::numeric_limits<::PROTOBUF_NAMESPACE_ID::int32>::max() +}; +bool MetricResponseStatusCode_IsValid(int value); +constexpr MetricResponseStatusCode MetricResponseStatusCode_MIN = METRIC_RESPONSE_STATUS_CODE_UNSPECIFIED; +constexpr MetricResponseStatusCode MetricResponseStatusCode_MAX = METRIC_RESPONSE_STATUS_CODE_ERROR; +constexpr int MetricResponseStatusCode_ARRAYSIZE = MetricResponseStatusCode_MAX + 1; + +const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor* MetricResponseStatusCode_descriptor(); +template +inline const std::string& MetricResponseStatusCode_Name(T enum_t_value) { + static_assert(::std::is_same::value || + ::std::is_integral::value, + "Incorrect type passed to function MetricResponseStatusCode_Name."); + return ::PROTOBUF_NAMESPACE_ID::internal::NameOfEnum( + MetricResponseStatusCode_descriptor(), enum_t_value); +} +inline bool MetricResponseStatusCode_Parse( + const std::string& name, MetricResponseStatusCode* value) { + return ::PROTOBUF_NAMESPACE_ID::internal::ParseNamedEnum( + MetricResponseStatusCode_descriptor(), name, value); +} +// =================================================================== + +class MetricResponse PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.MetricResponse) */ { + public: + inline MetricResponse() : MetricResponse(nullptr) {}; + virtual ~MetricResponse(); + + MetricResponse(const MetricResponse& from); + MetricResponse(MetricResponse&& from) noexcept + : MetricResponse() { + *this = ::std::move(from); + } + + inline MetricResponse& operator=(const MetricResponse& from) { + CopyFrom(from); + return *this; + } + inline MetricResponse& operator=(MetricResponse&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const MetricResponse& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const MetricResponse* internal_default_instance() { + return reinterpret_cast( + &_MetricResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = + 0; + + friend void swap(MetricResponse& a, MetricResponse& b) { + a.Swap(&b); + } + inline void Swap(MetricResponse* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(MetricResponse* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline MetricResponse* New() const final { + return CreateMaybeMessage(nullptr); + } + + MetricResponse* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const MetricResponse& from); + void MergeFrom(const MetricResponse& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(MetricResponse* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.MetricResponse"; + } + protected: + explicit MetricResponse(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kErrorTextFieldNumber = 2, + kErrorCodeFieldNumber = 1, + }; + // string error_text = 2; + void clear_error_text(); + const std::string& error_text() const; + void set_error_text(const std::string& value); + void set_error_text(std::string&& value); + void set_error_text(const char* value); + void set_error_text(const char* value, size_t size); + std::string* mutable_error_text(); + std::string* release_error_text(); + void set_allocated_error_text(std::string* error_text); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + std::string* unsafe_arena_release_error_text(); + GOOGLE_PROTOBUF_RUNTIME_DEPRECATED("The unsafe_arena_ accessors for" + " string fields are deprecated and will be removed in a" + " future release.") + void unsafe_arena_set_allocated_error_text( + std::string* error_text); + private: + const std::string& _internal_error_text() const; + void _internal_set_error_text(const std::string& value); + std::string* _internal_mutable_error_text(); + public: + + // .yagpcc.MetricResponseStatusCode error_code = 1; + void clear_error_code(); + ::yagpcc::MetricResponseStatusCode error_code() const; + void set_error_code(::yagpcc::MetricResponseStatusCode value); + private: + ::yagpcc::MetricResponseStatusCode _internal_error_code() const; + void _internal_set_error_code(::yagpcc::MetricResponseStatusCode value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.MetricResponse) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr error_text_; + int error_code_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fset_5fservice_2eproto; +}; +// ------------------------------------------------------------------- + +class SetQueryReq PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.SetQueryReq) */ { + public: + inline SetQueryReq() : SetQueryReq(nullptr) {}; + virtual ~SetQueryReq(); + + SetQueryReq(const SetQueryReq& from); + SetQueryReq(SetQueryReq&& from) noexcept + : SetQueryReq() { + *this = ::std::move(from); + } + + inline SetQueryReq& operator=(const SetQueryReq& from) { + CopyFrom(from); + return *this; + } + inline SetQueryReq& operator=(SetQueryReq&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const SetQueryReq& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SetQueryReq* internal_default_instance() { + return reinterpret_cast( + &_SetQueryReq_default_instance_); + } + static constexpr int kIndexInFileMessages = + 1; + + friend void swap(SetQueryReq& a, SetQueryReq& b) { + a.Swap(&b); + } + inline void Swap(SetQueryReq* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SetQueryReq* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline SetQueryReq* New() const final { + return CreateMaybeMessage(nullptr); + } + + SetQueryReq* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const SetQueryReq& from); + void MergeFrom(const SetQueryReq& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SetQueryReq* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.SetQueryReq"; + } + protected: + explicit SetQueryReq(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kPlanTreeFieldNumber = 7, + kDatetimeFieldNumber = 2, + kQueryKeyFieldNumber = 3, + kSegmentKeyFieldNumber = 4, + kQueryInfoFieldNumber = 5, + kQueryMetricsFieldNumber = 6, + kSubmitTimeFieldNumber = 8, + kStartTimeFieldNumber = 9, + kEndTimeFieldNumber = 10, + kAddInfoFieldNumber = 11, + kQueryStatusFieldNumber = 1, + }; + // repeated .yagpcc.MetricPlan plan_tree = 7; + int plan_tree_size() const; + private: + int _internal_plan_tree_size() const; + public: + void clear_plan_tree(); + ::yagpcc::MetricPlan* mutable_plan_tree(int index); + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::yagpcc::MetricPlan >* + mutable_plan_tree(); + private: + const ::yagpcc::MetricPlan& _internal_plan_tree(int index) const; + ::yagpcc::MetricPlan* _internal_add_plan_tree(); + public: + const ::yagpcc::MetricPlan& plan_tree(int index) const; + ::yagpcc::MetricPlan* add_plan_tree(); + const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::yagpcc::MetricPlan >& + plan_tree() const; + + // .google.protobuf.Timestamp datetime = 2; + bool has_datetime() const; + private: + bool _internal_has_datetime() const; + public: + void clear_datetime(); + const PROTOBUF_NAMESPACE_ID::Timestamp& datetime() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_datetime(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_datetime(); + void set_allocated_datetime(PROTOBUF_NAMESPACE_ID::Timestamp* datetime); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_datetime() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_datetime(); + public: + void unsafe_arena_set_allocated_datetime( + PROTOBUF_NAMESPACE_ID::Timestamp* datetime); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_datetime(); + + // .yagpcc.QueryKey query_key = 3; + bool has_query_key() const; + private: + bool _internal_has_query_key() const; + public: + void clear_query_key(); + const ::yagpcc::QueryKey& query_key() const; + ::yagpcc::QueryKey* release_query_key(); + ::yagpcc::QueryKey* mutable_query_key(); + void set_allocated_query_key(::yagpcc::QueryKey* query_key); + private: + const ::yagpcc::QueryKey& _internal_query_key() const; + ::yagpcc::QueryKey* _internal_mutable_query_key(); + public: + void unsafe_arena_set_allocated_query_key( + ::yagpcc::QueryKey* query_key); + ::yagpcc::QueryKey* unsafe_arena_release_query_key(); + + // .yagpcc.SegmentKey segment_key = 4; + bool has_segment_key() const; + private: + bool _internal_has_segment_key() const; + public: + void clear_segment_key(); + const ::yagpcc::SegmentKey& segment_key() const; + ::yagpcc::SegmentKey* release_segment_key(); + ::yagpcc::SegmentKey* mutable_segment_key(); + void set_allocated_segment_key(::yagpcc::SegmentKey* segment_key); + private: + const ::yagpcc::SegmentKey& _internal_segment_key() const; + ::yagpcc::SegmentKey* _internal_mutable_segment_key(); + public: + void unsafe_arena_set_allocated_segment_key( + ::yagpcc::SegmentKey* segment_key); + ::yagpcc::SegmentKey* unsafe_arena_release_segment_key(); + + // .yagpcc.QueryInfo query_info = 5; + bool has_query_info() const; + private: + bool _internal_has_query_info() const; + public: + void clear_query_info(); + const ::yagpcc::QueryInfo& query_info() const; + ::yagpcc::QueryInfo* release_query_info(); + ::yagpcc::QueryInfo* mutable_query_info(); + void set_allocated_query_info(::yagpcc::QueryInfo* query_info); + private: + const ::yagpcc::QueryInfo& _internal_query_info() const; + ::yagpcc::QueryInfo* _internal_mutable_query_info(); + public: + void unsafe_arena_set_allocated_query_info( + ::yagpcc::QueryInfo* query_info); + ::yagpcc::QueryInfo* unsafe_arena_release_query_info(); + + // .yagpcc.GPMetrics query_metrics = 6; + bool has_query_metrics() const; + private: + bool _internal_has_query_metrics() const; + public: + void clear_query_metrics(); + const ::yagpcc::GPMetrics& query_metrics() const; + ::yagpcc::GPMetrics* release_query_metrics(); + ::yagpcc::GPMetrics* mutable_query_metrics(); + void set_allocated_query_metrics(::yagpcc::GPMetrics* query_metrics); + private: + const ::yagpcc::GPMetrics& _internal_query_metrics() const; + ::yagpcc::GPMetrics* _internal_mutable_query_metrics(); + public: + void unsafe_arena_set_allocated_query_metrics( + ::yagpcc::GPMetrics* query_metrics); + ::yagpcc::GPMetrics* unsafe_arena_release_query_metrics(); + + // .google.protobuf.Timestamp submit_time = 8; + bool has_submit_time() const; + private: + bool _internal_has_submit_time() const; + public: + void clear_submit_time(); + const PROTOBUF_NAMESPACE_ID::Timestamp& submit_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_submit_time(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_submit_time(); + void set_allocated_submit_time(PROTOBUF_NAMESPACE_ID::Timestamp* submit_time); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_submit_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_submit_time(); + public: + void unsafe_arena_set_allocated_submit_time( + PROTOBUF_NAMESPACE_ID::Timestamp* submit_time); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_submit_time(); + + // .google.protobuf.Timestamp start_time = 9; + bool has_start_time() const; + private: + bool _internal_has_start_time() const; + public: + void clear_start_time(); + const PROTOBUF_NAMESPACE_ID::Timestamp& start_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_start_time(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_start_time(); + void set_allocated_start_time(PROTOBUF_NAMESPACE_ID::Timestamp* start_time); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_start_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_start_time(); + public: + void unsafe_arena_set_allocated_start_time( + PROTOBUF_NAMESPACE_ID::Timestamp* start_time); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_start_time(); + + // .google.protobuf.Timestamp end_time = 10; + bool has_end_time() const; + private: + bool _internal_has_end_time() const; + public: + void clear_end_time(); + const PROTOBUF_NAMESPACE_ID::Timestamp& end_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_end_time(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_end_time(); + void set_allocated_end_time(PROTOBUF_NAMESPACE_ID::Timestamp* end_time); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_end_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_end_time(); + public: + void unsafe_arena_set_allocated_end_time( + PROTOBUF_NAMESPACE_ID::Timestamp* end_time); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_end_time(); + + // .yagpcc.AdditionalQueryInfo add_info = 11; + bool has_add_info() const; + private: + bool _internal_has_add_info() const; + public: + void clear_add_info(); + const ::yagpcc::AdditionalQueryInfo& add_info() const; + ::yagpcc::AdditionalQueryInfo* release_add_info(); + ::yagpcc::AdditionalQueryInfo* mutable_add_info(); + void set_allocated_add_info(::yagpcc::AdditionalQueryInfo* add_info); + private: + const ::yagpcc::AdditionalQueryInfo& _internal_add_info() const; + ::yagpcc::AdditionalQueryInfo* _internal_mutable_add_info(); + public: + void unsafe_arena_set_allocated_add_info( + ::yagpcc::AdditionalQueryInfo* add_info); + ::yagpcc::AdditionalQueryInfo* unsafe_arena_release_add_info(); + + // .yagpcc.QueryStatus query_status = 1; + void clear_query_status(); + ::yagpcc::QueryStatus query_status() const; + void set_query_status(::yagpcc::QueryStatus value); + private: + ::yagpcc::QueryStatus _internal_query_status() const; + void _internal_set_query_status(::yagpcc::QueryStatus value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.SetQueryReq) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::yagpcc::MetricPlan > plan_tree_; + PROTOBUF_NAMESPACE_ID::Timestamp* datetime_; + ::yagpcc::QueryKey* query_key_; + ::yagpcc::SegmentKey* segment_key_; + ::yagpcc::QueryInfo* query_info_; + ::yagpcc::GPMetrics* query_metrics_; + PROTOBUF_NAMESPACE_ID::Timestamp* submit_time_; + PROTOBUF_NAMESPACE_ID::Timestamp* start_time_; + PROTOBUF_NAMESPACE_ID::Timestamp* end_time_; + ::yagpcc::AdditionalQueryInfo* add_info_; + int query_status_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fset_5fservice_2eproto; +}; +// ------------------------------------------------------------------- + +class SetPlanNodeReq PROTOBUF_FINAL : + public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:yagpcc.SetPlanNodeReq) */ { + public: + inline SetPlanNodeReq() : SetPlanNodeReq(nullptr) {}; + virtual ~SetPlanNodeReq(); + + SetPlanNodeReq(const SetPlanNodeReq& from); + SetPlanNodeReq(SetPlanNodeReq&& from) noexcept + : SetPlanNodeReq() { + *this = ::std::move(from); + } + + inline SetPlanNodeReq& operator=(const SetPlanNodeReq& from) { + CopyFrom(from); + return *this; + } + inline SetPlanNodeReq& operator=(SetPlanNodeReq&& from) noexcept { + if (GetArena() == from.GetArena()) { + if (this != &from) InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() { + return GetDescriptor(); + } + static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() { + return GetMetadataStatic().descriptor; + } + static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() { + return GetMetadataStatic().reflection; + } + static const SetPlanNodeReq& default_instance(); + + static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY + static inline const SetPlanNodeReq* internal_default_instance() { + return reinterpret_cast( + &_SetPlanNodeReq_default_instance_); + } + static constexpr int kIndexInFileMessages = + 2; + + friend void swap(SetPlanNodeReq& a, SetPlanNodeReq& b) { + a.Swap(&b); + } + inline void Swap(SetPlanNodeReq* other) { + if (other == this) return; + if (GetArena() == other->GetArena()) { + InternalSwap(other); + } else { + ::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(SetPlanNodeReq* other) { + if (other == this) return; + GOOGLE_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + inline SetPlanNodeReq* New() const final { + return CreateMaybeMessage(nullptr); + } + + SetPlanNodeReq* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final { + return CreateMaybeMessage(arena); + } + void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final; + void CopyFrom(const SetPlanNodeReq& from); + void MergeFrom(const SetPlanNodeReq& from); + PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final; + bool IsInitialized() const final; + + size_t ByteSizeLong() const final; + const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final; + ::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize( + ::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final; + int GetCachedSize() const final { return _cached_size_.Get(); } + + private: + inline void SharedCtor(); + inline void SharedDtor(); + void SetCachedSize(int size) const final; + void InternalSwap(SetPlanNodeReq* other); + friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata; + static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() { + return "yagpcc.SetPlanNodeReq"; + } + protected: + explicit SetPlanNodeReq(::PROTOBUF_NAMESPACE_ID::Arena* arena); + private: + static void ArenaDtor(void* object); + inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena); + public: + + ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final; + private: + static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() { + ::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&::descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto); + return ::descriptor_table_protos_2fyagpcc_5fset_5fservice_2eproto.file_level_metadata[kIndexInFileMessages]; + } + + public: + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + enum : int { + kDatetimeFieldNumber = 2, + kQueryKeyFieldNumber = 3, + kSegmentKeyFieldNumber = 4, + kNodeMetricsFieldNumber = 5, + kPlanNodeFieldNumber = 6, + kSubmitTimeFieldNumber = 7, + kStartTimeFieldNumber = 8, + kEndTimeFieldNumber = 9, + kNodeStatusFieldNumber = 1, + }; + // .google.protobuf.Timestamp datetime = 2; + bool has_datetime() const; + private: + bool _internal_has_datetime() const; + public: + void clear_datetime(); + const PROTOBUF_NAMESPACE_ID::Timestamp& datetime() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_datetime(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_datetime(); + void set_allocated_datetime(PROTOBUF_NAMESPACE_ID::Timestamp* datetime); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_datetime() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_datetime(); + public: + void unsafe_arena_set_allocated_datetime( + PROTOBUF_NAMESPACE_ID::Timestamp* datetime); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_datetime(); + + // .yagpcc.QueryKey query_key = 3; + bool has_query_key() const; + private: + bool _internal_has_query_key() const; + public: + void clear_query_key(); + const ::yagpcc::QueryKey& query_key() const; + ::yagpcc::QueryKey* release_query_key(); + ::yagpcc::QueryKey* mutable_query_key(); + void set_allocated_query_key(::yagpcc::QueryKey* query_key); + private: + const ::yagpcc::QueryKey& _internal_query_key() const; + ::yagpcc::QueryKey* _internal_mutable_query_key(); + public: + void unsafe_arena_set_allocated_query_key( + ::yagpcc::QueryKey* query_key); + ::yagpcc::QueryKey* unsafe_arena_release_query_key(); + + // .yagpcc.SegmentKey segment_key = 4; + bool has_segment_key() const; + private: + bool _internal_has_segment_key() const; + public: + void clear_segment_key(); + const ::yagpcc::SegmentKey& segment_key() const; + ::yagpcc::SegmentKey* release_segment_key(); + ::yagpcc::SegmentKey* mutable_segment_key(); + void set_allocated_segment_key(::yagpcc::SegmentKey* segment_key); + private: + const ::yagpcc::SegmentKey& _internal_segment_key() const; + ::yagpcc::SegmentKey* _internal_mutable_segment_key(); + public: + void unsafe_arena_set_allocated_segment_key( + ::yagpcc::SegmentKey* segment_key); + ::yagpcc::SegmentKey* unsafe_arena_release_segment_key(); + + // .yagpcc.GPMetrics node_metrics = 5; + bool has_node_metrics() const; + private: + bool _internal_has_node_metrics() const; + public: + void clear_node_metrics(); + const ::yagpcc::GPMetrics& node_metrics() const; + ::yagpcc::GPMetrics* release_node_metrics(); + ::yagpcc::GPMetrics* mutable_node_metrics(); + void set_allocated_node_metrics(::yagpcc::GPMetrics* node_metrics); + private: + const ::yagpcc::GPMetrics& _internal_node_metrics() const; + ::yagpcc::GPMetrics* _internal_mutable_node_metrics(); + public: + void unsafe_arena_set_allocated_node_metrics( + ::yagpcc::GPMetrics* node_metrics); + ::yagpcc::GPMetrics* unsafe_arena_release_node_metrics(); + + // .yagpcc.MetricPlan plan_node = 6; + bool has_plan_node() const; + private: + bool _internal_has_plan_node() const; + public: + void clear_plan_node(); + const ::yagpcc::MetricPlan& plan_node() const; + ::yagpcc::MetricPlan* release_plan_node(); + ::yagpcc::MetricPlan* mutable_plan_node(); + void set_allocated_plan_node(::yagpcc::MetricPlan* plan_node); + private: + const ::yagpcc::MetricPlan& _internal_plan_node() const; + ::yagpcc::MetricPlan* _internal_mutable_plan_node(); + public: + void unsafe_arena_set_allocated_plan_node( + ::yagpcc::MetricPlan* plan_node); + ::yagpcc::MetricPlan* unsafe_arena_release_plan_node(); + + // .google.protobuf.Timestamp submit_time = 7; + bool has_submit_time() const; + private: + bool _internal_has_submit_time() const; + public: + void clear_submit_time(); + const PROTOBUF_NAMESPACE_ID::Timestamp& submit_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_submit_time(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_submit_time(); + void set_allocated_submit_time(PROTOBUF_NAMESPACE_ID::Timestamp* submit_time); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_submit_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_submit_time(); + public: + void unsafe_arena_set_allocated_submit_time( + PROTOBUF_NAMESPACE_ID::Timestamp* submit_time); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_submit_time(); + + // .google.protobuf.Timestamp start_time = 8; + bool has_start_time() const; + private: + bool _internal_has_start_time() const; + public: + void clear_start_time(); + const PROTOBUF_NAMESPACE_ID::Timestamp& start_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_start_time(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_start_time(); + void set_allocated_start_time(PROTOBUF_NAMESPACE_ID::Timestamp* start_time); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_start_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_start_time(); + public: + void unsafe_arena_set_allocated_start_time( + PROTOBUF_NAMESPACE_ID::Timestamp* start_time); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_start_time(); + + // .google.protobuf.Timestamp end_time = 9; + bool has_end_time() const; + private: + bool _internal_has_end_time() const; + public: + void clear_end_time(); + const PROTOBUF_NAMESPACE_ID::Timestamp& end_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* release_end_time(); + PROTOBUF_NAMESPACE_ID::Timestamp* mutable_end_time(); + void set_allocated_end_time(PROTOBUF_NAMESPACE_ID::Timestamp* end_time); + private: + const PROTOBUF_NAMESPACE_ID::Timestamp& _internal_end_time() const; + PROTOBUF_NAMESPACE_ID::Timestamp* _internal_mutable_end_time(); + public: + void unsafe_arena_set_allocated_end_time( + PROTOBUF_NAMESPACE_ID::Timestamp* end_time); + PROTOBUF_NAMESPACE_ID::Timestamp* unsafe_arena_release_end_time(); + + // .yagpcc.PlanNodeStatus node_status = 1; + void clear_node_status(); + ::yagpcc::PlanNodeStatus node_status() const; + void set_node_status(::yagpcc::PlanNodeStatus value); + private: + ::yagpcc::PlanNodeStatus _internal_node_status() const; + void _internal_set_node_status(::yagpcc::PlanNodeStatus value); + public: + + // @@protoc_insertion_point(class_scope:yagpcc.SetPlanNodeReq) + private: + class _Internal; + + template friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper; + typedef void InternalArenaConstructable_; + typedef void DestructorSkippable_; + PROTOBUF_NAMESPACE_ID::Timestamp* datetime_; + ::yagpcc::QueryKey* query_key_; + ::yagpcc::SegmentKey* segment_key_; + ::yagpcc::GPMetrics* node_metrics_; + ::yagpcc::MetricPlan* plan_node_; + PROTOBUF_NAMESPACE_ID::Timestamp* submit_time_; + PROTOBUF_NAMESPACE_ID::Timestamp* start_time_; + PROTOBUF_NAMESPACE_ID::Timestamp* end_time_; + int node_status_; + mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_; + friend struct ::TableStruct_protos_2fyagpcc_5fset_5fservice_2eproto; +}; +// =================================================================== + + +// =================================================================== + +#ifdef __GNUC__ + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// MetricResponse + +// .yagpcc.MetricResponseStatusCode error_code = 1; +inline void MetricResponse::clear_error_code() { + error_code_ = 0; +} +inline ::yagpcc::MetricResponseStatusCode MetricResponse::_internal_error_code() const { + return static_cast< ::yagpcc::MetricResponseStatusCode >(error_code_); +} +inline ::yagpcc::MetricResponseStatusCode MetricResponse::error_code() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricResponse.error_code) + return _internal_error_code(); +} +inline void MetricResponse::_internal_set_error_code(::yagpcc::MetricResponseStatusCode value) { + + error_code_ = value; +} +inline void MetricResponse::set_error_code(::yagpcc::MetricResponseStatusCode value) { + _internal_set_error_code(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricResponse.error_code) +} + +// string error_text = 2; +inline void MetricResponse::clear_error_text() { + error_text_.ClearToEmpty(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline const std::string& MetricResponse::error_text() const { + // @@protoc_insertion_point(field_get:yagpcc.MetricResponse.error_text) + return _internal_error_text(); +} +inline void MetricResponse::set_error_text(const std::string& value) { + _internal_set_error_text(value); + // @@protoc_insertion_point(field_set:yagpcc.MetricResponse.error_text) +} +inline std::string* MetricResponse::mutable_error_text() { + // @@protoc_insertion_point(field_mutable:yagpcc.MetricResponse.error_text) + return _internal_mutable_error_text(); +} +inline const std::string& MetricResponse::_internal_error_text() const { + return error_text_.Get(); +} +inline void MetricResponse::_internal_set_error_text(const std::string& value) { + + error_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value, GetArena()); +} +inline void MetricResponse::set_error_text(std::string&& value) { + + error_text_.Set( + &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArena()); + // @@protoc_insertion_point(field_set_rvalue:yagpcc.MetricResponse.error_text) +} +inline void MetricResponse::set_error_text(const char* value) { + GOOGLE_DCHECK(value != nullptr); + + error_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string(value), + GetArena()); + // @@protoc_insertion_point(field_set_char:yagpcc.MetricResponse.error_text) +} +inline void MetricResponse::set_error_text(const char* value, + size_t size) { + + error_text_.Set(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), ::std::string( + reinterpret_cast(value), size), GetArena()); + // @@protoc_insertion_point(field_set_pointer:yagpcc.MetricResponse.error_text) +} +inline std::string* MetricResponse::_internal_mutable_error_text() { + + return error_text_.Mutable(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline std::string* MetricResponse::release_error_text() { + // @@protoc_insertion_point(field_release:yagpcc.MetricResponse.error_text) + return error_text_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena()); +} +inline void MetricResponse::set_allocated_error_text(std::string* error_text) { + if (error_text != nullptr) { + + } else { + + } + error_text_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), error_text, + GetArena()); + // @@protoc_insertion_point(field_set_allocated:yagpcc.MetricResponse.error_text) +} +inline std::string* MetricResponse::unsafe_arena_release_error_text() { + // @@protoc_insertion_point(field_unsafe_arena_release:yagpcc.MetricResponse.error_text) + GOOGLE_DCHECK(GetArena() != nullptr); + + return error_text_.UnsafeArenaRelease(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + GetArena()); +} +inline void MetricResponse::unsafe_arena_set_allocated_error_text( + std::string* error_text) { + GOOGLE_DCHECK(GetArena() != nullptr); + if (error_text != nullptr) { + + } else { + + } + error_text_.UnsafeArenaSetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), + error_text, GetArena()); + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.MetricResponse.error_text) +} + +// ------------------------------------------------------------------- + +// SetQueryReq + +// .yagpcc.QueryStatus query_status = 1; +inline void SetQueryReq::clear_query_status() { + query_status_ = 0; +} +inline ::yagpcc::QueryStatus SetQueryReq::_internal_query_status() const { + return static_cast< ::yagpcc::QueryStatus >(query_status_); +} +inline ::yagpcc::QueryStatus SetQueryReq::query_status() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.query_status) + return _internal_query_status(); +} +inline void SetQueryReq::_internal_set_query_status(::yagpcc::QueryStatus value) { + + query_status_ = value; +} +inline void SetQueryReq::set_query_status(::yagpcc::QueryStatus value) { + _internal_set_query_status(value); + // @@protoc_insertion_point(field_set:yagpcc.SetQueryReq.query_status) +} + +// .google.protobuf.Timestamp datetime = 2; +inline bool SetQueryReq::_internal_has_datetime() const { + return this != internal_default_instance() && datetime_ != nullptr; +} +inline bool SetQueryReq::has_datetime() const { + return _internal_has_datetime(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::_internal_datetime() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = datetime_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::datetime() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.datetime) + return _internal_datetime(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_datetime( + PROTOBUF_NAMESPACE_ID::Timestamp* datetime) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(datetime_); + } + datetime_ = datetime; + if (datetime) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.datetime) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::release_datetime() { + auto temp = unsafe_arena_release_datetime(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::unsafe_arena_release_datetime() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.datetime) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = datetime_; + datetime_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::_internal_mutable_datetime() { + + if (datetime_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + datetime_ = p; + } + return datetime_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::mutable_datetime() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.datetime) + return _internal_mutable_datetime(); +} +inline void SetQueryReq::set_allocated_datetime(PROTOBUF_NAMESPACE_ID::Timestamp* datetime) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(datetime_); + } + if (datetime) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(datetime)->GetArena(); + if (message_arena != submessage_arena) { + datetime = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, datetime, submessage_arena); + } + + } else { + + } + datetime_ = datetime; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.datetime) +} + +// .yagpcc.QueryKey query_key = 3; +inline bool SetQueryReq::_internal_has_query_key() const { + return this != internal_default_instance() && query_key_ != nullptr; +} +inline bool SetQueryReq::has_query_key() const { + return _internal_has_query_key(); +} +inline const ::yagpcc::QueryKey& SetQueryReq::_internal_query_key() const { + const ::yagpcc::QueryKey* p = query_key_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_QueryKey_default_instance_); +} +inline const ::yagpcc::QueryKey& SetQueryReq::query_key() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.query_key) + return _internal_query_key(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_query_key( + ::yagpcc::QueryKey* query_key) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_key_); + } + query_key_ = query_key; + if (query_key) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.query_key) +} +inline ::yagpcc::QueryKey* SetQueryReq::release_query_key() { + auto temp = unsafe_arena_release_query_key(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::QueryKey* SetQueryReq::unsafe_arena_release_query_key() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.query_key) + + ::yagpcc::QueryKey* temp = query_key_; + query_key_ = nullptr; + return temp; +} +inline ::yagpcc::QueryKey* SetQueryReq::_internal_mutable_query_key() { + + if (query_key_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::QueryKey>(GetArena()); + query_key_ = p; + } + return query_key_; +} +inline ::yagpcc::QueryKey* SetQueryReq::mutable_query_key() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.query_key) + return _internal_mutable_query_key(); +} +inline void SetQueryReq::set_allocated_query_key(::yagpcc::QueryKey* query_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_key_); + } + if (query_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_key)->GetArena(); + if (message_arena != submessage_arena) { + query_key = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, query_key, submessage_arena); + } + + } else { + + } + query_key_ = query_key; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.query_key) +} + +// .yagpcc.SegmentKey segment_key = 4; +inline bool SetQueryReq::_internal_has_segment_key() const { + return this != internal_default_instance() && segment_key_ != nullptr; +} +inline bool SetQueryReq::has_segment_key() const { + return _internal_has_segment_key(); +} +inline const ::yagpcc::SegmentKey& SetQueryReq::_internal_segment_key() const { + const ::yagpcc::SegmentKey* p = segment_key_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_SegmentKey_default_instance_); +} +inline const ::yagpcc::SegmentKey& SetQueryReq::segment_key() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.segment_key) + return _internal_segment_key(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_segment_key( + ::yagpcc::SegmentKey* segment_key) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(segment_key_); + } + segment_key_ = segment_key; + if (segment_key) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.segment_key) +} +inline ::yagpcc::SegmentKey* SetQueryReq::release_segment_key() { + auto temp = unsafe_arena_release_segment_key(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::SegmentKey* SetQueryReq::unsafe_arena_release_segment_key() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.segment_key) + + ::yagpcc::SegmentKey* temp = segment_key_; + segment_key_ = nullptr; + return temp; +} +inline ::yagpcc::SegmentKey* SetQueryReq::_internal_mutable_segment_key() { + + if (segment_key_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::SegmentKey>(GetArena()); + segment_key_ = p; + } + return segment_key_; +} +inline ::yagpcc::SegmentKey* SetQueryReq::mutable_segment_key() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.segment_key) + return _internal_mutable_segment_key(); +} +inline void SetQueryReq::set_allocated_segment_key(::yagpcc::SegmentKey* segment_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(segment_key_); + } + if (segment_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(segment_key)->GetArena(); + if (message_arena != submessage_arena) { + segment_key = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, segment_key, submessage_arena); + } + + } else { + + } + segment_key_ = segment_key; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.segment_key) +} + +// .yagpcc.QueryInfo query_info = 5; +inline bool SetQueryReq::_internal_has_query_info() const { + return this != internal_default_instance() && query_info_ != nullptr; +} +inline bool SetQueryReq::has_query_info() const { + return _internal_has_query_info(); +} +inline const ::yagpcc::QueryInfo& SetQueryReq::_internal_query_info() const { + const ::yagpcc::QueryInfo* p = query_info_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_QueryInfo_default_instance_); +} +inline const ::yagpcc::QueryInfo& SetQueryReq::query_info() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.query_info) + return _internal_query_info(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_query_info( + ::yagpcc::QueryInfo* query_info) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_info_); + } + query_info_ = query_info; + if (query_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.query_info) +} +inline ::yagpcc::QueryInfo* SetQueryReq::release_query_info() { + auto temp = unsafe_arena_release_query_info(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::QueryInfo* SetQueryReq::unsafe_arena_release_query_info() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.query_info) + + ::yagpcc::QueryInfo* temp = query_info_; + query_info_ = nullptr; + return temp; +} +inline ::yagpcc::QueryInfo* SetQueryReq::_internal_mutable_query_info() { + + if (query_info_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::QueryInfo>(GetArena()); + query_info_ = p; + } + return query_info_; +} +inline ::yagpcc::QueryInfo* SetQueryReq::mutable_query_info() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.query_info) + return _internal_mutable_query_info(); +} +inline void SetQueryReq::set_allocated_query_info(::yagpcc::QueryInfo* query_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_info_); + } + if (query_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_info)->GetArena(); + if (message_arena != submessage_arena) { + query_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, query_info, submessage_arena); + } + + } else { + + } + query_info_ = query_info; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.query_info) +} + +// .yagpcc.GPMetrics query_metrics = 6; +inline bool SetQueryReq::_internal_has_query_metrics() const { + return this != internal_default_instance() && query_metrics_ != nullptr; +} +inline bool SetQueryReq::has_query_metrics() const { + return _internal_has_query_metrics(); +} +inline const ::yagpcc::GPMetrics& SetQueryReq::_internal_query_metrics() const { + const ::yagpcc::GPMetrics* p = query_metrics_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_GPMetrics_default_instance_); +} +inline const ::yagpcc::GPMetrics& SetQueryReq::query_metrics() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.query_metrics) + return _internal_query_metrics(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_query_metrics( + ::yagpcc::GPMetrics* query_metrics) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_metrics_); + } + query_metrics_ = query_metrics; + if (query_metrics) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.query_metrics) +} +inline ::yagpcc::GPMetrics* SetQueryReq::release_query_metrics() { + auto temp = unsafe_arena_release_query_metrics(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::GPMetrics* SetQueryReq::unsafe_arena_release_query_metrics() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.query_metrics) + + ::yagpcc::GPMetrics* temp = query_metrics_; + query_metrics_ = nullptr; + return temp; +} +inline ::yagpcc::GPMetrics* SetQueryReq::_internal_mutable_query_metrics() { + + if (query_metrics_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::GPMetrics>(GetArena()); + query_metrics_ = p; + } + return query_metrics_; +} +inline ::yagpcc::GPMetrics* SetQueryReq::mutable_query_metrics() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.query_metrics) + return _internal_mutable_query_metrics(); +} +inline void SetQueryReq::set_allocated_query_metrics(::yagpcc::GPMetrics* query_metrics) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_metrics_); + } + if (query_metrics) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_metrics)->GetArena(); + if (message_arena != submessage_arena) { + query_metrics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, query_metrics, submessage_arena); + } + + } else { + + } + query_metrics_ = query_metrics; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.query_metrics) +} + +// repeated .yagpcc.MetricPlan plan_tree = 7; +inline int SetQueryReq::_internal_plan_tree_size() const { + return plan_tree_.size(); +} +inline int SetQueryReq::plan_tree_size() const { + return _internal_plan_tree_size(); +} +inline ::yagpcc::MetricPlan* SetQueryReq::mutable_plan_tree(int index) { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.plan_tree) + return plan_tree_.Mutable(index); +} +inline ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::yagpcc::MetricPlan >* +SetQueryReq::mutable_plan_tree() { + // @@protoc_insertion_point(field_mutable_list:yagpcc.SetQueryReq.plan_tree) + return &plan_tree_; +} +inline const ::yagpcc::MetricPlan& SetQueryReq::_internal_plan_tree(int index) const { + return plan_tree_.Get(index); +} +inline const ::yagpcc::MetricPlan& SetQueryReq::plan_tree(int index) const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.plan_tree) + return _internal_plan_tree(index); +} +inline ::yagpcc::MetricPlan* SetQueryReq::_internal_add_plan_tree() { + return plan_tree_.Add(); +} +inline ::yagpcc::MetricPlan* SetQueryReq::add_plan_tree() { + // @@protoc_insertion_point(field_add:yagpcc.SetQueryReq.plan_tree) + return _internal_add_plan_tree(); +} +inline const ::PROTOBUF_NAMESPACE_ID::RepeatedPtrField< ::yagpcc::MetricPlan >& +SetQueryReq::plan_tree() const { + // @@protoc_insertion_point(field_list:yagpcc.SetQueryReq.plan_tree) + return plan_tree_; +} + +// .google.protobuf.Timestamp submit_time = 8; +inline bool SetQueryReq::_internal_has_submit_time() const { + return this != internal_default_instance() && submit_time_ != nullptr; +} +inline bool SetQueryReq::has_submit_time() const { + return _internal_has_submit_time(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::_internal_submit_time() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = submit_time_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::submit_time() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.submit_time) + return _internal_submit_time(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_submit_time( + PROTOBUF_NAMESPACE_ID::Timestamp* submit_time) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(submit_time_); + } + submit_time_ = submit_time; + if (submit_time) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.submit_time) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::release_submit_time() { + auto temp = unsafe_arena_release_submit_time(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::unsafe_arena_release_submit_time() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.submit_time) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = submit_time_; + submit_time_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::_internal_mutable_submit_time() { + + if (submit_time_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + submit_time_ = p; + } + return submit_time_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::mutable_submit_time() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.submit_time) + return _internal_mutable_submit_time(); +} +inline void SetQueryReq::set_allocated_submit_time(PROTOBUF_NAMESPACE_ID::Timestamp* submit_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(submit_time_); + } + if (submit_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(submit_time)->GetArena(); + if (message_arena != submessage_arena) { + submit_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, submit_time, submessage_arena); + } + + } else { + + } + submit_time_ = submit_time; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.submit_time) +} + +// .google.protobuf.Timestamp start_time = 9; +inline bool SetQueryReq::_internal_has_start_time() const { + return this != internal_default_instance() && start_time_ != nullptr; +} +inline bool SetQueryReq::has_start_time() const { + return _internal_has_start_time(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::_internal_start_time() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = start_time_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::start_time() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.start_time) + return _internal_start_time(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_start_time( + PROTOBUF_NAMESPACE_ID::Timestamp* start_time) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time_); + } + start_time_ = start_time; + if (start_time) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.start_time) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::release_start_time() { + auto temp = unsafe_arena_release_start_time(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::unsafe_arena_release_start_time() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.start_time) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = start_time_; + start_time_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::_internal_mutable_start_time() { + + if (start_time_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + start_time_ = p; + } + return start_time_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::mutable_start_time() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.start_time) + return _internal_mutable_start_time(); +} +inline void SetQueryReq::set_allocated_start_time(PROTOBUF_NAMESPACE_ID::Timestamp* start_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time_); + } + if (start_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time)->GetArena(); + if (message_arena != submessage_arena) { + start_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, start_time, submessage_arena); + } + + } else { + + } + start_time_ = start_time; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.start_time) +} + +// .google.protobuf.Timestamp end_time = 10; +inline bool SetQueryReq::_internal_has_end_time() const { + return this != internal_default_instance() && end_time_ != nullptr; +} +inline bool SetQueryReq::has_end_time() const { + return _internal_has_end_time(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::_internal_end_time() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = end_time_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetQueryReq::end_time() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.end_time) + return _internal_end_time(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_end_time( + PROTOBUF_NAMESPACE_ID::Timestamp* end_time) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time_); + } + end_time_ = end_time; + if (end_time) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.end_time) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::release_end_time() { + auto temp = unsafe_arena_release_end_time(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::unsafe_arena_release_end_time() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.end_time) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = end_time_; + end_time_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::_internal_mutable_end_time() { + + if (end_time_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + end_time_ = p; + } + return end_time_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetQueryReq::mutable_end_time() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.end_time) + return _internal_mutable_end_time(); +} +inline void SetQueryReq::set_allocated_end_time(PROTOBUF_NAMESPACE_ID::Timestamp* end_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time_); + } + if (end_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time)->GetArena(); + if (message_arena != submessage_arena) { + end_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, end_time, submessage_arena); + } + + } else { + + } + end_time_ = end_time; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.end_time) +} + +// .yagpcc.AdditionalQueryInfo add_info = 11; +inline bool SetQueryReq::_internal_has_add_info() const { + return this != internal_default_instance() && add_info_ != nullptr; +} +inline bool SetQueryReq::has_add_info() const { + return _internal_has_add_info(); +} +inline const ::yagpcc::AdditionalQueryInfo& SetQueryReq::_internal_add_info() const { + const ::yagpcc::AdditionalQueryInfo* p = add_info_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_AdditionalQueryInfo_default_instance_); +} +inline const ::yagpcc::AdditionalQueryInfo& SetQueryReq::add_info() const { + // @@protoc_insertion_point(field_get:yagpcc.SetQueryReq.add_info) + return _internal_add_info(); +} +inline void SetQueryReq::unsafe_arena_set_allocated_add_info( + ::yagpcc::AdditionalQueryInfo* add_info) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(add_info_); + } + add_info_ = add_info; + if (add_info) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetQueryReq.add_info) +} +inline ::yagpcc::AdditionalQueryInfo* SetQueryReq::release_add_info() { + auto temp = unsafe_arena_release_add_info(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::AdditionalQueryInfo* SetQueryReq::unsafe_arena_release_add_info() { + // @@protoc_insertion_point(field_release:yagpcc.SetQueryReq.add_info) + + ::yagpcc::AdditionalQueryInfo* temp = add_info_; + add_info_ = nullptr; + return temp; +} +inline ::yagpcc::AdditionalQueryInfo* SetQueryReq::_internal_mutable_add_info() { + + if (add_info_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::AdditionalQueryInfo>(GetArena()); + add_info_ = p; + } + return add_info_; +} +inline ::yagpcc::AdditionalQueryInfo* SetQueryReq::mutable_add_info() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetQueryReq.add_info) + return _internal_mutable_add_info(); +} +inline void SetQueryReq::set_allocated_add_info(::yagpcc::AdditionalQueryInfo* add_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(add_info_); + } + if (add_info) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(add_info)->GetArena(); + if (message_arena != submessage_arena) { + add_info = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, add_info, submessage_arena); + } + + } else { + + } + add_info_ = add_info; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetQueryReq.add_info) +} + +// ------------------------------------------------------------------- + +// SetPlanNodeReq + +// .yagpcc.PlanNodeStatus node_status = 1; +inline void SetPlanNodeReq::clear_node_status() { + node_status_ = 0; +} +inline ::yagpcc::PlanNodeStatus SetPlanNodeReq::_internal_node_status() const { + return static_cast< ::yagpcc::PlanNodeStatus >(node_status_); +} +inline ::yagpcc::PlanNodeStatus SetPlanNodeReq::node_status() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.node_status) + return _internal_node_status(); +} +inline void SetPlanNodeReq::_internal_set_node_status(::yagpcc::PlanNodeStatus value) { + + node_status_ = value; +} +inline void SetPlanNodeReq::set_node_status(::yagpcc::PlanNodeStatus value) { + _internal_set_node_status(value); + // @@protoc_insertion_point(field_set:yagpcc.SetPlanNodeReq.node_status) +} + +// .google.protobuf.Timestamp datetime = 2; +inline bool SetPlanNodeReq::_internal_has_datetime() const { + return this != internal_default_instance() && datetime_ != nullptr; +} +inline bool SetPlanNodeReq::has_datetime() const { + return _internal_has_datetime(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::_internal_datetime() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = datetime_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::datetime() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.datetime) + return _internal_datetime(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_datetime( + PROTOBUF_NAMESPACE_ID::Timestamp* datetime) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(datetime_); + } + datetime_ = datetime; + if (datetime) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.datetime) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::release_datetime() { + auto temp = unsafe_arena_release_datetime(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::unsafe_arena_release_datetime() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.datetime) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = datetime_; + datetime_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::_internal_mutable_datetime() { + + if (datetime_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + datetime_ = p; + } + return datetime_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::mutable_datetime() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.datetime) + return _internal_mutable_datetime(); +} +inline void SetPlanNodeReq::set_allocated_datetime(PROTOBUF_NAMESPACE_ID::Timestamp* datetime) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(datetime_); + } + if (datetime) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(datetime)->GetArena(); + if (message_arena != submessage_arena) { + datetime = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, datetime, submessage_arena); + } + + } else { + + } + datetime_ = datetime; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.datetime) +} + +// .yagpcc.QueryKey query_key = 3; +inline bool SetPlanNodeReq::_internal_has_query_key() const { + return this != internal_default_instance() && query_key_ != nullptr; +} +inline bool SetPlanNodeReq::has_query_key() const { + return _internal_has_query_key(); +} +inline const ::yagpcc::QueryKey& SetPlanNodeReq::_internal_query_key() const { + const ::yagpcc::QueryKey* p = query_key_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_QueryKey_default_instance_); +} +inline const ::yagpcc::QueryKey& SetPlanNodeReq::query_key() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.query_key) + return _internal_query_key(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_query_key( + ::yagpcc::QueryKey* query_key) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_key_); + } + query_key_ = query_key; + if (query_key) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.query_key) +} +inline ::yagpcc::QueryKey* SetPlanNodeReq::release_query_key() { + auto temp = unsafe_arena_release_query_key(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::QueryKey* SetPlanNodeReq::unsafe_arena_release_query_key() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.query_key) + + ::yagpcc::QueryKey* temp = query_key_; + query_key_ = nullptr; + return temp; +} +inline ::yagpcc::QueryKey* SetPlanNodeReq::_internal_mutable_query_key() { + + if (query_key_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::QueryKey>(GetArena()); + query_key_ = p; + } + return query_key_; +} +inline ::yagpcc::QueryKey* SetPlanNodeReq::mutable_query_key() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.query_key) + return _internal_mutable_query_key(); +} +inline void SetPlanNodeReq::set_allocated_query_key(::yagpcc::QueryKey* query_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_key_); + } + if (query_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(query_key)->GetArena(); + if (message_arena != submessage_arena) { + query_key = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, query_key, submessage_arena); + } + + } else { + + } + query_key_ = query_key; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.query_key) +} + +// .yagpcc.SegmentKey segment_key = 4; +inline bool SetPlanNodeReq::_internal_has_segment_key() const { + return this != internal_default_instance() && segment_key_ != nullptr; +} +inline bool SetPlanNodeReq::has_segment_key() const { + return _internal_has_segment_key(); +} +inline const ::yagpcc::SegmentKey& SetPlanNodeReq::_internal_segment_key() const { + const ::yagpcc::SegmentKey* p = segment_key_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_SegmentKey_default_instance_); +} +inline const ::yagpcc::SegmentKey& SetPlanNodeReq::segment_key() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.segment_key) + return _internal_segment_key(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_segment_key( + ::yagpcc::SegmentKey* segment_key) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(segment_key_); + } + segment_key_ = segment_key; + if (segment_key) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.segment_key) +} +inline ::yagpcc::SegmentKey* SetPlanNodeReq::release_segment_key() { + auto temp = unsafe_arena_release_segment_key(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::SegmentKey* SetPlanNodeReq::unsafe_arena_release_segment_key() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.segment_key) + + ::yagpcc::SegmentKey* temp = segment_key_; + segment_key_ = nullptr; + return temp; +} +inline ::yagpcc::SegmentKey* SetPlanNodeReq::_internal_mutable_segment_key() { + + if (segment_key_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::SegmentKey>(GetArena()); + segment_key_ = p; + } + return segment_key_; +} +inline ::yagpcc::SegmentKey* SetPlanNodeReq::mutable_segment_key() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.segment_key) + return _internal_mutable_segment_key(); +} +inline void SetPlanNodeReq::set_allocated_segment_key(::yagpcc::SegmentKey* segment_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(segment_key_); + } + if (segment_key) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(segment_key)->GetArena(); + if (message_arena != submessage_arena) { + segment_key = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, segment_key, submessage_arena); + } + + } else { + + } + segment_key_ = segment_key; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.segment_key) +} + +// .yagpcc.GPMetrics node_metrics = 5; +inline bool SetPlanNodeReq::_internal_has_node_metrics() const { + return this != internal_default_instance() && node_metrics_ != nullptr; +} +inline bool SetPlanNodeReq::has_node_metrics() const { + return _internal_has_node_metrics(); +} +inline const ::yagpcc::GPMetrics& SetPlanNodeReq::_internal_node_metrics() const { + const ::yagpcc::GPMetrics* p = node_metrics_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_GPMetrics_default_instance_); +} +inline const ::yagpcc::GPMetrics& SetPlanNodeReq::node_metrics() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.node_metrics) + return _internal_node_metrics(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_node_metrics( + ::yagpcc::GPMetrics* node_metrics) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(node_metrics_); + } + node_metrics_ = node_metrics; + if (node_metrics) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.node_metrics) +} +inline ::yagpcc::GPMetrics* SetPlanNodeReq::release_node_metrics() { + auto temp = unsafe_arena_release_node_metrics(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::GPMetrics* SetPlanNodeReq::unsafe_arena_release_node_metrics() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.node_metrics) + + ::yagpcc::GPMetrics* temp = node_metrics_; + node_metrics_ = nullptr; + return temp; +} +inline ::yagpcc::GPMetrics* SetPlanNodeReq::_internal_mutable_node_metrics() { + + if (node_metrics_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::GPMetrics>(GetArena()); + node_metrics_ = p; + } + return node_metrics_; +} +inline ::yagpcc::GPMetrics* SetPlanNodeReq::mutable_node_metrics() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.node_metrics) + return _internal_mutable_node_metrics(); +} +inline void SetPlanNodeReq::set_allocated_node_metrics(::yagpcc::GPMetrics* node_metrics) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(node_metrics_); + } + if (node_metrics) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(node_metrics)->GetArena(); + if (message_arena != submessage_arena) { + node_metrics = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, node_metrics, submessage_arena); + } + + } else { + + } + node_metrics_ = node_metrics; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.node_metrics) +} + +// .yagpcc.MetricPlan plan_node = 6; +inline bool SetPlanNodeReq::_internal_has_plan_node() const { + return this != internal_default_instance() && plan_node_ != nullptr; +} +inline bool SetPlanNodeReq::has_plan_node() const { + return _internal_has_plan_node(); +} +inline const ::yagpcc::MetricPlan& SetPlanNodeReq::_internal_plan_node() const { + const ::yagpcc::MetricPlan* p = plan_node_; + return p != nullptr ? *p : *reinterpret_cast( + &::yagpcc::_MetricPlan_default_instance_); +} +inline const ::yagpcc::MetricPlan& SetPlanNodeReq::plan_node() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.plan_node) + return _internal_plan_node(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_plan_node( + ::yagpcc::MetricPlan* plan_node) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(plan_node_); + } + plan_node_ = plan_node; + if (plan_node) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.plan_node) +} +inline ::yagpcc::MetricPlan* SetPlanNodeReq::release_plan_node() { + auto temp = unsafe_arena_release_plan_node(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline ::yagpcc::MetricPlan* SetPlanNodeReq::unsafe_arena_release_plan_node() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.plan_node) + + ::yagpcc::MetricPlan* temp = plan_node_; + plan_node_ = nullptr; + return temp; +} +inline ::yagpcc::MetricPlan* SetPlanNodeReq::_internal_mutable_plan_node() { + + if (plan_node_ == nullptr) { + auto* p = CreateMaybeMessage<::yagpcc::MetricPlan>(GetArena()); + plan_node_ = p; + } + return plan_node_; +} +inline ::yagpcc::MetricPlan* SetPlanNodeReq::mutable_plan_node() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.plan_node) + return _internal_mutable_plan_node(); +} +inline void SetPlanNodeReq::set_allocated_plan_node(::yagpcc::MetricPlan* plan_node) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(plan_node_); + } + if (plan_node) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(plan_node)->GetArena(); + if (message_arena != submessage_arena) { + plan_node = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, plan_node, submessage_arena); + } + + } else { + + } + plan_node_ = plan_node; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.plan_node) +} + +// .google.protobuf.Timestamp submit_time = 7; +inline bool SetPlanNodeReq::_internal_has_submit_time() const { + return this != internal_default_instance() && submit_time_ != nullptr; +} +inline bool SetPlanNodeReq::has_submit_time() const { + return _internal_has_submit_time(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::_internal_submit_time() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = submit_time_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::submit_time() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.submit_time) + return _internal_submit_time(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_submit_time( + PROTOBUF_NAMESPACE_ID::Timestamp* submit_time) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(submit_time_); + } + submit_time_ = submit_time; + if (submit_time) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.submit_time) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::release_submit_time() { + auto temp = unsafe_arena_release_submit_time(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::unsafe_arena_release_submit_time() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.submit_time) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = submit_time_; + submit_time_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::_internal_mutable_submit_time() { + + if (submit_time_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + submit_time_ = p; + } + return submit_time_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::mutable_submit_time() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.submit_time) + return _internal_mutable_submit_time(); +} +inline void SetPlanNodeReq::set_allocated_submit_time(PROTOBUF_NAMESPACE_ID::Timestamp* submit_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(submit_time_); + } + if (submit_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(submit_time)->GetArena(); + if (message_arena != submessage_arena) { + submit_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, submit_time, submessage_arena); + } + + } else { + + } + submit_time_ = submit_time; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.submit_time) +} + +// .google.protobuf.Timestamp start_time = 8; +inline bool SetPlanNodeReq::_internal_has_start_time() const { + return this != internal_default_instance() && start_time_ != nullptr; +} +inline bool SetPlanNodeReq::has_start_time() const { + return _internal_has_start_time(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::_internal_start_time() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = start_time_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::start_time() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.start_time) + return _internal_start_time(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_start_time( + PROTOBUF_NAMESPACE_ID::Timestamp* start_time) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time_); + } + start_time_ = start_time; + if (start_time) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.start_time) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::release_start_time() { + auto temp = unsafe_arena_release_start_time(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::unsafe_arena_release_start_time() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.start_time) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = start_time_; + start_time_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::_internal_mutable_start_time() { + + if (start_time_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + start_time_ = p; + } + return start_time_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::mutable_start_time() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.start_time) + return _internal_mutable_start_time(); +} +inline void SetPlanNodeReq::set_allocated_start_time(PROTOBUF_NAMESPACE_ID::Timestamp* start_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time_); + } + if (start_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(start_time)->GetArena(); + if (message_arena != submessage_arena) { + start_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, start_time, submessage_arena); + } + + } else { + + } + start_time_ = start_time; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.start_time) +} + +// .google.protobuf.Timestamp end_time = 9; +inline bool SetPlanNodeReq::_internal_has_end_time() const { + return this != internal_default_instance() && end_time_ != nullptr; +} +inline bool SetPlanNodeReq::has_end_time() const { + return _internal_has_end_time(); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::_internal_end_time() const { + const PROTOBUF_NAMESPACE_ID::Timestamp* p = end_time_; + return p != nullptr ? *p : *reinterpret_cast( + &PROTOBUF_NAMESPACE_ID::_Timestamp_default_instance_); +} +inline const PROTOBUF_NAMESPACE_ID::Timestamp& SetPlanNodeReq::end_time() const { + // @@protoc_insertion_point(field_get:yagpcc.SetPlanNodeReq.end_time) + return _internal_end_time(); +} +inline void SetPlanNodeReq::unsafe_arena_set_allocated_end_time( + PROTOBUF_NAMESPACE_ID::Timestamp* end_time) { + if (GetArena() == nullptr) { + delete reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time_); + } + end_time_ = end_time; + if (end_time) { + + } else { + + } + // @@protoc_insertion_point(field_unsafe_arena_set_allocated:yagpcc.SetPlanNodeReq.end_time) +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::release_end_time() { + auto temp = unsafe_arena_release_end_time(); + if (GetArena() != nullptr) { + temp = ::PROTOBUF_NAMESPACE_ID::internal::DuplicateIfNonNull(temp); + } + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::unsafe_arena_release_end_time() { + // @@protoc_insertion_point(field_release:yagpcc.SetPlanNodeReq.end_time) + + PROTOBUF_NAMESPACE_ID::Timestamp* temp = end_time_; + end_time_ = nullptr; + return temp; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::_internal_mutable_end_time() { + + if (end_time_ == nullptr) { + auto* p = CreateMaybeMessage(GetArena()); + end_time_ = p; + } + return end_time_; +} +inline PROTOBUF_NAMESPACE_ID::Timestamp* SetPlanNodeReq::mutable_end_time() { + // @@protoc_insertion_point(field_mutable:yagpcc.SetPlanNodeReq.end_time) + return _internal_mutable_end_time(); +} +inline void SetPlanNodeReq::set_allocated_end_time(PROTOBUF_NAMESPACE_ID::Timestamp* end_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArena(); + if (message_arena == nullptr) { + delete reinterpret_cast< ::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time_); + } + if (end_time) { + ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena = + reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(end_time)->GetArena(); + if (message_arena != submessage_arena) { + end_time = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage( + message_arena, end_time, submessage_arena); + } + + } else { + + } + end_time_ = end_time; + // @@protoc_insertion_point(field_set_allocated:yagpcc.SetPlanNodeReq.end_time) +} + +#ifdef __GNUC__ + #pragma GCC diagnostic pop +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// ------------------------------------------------------------------- + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace yagpcc + +PROTOBUF_NAMESPACE_OPEN + +template <> struct is_proto_enum< ::yagpcc::MetricResponseStatusCode> : ::std::true_type {}; +template <> +inline const EnumDescriptor* GetEnumDescriptor< ::yagpcc::MetricResponseStatusCode>() { + return ::yagpcc::MetricResponseStatusCode_descriptor(); +} + +PROTOBUF_NAMESPACE_CLOSE + +// @@protoc_insertion_point(global_scope) + +#include +#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_protos_2fyagpcc_5fset_5fservice_2eproto diff --git a/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/README.MD b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/README.MD new file mode 100644 index 00000000000..291e31a3099 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/README.MD @@ -0,0 +1 @@ +This directory contains a slightly modified subset of pg_stat_statements for PG v9.4 to be used in query and plan ID generation. diff --git a/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/README.md b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/README.md new file mode 100644 index 00000000000..291e31a3099 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/README.md @@ -0,0 +1 @@ +This directory contains a slightly modified subset of pg_stat_statements for PG v9.4 to be used in query and plan ID generation. diff --git a/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.c b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.c new file mode 100644 index 00000000000..7404208055f --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.c @@ -0,0 +1,378 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * pg_stat_statements_ya_parser.c + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.c + * + *------------------------------------------------------------------------- + */ + +// NOTE: this file is just a bunch of code borrowed from pg_stat_statements for PG 9.4 +// and from our own inhouse implementation of pg_stat_statements for managed PG + +#include "postgres.h" + +#include +#include + +#include "common/hashfn.h" +#include "lib/stringinfo.h" +#include "mb/pg_wchar.h" +#include "miscadmin.h" +#include "parser/scanner.h" +#include "utils/builtins.h" +#include "utils/memutils.h" +#include "utils/queryjumble.h" + +#include "pg_stat_statements_ya_parser.h" + +#ifndef FCONST +#define FCONST 260 +#endif +#ifndef SCONST +#define SCONST 261 +#endif +#ifndef BCONST +#define BCONST 263 +#endif +#ifndef XCONST +#define XCONST 264 +#endif +#ifndef ICONST +#define ICONST 266 +#endif + +static void fill_in_constant_lengths(JumbleState *jstate, const char *query); +static int comp_location(const void *a, const void *b); +StringInfo gen_normplan(const char *execution_plan); +static bool need_replace(int token); +static char *generate_normalized_query(JumbleState *jstate, const char *query, + int *query_len_p, int encoding); + +void stat_statements_parser_init(void) +{ + EnableQueryId(); +} + +void stat_statements_parser_deinit(void) +{ + /* NO-OP */ +} + +/* check if token should be replaced by substitute varable */ +static bool +need_replace(int token) +{ + return (token == FCONST) || (token == ICONST) || (token == SCONST) || (token == BCONST) || (token == XCONST); +} + +/* + * gen_normplan - parse execution plan using flex and replace all CONST to + * substitute variables. + */ +StringInfo +gen_normplan(const char *execution_plan) +{ + core_yyscan_t yyscanner; + core_yy_extra_type yyextra; + core_YYSTYPE yylval; + YYLTYPE yylloc; + int tok; + int bind_prefix = 1; + char *tmp_str; + YYLTYPE last_yylloc = 0; + int last_tok = 0; + StringInfo plan_out = makeStringInfo(); + ; + + yyscanner = scanner_init(execution_plan, + &yyextra, +#if PG_VERSION_NUM >= 120000 + &ScanKeywords, + ScanKeywordTokens +#else + ScanKeywords, + NumScanKeywords +#endif + ); + + for (;;) + { + /* get the next lexem */ + tok = core_yylex(&yylval, &yylloc, yyscanner); + + /* now we store end previsous lexem in yylloc - so could prcess it */ + if (need_replace(last_tok)) + { + /* substitute variable instead of CONST */ + int s_len = asprintf(&tmp_str, "$%i", bind_prefix++); + if (s_len > 0) + { + appendStringInfoString(plan_out, tmp_str); + free(tmp_str); + } + else + { + appendStringInfoString(plan_out, "??"); + } + } + else + { + /* do not change - just copy as-is */ + tmp_str = strndup((char *)execution_plan + last_yylloc, yylloc - last_yylloc); + appendStringInfoString(plan_out, tmp_str); + free(tmp_str); + } + /* check if further parsing not needed */ + if (tok == 0) + break; + last_tok = tok; + last_yylloc = yylloc; + } + + scanner_finish(yyscanner); + + return plan_out; +} + +/* + * comp_location: comparator for qsorting LocationLen structs by location + */ +static int +comp_location(const void *a, const void *b) +{ + int l = ((const LocationLen *) a)->location; + int r = ((const LocationLen *) b)->location; + + if (l < r) + return -1; + else if (l > r) + return +1; + else + return 0; +} + +/* + * Given a valid SQL string and an array of constant-location records, + * fill in the textual lengths of those constants. + * + * The constants may use any allowed constant syntax, such as float literals, + * bit-strings, single-quoted strings and dollar-quoted strings. This is + * accomplished by using the public API for the core scanner. + * + * It is the caller's job to ensure that the string is a valid SQL statement + * with constants at the indicated locations. Since in practice the string + * has already been parsed, and the locations that the caller provides will + * have originated from within the authoritative parser, this should not be + * a problem. + * + * Duplicate constant pointers are possible, and will have their lengths + * marked as '-1', so that they are later ignored. (Actually, we assume the + * lengths were initialized as -1 to start with, and don't change them here.) + * + * N.B. There is an assumption that a '-' character at a Const location begins + * a negative numeric constant. This precludes there ever being another + * reason for a constant to start with a '-'. + */ +static void +fill_in_constant_lengths(JumbleState *jstate, const char *query) +{ + LocationLen *locs; + core_yyscan_t yyscanner; + core_yy_extra_type yyextra; + core_YYSTYPE yylval; + YYLTYPE yylloc; + int last_loc = -1; + int i; + + /* + * Sort the records by location so that we can process them in order while + * scanning the query text. + */ + if (jstate->clocations_count > 1) + qsort(jstate->clocations, jstate->clocations_count, + sizeof(LocationLen), comp_location); + locs = jstate->clocations; + + /* initialize the flex scanner --- should match raw_parser() */ + yyscanner = scanner_init(query, + &yyextra, + &ScanKeywords, + ScanKeywordTokens); + + /* Search for each constant, in sequence */ + for (i = 0; i < jstate->clocations_count; i++) + { + int loc = locs[i].location; + int tok; + + Assert(loc >= 0); + + if (loc <= last_loc) + continue; /* Duplicate constant, ignore */ + + /* Lex tokens until we find the desired constant */ + for (;;) + { + tok = core_yylex(&yylval, &yylloc, yyscanner); + + /* We should not hit end-of-string, but if we do, behave sanely */ + if (tok == 0) + break; /* out of inner for-loop */ + + /* + * We should find the token position exactly, but if we somehow + * run past it, work with that. + */ + if (yylloc >= loc) + { + if (query[loc] == '-') + { + /* + * It's a negative value - this is the one and only case + * where we replace more than a single token. + * + * Do not compensate for the core system's special-case + * adjustment of location to that of the leading '-' + * operator in the event of a negative constant. It is + * also useful for our purposes to start from the minus + * symbol. In this way, queries like "select * from foo + * where bar = 1" and "select * from foo where bar = -2" + * will have identical normalized query strings. + */ + tok = core_yylex(&yylval, &yylloc, yyscanner); + if (tok == 0) + break; /* out of inner for-loop */ + } + + /* + * We now rely on the assumption that flex has placed a zero + * byte after the text of the current token in scanbuf. + */ + locs[i].length = strlen(yyextra.scanbuf + loc); + break; /* out of inner for-loop */ + } + } + + /* If we hit end-of-string, give up, leaving remaining lengths -1 */ + if (tok == 0) + break; + + last_loc = loc; + } + + scanner_finish(yyscanner); +} + +/* + * Generate a normalized version of the query string that will be used to + * represent all similar queries. + * + * Note that the normalized representation may well vary depending on + * just which "equivalent" query is used to create the hashtable entry. + * We assume this is OK. + * + * *query_len_p contains the input string length, and is updated with + * the result string length (which cannot be longer) on exit. + * + * Returns a palloc'd string. + */ +static char * +generate_normalized_query(JumbleState *jstate, const char *query, + int *query_len_p, int encoding) +{ + char *norm_query; + int query_len = *query_len_p; + int i, + len_to_wrt, /* Length (in bytes) to write */ + quer_loc = 0, /* Source query byte location */ + n_quer_loc = 0, /* Normalized query byte location */ + last_off = 0, /* Offset from start for previous tok */ + last_tok_len = 0; /* Length (in bytes) of that tok */ + + /* + * Get constants' lengths (core system only gives us locations). Note + * this also ensures the items are sorted by location. + */ + fill_in_constant_lengths(jstate, query); + + /* Allocate result buffer */ + norm_query = palloc(query_len + 1); + + for (i = 0; i < jstate->clocations_count; i++) + { + int off, /* Offset from start for cur tok */ + tok_len; /* Length (in bytes) of that tok */ + + off = jstate->clocations[i].location; + tok_len = jstate->clocations[i].length; + + if (tok_len < 0) + continue; /* ignore any duplicates */ + + /* Copy next chunk (what precedes the next constant) */ + len_to_wrt = off - last_off; + len_to_wrt -= last_tok_len; + + Assert(len_to_wrt >= 0); + memcpy(norm_query + n_quer_loc, query + quer_loc, len_to_wrt); + n_quer_loc += len_to_wrt; + + /* And insert a '?' in place of the constant token */ + norm_query[n_quer_loc++] = '?'; + + quer_loc = off + tok_len; + last_off = off; + last_tok_len = tok_len; + } + + /* + * We've copied up until the last ignorable constant. Copy over the + * remaining bytes of the original query string. + */ + len_to_wrt = query_len - quer_loc; + + Assert(len_to_wrt >= 0); + memcpy(norm_query + n_quer_loc, query + quer_loc, len_to_wrt); + n_quer_loc += len_to_wrt; + + Assert(n_quer_loc <= query_len); + norm_query[n_quer_loc] = '\0'; + + *query_len_p = n_quer_loc; + return norm_query; +} + +char *gen_normquery(const char *query) +{ + if (!query) { + return NULL; + } + JumbleState jstate; + jstate.jumble = (unsigned char *)palloc(JUMBLE_SIZE); + jstate.jumble_len = 0; + jstate.clocations_buf_size = 32; + jstate.clocations = (LocationLen *) + palloc(jstate.clocations_buf_size * sizeof(LocationLen)); + jstate.clocations_count = 0; + int query_len = strlen(query); + return generate_normalized_query(&jstate, query, &query_len, GetDatabaseEncoding()); +} \ No newline at end of file diff --git a/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.h b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.h new file mode 100644 index 00000000000..96c6a776dba --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.h @@ -0,0 +1,43 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * pg_stat_statements_ya_parser.h + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/stat_statements_parser/pg_stat_statements_ya_parser.h + * + *------------------------------------------------------------------------- + */ + +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif + +extern void stat_statements_parser_init(void); +extern void stat_statements_parser_deinit(void); + +StringInfo gen_normplan(const char *executionPlan); +char *gen_normquery(const char *query); + +#ifdef __cplusplus +} +#endif diff --git a/gpcontrib/yagp_hooks_collector/src/yagp_hooks_collector.c b/gpcontrib/yagp_hooks_collector/src/yagp_hooks_collector.c new file mode 100644 index 00000000000..271bceee178 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/src/yagp_hooks_collector.c @@ -0,0 +1,150 @@ +/*------------------------------------------------------------------------- + * + * 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. + * + * yagp_hooks_collector.c + * + * IDENTIFICATION + * gpcontrib/yagp_hooks_collector/src/yagp_hooks_collector.c + * + *------------------------------------------------------------------------- + */ + +#include "postgres.h" +#include "cdb/cdbvars.h" +#include "funcapi.h" +#include "utils/builtins.h" + +#include "hook_wrappers.h" + +PG_MODULE_MAGIC; + +void _PG_init(void); +void _PG_fini(void); +PG_FUNCTION_INFO_V1(yagp_stat_messages_reset); +PG_FUNCTION_INFO_V1(yagp_stat_messages); +PG_FUNCTION_INFO_V1(yagp_init_log); +PG_FUNCTION_INFO_V1(yagp_truncate_log); + +PG_FUNCTION_INFO_V1(yagp_test_uds_start_server); +PG_FUNCTION_INFO_V1(yagp_test_uds_receive); +PG_FUNCTION_INFO_V1(yagp_test_uds_stop_server); + +void _PG_init(void) { + if (Gp_role == GP_ROLE_DISPATCH || Gp_role == GP_ROLE_EXECUTE) + hooks_init(); +} + +void _PG_fini(void) { + if (Gp_role == GP_ROLE_DISPATCH || Gp_role == GP_ROLE_EXECUTE) + hooks_deinit(); +} + +Datum yagp_stat_messages_reset(PG_FUNCTION_ARGS) { + FuncCallContext *funcctx; + + if (SRF_IS_FIRSTCALL()) { + funcctx = SRF_FIRSTCALL_INIT(); + yagp_functions_reset(); + } + + funcctx = SRF_PERCALL_SETUP(); + SRF_RETURN_DONE(funcctx); +} + +Datum yagp_stat_messages(PG_FUNCTION_ARGS) { + return yagp_functions_get(fcinfo); +} + +Datum yagp_init_log(PG_FUNCTION_ARGS) { + FuncCallContext *funcctx; + + if (SRF_IS_FIRSTCALL()) { + funcctx = SRF_FIRSTCALL_INIT(); + init_log(); + } + + funcctx = SRF_PERCALL_SETUP(); + SRF_RETURN_DONE(funcctx); +} + +Datum yagp_truncate_log(PG_FUNCTION_ARGS) { + FuncCallContext *funcctx; + + if (SRF_IS_FIRSTCALL()) { + funcctx = SRF_FIRSTCALL_INIT(); + truncate_log(); + } + + funcctx = SRF_PERCALL_SETUP(); + SRF_RETURN_DONE(funcctx); +} + +Datum yagp_test_uds_start_server(PG_FUNCTION_ARGS) { + FuncCallContext *funcctx; + + if (SRF_IS_FIRSTCALL()) { + funcctx = SRF_FIRSTCALL_INIT(); + char *path = text_to_cstring(PG_GETARG_TEXT_PP(0)); + test_uds_start_server(path); + pfree(path); + } + + funcctx = SRF_PERCALL_SETUP(); + SRF_RETURN_DONE(funcctx); +} + +Datum yagp_test_uds_receive(PG_FUNCTION_ARGS) { + FuncCallContext *funcctx; + int64 *result; + + if (SRF_IS_FIRSTCALL()) { + MemoryContext oldcontext; + + funcctx = SRF_FIRSTCALL_INIT(); + oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); + result = (int64 *)palloc(sizeof(int64)); + funcctx->user_fctx = result; + funcctx->max_calls = 1; + MemoryContextSwitchTo(oldcontext); + + int timeout_ms = PG_GETARG_INT32(0); + *result = test_uds_receive(timeout_ms); + } + + funcctx = SRF_PERCALL_SETUP(); + + if (funcctx->call_cntr < funcctx->max_calls) { + result = (int64 *)funcctx->user_fctx; + SRF_RETURN_NEXT(funcctx, Int64GetDatum(*result)); + } + + SRF_RETURN_DONE(funcctx); +} + +Datum yagp_test_uds_stop_server(PG_FUNCTION_ARGS) { + FuncCallContext *funcctx; + + if (SRF_IS_FIRSTCALL()) { + funcctx = SRF_FIRSTCALL_INIT(); + test_uds_stop_server(); + } + + funcctx = SRF_PERCALL_SETUP(); + SRF_RETURN_DONE(funcctx); +} diff --git a/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.0--1.1.sql b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.0--1.1.sql new file mode 100644 index 00000000000..8684ca73915 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.0--1.1.sql @@ -0,0 +1,113 @@ +/* yagp_hooks_collector--1.0--1.1.sql */ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION yagp_hooks_collector UPDATE TO '1.1'" to load this file. \quit + +CREATE SCHEMA yagpcc; + +-- Unlink existing objects from extension. +ALTER EXTENSION yagp_hooks_collector DROP VIEW yagp_stat_messages; +ALTER EXTENSION yagp_hooks_collector DROP FUNCTION yagp_stat_messages_reset(); +ALTER EXTENSION yagp_hooks_collector DROP FUNCTION __yagp_stat_messages_f_on_segments(); +ALTER EXTENSION yagp_hooks_collector DROP FUNCTION __yagp_stat_messages_f_on_master(); +ALTER EXTENSION yagp_hooks_collector DROP FUNCTION __yagp_stat_messages_reset_f_on_segments(); +ALTER EXTENSION yagp_hooks_collector DROP FUNCTION __yagp_stat_messages_reset_f_on_master(); + +-- Now drop the objects. +DROP VIEW yagp_stat_messages; +DROP FUNCTION yagp_stat_messages_reset(); +DROP FUNCTION __yagp_stat_messages_f_on_segments(); +DROP FUNCTION __yagp_stat_messages_f_on_master(); +DROP FUNCTION __yagp_stat_messages_reset_f_on_segments(); +DROP FUNCTION __yagp_stat_messages_reset_f_on_master(); + +-- Recreate functions and view in new schema. +CREATE FUNCTION yagpcc.__stat_messages_reset_f_on_master() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_stat_messages_reset' +LANGUAGE C EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__stat_messages_reset_f_on_segments() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_stat_messages_reset' +LANGUAGE C EXECUTE ON ALL SEGMENTS; + +CREATE FUNCTION yagpcc.stat_messages_reset() +RETURNS SETOF void +AS +$$ + SELECT yagpcc.__stat_messages_reset_f_on_master(); + SELECT yagpcc.__stat_messages_reset_f_on_segments(); +$$ +LANGUAGE SQL EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__stat_messages_f_on_master() +RETURNS SETOF record +AS 'MODULE_PATHNAME', 'yagp_stat_messages' +LANGUAGE C STRICT VOLATILE EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__stat_messages_f_on_segments() +RETURNS SETOF record +AS 'MODULE_PATHNAME', 'yagp_stat_messages' +LANGUAGE C STRICT VOLATILE EXECUTE ON ALL SEGMENTS; + +CREATE VIEW yagpcc.stat_messages AS + SELECT C.* + FROM yagpcc.__stat_messages_f_on_master() as C ( + segid int, + total_messages bigint, + send_failures bigint, + connection_failures bigint, + other_errors bigint, + max_message_size int + ) + UNION ALL + SELECT C.* + FROM yagpcc.__stat_messages_f_on_segments() as C ( + segid int, + total_messages bigint, + send_failures bigint, + connection_failures bigint, + other_errors bigint, + max_message_size int + ) +ORDER BY segid; + +-- Create new objects. +CREATE FUNCTION yagpcc.__init_log_on_master() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_init_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__init_log_on_segments() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_init_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON ALL SEGMENTS; + +-- Creates log table inside yagpcc schema. +SELECT yagpcc.__init_log_on_master(); +SELECT yagpcc.__init_log_on_segments(); + +CREATE VIEW yagpcc.log AS + SELECT * FROM yagpcc.__log -- master + UNION ALL + SELECT * FROM gp_dist_random('yagpcc.__log') -- segments + ORDER BY tmid, ssid, ccnt; + +CREATE FUNCTION yagpcc.__truncate_log_on_master() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_truncate_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__truncate_log_on_segments() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_truncate_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON ALL SEGMENTS; + +CREATE FUNCTION yagpcc.truncate_log() +RETURNS SETOF void AS $$ +BEGIN + PERFORM yagpcc.__truncate_log_on_master(); + PERFORM yagpcc.__truncate_log_on_segments(); +END; +$$ LANGUAGE plpgsql VOLATILE; diff --git a/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.0.sql b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.0.sql new file mode 100644 index 00000000000..270cab92382 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.0.sql @@ -0,0 +1,55 @@ +/* yagp_hooks_collector--1.0.sql */ + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION yagp_hooks_collector" to load this file. \quit + +CREATE FUNCTION __yagp_stat_messages_reset_f_on_master() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_stat_messages_reset' +LANGUAGE C EXECUTE ON MASTER; + +CREATE FUNCTION __yagp_stat_messages_reset_f_on_segments() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_stat_messages_reset' +LANGUAGE C EXECUTE ON ALL SEGMENTS; + +CREATE FUNCTION yagp_stat_messages_reset() +RETURNS SETOF void +AS +$$ + SELECT __yagp_stat_messages_reset_f_on_master(); + SELECT __yagp_stat_messages_reset_f_on_segments(); +$$ +LANGUAGE SQL EXECUTE ON MASTER; + +CREATE FUNCTION __yagp_stat_messages_f_on_master() +RETURNS SETOF record +AS 'MODULE_PATHNAME', 'yagp_stat_messages' +LANGUAGE C STRICT VOLATILE EXECUTE ON MASTER; + +CREATE FUNCTION __yagp_stat_messages_f_on_segments() +RETURNS SETOF record +AS 'MODULE_PATHNAME', 'yagp_stat_messages' +LANGUAGE C STRICT VOLATILE EXECUTE ON ALL SEGMENTS; + +CREATE VIEW yagp_stat_messages AS + SELECT C.* + FROM __yagp_stat_messages_f_on_master() as C ( + segid int, + total_messages bigint, + send_failures bigint, + connection_failures bigint, + other_errors bigint, + max_message_size int + ) + UNION ALL + SELECT C.* + FROM __yagp_stat_messages_f_on_segments() as C ( + segid int, + total_messages bigint, + send_failures bigint, + connection_failures bigint, + other_errors bigint, + max_message_size int + ) +ORDER BY segid; diff --git a/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.1.sql b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.1.sql new file mode 100644 index 00000000000..83bfb553638 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector--1.1.sql @@ -0,0 +1,110 @@ +/* yagp_hooks_collector--1.1.sql */ + +-- complain if script is sourced in psql, rather than via CREATE EXTENSION +\echo Use "CREATE EXTENSION yagp_hooks_collector" to load this file. \quit + +CREATE SCHEMA yagpcc; + +CREATE FUNCTION yagpcc.__stat_messages_reset_f_on_master() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_stat_messages_reset' +LANGUAGE C EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__stat_messages_reset_f_on_segments() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_stat_messages_reset' +LANGUAGE C EXECUTE ON ALL SEGMENTS; + +CREATE FUNCTION yagpcc.stat_messages_reset() +RETURNS SETOF void +AS +$$ + SELECT yagpcc.__stat_messages_reset_f_on_master(); + SELECT yagpcc.__stat_messages_reset_f_on_segments(); +$$ +LANGUAGE SQL EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__stat_messages_f_on_master() +RETURNS SETOF record +AS 'MODULE_PATHNAME', 'yagp_stat_messages' +LANGUAGE C STRICT VOLATILE EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__stat_messages_f_on_segments() +RETURNS SETOF record +AS 'MODULE_PATHNAME', 'yagp_stat_messages' +LANGUAGE C STRICT VOLATILE EXECUTE ON ALL SEGMENTS; + +CREATE VIEW yagpcc.stat_messages AS + SELECT C.* + FROM yagpcc.__stat_messages_f_on_master() as C ( + segid int, + total_messages bigint, + send_failures bigint, + connection_failures bigint, + other_errors bigint, + max_message_size int + ) + UNION ALL + SELECT C.* + FROM yagpcc.__stat_messages_f_on_segments() as C ( + segid int, + total_messages bigint, + send_failures bigint, + connection_failures bigint, + other_errors bigint, + max_message_size int + ) +ORDER BY segid; + +CREATE FUNCTION yagpcc.__init_log_on_master() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_init_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__init_log_on_segments() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_init_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON ALL SEGMENTS; + +-- Creates log table inside yagpcc schema. +SELECT yagpcc.__init_log_on_master(); +SELECT yagpcc.__init_log_on_segments(); + +CREATE VIEW yagpcc.log AS + SELECT * FROM yagpcc.__log -- master + UNION ALL + SELECT * FROM gp_dist_random('yagpcc.__log') -- segments +ORDER BY tmid, ssid, ccnt; + +CREATE FUNCTION yagpcc.__truncate_log_on_master() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_truncate_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__truncate_log_on_segments() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_truncate_log' +LANGUAGE C STRICT VOLATILE EXECUTE ON ALL SEGMENTS; + +CREATE FUNCTION yagpcc.truncate_log() +RETURNS SETOF void AS $$ +BEGIN + PERFORM yagpcc.__truncate_log_on_master(); + PERFORM yagpcc.__truncate_log_on_segments(); +END; +$$ LANGUAGE plpgsql VOLATILE; + +CREATE FUNCTION yagpcc.__test_uds_start_server(path text) +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_test_uds_start_server' +LANGUAGE C STRICT EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__test_uds_receive(timeout_ms int DEFAULT 2000) +RETURNS SETOF bigint +AS 'MODULE_PATHNAME', 'yagp_test_uds_receive' +LANGUAGE C STRICT EXECUTE ON MASTER; + +CREATE FUNCTION yagpcc.__test_uds_stop_server() +RETURNS SETOF void +AS 'MODULE_PATHNAME', 'yagp_test_uds_stop_server' +LANGUAGE C EXECUTE ON MASTER; diff --git a/gpcontrib/yagp_hooks_collector/yagp_hooks_collector.control b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector.control new file mode 100644 index 00000000000..cb5906a1302 --- /dev/null +++ b/gpcontrib/yagp_hooks_collector/yagp_hooks_collector.control @@ -0,0 +1,5 @@ +# yagp_hooks_collector extension +comment = 'Intercept query and plan execution hooks and report them to Yandex GPCC agents' +default_version = '1.1' +module_pathname = '$libdir/yagp_hooks_collector' +superuser = true diff --git a/pom.xml b/pom.xml index c3a1cd34381..fd9fd587241 100644 --- a/pom.xml +++ b/pom.xml @@ -154,6 +154,12 @@ code or new licensing patterns. gpcontrib/gp_exttable_fdw/gp_exttable_fdw.control gpcontrib/diskquota/** + gpcontrib/yagp_hooks_collector/yagp_hooks_collector.control + gpcontrib/yagp_hooks_collector/protos/yagpcc_set_service.proto + gpcontrib/yagp_hooks_collector/protos/yagpcc_plan.proto + gpcontrib/yagp_hooks_collector/protos/yagpcc_metrics.proto + gpcontrib/yagp_hooks_collector/.clang-format + gpcontrib/yagp_hooks_collector/Makefile getversion .git-blame-ignore-revs diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 062ec75b039..edc49b72e05 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -271,6 +271,7 @@ with_zstd = @with_zstd@ ZSTD_CFLAGS = @ZSTD_CFLAGS@ ZSTD_LIBS = @ZSTD_LIBS@ EVENT_LIBS = @EVENT_LIBS@ +with_yagp_hooks_collector = @with_yagp_hooks_collector@ ########################################################################## # diff --git a/src/backend/commands/createas.c b/src/backend/commands/createas.c index 6822032fe0d..a3d2f155fd8 100644 --- a/src/backend/commands/createas.c +++ b/src/backend/commands/createas.c @@ -478,10 +478,6 @@ ExecCreateTableAs(ParseState *pstate, CreateTableAsStmt *stmt, dest, params, queryEnv, 0); } - /* GPDB hook for collecting query info */ - if (query_info_collect_hook) - (*query_info_collect_hook)(METRICS_QUERY_SUBMIT, queryDesc); - if (into->skipData) { /* @@ -495,6 +491,10 @@ ExecCreateTableAs(ParseState *pstate, CreateTableAsStmt *stmt, } else { + /* GPDB hook for collecting query info */ + if (query_info_collect_hook) + (*query_info_collect_hook)(METRICS_QUERY_SUBMIT, queryDesc); + check_and_unassign_from_resgroup(queryDesc->plannedstmt); queryDesc->plannedstmt->query_mem = ResourceManagerGetQueryMemoryLimit(queryDesc->plannedstmt); diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index 1555ea9d334..dc8efd4d892 100644 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@ -63,6 +63,7 @@ #include "tcop/tcopprot.h" #include "utils/builtins.h" #include "utils/lsyscache.h" +#include "utils/metrics_utils.h" #include "utils/rel.h" #include "utils/snapmgr.h" #include "utils/syscache.h" @@ -842,6 +843,10 @@ refresh_matview_datafill(DestReceiver *dest, Query *query, GetActiveSnapshot(), InvalidSnapshot, dest, NULL, NULL, 0); + /* GPDB hook for collecting query info */ + if (query_info_collect_hook) + (*query_info_collect_hook)(METRICS_QUERY_SUBMIT, queryDesc); + RestoreOidAssignments(saved_dispatch_oids); /* call ExecutorStart to prepare the plan for execution */ diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c index 4817c14f07d..553830e8599 100644 --- a/src/backend/commands/portalcmds.c +++ b/src/backend/commands/portalcmds.c @@ -35,6 +35,7 @@ #include "tcop/pquery.h" #include "tcop/tcopprot.h" #include "utils/memutils.h" +#include "utils/metrics_utils.h" #include "utils/snapmgr.h" #include "cdb/cdbendpoint.h" @@ -373,6 +374,10 @@ PortalCleanup(Portal portal) FreeQueryDesc(queryDesc); CurrentResourceOwner = saveResourceOwner; + } else { + /* GPDB hook for collecting query info */ + if (queryDesc->yagp_query_key && query_info_collect_hook) + (*query_info_collect_hook)(METRICS_QUERY_ERROR, queryDesc); } } diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c index 532690f1d51..7c1dbc480bc 100644 --- a/src/backend/tcop/pquery.c +++ b/src/backend/tcop/pquery.c @@ -127,6 +127,9 @@ CreateQueryDesc(PlannedStmt *plannedstmt, if (Gp_role != GP_ROLE_EXECUTE) increment_command_count(); + /* null this field until set by YAGP Hooks collector */ + qd->yagp_query_key = NULL; + return qd; } diff --git a/src/backend/utils/workfile_manager/workfile_mgr.c b/src/backend/utils/workfile_manager/workfile_mgr.c index e5b311cf9ba..21b4463e5f1 100644 --- a/src/backend/utils/workfile_manager/workfile_mgr.c +++ b/src/backend/utils/workfile_manager/workfile_mgr.c @@ -192,6 +192,9 @@ static void unpin_workset(workfile_set *work_set); static bool proc_exit_hook_registered = false; +static uint64 total_bytes_written = 0; +static uint64 total_files_created = 0; + Datum gp_workfile_mgr_cache_entries(PG_FUNCTION_ARGS); Datum gp_workfile_mgr_used_diskspace(PG_FUNCTION_ARGS); @@ -371,6 +374,7 @@ RegisterFileWithSet(File file, workfile_set *work_set) localCtl.entries[file].work_set = work_set; work_set->num_files++; work_set->perquery->num_files++; + total_files_created++; /* Enforce the limit on number of files */ if (gp_workfile_limit_files_per_query > 0 && @@ -447,6 +451,7 @@ UpdateWorkFileSize(File file, uint64 newsize) (errcode(ERRCODE_INSUFFICIENT_RESOURCES), errmsg("workfile per segment size limit exceeded"))); } + total_bytes_written += diff; } /* @@ -986,3 +991,22 @@ workfile_is_active(workfile_set *workfile) { return workfile ? workfile->active : false; } + +uint64 +WorkfileTotalBytesWritten(void) +{ + return total_bytes_written; +} + +uint64 +WorkfileTotalFilesCreated(void) +{ + return total_files_created; +} + +void +WorkfileResetBackendStats(void) +{ + total_bytes_written = 0; + total_files_created = 0; +} diff --git a/src/include/executor/execdesc.h b/src/include/executor/execdesc.h index e3ecf31b664..e469945a4c5 100644 --- a/src/include/executor/execdesc.h +++ b/src/include/executor/execdesc.h @@ -22,6 +22,14 @@ struct CdbExplain_ShowStatCtx; /* private, in "cdb/cdbexplain.c" */ +typedef struct YagpQueryKey +{ + int tmid; /* transaction time */ + int ssid; /* session id */ + int ccnt; /* command count */ + int nesting_level; + uintptr_t query_desc_addr; +} YagpQueryKey; /* * SerializedParams is used to serialize external query parameters @@ -330,6 +338,9 @@ typedef struct QueryDesc /* This is always set NULL by the core system, but plugins can change it */ struct Instrumentation *totaltime; /* total time spent in ExecutorRun */ + + /* YAGP Hooks collector */ + YagpQueryKey *yagp_query_key; } QueryDesc; /* in pquery.c */ diff --git a/src/include/utils/workfile_mgr.h b/src/include/utils/workfile_mgr.h index dfbd17bca57..48c83620610 100644 --- a/src/include/utils/workfile_mgr.h +++ b/src/include/utils/workfile_mgr.h @@ -74,4 +74,8 @@ extern workfile_set *workfile_mgr_cache_entries_get_copy(int* num_actives); extern uint64 WorkfileSegspace_GetSize(void); extern bool workfile_is_active(workfile_set *workfile); +extern uint64 WorkfileTotalBytesWritten(void); +extern uint64 WorkfileTotalFilesCreated(void); +extern void WorkfileResetBackendStats(void); + #endif /* __WORKFILE_MGR_H__ */