This is an automated email from the ASF dual-hosted git repository.

djwang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git

commit 7f4ed5ed5c60e1f02d148dd241524065d8527acd
Author: NJrslv <[email protected]>
AuthorDate: Wed Jan 21 13:52:56 2026 +0000

    [yagp_hooks_collector] Add Apache license headers and enable -Werror
---
 gpcontrib/yagp_hooks_collector/Makefile            |  2 +-
 pom.xml                                            |  6 ++++
 src/Config.cpp                                     | 27 ++++++++++++++++++
 src/Config.h                                       | 27 ++++++++++++++++++
 src/EventSender.cpp                                | 27 ++++++++++++++++++
 src/EventSender.h                                  | 27 ++++++++++++++++++
 src/PgUtils.cpp                                    | 27 ++++++++++++++++++
 src/PgUtils.h                                      | 27 ++++++++++++++++++
 src/ProcStats.cpp                                  | 27 ++++++++++++++++++
 src/ProcStats.h                                    | 27 ++++++++++++++++++
 src/ProtoUtils.cpp                                 | 27 ++++++++++++++++++
 src/ProtoUtils.h                                   | 27 ++++++++++++++++++
 src/UDSConnector.cpp                               | 29 ++++++++++++++++++-
 src/UDSConnector.h                                 | 27 ++++++++++++++++++
 src/YagpStat.cpp                                   | 27 ++++++++++++++++++
 src/YagpStat.h                                     | 27 ++++++++++++++++++
 src/hook_wrappers.cpp                              | 33 ++++++++++++++++++++--
 src/hook_wrappers.h                                | 27 ++++++++++++++++++
 src/log/LogOps.cpp                                 | 27 ++++++++++++++++++
 src/log/LogOps.h                                   | 27 ++++++++++++++++++
 src/log/LogSchema.cpp                              | 27 ++++++++++++++++++
 src/log/LogSchema.h                                | 27 ++++++++++++++++++
 src/memory/gpdbwrappers.cpp                        | 27 ++++++++++++++++++
 src/memory/gpdbwrappers.h                          | 27 ++++++++++++++++++
 src/stat_statements_parser/README.md               |  1 +
 .../pg_stat_statements_ya_parser.c                 | 27 ++++++++++++++++++
 .../pg_stat_statements_ya_parser.h                 | 27 ++++++++++++++++++
 src/yagp_hooks_collector.c                         | 27 ++++++++++++++++++
 28 files changed, 688 insertions(+), 4 deletions(-)

diff --git a/gpcontrib/yagp_hooks_collector/Makefile 
b/gpcontrib/yagp_hooks_collector/Makefile
index d145ae46dbe..49825c55f35 100644
--- a/gpcontrib/yagp_hooks_collector/Makefile
+++ b/gpcontrib/yagp_hooks_collector/Makefile
@@ -10,7 +10,7 @@ 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 = -fPIC -g3 -Wall -Wpointer-arith -Wendif-labels \
+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
diff --git a/pom.xml b/pom.xml
index cfa44a0d6aa..aada6870658 100644
--- a/pom.xml
+++ b/pom.xml
@@ -154,6 +154,12 @@ code or new licensing patterns.
             
<exclude>gpcontrib/gp_exttable_fdw/gp_exttable_fdw.control</exclude>
 
             <exclude>gpcontrib/diskquota/**</exclude>
+            
<exclude>gpcontrib/yagp_hooks_collector/yagp_hooks_collector.control</exclude>
+            
<exclude>gpcontrib/yagp_hooks_collector/protos/yagpcc_set_service.proto</exclude>
+            
<exclude>gpcontrib/yagp_hooks_collector/protos/yagpcc_plan.proto</exclude>
+            
<exclude>gpcontrib/yagp_hooks_collector/protos/yagpcc_metrics.proto</exclude>
+            <exclude>gpcontrib/yagp_hooks_collector/.clang-format</exclude>
+            <exclude>gpcontrib/yagp_hooks_collector/Makefile</exclude>
 
             <exclude>getversion</exclude>
             <exclude>.git-blame-ignore-revs</exclude>
diff --git a/src/Config.cpp b/src/Config.cpp
index 2c2032ebb03..62c16e91d1f 100644
--- a/src/Config.cpp
+++ b/src/Config.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <limits.h>
diff --git a/src/Config.h b/src/Config.h
index aa6b5bdc0ba..01ae5ea328e 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <memory>
diff --git a/src/EventSender.cpp b/src/EventSender.cpp
index 853a0c43fb9..f1cc0cc6ea1 100644
--- a/src/EventSender.cpp
+++ b/src/EventSender.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/EventSender.h b/src/EventSender.h
index e9acb04422b..ef7dcb0bf8c 100644
--- a/src/EventSender.h
+++ b/src/EventSender.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <memory>
diff --git a/src/PgUtils.cpp b/src/PgUtils.cpp
index 7e53abdabbf..ed4bf4d7e64 100644
--- a/src/PgUtils.cpp
+++ b/src/PgUtils.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/PgUtils.h b/src/PgUtils.h
index e9715ce10f4..5113fadbff2 100644
--- a/src/PgUtils.h
+++ b/src/PgUtils.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/ProcStats.cpp b/src/ProcStats.cpp
index 5c09fa0bce4..72a12e8ca00 100644
--- a/src/ProcStats.cpp
+++ b/src/ProcStats.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <string>
diff --git a/src/ProcStats.h b/src/ProcStats.h
index 30a90a60519..7629edd0aea 100644
--- a/src/ProcStats.h
+++ b/src/ProcStats.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 {
diff --git a/src/ProtoUtils.cpp b/src/ProtoUtils.cpp
index f9119ca4b14..b449ae20900 100644
--- a/src/ProtoUtils.cpp
+++ b/src/ProtoUtils.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/ProtoUtils.h b/src/ProtoUtils.h
index 37b7e4a8a29..c954545494f 100644
--- a/src/ProtoUtils.h
+++ b/src/ProtoUtils.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/UDSConnector.cpp b/src/UDSConnector.cpp
index ea118fca783..d13a82a5ca9 100644
--- a/src/UDSConnector.cpp
+++ b/src/UDSConnector.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
@@ -67,7 +94,7 @@ bool UDSConnector::report_query(const yagpcc::SetQueryReq 
&req,
     return false;
   }
 
-  const auto data_size = req.ByteSize();
+  const auto data_size = req.ByteSizeLong();
   const auto total_size = data_size + sizeof(uint32_t);
   auto *buf = static_cast<uint8_t *>(ya_gpdb::palloc(total_size));
   // Free buf automatically on error path.
diff --git a/src/UDSConnector.h b/src/UDSConnector.h
index 9483407159d..be5ab1ef413 100644
--- a/src/UDSConnector.h
+++ b/src/UDSConnector.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/YagpStat.cpp b/src/YagpStat.cpp
index 879cde85212..3a760b6ea97 100644
--- a/src/YagpStat.cpp
+++ b/src/YagpStat.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <algorithm>
diff --git a/src/YagpStat.h b/src/YagpStat.h
index 110b1fdcbb1..57fc90cd4d1 100644
--- a/src/YagpStat.h
+++ b/src/YagpStat.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <cstdint>
diff --git a/src/hook_wrappers.cpp b/src/hook_wrappers.cpp
index 602a2470805..cb4970d60d9 100644
--- a/src/hook_wrappers.cpp
+++ b/src/hook_wrappers.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
@@ -46,8 +73,10 @@ static void ya_ExecutorRun_hook(QueryDesc *query_desc, 
ScanDirection direction,
 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
@@ -195,14 +224,14 @@ void ya_query_info_collect_hook(QueryMetricsStatus 
status, void *arg) {
   }
 }
 
+#ifdef IC_TEARDOWN_HOOK
 void ya_ic_teardown_hook(ChunkTransportState *transportStates, bool hasErrors) 
{
   cpp_call(get_sender(), &EventSender::ic_metrics_collect);
-#ifdef IC_TEARDOWN_HOOK
   if (previous_ic_teardown_hook) {
     (*previous_ic_teardown_hook)(transportStates, hasErrors);
   }
-#endif
 }
+#endif
 
 #ifdef ANALYZE_STATS_COLLECT_HOOK
 void ya_analyze_stats_collect_hook(QueryDesc *query_desc) {
diff --git a/src/hook_wrappers.h b/src/hook_wrappers.h
index 236c6eb9d79..443406a5259 100644
--- a/src/hook_wrappers.h
+++ b/src/hook_wrappers.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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
diff --git a/src/log/LogOps.cpp b/src/log/LogOps.cpp
index 56bdf1dca62..e8c927ece84 100644
--- a/src/log/LogOps.cpp
+++ b/src/log/LogOps.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/log/LogOps.h b/src/log/LogOps.h
index bad03d09a8f..1fc30c21030 100644
--- a/src/log/LogOps.h
+++ b/src/log/LogOps.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <string>
diff --git a/src/log/LogSchema.cpp b/src/log/LogSchema.cpp
index 2fadcc46599..a391b1a2209 100644
--- a/src/log/LogSchema.cpp
+++ b/src/log/LogSchema.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
diff --git a/src/log/LogSchema.h b/src/log/LogSchema.h
index f713c1e9b0e..f78acec7ce9 100644
--- a/src/log/LogSchema.h
+++ b/src/log/LogSchema.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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 <array>
diff --git a/src/memory/gpdbwrappers.cpp b/src/memory/gpdbwrappers.cpp
index 8cc483a39de..22083e8bdaf 100644
--- a/src/memory/gpdbwrappers.cpp
+++ b/src/memory/gpdbwrappers.cpp
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"
 
diff --git a/src/memory/gpdbwrappers.h b/src/memory/gpdbwrappers.h
index e080ef5cdd4..fe9b3ba0487 100644
--- a/src/memory/gpdbwrappers.h
+++ b/src/memory/gpdbwrappers.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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" {
diff --git a/src/stat_statements_parser/README.md 
b/src/stat_statements_parser/README.md
new file mode 100644
index 00000000000..291e31a3099
--- /dev/null
+++ b/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/src/stat_statements_parser/pg_stat_statements_ya_parser.c 
b/src/stat_statements_parser/pg_stat_statements_ya_parser.c
index 54c8b2cf59f..7404208055f 100644
--- a/src/stat_statements_parser/pg_stat_statements_ya_parser.c
+++ b/src/stat_statements_parser/pg_stat_statements_ya_parser.c
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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
 
diff --git a/src/stat_statements_parser/pg_stat_statements_ya_parser.h 
b/src/stat_statements_parser/pg_stat_statements_ya_parser.h
index b08e8533992..96c6a776dba 100644
--- a/src/stat_statements_parser/pg_stat_statements_ya_parser.h
+++ b/src/stat_statements_parser/pg_stat_statements_ya_parser.h
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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
diff --git a/src/yagp_hooks_collector.c b/src/yagp_hooks_collector.c
index f7863a38921..271bceee178 100644
--- a/src/yagp_hooks_collector.c
+++ b/src/yagp_hooks_collector.c
@@ -1,3 +1,30 @@
+/*-------------------------------------------------------------------------
+ *
+ * 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"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to